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
CKarl
Associate

Here is the code https://www.codepile.net/pile/P85yVq8J, Can anyone convert the code to be able to use on an arduino/esp32/esp8266? Or what is the smallest/least expensive board I could use with the sensor and the provided code to have the same functionality as in the demo? If not possible to port I guess that maybe I could use an esp8266 that only transmits the people count value when new count is detected.

hyu.18.83
Associate

Hi Kabron,

#include <Wire.h>

#include "vl53l1_api.h"

#include <Adafruit_GFX.h>

#include <Adafruit_SSD1306.h>

#include <tof_gestures.h>

#include <tof_gestures_DIRSWIPE_1.h>

Where are these files?

Ask Google

MDIAL
Associate II

Hello

I'm trying to go from the frequency 30 Hz to the frequency 100 Hz and I used the manual that ST provides on this and I have the error code -18 which corresponds to

#define VL53L1_ERROR_STREAM_COUNT_CHECK_FAIL      ((VL53L1_Error) - 18)

/*!< Stream count check fail - API out of sync with device */ on this fonction VL53L1_GetRangingMeasurementData(Dev,&RangingData)

I am using an Arduino Mega 2560 to display SPADs

could someone explain to me how to fix this?

Julien NGUYEN
ST Employee

​Hi,

Actually, the distinction between people, pets or a moving object is not possible with this sensor.

Julien


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi Kabron

Thanks for the src code. I'm struggling to get repeatable results with your code.

Im using the VL53l1x on the stm32 platform without any arduino libraries, just the provided API's.

Something I noticed is that your screen grab of serial output is really clean. My readings are very sporadic when there is nothing

in the sensors view, are you filtering the readings somewhere else?

Thanks

Fdomi.11
Associate II

i'm a newbe on this sensor but can you explain what is this line on the code, itry to understand how this library work but this line i not understand.

dev1_sel

on line 84 on the exemple code.

*****copy of the line in code

pinMode(XSHUT, OUTPUT);

delay(100);

dev1_sel 

Dev->I2cDevAddr = 0x52;

Serial.printf("\n\rDevice data ");

checkDev(Dev);

delay(1000);

*****copy of the line in code

Thanks

Dominic Foisy

Fdomi.11
Associate II

forget my question i find it. thanks for your library it like to work perfectly. i will probably code some other fonction them trad with you

Thanks

gates.nathan
Associate III

Hi Dominic

From what project/file is this code?

I cant see it in the main.c file of the people counting source code?

Nathan

Fdomi.11
Associate II

VL53L1X_Polulu_API_Gesture_2ROI.ino file, but i understand now it is a define on top of code i see it just after i worte my first question. i try to make a new fonction to have 2 sensor to make similar job but witghout risk of colision between the 2 persone. (one go in and one go out at same time) with the wrote fonction all work fine with one person but if you habe 2 person at same time on zone if the colision is on zone 1 or zone 2 we lost a count. with 2 sensor we have posibility to have 4 zone or 6 zone if we use roi on 3 zone on each. any body try to make a similar fonction?