Using Time of Flight Depth Sensor to Monitor Motion Part2
Nowadays, monitoring of human motion can help to restrain a large group of people gathering at a place.
Author: Ho Xiu Ting Date: 2nd December 2021
As border restrictions ease at a slower pace, we would need to ensure that we keep a distance from each other to protect our loved ones. World Health Organization (WHO) has not confirmed the transmissibility and the severity of the disease since it is only reported recently on the 24th November 2021. Although the transmissibility is not yet confirmed, precaution can be done to avoid the emergence against the Omicron variant.
Using the Time of Flight (ToF) depth sensor technology to monitor the flow of the traffic can restrict the number of people in the same room or office. For more information about the technology, please refer to the article: “Using Time of Flight Depth Sensor to Monitor Motion Part 1”. Part 1 of the newsletter shows how we can extract data locally offline from the sensor to an excel spreadsheet and HTML. In Part 2, we will be sending data to the cloud so that we are able to analyse the data without being at the location physically. The advantages of exporting data from the cloud are stated below.
Demonstrations
Demonstrations have been done to produce various presentations showing the same result. Internet of Things (IoT) became popular across industries as data are shared among management and it avoids miscommunication between departments. To sustain this trend, we will also design a system that could provide such technology. Hence, I will conduct 2 demonstrations using multiple sources to obtain the same result.
Demonstrations | Components | Result shown |
#1 | RGB LED, Buzzer | Physically, reflect directly |
#2 | Thing Speak MQTT Channel | IoT, update every 15 seconds |
Setup GPIO ports
Utilizing the General-Purpose Input/Output (GPIO) pins in the Raspberry Pi allows us to build a system that reflects the status visually and audibly. Results will reflect immediately to the RGB LED and buzzer when the conditions are met.
As shown in the gif below that the RGB LED will indicate whether the limit of the people has exceeded. In this case, if more than 3 people are detected entering the shop, RGB LED will turn red, and the buzzer will ring if people ignore the status of the LED. The purpose of the buzzer is to alert the retailers to control the crowd in the shop.
You could either purchase the solution together with the device or program the device personally to cater to your needs. As Terabee Evo 64px has a 15° Field of View (FoV), it can be mounted on both sides and the top of the doorway.
When the experiment was conducted, data was being transmitted to both Excel and HTML files for data analysis and pre IoT purposes respectively. However, this is in the initial design phase whereby the data and the visual are still incomplete.
IoT Result using Thing Speak
Message Queuing Telemetry Transport (MQTT) is a network protocol that transmits and receives messages between devices. It is often used on the Internet of Things (IoT) platform to send high volume of data. It is ideal for connecting remote devices with a small code footprint and minimal network bandwidth. We will be making use of this protocol to communicate with Raspberry Pi and Think Speak.
In this demo, messages have been subscribed and published to Thing Speak for human presence. It indicates the number of people entering and exiting the shop within the timeframe then calculates the total number of shoppers left.
When Terabee Evo 64px detects human presence at both ends, it will feedback to the Raspberry Pi. It will analyse and calculate based on various scenarios then publish the output online through MQTT. Thing Speak will then collect the data every 15 seconds and display it in a chart form and produce the result through the LED form.
Total number in the store | LED Status |
≤ 6 | LED switched off |
> 7 | LED switched on |
An advantage of connecting it through Thing Speak is that the data can be monitored this information at any location. However, for a free account, it is limited to 4 channels and the message interval is 15 seconds. Unlike the free account, the standard account provides 250 channels per unit, and it will update the message every second without delay that will satisfy real-time analysis. With a paid standard license, it can connect to more sensors, share channel views with clients and colleagues for analysis. Visualization of the statistics and schedule predictive analytics can be customized based on individual needs.
As shown, 3 fields including incoming, exiting, and the total number of people in the store, and 1 LED visualization are displayed on the channel. LED will switch on to alert the retailer and management to control the crowd when the total number of people in the store exceeded 7. Otherwise, the LED remains to switch off.
Terabee L-XL device is General Data Protection Regulation (GDPR) compliant by design, providing a powerful people counting algorithm with 98% accuracy. This solution encompasses an IoT hardware device with embedded counting software to enable powerful analytics services. It is installed above doors and counts the number of people going in and out. It can detect several people passing in multiple directions below it with highly reliable accuracy.
Applications:
- Consuming the occupancy data of the buildings and rooms that are monitored - Analysing the room’s usage patterns by understanding the status through real-time and historical data - HVAC system integration that allows energy savings - Detect the presence of staff in public spaces and retail
Conclusion
In the above demonstrations, I have shown how to produce the result using sensors and upload it on the cloud. We can customize solutions based on your needs and requirements in terms of monitoring the motion of traffic flow.
Reference
1. People counting sensor: GDPR compliant: People traffic counter. Terabee. (2021, September 27). Retrieved December 2, 2021, from https://www.terabee.com/shop/people-counting/terabee-people-counting-l/. 2. Small and lightweight TOF depth camera: Teraranger Evo 64px. Terabee. (2021, September 2). Retrieved December 2, 2021, from https://www.terabee.com/shop/3d-tof-cameras/teraranger-evo-64px/. 3. World Health Organization. (n.d.). Update on Omicron. World Health Organization. Retrieved December 2, 2021, from https://www.who.int/news/item/28-11-2021-update-on-omicron.
Please contact us if you are interested to see demo of Terabee.