Introduction: How to Make a Timer Less Contact to Wash Your Hands #Covid-19

Hi ! This tutorial is going to show you how to make a timer less contact. indeed in this period of coronavirus epidemic it's really important to wash your hands well. It's why, I have created this timer. For this timer I have used a Nokia 5110 LCD screen for print the remaining time , the sensor HC-SR04 for switch on the timer (to serve as a contactless button) and a buzzer as an audible indicator of the start and end of the timer.

Needed material

  1. 1x Arduino Nano or an another Arduino
  2. 1x HC-SR04 sensor
  3. 1x Nokia 5110 LCD
  4. Buzzer / piezo speaker
  5. Jumper
  6. 1x 330 ohm resistor
  7. 1x 1K resistor
  8. 4x 10K resistors
  9. 100 Ohm resistor (optional)

Step 1: Wiring

Here are the differents wiring for each element :

For Nokia 5110 LCD

  • Connect the pin 1 (RST Pin) to the pin 6 of Arduino through the 10K resistor.
  • Connect the pin 2 (SCE Pin) to the pin 7 of Arduino through the 1K resistor.
  • Connect the pin 3 (D/C Pin) to the pin 5 of Arduino through the 10K resistor.
  • Connect the pin 4 (DIN Pin) to the pin 4 of Arduino through the 10K resistor.
  • Connect the pin 5 (CLK Pin) to the pin 3 of Arduino through the 10K resistor.
  • Connect the pin 6 (VCC Pin) to the 3.3V pin of Arduino.
  • Connect the pin 7 (LED Pin) to the GND of Arduino through 330 ohm resistor.
  • Connect the pin 8 (GND Pin) to the GND of Arduino.

For HC-SR04 Sensor

  • Connect the VCC Pin to the 3.3V pin of Arduino.
  • Connect the Trig Pin to the pin 9 of Arduino.
  • Connect the Echo Pin to the pin 10 of Arduino.
  • Connect the Gnd Pin to the GND of Arduino.

For buzzer

  • Connect the VCC Pin to the 8 pin of Arduino through the 100 ohm resistor.
  • Connect the Gnd Pin to the GND of Arduino.

Step 2: Program

The program operation :

  • print "hello Please start the timer" on the screen
  • measure distance with HC-SR04
  • If distance >= 30 cm :
    • play timer start music with buzzer
    • start Timer of 30 seconds

after the timer end :

  • play timer end music with buzzer
  • print the first message : "hello Please start the timer" on the screen

this instructions turn a loop.

for Upload the code :

  1. Download and open the file who is at the end of the step.
  2. Open the Manager librairies : Sketch -> Include Library -> Manage Librairies...
  3. Write "PCD8544" in the search bar and Install the librairies 'PCD8544' by Carlos Rodrigues
  4. Close the Manager librairies
  5. If you use an Arduino Nano : Select 'Arduino Duemilanove or Diecimila' in : Tools -> Board -> Arduino Duemilanove or Diecimila because there are error in Upload when I select 'Arduino Nano'
  6. Upload the code

If you want change the delay of the dimer it is enough for you to change the value of the variable delayTimer in the line 32 by default it's to 30 seconds.

If you want change the distance with the sensor HC-SR04 for start the timer, it is enough for you to change the value of the variable startDistance in the line 12 by default it's to 30 cm.

Step 3: Result

thank you for following this tutorial !

Arduino Contest 2020

Participated in the
Arduino Contest 2020