Fight COVID-19 by washing your hands using Bolt IoT

Cover image

This project was made by Harneet Kaur Dehiya as a part of the "Fight COVID-19 using IoT and ML" Challenge.  Here is a video made by Harneet Kaur Dehiya showing how the project works. You can build the project yourself by going through the rest of the blog.

Respiratory viruses like coronavirus disease (COVID-19) spread when mucus or droplets containing the virus get into your body through your eyes, nose or throat. Most often, this happens through your hands. Hands are also one of the most common ways that the virus spreads from one person to the next.

During a global pandemic, one of the cheapest, easiest, and most important ways to prevent the spread of a virus is to wash your hands frequently with soap and water.

It is great if you are into the habit of washing your hands when you get into your house. But if you don't have this habit, then it is a bit difficult to form this habit. Luckily you can build a quick reminder system for yourself to wash your hand when you enter the house using the Bolt IoT Platform.

Things used in this project

Hardware components

  • Bolt WiFi Module
  • An LDR
  • 10kOhm resistor
  • A Buzzer
  • 2 really long cables
  • A small breadboard
  • USB power supply.

Software, Apps and online services

  • Bolt Cloud
  • Digital Ocean droplet

Hardware setup

Step 1] Make the hardware connections as shown in the figure below.

Circuit Diagram

Step 2] Power up the Bolt WiFi module using the USB power supply.

Step 3] If you have not already done so, click here to see a video which will you how to configure the Bolt WiFi module to connect to the internet.

Step 4] Place the Bolt WiFi module along with the breadboard just at the entrance of your house such that whenever a person comes in, his shadow should fall on the sensor.

Step 5] Place the buzzer on a nearby sink, ensuring that the sensor is connected to the Bolt WiFi module using the long cables.

Software Programming

Step 1]Log in to, go to the API tab, and copy over the API. This will be used later.

5. Copy API key

Step 2] Go to the devices tab, and copy over the device id.

4. Copy Device ID

Step 3] Log in to your DigitalOcean droplet, and install the required software using the following instructions.

sudo apt-get -y update
sudo apt install python3-pip
sudo pip3 install boltiot

Step 4] Use the "nano" command to create a python file and add the following code to the python file. NOTE remember to replace <API key> and <Device ID> with the API key that you copied in step 1, and the device id that you copied in step 1.

import json, time

from boltiot import Bolt

myBolt = Bolt(<API key>,<Device ID>)

def readSensor():

      print("Reading LDR sensor value")

     input = myBolt.analogRead("A0")


     print("LDR sensor value is " + str(data["value"]))

     return data


def buzzeron():

     output = myBolt.digitalWrite("0", "HIGH")

     return output


def buzzeroff():

     output = myBolt.digitalWrite("0", "LOW")

     return output


data1 = read()

value1 = int(data1["value"])

while True:


     data2 = read()

     value2 = int(data2["value"])

     value1 = value1 + 500

     if value2>value1:




     value1 = value2

Step 5] Exit the nano editor by pressing "ctrl +x" and then press enter.

Step 6] Run the python code using the command "sudo python3"

The output of the program will look like the below image.



The system will start working as expected. Whenever a person walks by the sensor, the buzzer will run for 5 seconds, reminding him to wash his hands. This system will ensure that every person who enters your house remembers to wash their hands, and you will be able to fight off the COVID-19 disease.

Want to build more such IoT and ML projects? Want to learn IoT and ML from basics?

Check out the Bolt IoT and ML training. This online video training is excellent for those who want to start with IoT and ML because it teaches you to build projects from the basics. Click on the button below to know more about the training.

Learn more about Bolt IoT & ML Training

Home Automation COVID-19 Reminder Cleanliness