Issues while interfacing two VL53L1X sensors using Esp32
- July 24, 2021
- 4 replies
- 3493 views
Hi ST team and community!
I am trying to develop a People Footfall Counter for commercial use using the two VL53L1X Sensors on Esp32 using the Sparkun Library from the following:
https://github.com/sparkfun/SparkFun_VL53L1X_Arduino_Library
First of all, I set two different addresses using XSHUT pins for the respective VL53L1X sensor. On calling getI2CAddress() function, I receive the set addresses again. But strangely, when i2c scanner code is executed(the i2c scanner code written just below the getI2CAddress()), I receive a single i2c address ie. 0X0B after scanning and not the assigned addresses of VL53L1X. Also it shows as 1 device found which is again strange as it should scan the VL53L1X Sensors as two separate entities since we have assigned two separate addresses. Please ignore address 0X68 as its of RTC.
Since its for commercial use, I need the VL53L1X sensors to cover maximum area too. I get better output in ROI Configuration: x=8, y=8 and opticalCentre = {167, 223}. But when the ROI Configuration is set as: x=8, y=16, opticalCentre = {167, 223} the accuracy drops and many a times the person crossing goes undetected.
Can we use multiple(in my case two) VL53LIX sensors for detecting a person crossing and even cover maximum area too?
I tried analysing distances of both the sensors and updated the status ie. in or out of both the sensors separately.
Then used the logical 'OR' condition ie. if any of the sensors detects a person crossing, then increment the person count to one.
This doesn't give proper output, in fact the output is much better when the distance of only one sensor is analysed and count of the person crossing is incremented without using logical 'OR'.
Is there any better way to implement multiple VL53L1X?
Refer the attachment below for the code snippet and the received output.
