VL53L0x returning werid values

Hi there, I am currently working with VL53L0x ranging sensor using the codes from https://github.com/pololu/vl53l0x-arduino. However, the values i am getting when i read from sensors are values ranging from 0 (typically this value) to 65533; not the values in mm which the sensor is suppose to return. Is there anything that i might be doing wrong?

For pins I/O i have only connected to Vin (3.3V), GND, SDA and SCLK, leaving XSHUT and GPIO open.

What kind of microcontroller board are you using? Can you post pictures that show the board and connections including any soldered connections you made?

-Nathan

HI nathanb, thanks for the reply.

Im currently using a TM4C123BH6PZ microcontroller on a board with I2C communications working (I2C data and clock works with other I2C devices).

Im soldered leg connectors onto the VL530L0x as below:

with the legs, i used wires to connect them to the board im using. The ports are connected were as follow:
VL53L0x => board
VDD => open
VIN => 3.3V output
GND => Ground
SDA => I2C0 SDA
SCL => I2C0 SCL
XSHUT => open
GPIO1 => open

In addition, i noticed that the timing budget is always recalulated after every distance ranging routine (from pololu’s library) is it possible to just set the budget to the minimum amount that is required of each mode? e.g. fast mode => 20ms, default => 33ms

In our library and example programs, the timing budget should only be calculated once at the beginning of the program. If it seems to be recalculated after every range measurement for you, could you tell us what indication you see that that is happening and post your code if you are not using one of our unmodified examples?

-Nathan

Hi Nathan,

I found out the problem was with the I2C communication i had between my board and the vl53l0x sensor. After resolving it, i was able to get the readings i required.

Regarding the timing budget, i think it was because of the communication error that caused the timing budget to be set to some other values then the minimum while calling getTImingBudget()

1 Like