WashHands

WashHands © GPL3+

An Arduino project to help people wash their hands correctly during the COVID-19 crisis.

  • 1,840 views
  • 2 comments
  • 1 respect

Components and supplies

About this project

With the COVID-19 crisis and the quarantine we face, to avoid getting infected with the coronavirus, it's important to follow the World Health Organization recommendations, and one of the most important things to do is to keep your hands clean. A video from Vox shows how soap and water is enough to clean your hands, if done properly, which means:

  • Wet your hands;
  • Spread soap all over your hands;
  • Wash them for at least 20 seconds;

However the human brain isn't a very good counter, so we usually stop washing our hands before the 20 seconds. That's why I thought on developing a device that could count the time for you without one having to touch it (to avoid the contamination). Using the ultrasonic sensor with Arduino, this project aims to help you manage your time while washing your hands, to make sure you got rid of the viruses.

Demo video

Code

WashHandsArduino
/*** --- WashHand Project --- ***/
/** Author: Nilson Sales **/


// Loading ultrasonic library
#include <Ultrasonic.h>


// Defining pins for echo, trigger, leds and buzz
#define TRIGGER_PIN  4
#define ECHO_PIN     5

#define RED_PIN      9
#define YELLOW_PIN  10
#define GREEN_PIN   11

#define BUZZ         3


// Initialising the sensor
Ultrasonic ultrasonic(TRIGGER_PIN, ECHO_PIN);

void setup() {
  // code to run once:
  
  Serial.begin(9600);
  Serial.println("Reading sensor data...");

  pinMode(RED_PIN, OUTPUT);
  pinMode(YELLOW_PIN, OUTPUT);
  pinMode(GREEN_PIN, OUTPUT);

  pinMode(BUZZ, OUTPUT); 
}

void loop() {
  // code to run repeatedly:
  
  float cmMsec, inMsec;
  long microsec = ultrasonic.timing();

  cmMsec = ultrasonic.convert(microsec, Ultrasonic::CM);
  //inMsec = ultrasonic.convert(microsec, Ultrasonic::IN);
  //Serial.print("MS: ");
  //Serial.print(microsec);
  //Serial.print(", CM: ");   /* Uncomment these lines to test the ultrasonic sensor */
  //Serial.print(cmMsec);
  //Serial.print(", IN: ");
  //Serial.println(inMsec);
  

  if(cmMsec <= 20){ // If detects object closer to 20 cm, activate
    start_counter();
  }

  delay(1000);
  
}

void start_counter(){
  
  // Confirmation blink and buzz
  digitalWrite(RED_PIN, HIGH);
  digitalWrite(YELLOW_PIN, HIGH);
  digitalWrite(GREEN_PIN, HIGH);
  tone(BUZZ, 330, 800);
  delay(1500);
  digitalWrite(RED_PIN, LOW);
  digitalWrite(YELLOW_PIN, LOW);
  digitalWrite(GREEN_PIN, LOW);

  
  for(int i = 0; i <= 18; ++i){ // blink for 18 sec
    digitalWrite(RED_PIN, HIGH);
    delay(700);
    digitalWrite(RED_PIN, LOW);
    delay(300);
  }

  digitalWrite(YELLOW_PIN, HIGH); // blink for 2 sec
  delay(2000);
  digitalWrite(YELLOW_PIN, LOW);

  for(int i = 0; i <= 3; ++i){  // blink 3 times and buzz
    digitalWrite(GREEN_PIN, HIGH);
    tone(BUZZ, 349, 500); // 330
    delay(1000);
    digitalWrite(GREEN_PIN, LOW);
    delay(200);
  }
  
}
Ultrassonic Library
Ultrassonic library used on the project

Schematics

Circuit
Circuit nzxedjr3zn

Comments

Similar projects you might like

Touchless Thermometer

Project tutorial by WU_HuiQiao(吴惠乔)

  • 6,092 views
  • 0 comments
  • 19 respects

LED Display with Arduino ADC and PWM

Project tutorial by Ian Etheridge

  • 9,855 views
  • 1 comment
  • 13 respects

Fire and Smoke Alarm

Project showcase by ayanfeoluwaadekanye1

  • 7,961 views
  • 10 comments
  • 9 respects

Ultrasonic occupancy counter

Project tutorial by harrrrrrrrrrrrrrrry

  • 3,454 views
  • 1 comment
  • 3 respects

Is The Overtaking Car Keeping Enough Side Distance To You?

Project showcase by theodorbenad

  • 2,666 views
  • 9 comments
  • 3 respects

Recycled Meter Artwork

Project showcase by tekyinblack2

  • 645 views
  • 0 comments
  • 6 respects
Add projectSign up / Login