People Counting System built with Wio Terminal and Ultrasonic Sensor
With TinyML running right on the ATSAMD51 powered Wio Terminal, we can train a machine learning model on distance patterns to recognize when people are moving in or out of a room.
With some additional programming to keep count, and using the Wio Terminal's onboard WiFi & Bluetooth, we can easily build a cloud-connected application to monitor room occupancy remotely with IoT platforms like Azure IoT Central.
- Powered by TinyML, train machine learning model on distance patterns
- Build system and learn TinyML easily with step by step tutorial
- Plug and Play Grove Sensors
- Gather the data through Edge Impulse
- Use continuous inference example to make sure not missing any important data.
- Store the room occupancy data in the cloud and visualize it on PC
- Connect to Azure IoT Central, watch the detailed progress feedback on the Serial Terminal
An ordinary ultrasonic ranger can easily measure changes in distance to obstacles, but what about complex real-world tasks like people counting?
Well, with TinyML running right on the ATSAMD51 powered Wio Terminal, we can train a machine learning model on distance patterns to recognize when people are moving in or out of a room!
With some additional programming to keep count, and using the Wio Terminal's onboard WiFi & Bluetooth, we can easily build a cloud-connected application to monitor room occupancy remotely with IoT platforms like Azure IoT Central!
Ultrasonic Distance Sensor is an ultrasonic transducer that utilizes ultrasonic waves to measures distance. It can measure from 3cm to 350cm with an accuracy of up to 2mm. We can utilize the ultrasonic sensor to determine the direction of objects. What if you want to train a model to detect walk-in and walk out of the room? Let’s create a new project on Edge Impulse Dashboard and prepare to get the data. For gathering the data, since we don’t need very high sampling frequency, we can use a data forwarder tool from edge-impulse-cli. Upload the ei_people_counter_data_collection.ino script (Please follow up this guide and upload the script in the article) to Wio Terminal – to learn more about how to set up edge-impulse-cli and data forwarder protocol, watch the first video of TinyML series.
For your application, you might need to set this value lower or higher, depending on the setup. Then start walking.
We can also use continuous inference example to make sure we are not missing any important data. Clone Seeed studio example sketches repository and open people_counting_continious.ino sketch with Arduino IDE, change the name of the Edge Impulse library to one matching your project name, choose Wio Terminal as your board, install Grove Ultrasonic sensor library and upload the sketch.
Azure IoT Central Integration
Your model works! However it is not suitable for actually applying it in the real world without visualization. Let’s add two elements to make it into a full-fledged application – a simple GUI and data upload to cloud with pretty graphs. We will use LVGL library for creating the graphical user interface and Microsoft Azure IoT Central service for sending data to and visualization. It is much more fun and useful to combine Azure and Edge Impulse work together.