Skip to content

Project Progress

Component of The Project

We use the equipment we have in week 3

  1. Arduino Nano
  2. Motor Driver (L298N)
  3. 5V DC Motor
  4. OLED screen (12C) 128x64
  5. Two Tactile Switches
  6. Variable Resistor Switch
  7. Pipe
  8. 3D Design of Peristaltic Pump

Project Progress of Week 3

The main assignment for week 3 is to design the shape of the project. However, we also worked on Input/Output.

Input/Output

I was able to run the DC Motor for a certain time to pump a specific amount of liquid or to allow the air inside the pipe to escape. I also successfully ran the OLED screen using Adafruit and Arduino. I almost ran the DC Motor using Tactile Switches.

The Challenges We Faced:

Every project has challenges, but it’s how we handle them that makes us better.

First Challenge

I tried to run the OLED screen using Adafruit and Arduino, but it wasn’t working. So, I tried multiple codes and searched on Google to find out how to test the OLED screen. I found a code for testing the screen, used it, and the result was positive. I continued working on it. However, while holding the screen for a second, it broke, wasting my time. I replaced it with another one, and it worked fine.

Second Challenge

I attempted to run the DC Motor with the Adafruit motor featherwing, but then I realized that the featherwing was broken. So, we decided to use the Arduino Nano and Motor Driver (L298N) instead.

Third Challenge

The third challenge was to run the pump using tactile switches. We connected the circuit and wrote the code. We installed it on Arduino and connected the power supply to the circuit. However, the tactile switches were functioning as movement sensors. Engineer Haitham inspected the circuit and found incorrect connections and errors in the code. We fixed them.

#define MotorIN1 4   // input1 is connected to d4
#define MotorIN2 5   // input2 is connected to d5
#define ENA 3


int button = 0;// variable for the button
int antState1 = 0;// variable for the anterior state of the button
int buttonOff1 = 0;// 0 = dc motor ON, 1 = dc motor OFF
int antState2 = 0;// variable for the anterior state of the button
int buttonOff2 = 0;// 0 = dc motor ON, 1 = dc motor OFF
int button1 = 10;
int button2 = 11;




void setup() {
  // MotorIN1 and MotorIN2 are Initialized as Output
  pinMode(MotorIN1, OUTPUT);  
  pinMode(MotorIN2, OUTPUT);
  pinMode(button1, INPUT);// BUTTON as INPUT
  pinMode(11,INPUT);// BUTTON as INPUT


}


void loop() {
    int buttonState1 = digitalRead(button1);

   if(buttonState1 == 1){
  digitalWrite(MotorIN1, HIGH);
  digitalWrite(MotorIN2, LOW);
  delay(25000);

   }

  else {
    digitalWrite(MotorIN1, LOW);
    digitalWrite(MotorIN2, LOW);
  }


 int buttonState2 = digitalRead(button2);

   if(buttonState2 == 1){
  digitalWrite(MotorIN1, HIGH);
  digitalWrite(MotorIN2, LOW);
  delay(120000);

   }

  else {

    digitalWrite(MotorIN1, LOW);
    digitalWrite(MotorIN2, LOW);
  }


}


Last update: August 14, 2023