-
-
The Hardware. Arduino powers the sensors; NodeMCU reads the data & sends it to the cloud.
-
Libraries & Wi-Fi communication & Pins & Variables
-
Reading data from a ping sensor. Code for the second ping is analogous.
-
Reading data from the pressure sensor
-
Logic for the actual counter, combines data from the FSR402 and the HC-SR04s
-
Displaying Blynk widgets & notifications
-
Initializing ping pins & sending all data to the cloud
-
GIF
Reading data from 3 pressure sensors simultaneously using JSON. Dropped from project - hard to make it communicate with Blynk in real time.
-
GIF
Real-time RoomCensus shown on an LCD screen. Dropped from project - LCD requires too many pins & is unreliable as a component.
Given the current COVID pandemic, this project constitutes an ideal opportunity to use technology in a societally impactful manner. Our project aims to limit overpopulation in indoor spaces through the detection and tracking of people in entrance and exit areas.
Our project improves upon a manual tally counter by implementing automation. Our device allows its users to continuously read the number of people in an indoor space without having to actively record it themselves. RoomCensus is scaled for use in households and smaller indoor spaces. It is easy to build and its constituent components are much less expensive than commercially available automatic tally counter systems which are often designed to be implemented on much larger scales.
Modus operandi
At each regular door entrance/exit, two ping sensors (HC-SR04) are positioned on one side of the doorway facing the opposite side. These two sensors are slightly offset, with one slightly inside and the other slightly outside of the doorframe itself. When a person passes the entry/exit area, they pass through the two sensors one before the other. The order in which the sensors detect a shorter distance than the default doorway width allows the RoomCensus device to identify whether a person is entering or exiting.
To definitively confirm that a person is entering or exiting an indoor space, a pressure pad (FSR-402 for proof of concept) is placed in the doorway. This pad has an arbitrary threshold pressure that essentially makes its output a binary result (pressed or not pressed). If the pressure sensor outputs a “pressed” result at any point in time when the ping sensors detect movement through the doorway, it is assumed that a person is either entering or exiting the indoor space protected by the RoomCensus device. Combining the readings of the pressure sensor with the data produced by the ping sensors allows the device to decide whether it is appropriate to increment or decrement the global headcount in real-time.
The number of people within the indoor space at any given time is continuously tracked. An entrance results in a +1 operation to the total count while an exit subtracts one. A Wi-Fi system hypothetically allows for there to be multiple entrances and exits that contribute to the same headcount if multiple RoomCensus units (an Arduino, a NodeMCU, 2x HC-SR04, and a FSR402) are implemented. However, our goal for this project was an end-product that functioned properly for a single entryway.
The real-time headcount total is displayed with a Blynk widget on the user’s smartphone device. Once a predetermined threshold/limit is reached, the person responsible for the room/space (i.e. the user) will be notified of this through an alert system implemented through Blynk’s notification widget function. This constitutes our project’s Wi-Fi component.
Initially, plans were made to have the total headcount displayed on an LCD screen at all times. While we were successful in implementing this LCD function, this proposal was ultimately abandoned as the LCD screen component required too many pins for connection and proved to be too delicate and unreliable to justify its inclusion in the RoomCensus device.
To combat cases of multiple people entering and/or exiting the room at the same time, we initially intended to use three pressure pads placed side-by-side in the doorway with slight separation. If all three pads or the two wide pads were to be pressed, the device would assume that there are two people passing through the doorway at the same time. In the end, this function was not implemented in our project. While we succeeded in writing code that allowed us to read data from all three pressure pads using JSON, we were unable to transfer said data to the cloud in real-time. As such, we ultimately decided to implement only one pressure pad in our device. Arguably, this is justified as RoomCensus is designed for household use where the edge case of multiple people simultaneously moving through one (typically small) doorway should be rather infrequent.
Built With
- arduino
- blynk
- fsr402
- hc-sr04
- nodemcu
Log in or sign up for Devpost to join the conversation.