cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L1 and VL53L3CX not found in i2C Scan

MTjel.1
Associate II

Hi there

I can't find out how to connect my sensor to an arduino uno. Tried both with sample codes from SparkFun and i2C example code. It is connected in the following way:0693W000008GAdCQAW.pngSCL -> SCL

SDA -> SDA

GND -> GND

VDD -> 5V

I also tried with 2K ohm pull-up resistors, but didn't work.

I hope someone can help 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
John E KVAM
ST Employee

that's going to be a hard one.

the VL53L1X works using a algorithm we call Sigma/Delta. And as the name implies, it's a statisical model, where all the photon arrival times are averaged together and the answer is produced by the Sensor.

the VL53L3X however works differently. The raw data is gathered up into a histogram where each bin is the number of photons detected during each clock cycle.

That raw data is then sent to the host for processing. It is your host MCU that turns the raw data into an answer.

The answer does contain more information than Sigma Delta, but it takes more processing on your part.

The L3 can be made to run in Sigma Delta if you really need it to. (This is NOT in the datasheet, and not offically even allowed. It is a quirk of how the chips evolved from one to the other.)

If you want to run the L3 in Sigma Delta it would be easier to simply buy the VL53L0X (Because that's what you would be getting anyway.)

In Sigma/Delta the L1 is vastly better than the L3.

  • john

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. It helps the next guy.

View solution in original post

9 REPLIES 9
John E KVAM
ST Employee

VDD has a max of 3.6.

5V is completely out of the question.

There are a good dozen variants of tiny carrier boards. Pololu, Sparkfun, and enen ST make them.

From the picture it looks like that's the green satellite board from ST and it does not have any voltage regulators on them.

So 3v3 is the right answer.

The VL53L1 doesn't really do very well if you over-voltage it, so I'm a little worried.

if you need to buy another, you can by the ST satellit board that does NOT come with the X-Nucleo-53L1A1.

Those are blue and do have voltage regulators on them.

Good luck.

  • john

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. It helps the next guy.

Hi John

Thank you very much for the quick reply!

I thought the satellite board had regulator as seen in the documentation from 5v to 2.8 (https://www.st.com/resource/en/data_brief/vl53l1x-satel.pdf), but i also tried 3v3 without any luck. I thought this was a carrier board and the voltage regulator can be "broken" off at the dotted line.0693W000008GB5LQAW.png

John E KVAM
ST Employee

We sell those two ways - with regulators and I2C level shifters and without.

The sensor itself only needs 3v3, ground and I2C clk and data. Although there is an interrupt line you can use.

Look on the back side of that board. Are the chips stuffed?

If so you should be good.

otherwise the most common mistakes are reversing the I2C clock and data or using too long a wire.

If you are going to use anything except 3v3 please use the entire board.

You need the regulators.

Another issue is that this device has 2-byte address. (Most I2C parts have a one-byte address.)

If you only send one byte addresses, the chip will not respond until it gets the second address.

The boad you have should work.

the easy thing is to try to do a read on I2C address 0x29 (write address 0x52/ read address 0x53)

there is an internal register - 0x10F

 printf("VL53L1X Examples...\n");

 Dev->I2cHandle = &hi2c1;

 Dev->I2cDevAddr = 0x52;

 VL53L1_RdByte(Dev, 0x010F, &byteData);

 printf("VL53L1X Model_ID: %02X\n\r", byteData);

 VL53L1_RdByte(Dev, 0x0110, &byteData);

 printf("VL53L1X Module_Type: %02X\n\r", byteData);

 VL53L1_RdWord(Dev, 0x010F, &wordData);

 printf("VL53L1X: %02X\n\r", wordData);


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. It helps the next guy.

Hi

I not too experienced in electronics, but got it to work with the i2C scanner by adding wires to the "main" board (the small one) from 3v3.

Next step is to find a code in Arduino that utilised i2C

John E KVAM
ST Employee

got to Github.com and search for VL53L1x Arduino

There is stuff from Pololu and Sparkfun - as well as a bunch more.

There were 17 projects that came up.

Something there will help you out.

Some of that code will do exactly what you want.

  • john

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. It helps the next guy.
MTjel.1
Associate II

Thank you very much John, I got it to work! 🙂 However when trying the VL53L3CX, I can't get it to work with the same code, any idea why not?

code:

#include <Wire.h>

#include <VL53L1X.h>

VL53L1X sensor;

void setup()

{

 Serial.begin(115200);

 Wire.begin();

 Wire.setClock(400000); // use 400 kHz I2C

 sensor.setTimeout(500);

 if (!sensor.init())

 {

  Serial.println("Failed to detect and initialize sensor!");

  while (1);

 }

 // Use long distance mode and allow up to 50000 us (50 ms) for a measurement.

 // You can change these settings to adjust the performance of the sensor, but

 // the minimum timing budget is 20 ms for short distance mode and 33 ms for

 // medium and long distance modes. See the VL53L1X datasheet for more

 // information on range and timing limits.

 sensor.setDistanceMode(VL53L1X::Long);

 sensor.setMeasurementTimingBudget(50000);

 // Start continuous readings at a rate of one measurement every 50 ms (the

 // inter-measurement period). This period should be at least as long as the

 // timing budget.

 sensor.startContinuous(50);

}

void loop()

{

 Serial.print(sensor.read());

 if (sensor.timeoutOccurred()) {

  Serial.print(" TIMEOUT");

 }

 Serial.println();

 delay(1000);

}

John E KVAM
ST Employee

that's going to be a hard one.

the VL53L1X works using a algorithm we call Sigma/Delta. And as the name implies, it's a statisical model, where all the photon arrival times are averaged together and the answer is produced by the Sensor.

the VL53L3X however works differently. The raw data is gathered up into a histogram where each bin is the number of photons detected during each clock cycle.

That raw data is then sent to the host for processing. It is your host MCU that turns the raw data into an answer.

The answer does contain more information than Sigma Delta, but it takes more processing on your part.

The L3 can be made to run in Sigma Delta if you really need it to. (This is NOT in the datasheet, and not offically even allowed. It is a quirk of how the chips evolved from one to the other.)

If you want to run the L3 in Sigma Delta it would be easier to simply buy the VL53L0X (Because that's what you would be getting anyway.)

In Sigma/Delta the L1 is vastly better than the L3.

  • john

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. It helps the next guy.
MTjel.1
Associate II

Hi John

Thank you so much for the response, you are a huge help!

What is the VL53L1CB running? It seems to have 8m range and i am using it for water table measurement, where the longer the range the better.

Can it run on a Particle device like electron or boron?

John E KVAM
ST Employee

The VL53L1CB and the VL53L3 run the same algro - histograms. If conditions are perfect, you can indeed get to 8M. It does take a very reflective surface however. A customer asked us to focus a projector, and he needed that extra distance, and a projector screen is rather refletive.

I have no idea what a particle device is.

Our little chip uses 940nm near I/R light. It's the same laser thats in all the fiber optics in the world.

That made the laser cheap and available.

  • john


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. It helps the next guy.