Inflating/deflating mechanism with arduino uno

I am trying to create an inflating/deflating mechanism with an arduino uno, two electric pumps (one for inflating and one for deflating) and a solenoid valve. I am using this video as rough guidance. I don't need the 'breathing' sequence to be complex so I am just trying to code the components to turn on and off in sequence but I can't seem to get them to turn off at all. The code which I am currently using is down below. Would it be possible to get some guidance on this?

int pump = 11;
int pump1 = 10;
int solenoidPin = 9;

void setup() {
  pinMode (pump,OUTPUT);
  pinMode (pump1,OUTPUT);
  pinMode (solenoidPin,OUTPUT);
}

void loop() {
  digitalWrite(pump,HIGH);
  digitalWrite(pump1,LOW);
  digitalWrite(solenoidPin,HIGH);
  delay(5000);
  digitalWrite(pump,LOW);
  digitalWrite(pump1,HIGH);
  digitalWrite(solenoidPin,LOW);
  delay(5000);
}

Does your pump have "fwd" and "rev" pins or do you just switch positive and negative leads to reverse the direction of airflow?

The pumps and solenoids must have drivers. No Arduino can directly drive them. Please post a schematic or wiring diagram. Written descriptions are always more ambiguous than a drawing. Hand drawn, photographed and posted is fine. Include all pin names/numbers, components, their part numbers and/or values and power supplies.

Your code is good (I used it to make this simulation). Power the pump and the relays with an external power supply. If your pump only needs reverse wiring to reverse the flow, wire the relays to do just that. Use the Arduino only to signal the relays and share the ground.
pumps

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.