How many of us sit and/or stare at screens too long during the day? Let's build a device that reminds us to get movin
This project will be utilising the Zio Qwiic Ultrasonic Distance Sensor to detect and track a person. The device will be strategically placed on top of a screen/monitor facing the person sitting down, in front of his/her computer.
The project will track how long they have been sitting down for in hours/mins. After the maximum ‘sitting’ time is reached, it will alert them to stand up and walk around.
You will need the following modules to build this project:
Step 3: Daisy Chain All the Modules Together
Step 4: Configuration & Code
Download and install the following libraries to your Arduino IDE:
Upload the Full Project Code to your board. Plug your Uno to a computer. Download and Flash the code to your Uno using the Arduino IDE.
Step 5: Code Explanation
From the start, the sensor will detect a human’s presence sitting within the distance of 75cm. At this time, all counters will be initialized to zero.
Inside the loop function, the sensor will first detect for human presence. If no object is within the detection range, a ‘leave counter’ will start to track the time when nobody is present.
If he/she has been sitting for more than 2 hours, the code will display a message for the person to take a break.
If the person decides to take a break, the code will check again if there is human presence. If no presence is detected, the sitting counter will reset to zero and the leave counter will start. The sensor will track the time that the person has left their workspace to take a break.
Place the Zio Qwiic Ultrasonic Distance Sensor on top of your computer monitor.
Note: It is better to put it above the computer to avoid any objects being detected by the sensor which could distort the results.
You can view the sitting time results on the OLED display attached to the device.
Step 7: How It Works
The Ultrasonic Distance sensor will track and detect a sitting person if he/she is sitting within the range of 75cm (the distance from the monitor to the seat) from the sensor.
It will track the number of hours that the person sat and the distance from the sensor.
If he/she is not within the specified 75cm range, the sensor will assume that the person left his/her sitting area. The OLED screen will display the time a person left after sitting down.
If the sensor has tracked and detected that a person has been sitting for more than 2 hours straight, the screen will display a message to let him/her take a break.