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.

]

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.

Soldering:
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:

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() {
  Serial.begin(9600);
  pinMode(PWM,OUTPUT);
}
 
 
void loop() {
  # turn on
  analogWrite(PWM,255);
  delay(3000);
  
  
  # turn off
  analogWrite(PWM,0);
  delay(3000);
}

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() {
  Serial.begin(9600);

  //pin settings
  //valve
  pinMode(valve,OUTPUT);
  digitalWrite(valve,LOW);

  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 
  digitalWrite(valve,HIGH);
  digitalWrite(inflate1,HIGH);
  digitalWrite(inflate2,LOW);
  digitalWrite(deflate1,LOW);
  digitalWrite(deflate2,LOW);
  delay(2000);  //for two seconds

//PUMP deflating
  digitalWrite(valve,LOW);
  digitalWrite(inflate1,LOW);
  digitalWrite(inflate2,LOW);
  digitalWrite(deflate1,HIGH);
  digitalWrite(deflate2,LOW);
  delay(2000);  // for two seconds
}

Revision #16
Created 23 March 2023 12:32:55 by agnes cameron
Updated 13 February 2024 17:51:38 by Lexin Zhou