cancel
Showing results for 
Search instead for 
Did you mean: 

Is VL53L1X people counting source code available?

CNiev
Associate

I saw the VL53L1X used as a people counter video at:

https://www.youtube.com/watch?v=c91Ve-g0J2U

Is the source code used in that video available?

TIA,

30 REPLIES 30
Kabron
Associate III

I join to question.

AVARG.2
Associate II

What is the idea behind people counting using VL53L1X sensor Since this sensor is used for measuring the distance. How to detect whether the obstacle is people or not?

Kabron
Associate III

I guess they use more than one ROI SPAD regions, but it is beyond current API

Kabron
Associate III

I did it! It is very simple.

Unlike ST I will not keep mysterious silence and will publish the code after some tests.

Kabron
Associate III

This example illustrates direction recognition with the single VL53L1X TOF sensor. Two Regions Of Interest(ROI) are defined in SPAD sensor array:

 ROI1 ROI2

0,15___12,15 

 ####----####

 ####----####

 ####----####

 ...

 ####----####

 ####----####

_____3,0 _____15,0

Data measurements distance0 and distance1 cyclically readed from both ROIs, switching them on the fly.

Then STM32duino_Proximity_Gesture library used for event interpretation.

To suit Arduino requirement I added necessary library description to Pololu vl53l1_api.

Also, to handle handMustCoverBoth parameter support in STM32duino_Proximity_Gesture library, I had to slightly modify tof_gestures_DIRSWIPE_1.cpp and tof_gestures_DIRSWIPE_1.h. Both libraries are included in this bundle.

This code is for WEMOS D1 mini Lite, but with board and pins adjustments will work with any Arduino.

Data outputs to serial @115200 and to OLED. For investigations and adjustments it is suitable to use SerialPlot: https://bitbucket.org/hyOzd/serialplot.

Files here:

https://yadi.sk/d/UIIAXFol3P_jXg

Video here: 

https://www.youtube.com/watch?v=_ZjAZ7eieNM0690X000006DO9dQAG.jpg0690X000006DO9TQAW.jpg

Thanks for sharing your source code. I am using Nucleo - F401RE board with VL53L1X sensor. Is it possible to use this code in stm nucleo board?

Sure.

You can adapt SimpleRanging example code (from STM32CubeExpansion_53L1A1_V2.0.1) to suit the task.

What changes has to be done in the simple ranging code for counting the number of people? I have already changed the ROI of the sensor. Now how to detect people using this sensor?

Are you completely novice in this field?

Counting code lays between 134-148 lines of my example.