We come in contact with a lot of disease-causing agents like bacteria, virus, etc. everyday. Often, we forget to wash our hands when we enter our house. The germs on our hands can make us sick. In recent times, due to the outbreak of the COVID-19, this issue has become more relevant than ever. This project detects when the door is opened and reminds the person entering the house to wash his/her hands by sounding a buzzer.
Hardware ConnectionsDevice 1-
- LDR: Connect one arm of the LDR to 3v3 pin of the Bolt Wifi Module, and the other arm to the A0 pin
- Resistor: Connect one arm of the 10k ohm Resistor to GND pin of the Bolt Wifi Module, and the other arm to the A0 pin.
Warning!! Make sure that at no point do the 3.3V (or even 5V) and GND pins or wires coming out of them touch each other. If you short power to Ground without a resistor even accidentally, the current drawn might be high enough to destroy the Bolt module
Device 2-
- Buzzer: Connect the short arm (-ve) of the Buzzer to GND pin of the Bolt Wifi Module, and the long arm (+ve) to the 0 pin. Use female to male wires for connection
Alternatively, you can use a breadboard to make connections using a single Bolt WiFi Module. The wires used to connect must be longer in this case. See diagram below.
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.
Place the buzzer on a nearby sink, ensuring that the sensor is connected to the Bolt WiFi module using the long cables.
Coding1. Log in to Cloud.boltiot.com, go to the API tab, and copy over the API. This will be used later.
2. Go to the devices tab, and copy over the device id.
3. Log in to Command Line, and install the required software using the following instructions.
4. Use the "nano conf.py" 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 2.
Note: Here I have used two devices hence, I have written two API keys and two Device IDs
5. Make a python file, write the code on Command Line: sudo nano main.py
In this file, copy the following code.
6. Run the python code using the command "sudo python3 main.py"
The output of the program will look like the below image.
The LDR device is to be placed in between the main door and the safety door, preferably opposite from the hinges. When both the doors are closed, negligible light will fall on the light sensor (say, input1). As soon as either of the doors is opened, the intensity of light falling on the sensor will increase (input2). If it crosses the threshold value that we have set (say, input1+500), the Buzzer which is placed near the wash basin or sink will go off for 2 minutes. This will prompt the person entering to wash his/her hands. It is also useful in the case that a person is not entering the house, but merely accepting a courier or letter. After accepting the parcel, the resident will be reminded to was his/her hands.
Note: The threshold value and the time for which the Buzzer beeps can be varied according to requirements.
Comments