Lesson eight project for people counting with ultrasonic sensors, specifically theory and data collection.
In this article, we will create a people accounting system by using Real Terminal, an ordinary ultrasonic
ranger and special deep learning saws.
To top it off and actually make it to work, we will also utilize Microsoft Azure IoT Central Service
to store the real occupancy data, the cloud and visualize it on ABC.
Now that sounds interesting, right?
The first thing we need to do is learn about the data we can get from the ultrasonic sensor and how
we can use it to figure out the direction of things.
This grow ultrasonic ranger is a module that doesn't need to be touched to measure distance.
It works at 40 hertz.
We then send a pulse signal through the signal pin that last more than 10 us through signal pin.
Then the global supersonic ranger will send out eight cycles of 400 cycle level and listen for the Echo.
The pulse width of the Echo signal changes as you get closer.
If you want to know how to do this, here is what you need.
Reflection time multiplied by sound speed The sound speed is equivalent to 340 meters per second squared.
Now it is important to take note that do not hot block growth ultrasonic ranger.
Otherwise, it will damage the sensor.
The measured area must be no less than 0.5 square meters and smooth.
Now, after installing, girls will just like Ranger Library for the Arduino HD and connecting ultrasonic
ranger to wheel Terminal D one or two.
We can upload this simple script with a terminal connected to growth will just like Ranger and then
walk in and walk out of the room.
Then after that, we can immediately see that for walking it, we can get relatively high values, which
are corresponding to the distance from the object first, which then decrease, and for walking out,
we get completely the opposite of it.
It's possible that we could write an algorithm by hand that could help us figure out the right way to
go.
As it turns out, real life is it as simple as it looks?
We have people who walk quickly and people who walk slowly.
We have dinner people and people who aren't so thin.
So our handwritten algorithm has to take all of this into an account, which will make it very complicated
and hard to figure out at the same time.
We have a project that needs to be done, but inferencing, not processing in a lot of noisy data.
Big differences.
Now there is a way to do this, which is called deep learning install ultrasonic reader library, Arduino
IEEE.
Step one is that download the Ultrasonic Ranger Library from GitHub, step to extract the archive and
place it inside the Libraries folder and make sure we are terminal and ultrasonic sensor with screws
to wooden or 3D printed frame.
For example, to put the frame of the wall through metal, velcro strips were used.
Additional options include using phone data, screws or nails.
Now let's start a new project in the edge embossed dashboard and get ready to get the data from it.
We can use the data for our tool from Edge impulsively to get the data, since we don't need very high
sampling frequencies.
We can just use this tool if you have already installed Edge impulsively.
Follow these steps to upload the API.
People counter data collection that inner script to the wheel terminal.
Now this is the same script that was repeated above in this script.
We set all the values above 200 centimeter to negative one, so we can see them actually not for your
application.
You might need to set this value lower or higher, depending on the setup.
Start walking.
You should try walking in and now try walking up.
Now, try walking near the device, not getting closer or further away from you.
For this lesson, we recorded one minute and 30 seconds of data for each class, each time we recorded
five thousand millisecond samples and then cut them down to get one thousand five hundred millisecond
samples.
Make sure you have the samples where you or other people walk fast.
Slow run and so on.
Now try again for walking in.
Then after that, try observing when walking out now for the non category.
Apart from samples that have nobody in front of the device, it is a good idea to include samples that
have a person standing close to the device and walking beside it to avoid any movement being falsely
classified as in or out.
Then lastly, try to change the position of the ultrasonic sensor, installing it lower or higher,
or possibly near another door frame.