# Controlling air pump and air valve from PiicoDev

**URL:** <https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708>\
**Category:** Core Electronics\
**Created:** [7 January 2022 00:40 UTC](https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708 "2022-01-07T00:40:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![James111111](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@James111111](https://forum.core-electronics.com.au/u/James111111)\
**Post date:** [7 January 2022 00:40 UTC](https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708/1 "2022-01-07T00:40:52Z")

</div>

Hi,

I’d like to be able to control an air pump and air valve, using a PiicoDev and BME280.

The air pump and air valve I was thinking of using:

> **[Air Pump and Vacuum DC Motor - 4.5 V and 2.5 LPM - ZR370-02PM](https://core-electronics.com.au/air-pump-and-vacuum-dc-motor-4-5-v-and-2-5-lpm-zr370-02pm.html)**
>
> Make inflatables or air-powered projects with this simple air pump. It's great for beginner projects and super easy to use! The pump is basically a DC motor, driving an impellor, that is powered with ~4.5V and draws about ~500 mA. 5V should be just...

> **[6V Air Valve with 2-pin JST PH Connector - FA0520E](https://core-electronics.com.au/6v-air-valve-with-2-pin-jst-ph-connector-fa0520e.html)**
>
> Here's a cool new valve for makers interested in pneumatic systems, hydraulics, inflatables, projects with compressed air, and the like. These air valves, also known by other names like, automatic bleeding valve or air release valve, are typically...

I found a great tutorial on using the PiicoDev and BME280.

[![](https://img.youtube.com/vi/VIIboNNBr5w/maxresdefault.jpg "PiicoDev Atmospheric Sensor BME280 - Raspberry Pi Guide") ](https://www.youtube.com/watch?v=VIIboNNBr5w)

Which is what convinced to use the PiicoDev.

Based on the readings that the BME280 receive, I’d like to turn on/off the air pump or the air valve.  
But I’m not sure how to control the air pump or air valve, or how to connect them to the PiicoDev, or if I connect them to the PiicoDev expansion board.

I was hoping to get some advice on how to connect the air pump and air valve. Preferably without the need for soldering.

Thanks.

James.

---

<div class="post-metadata">

**Author:** ![Trent5487676](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/trent5487676/32/4583_2.png) [@Trent5487676](https://forum.core-electronics.com.au/u/Trent5487676)\
**Post date:** [7 January 2022 01:09 UTC](https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708/2 "2022-01-07T01:09:29Z")

</div>

Hi James,

Sounds like a cool project, can you confirm for me which microcontroller or device you were using to read the sensor data from the PiicoDev atmospheric sensor? Was it a Raspberry Pi, Pi Pico, or a micro:bit? We have a version of that tutorial for each.

Most microcontrollers can’t switch any external devices with a current load above around 10mA, instead they send a small digital output signal which switches an external relay or transistor and that external devices directs power to the pump/valve/motor etc.

> **[Controlling a Solenoid with Raspberry Pi and a Relay - Tutorial](https://core-electronics.com.au/tutorials/solenoid-control-with-raspberry-pi-relay.html)**
>
> Here is how to control a 12 Volt Solenoid with a Raspberry Pi using a 5 Volt Relay. Solenoids are an immensely useful way to turn electrical energy into a linear motion. Solenoids come in a variety of different specifications with 5 Volt and 12 Volt...

In terms of keeping things solderless it may be possible to do using prototyping wire and a breadboard, but that will make it hard to use the easy cabling that the PiicoDev system is built around.

> **[How to Use Breadboards - Tutorial](https://core-electronics.com.au/tutorials/how-to-use-breadboards.html)**
>
> Hello makers, if you love to prototype circuits and create electronic designs, then you’ll be familiar with the humble solderless breadboard. It’s where most electronic projects begin and is a familiar sight for tinkerers and inventors. However, for...

Once we know what microcontroller you are using and what gear you have we’ll see what options we have for connecting it all that avoid the need for soldering.

---

<div class="post-metadata">

**Author:** ![James111111](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@James111111](https://forum.core-electronics.com.au/u/James111111)\
**Post date:** [7 January 2022 02:05 UTC](https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708/3 "2022-01-07T02:05:46Z")

</div>

Thanks Trent.  
I was going to use the Pi Pico.

I’m happy to do some soldering, if required. Was just hoping for plug and play essentially.

Thanks for the explanation around the switching above 10mA.

---

<div class="post-metadata">

**Author:** ![Trent5487676](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/trent5487676/32/4583_2.png) [@Trent5487676](https://forum.core-electronics.com.au/u/Trent5487676)\
**Post date:** [7 January 2022 03:04 UTC](https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708/4 "2022-01-07T03:04:10Z")

</div>

Hi James,

Here’s the [guide specific to the Pi Pico](https://core-electronics.com.au/tutorials/piicodev-atmospheric-sensor-bme280-quickstart-guide-for-rpi-pico.html).

There is a soldering free option, you just use a breadboard and either of these two to connect to your PiicoDev sensors

> **[PiicoDev Prototyping Cable (Male) 200mm](https://core-electronics.com.au/piicodev-breakout-cable-200mm.html)**
>
> This 200mm cable breaks out the four wires in a PiicoDev cable for manual wiring to breadboards or development boards. It's a 4-wire harness with an SH connector on one end and four Dupont-style connectors on the other.

> **[PiicoDev Adapter for Breadboards](https://core-electronics.com.au/piicodev-breadboard-adapter.html)**
>
> The PiicoDev® Adapter for Breadboards allows you to break-out the 4-wires in a PiicoDev cable for prototyping on a breadboard.

Otherwise if you’re happy to solder it’s easy enough to just solder header pins onto the PiicoDev sensor directly.

The air valve has a JST PH connector, so male prototyping wires should fit into the end of the connector.

The pump and vacuum motor might have to be a job for alligator clips.

---

<div class="post-metadata">

**Author:** ![Liam120347](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam120347/32/5003_2.png) [@Liam120347](https://forum.core-electronics.com.au/u/Liam120347)\
**Post date:** [7 January 2022 03:43 UTC](https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708/5 "2022-01-07T03:43:17Z")

</div>

Hi James,

Another part to consider would be the [Makerverse Motor driver](https://core-electronics.com.au/makerverse-motor-driver-2-channel.html), I couldnt see how many amps the solenoid requires but fingers crossed it isnt more than 1A. there is some soldering required but it brings the cost down a bit.  
PS: there’s more exellent documenation from the guys at Core for this one.

You’ll also be able to control both the pump and solenoid from the same board.  
Just make sure to include some histeriesis control on the solenoid so you dont burn it out from switching it quickly (and avoid using duty cycles - either full on or off)

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [7 January 2022 04:17 UTC](https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708/6 "2022-01-07T04:17:11Z")

</div>

Hi Guys  
I am a bit of a fan of keeping things simple. What is wrong with a simple N channel Mosfet low side switch, all mounted up with required components like this little board CEO4538 or something similar. Unfortunately as of a couple of minutes ago this item is not in stock at the moment.  
Whatever is used don’t forget the diode across the motor or solenoid or any inductive load.

Core also have some high side switches too.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [7 January 2022 05:52 UTC](https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708/7 "2022-01-07T05:52:02Z")

</div>

Hi Trent  
Re this tutorial you linked.

### [Controlling a Solenoid with Raspberry Pi and a Relay - Tutorial](https://core-electronics.com.au/tutorials/solenoid-control-with-raspberry-pi-relay.html)

Just had a look for interest to see how you suggest driving a solenoid. Noted the relay used is quoted at 5V so I looked up the data sheet for it as this is the only documentation that seems to come with that little board.

Your descriptive text says

- While marked as a 5V supply voltage & input signals, we have found this to work fine at 3.3V

I think this may be a bit misleading. The spec on the data sheet says the relay is guaranteed to operate at 75% of rated voltage. So for 5V this is 3.75V which is a fair bit above 3.3V. Some you have tried may well work at 3.3V but you could not guarantee ALL of them to do so. Especially as if a transistor is used to drive this relay it may drop 100 to 200 mV or so which has to be subtracted from the voltage available for the relay. If a Mosfet is used this will be much less. I can see in the pics there is a 3 terminal device but don’t know if it is Mosfet or transistor. I cannot find a schematic for this board.

This lack of pertinent information I brought up in another post. It sucks.

What I am trying to say here is you may have tested some units at 3.3V and made this statement but there is a possibility that some will not work at this voltage and there is really nothing wrong with the board as it is supposed to be 5V. If some people do not have success at 3.3V they probably think they have a faulty unit when in reality the relay is being asked to operate out of its rated limits.

It is possible you have just copied the information given to you by your supplier in which case I would humbly suggest you have a more stringent checking procedure or give your supplier a good knuckle rap.

I might add that it is this sort of thing that would cause me to lose faith completely with this sort of product (as well as the Chinese writing) and prompt me to look elsewhere for a product that would do my job. I only looked at this out of interest as I would usually arrange my own relay driving so I know and have some control over what happens.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![James111111](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@James111111](https://forum.core-electronics.com.au/u/James111111)\
**Post date:** [9 January 2022 09:21 UTC](https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708/8 "2022-01-09T09:21:21Z")

</div>

Thankyou Trent, Liam and Robert.  
Your input has been valuable.  
I’ve been reading all the information you all have provided, and I have learnt a lot, and am able to move forward.

---

<div class="post-metadata">

**Author:** ![James46717](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@James46717](https://forum.core-electronics.com.au/u/James46717)\
**Post date:** [10 January 2022 00:16 UTC](https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708/9 "2022-01-10T00:16:28Z")

</div>

I am using this device triggered by a Pi Pico GPIO.  
The relay is powered of the supply powering the Pico 5V and the 3.3V GPIO from the Pico is enough to activate the relay. Works nicely. Would also work with a Pi Zero or Microbit.

The relay would connect power to the devices you have listed.

> **[Pololu Basic SPDT Relay Carrier with 5VDC Relay (Assembled)](https://core-electronics.com.au/pololu-basic-spdt-relay-carrier-with-5vdc-relay-assembled.html)**
>
> The Pololu basic relay carrier modules allow simple control of a single-pole, double-throw (SPDT) switch from low-voltage, low-current control signals. This item includes the basic carrier PCB with a soldered-in 5 V relay, 5.0 mm terminal blocks for...

Regards  
Jim

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [10 January 2022 02:56 UTC](https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708/10 "2022-01-10T02:56:49Z")

</div>

Hi James111111 and James46717.  
A much better choice all round. Also Pololu supply all the information needed to make informed decisions. Your decision to operate the relay at full 5V is also sensible and the data sheet shows the Mosfet fully on at 2.5V. Well catered for.

One small point though. Although toe Mosfet gate capacitance is small at 27pF it is still a short to ground at the moment of switch on. As I have found and has been pretty well documented that electronic damage can be cumulative, that is a but of repetitive damage now can show up later for no apparent reason. If it were me I would be inserting a low value resistor of about 330Ω in series with the gate. This will limit the short inrush current spike to a safe value for your I/O pin.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![James46717](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@James46717](https://forum.core-electronics.com.au/u/James46717)\
**Post date:** [10 January 2022 04:42 UTC](https://forum.core-electronics.com.au/t/controlling-air-pump-and-air-valve-from-piicodev/12708/11 "2022-01-10T04:42:27Z")

</div>

> [@Robert93820](#):
>
> I would be inserting a low value resistor of about 330Ω in series with the gate

Good point !!!  
Will be easy to incorporate into my design, plenty of space to do that.  
Pi Pico is mounted on vero board.  
Thanks for the advice @Robert93820

cheers  
Jim
