As businesses embark on a quest to return to trading while adhering to Covid-19 guidelines, one of the common practices is limiting the numbers of customers on the premises.
This usually involves a member of staff being positioned at the door to allow customers in up to whatever the threshold is, and prevent new customers from entering until another customer leaves. This can be automated and remove the necessity to dedicate a member of staff to this task.
The idea is a simple one: have a device to track entry and exit of customers, use some pre-defined variables to check the capacity and signal whether the store is at capacity or not.
Ultrasonic sensors are a great way or tracking such activity; measuring across the doorway, and when that distance is greatly reduced it will indicate a customer crossing the threshold. Combine with another sensor and checking the order they are triggered will also allow for tracking the direction of travel of the customer.
My project can use configurations of two sensors or four sensors to allow it to monitor the vast majority of small stores with a single entrance or single entrance and exit. It can easily be expanded to monitor more doorways too!
While I have opted to mount my sensors and Arduino MKR WiFi 1010 in the same enclosure it is entirely possible to mount the sensors in separate enclosures to make mounting the arduino centrally to multiple doors more convenient. In this instance I would personally use some ethernet cables; they have 8 wires inside (perfect for the two sensors each door would require) and you can get some nice tidy ethernet jacks/keystones to mount in the case.
The code itself is as simple as the idea; the main loop cycles through each sensor and checks it's state. If it's determined a customer is entering, it adds one to a counter variable. If one is determined to be leaving, it deducts one.
Following the sensors being checked the code then evaluates the customer count, compares it against the maximum capacity and will trigger one of two relays depending on the result. These relays can be attached to some status lights to signal whether it is safe for the customer to enter or not. If a store has a means of information display this could be easily reconfigured to work with that, either by serial or by WiFi.
The device itself can be monitored and managed over WiFi. This allows the store to set the maximum capacity for their premises, manually adjust the counter in case of error, and enable/disable the counter at time for deliveries, or when staff are entering/exiting the premises.
Comments