Arduino Hand Hygiene Timer – Promote Proper Handwashing for Kids
Components and supplies
 | | × | 1 | |
 | | RGB Diffused Common Cathode |
| × | 1 | |
| | × | 1 | |
 | | UTSOURCE Electronic Parts |
| × | 1 | |
About this project
This is a great project to teach your kids the importance of cleanliness & washing hands properly in the current times. This project turns the LED red when you start washing hands & will turn green once twenty seconds are complete thus reminding you to wash hands for twenty seconds & do not keep the water running while washing hands. Remember, in the midst of one global crisis, let's not worsen another.Maker : @devd_31 The circuit is made out of @arduino.cc uno board, an infrared sensor & a RGB led.Thanks UTSOURCE.net to offer electronic components for our projects.
Follow Us on instagram : https://www.instagram.com/random_stuff_we_make/Code
CodeArduino
Use Arduino IDE to upload the code/* The following code is developed by members of Random Stuff Community.
for further information or ideas, please keep following "Random Stuff We Make" on instagram
*/
void setup()
{
pinMode(2,OUTPUT); //RED
pinMode(3,OUTPUT); //GREEN
pinMode(4,OUTPUT); //BLUE
pinMode(5,INPUT); //IR sensor
Serial.begin(9600);
}
void loop()
{
int a= digitalRead(5);
Serial.println(a);
delay(100);
digitalWrite(2,LOW); //RED off
digitalWrite(3,HIGH); //GREEN on by default
digitalWrite(4,LOW); //BLUE off
if(a==1)
{
digitalWrite(3,LOW);
digitalWrite(4,LOW);
for(int i=0; i<20; i++)
{
digitalWrite(2,HIGH);
delay(1000);
}
digitalWrite(2,LOW);
}
}
Schematics
Make the circuit like shown below