newproyecto
Published © GPL3+

Hand wash timer

¡Easy Hand washing ! with I2C LCD

IntermediateFull instructions provided1 hour649
Hand wash timer

Things used in this project

Hardware components

5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Green
5 mm LED: Green
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×1
Buzzer
Buzzer
active
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
4 male/female the rest male / male
×1
Arduino UNO
Arduino UNO
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Resistor 221 ohm
Resistor 221 ohm
×2
I2C 16x2 Arduino LCD Display Module
DFRobot I2C 16x2 Arduino LCD Display Module
×1

Software apps and online services

Arduino Web Editor
Arduino Web Editor
can be both

Story

Read more

Schematics

mighty_uusam_4r5FeEjxUo.png

Code

code

Arduino
#include <Wire.h>                 
#include <LiquidCrystal_I2C.h>  //libraries for lcd

LiquidCrystal_I2C lcd(0x27,16,2); 
                                 
//we define variables and constant variables
int ledr=13;//red led
int ledg=12;//green led
const  int Buzzer = 11 ;//nuestro zumbador activo
int btn = 10;// our button

void setup(){
 //we define the outputs
 pinMode(ledr, OUTPUT);
 pinMode(ledg, OUTPUT);
 pinMode(Buzzer,OUTPUT);
 //and the inputs
 pinMode(btn,INPUT);
 //we start the lcd
   lcd.init();                     
  lcd.backlight();
      lcd.setCursor(0, 0); 
      lcd.print("start      ");  
 }
void loop(){
  // leemos el valor del boton si esta encendido inicia la cuenta
if (digitalRead(btn)==HIGH){ 
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, HIGH);
delay(500);
lcd.setCursor(0, 0); 
lcd.print("20 seconds"); 
lcd.setCursor(0, 1); 
lcd.print("remember  ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("19 seconds"); 
lcd.setCursor(0, 1); 
lcd.print("this can  ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("18 seconds"); 
lcd.setCursor(0, 1); 
lcd.print("save your ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("17 seconds"); 
lcd.setCursor(0, 1); 
lcd.print("life      ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("16 seconds");    
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("15 seconds");
lcd.setCursor(0, 1); 
lcd.print("remember  ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("14 seconds");
lcd.setCursor(0, 1); 
lcd.print("this can  ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("13 seconds"); 
lcd.setCursor(0, 1); 
lcd.print("save your ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("12 seconds"); 
lcd.setCursor(0, 1); 
lcd.print("life      ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("11 seconds");    
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("10 seconds"); 
lcd.setCursor(0, 1); 
lcd.print("remember  ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("9 seconds "); 
lcd.setCursor(0, 1); 
lcd.print("this can  ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("8 seconds ");  
lcd.setCursor(0, 1); 
lcd.print("save your ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("7 seconds ");
lcd.setCursor(0, 1); 
lcd.print("life      ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("6 seconds ");    
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("5 seconds ");  
lcd.setCursor(0, 1); 
lcd.print("remember  ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0);
lcd.print("4 seconds "); 
lcd.setCursor(0, 1); 
lcd.print("this can  ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("3 seconds "); 
lcd.setCursor(0, 1); 
lcd.print("save your ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("2 seconds ");  
lcd.setCursor(0, 1); 
lcd.print("life      ");
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("1 second  ");    
digitalWrite(ledr, HIGH);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
delay(1000);
lcd.setCursor(0, 0); 
lcd.print("successful");
lcd.setCursor(0, 1); 
lcd.print("washing   ");
digitalWrite(ledr, LOW);
digitalWrite(ledg, HIGH);
digitalWrite(Buzzer, HIGH);
delay(500);
lcd.setCursor(0, 0); 
lcd.print("successful");
lcd.setCursor(0, 1); 
lcd.print("washing   ");
digitalWrite(ledr, LOW);
digitalWrite(ledg, HIGH);
digitalWrite(Buzzer, LOW);
delay(500);
lcd.setCursor(0, 0); 
lcd.print("successful");
lcd.setCursor(0, 1); 
lcd.print("washing   ");
digitalWrite(ledr, LOW);
digitalWrite(ledg, HIGH);
digitalWrite(Buzzer, HIGH);
delay(500);
lcd.setCursor(0, 0); 
lcd.print("successful");
lcd.setCursor(0, 1); 
lcd.print("washing   ");
digitalWrite(ledr, LOW);
digitalWrite(ledg, HIGH);
digitalWrite(Buzzer, LOW);
delay(500);
lcd.setCursor(0, 0); 
lcd.print("can go out");
lcd.setCursor(0, 1); 
lcd.print("          ");
delay(5000);
}
else {
digitalWrite(ledr, LOW);
digitalWrite(ledg, LOW);
digitalWrite(Buzzer, LOW);
lcd.setCursor(0, 0); 
lcd.print("start      "); 
}
}

Credits

newproyecto

newproyecto

3 projects • 4 followers
Hello everyone, my name is Antonio and I love programming and doing projects with Arduino and I hope these projects will help you.

Comments