Skip to main content

5V Air Pump Guide

We have a number of small 5V air pumps and silicone tubing available for students to borrow for small-scale inflatable projects, which include the single and inflate-deflate air pump control. These can't fill a lot of space, so for inflatables larger than about a balloon's worth of volume, you might want to get something more powerful. They are ideal for silicon soft robotics projects!

These pumps cannot be used to pump water: for liquid pumps please come and chat to us, as we have a small number of peristaltic pumps available to borrow. The other main constraint of these pumps is that they are unidirectional -- to both inflate and deflate something you will need two!

Parts List

All of these parts may be borrowed from the technical office.

  • Arduino Leonardo (Uno is also fine)
  • 5V air pump (you need to solder connecting wires to the pins on the bottom if not already done)
  • Three ports Air Valve(for inflate and deflate system)
  • IRF520 MOS Module(for one pump) or LM298N Module(for two pump / inflate-deflate)
  • 5v Power supply (because these are 5V pumps -- don't use a higher one!)
  • DC terminal barrel jack (socket type)
  • Connecting wires, silicon tubing, etc etc
  • Screwdrivers for attaching the wires to the screw terminal blocks on the module and DC barrel jack


Basic Setup

The setup for an air pump is basically equivalent to that of a DC motor, and like a DC motor requires the use of an external power supply, to manage the flow of current to the pump.

Pins are on the base of the pumps. Wrap the wire through the small hole, add a blob of solder and trim any excess wire to prevent shorts. Give the wires a gentle tug to make sure they're properly secured.

Attaching screw terminal:
Make sure when you're attaching things to screw terminals that the wires are attached tightly and do not show exposed metal. This is not a part of your circuit where you want a short! Once they are screwed in, give the wires a gentle tug to make sure they're properly secured.

One Air Pump system

The easiest way to do this is to use one of the IRF520 MOS modules we have in stock, which can be controlled using an Arduino. These can be used to control DC motors or things like air pumps, using a PWM signal.

You want to wire up the components according to the diagram below:

  • Out+ and Out- connect to your pump
  • Vin and Gnd (on the screw terminal blocks) connect to the + and - of the barrel jack of your power supply. Very important -- Vin connects to + and Gnd connects to -
  • SIG, VCC and GND (e.g. the non-screw terminal connector) connect to a PWM pin (e.g. pin 3), 5V and GND, on your Arduino.

Connection diagram

Sample Arduino code

Once your circuit is wired up, you want to plug in your 5V power supply (and plug it into the jack), and plug your Arduino in to your computer. This code assumes you have connected SIG on the board to Pin 3 of the Arduino.

#define PWM 3

void setup() {
void loop() {
  # turn on
  # turn off

Inflate-deflate system

The pumps we have are not bidirectional -- this means that if you want something that inflates and deflates, you need to use 2 pumps linked by a splitter. The circuit to drive each pump will be the same, but you can connect both SIG pins to different PWM pins on the same Arduino. We have valves and splitters available in the tech office.

If you have the 2-motor driver...
If you are trying to drive 2 pumps, we might have given you the LM298N board, which can drive 2 motors at once. These are a little more tricky to understand, as they also allow you to change the direction of the motors.

Before you choosing the extra power supply for the LM298N board, check the Rated /Operating voltage of the motors you wanna control. The LM298N board will make a slight voltage drop (around 1v), which means the voltage of power adaptor could be slightly bigger.

Connection diagram

For each motor, 2 pins control the motion: IN1 and IN2 control the first motor, and IN3 and IN4 control the second. For the motor to be running, one of these should be high and the other low. Depending on which is which, the motor will run either forward or backward: air pump motors can only run forward, so we want to set IN1 and IN3 as HIGH, and IN2 and IN4 as LOW.

Sample Arduino code

Once your circuit is wired up, you want to plug in your power supply (and plug it into the jack), and plug your Arduino into your computer. This code assumes you have connected Pin 2 to connect the air valve, Pin 3 and Pin 4 to control the inflating, and Pin 5 and Pin 6 to control the deflating(as you need to connect it as shown in the connection diagram).

const int valve = 2;
const int inflate1 = 3;
const int inflate2 = 4;
const int deflate1 = 5;
const int deflate2 = 6;

void setup() {

  //pin settings

  pinMode(inflate1, OUTPUT);
  digitalWrite(inflate1, LOW);
  pinMode(inflate2, OUTPUT);
  digitalWrite(inflate2, LOW);

  pinMode(deflate1, OUTPUT);
  digitalWrite(deflate1, LOW);
  pinMode(deflate2, OUTPUT);
  digitalWrite(deflate2, LOW);
void loop() {
//PUMP inflating 
  delay(2000);  //for two seconds

//PUMP deflating
  delay(2000);  // for two seconds