Preethi G
Created May 24, 2021

Low Cost Ventilator Using Arduino

In view of current pandemic, ventilators are designed to keep oxygen in the lungs and to remove carbon dioxide.

Advanced10 hours170

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Stepper motor driver board A4988
SparkFun Stepper motor driver board A4988
×1
Stepper Motor, Bipolar
Stepper Motor, Bipolar
×1
Alphanumeric LCD, 20 x 4
Alphanumeric LCD, 20 x 4
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×1
Resistor 10k ohm
Resistor 10k ohm
×1
60W PCIe 12V 5A Power Supply
Digilent 60W PCIe 12V 5A Power Supply
×1
Ambu bag
×1
Lead Screw 8mm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Block Diagram

Code

Test Code

Arduino
#define EN        8  
#define X_DIR     2 //Direction pin
#define X_STP     3 //Step pin

int delayTime=30; //Delay between each pause in uS
int stps=6400;// Steps to move

void step(boolean dir, byte dirPin, byte stepperPin, int steps)

{
  digitalWrite(dirPin, dir);
  delay(100);
  for (int i = 0; i < steps; i++) {
    digitalWrite(stepperPin, HIGH);
    delayMicroseconds(delayTime); 
    digitalWrite(stepperPin, LOW);
    delayMicroseconds(delayTime); 
  }
}

void setup(){
  pinMode(X_DIR, OUTPUT); pinMode(X_STP, OUTPUT);
  pinMode(EN, OUTPUT);
  digitalWrite(EN, LOW);
}

void loop(){

  step(false, X_DIR, X_STP, stps); //X, Clockwise
  delay(100);
  step(true, X_DIR, X_STP, stps); //X, Counterclockwise
  delay(100);
}

Credits

Preethi G

Preethi G

1 project • 1 follower
Web Developer | AI Enthusiast | Aspiring Data Analyst

Comments