Motion Detector Sink Timer
Introduction:
This project tracks how long someone washed their hands for and then reports the data to an administrator's phone. This device encourages proper hygiene, which is especially important during the COVID-19 pandemic.
I intended this project to be used to monitor hand-washing in lower school bathrooms, helping to maintain a clean environment for learning while preventing the spread of disease in the school environment. However, this device can be used in many different venues and help track a necessary protocol during the COVID-19 pandemic.
The project will use an Arduino Uno, Neopixel ring, PIR motion sensor, buzzer, and Wemos Bluetooth module as its main components. The device will connect to an app (using the Wemos board) that the administrator can install on their phones, reporting how many users washed their hands, at what time, and for what amount of time, to promote proper practices of hygiene. The code is written using Arduino/C++.
Materials:
PIR motion sensor
Wemos board
Neopixel ring or LED (optional)
Velcro or Command tabs
Tools:
3d printer for device case
Soldering iron
Arduino program
Collect Supplies
Gather all supplies listed in the materials list above. Then, make sure all of your tools are working properly and that you have a clean, organized workspace.
Set Up Board
Use your Wemos D1 board and PIR motion sensor. Connect these to the computer using an HDMI cord attached to the Wemos. Refer to the photo below for the jumper wire connections.
PIR --> Wemos
GND --> GND
OUT --> PIN7
VCC --> 5V
Arduino Code + Blynk App
Using Arduino on a computer, write the code for your PIR sensor. You will need to pair your Wemos with the Blynk app at this point. To do so, enter your wifi network's name and password into the correct spots in the sample code below. Make sure that you have a strong wifi network. In the Blynk app, pair your phone with the code using the provided Authorization Token. Add two new widgets to your workspace: push notifications and button.
The button can be used to test your sensors and code. The push notification widget will send notifications to your phone when motion is detected. You can change the frequency of these notifications in your code.
Upload your code to the board and make sure that the Blynk app is online and connected to your board.
Downloads
Test
Make sure the device is plugged in. Compile and upload the code. To test the motion sensor, wave your hand in front of it and wait for the notifications to begin on your phone. If so, it is working! Congratulations!
3D Print Case
You will need to use a 3D printer to make the case for your sink timer device. Using the file linked below, print out the case and then install your device inside of it. This helps improve the aesthetics of the design. To mount the device on a wall, use velcro or command tabs on the back of your case and the wall.
The top should have a hole in it to acommodate the motion sensor. The top should have a lip on it that allows it to sit securely on top of the case's base. Make a rough estimation of the bottom's dimensions. This does not need to be exact, and just needs to be large enough to fit all of your wiring and boards.
Finishing Touches/Troubleshooting
Make sure that your device is secure inside of the case.
Ensure that you have a strong wifi connection.
Make sure that your device is actually connected to wifi/the password is typed in correctly.
Sometimes the Blynk app can be glitchy, make sure that it is accurately connected. It can help to disconnect your device and then reconnect it if it does not work on the first try!
Video of finished product linked below :)