WashHands

WashHands © GPL3+

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

  • 257 views
  • 2 comments
  • 0 respects

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

Measure Heart Rate and SpO2 with MAX30102

Project tutorial by SurtrTech

  • 69,642 views
  • 39 comments
  • 174 respects

Arduino WiFi Pulse Monitor

Project showcase by Andres Santos

  • 12,299 views
  • 8 comments
  • 30 respects

IoT PCR: Low Cost DNA Replication Connected to the Internet.

Project showcase by kemfic

  • 11,886 views
  • 0 comments
  • 33 respects

Bracelet Dodges Obstacles

by PaulinaPeralta

  • 4,647 views
  • 4 comments
  • 8 respects

UltraV: A Portable UV-Index Meter

Project tutorial by fmarzocca

  • 4,101 views
  • 6 comments
  • 15 respects

Quo Vadis

Project showcase by basvanoerle

  • 3,964 views
  • 7 comments
  • 54 respects
Add projectSign up / Login