Hi,
I’ve got a VL53L1X breakout board connected to an Arduino (Teensy 2++) via a level shifter. I’m using the ReadDistance sample from the library you provide.
I’ve cut the I2C pullup jumper traces, but not the INT trace.
The board and library initialize successfully (*), but distanceSensor.getDistance() returns 22mm, regardless of the distance to the target object.
Looking at the scope traces (below, clk in yellow) it seems that the I2C interface is working as expected.
Any idea what might be going on?
Thanks much,
Dan
- I’m pretty sure there’s a bug in the example in the line:
if (distanceSensor.begin() == true)
since begin returns false if initialization was successful
Update–I’ve sometimes been able to get the sensor to provide non-constant readings for some time by power-cycling the electronics (Teensy and board). However, it only work for less than a minute before settling on some constant value that then persists until restart.
I can see that the I2C bus still has activity when stuck at the constant value.
Also, I can see that the internal distance routine, VL53L1X_GetDistance, is not returning an error at any point.
Hi Dan,
I have a few quick questions to try and figure out what may be causing the issue. First, the Teensy++ 2.0 is a 5V board and does not have any 3.3V rails so how are you powering the sensor? Also, disabling the pull-up resistors on the board may also be causing problems since, if you are using pull-ups on the Teensy, that is pulling the I2C lines to 5V which is out of spec for the sensor. I have a feeling the issues are related to this logic/power issue since the VL53L1X has a max voltage of 3.5V. If you can elaborate a bit on how you are connecting it, we can try and identify what the issue here is.
Hi Mark,
I’m powering the sensor with a 3.3V regulator.
The I2C lines are being pulled up to the 3.3V rail. I’ve attached the circuit I’m using.
I’ve confirmed that SDA and SCL have the voltages they should on the scope, but I guess I should have a look at the quality of the 3.3V power.
Thanks very much for your help.
Dan
Hi again Dan,
Thanks for clarifying how you have the board connected. Since it’s working a bit now but locking up, I have a feeling it’s still power related so double-checking your output from that regulator would be a good thing to test. If you find that it’s a clean 3.3V to the VL53L1X I think we can make the determination that it is defective and go from there.
Hey Mark,
The 3.3v rail does seems to be relatively clean; most noise ±50mv, with a few spikes in the ±100mv range:
You think it might be a failed part? Have you seen any failures like this before?
Thanks,
Dan
That supply voltage should work just fine for this part. I’m going to test the library with a Teensy just to make sure there is no problem going on there but I would expect you to get compile errors or at least some weird behavior on the I2C lines if the issue was related to the library. If you have another microcontroller to test the board/library with, that would be helpful here too.
I’m going to have to pull some parts to test the library so I’ll update you on my tests with the library using a Teensy tomorrow.
Hey Mark,
One additional piece of information: I bought one of your VEML6030 breakout boards to try to rule out my implementation of the qwiic/level shifter interface as a source of problems.
Things seem to be working fine with that board, which I suppose makes my qwiic/I2C interface unlikely to be the problem.
Thanks again for your help,
Dan
Thanks for testing to make sure your I2C/Qwiic interface is working properly. I just finished testing the library with a Teensy 3.6 and it had no issues so I think it may be a bad sensor. Assuming you purchased the board directly from SparkFun, please fill out the form on [this page and in the “Why do you want an RMA?” box, fill in a brief description and a link to this post and we will follow up with further instructions.](Return Policy - SparkFun Electronics)
One clarification Mark–my board uses a Teensy 2++ rather than a Teensy 3.5.
If you think that’s not likely to make a difference, I can return the part and try with a different one.
Thx,
Dan
The only thing that would cause the behavior to be any different is the Teensy 2.0++ runs at 5V and the 3.6 runs at 3.3V. One last test, just to eliminate the possibility that your level shifting circuit is affecting the sensor, try re-enabling the pull-up resistors on the VL53L1X by resoldering the jumper and power the board with your 3.3V source. Then connect the I2C lines directly to the I2C bus on your Teensy 2.0++ and see if that helps anything. It might be those transistors are locking up but as I mentioned previously, you would have seen that on your scope.