2025-05-01 5:00 PM
Hello! I've designed a custom PCB very similar to other breakout boards on the market, because there are additional components I want to fit in a small package alongside the VL53L1X sensor. When testing my PCB, the sensor does not initialize. I've been using the same library that works with other breakout boards. The PCB is supplied with 5V from an Arduino Nano, stepped down to 2.8V with an LDO and then logic shifted with two BSS138's to the SDA and SCL pins.
At first I thought it was an I2C timing issue, so I made the pullups stronger on the bus (~3.6k) but that was unsuccessful. I've done a continuity test on all components. I'm wondering if there's anything I've missed or if there's a chance something went wrong in manufacturing. I can provide the PCB layout if needed.
Any help is appreciated, this is one of my first PCB designs! Thank you!
2025-05-02 10:56 AM
Assuming you have power and the XShut line is high, it's almost impossible to not have the sensor work.
But it's REALLY easy to screw up an I2C line when converting it from a 5V to a 3v3 (or 2v8).
My friends at SparkFun - who like the Arduino processors do it this way:
Which looks a lot like what you have.
Bi-Directional Logic Level Converter Hookup Guide - SparkFun Learn
I'd put a scope on the I2C. First thing to check is that both clock and data are high when not in use. Next I'd put an infinite loop around the isAlive call. It attempts to read a single byte register. Do that over and over and look at the shape of the signal. Is it nice and square? Not too much overshoot or undershoot. But you need square waves.
Some scopes and logic analyzers have I2C functions on them. You should see an address (0x52), two address bytes, then a read.
Note that if your wires are long, shorten them about 1 foot is the max unless you do crazy things with pull-ups.
- john
But I'm a software guy and I go blind following
2025-05-05 4:01 PM
Hi John! Thanks for your reply. I appreciate the thoroughness. As you said, my main suspicion is there being something wrong with the I2C lines. These are the diagnostics I did in order with pictures provided.
isAlive call - I'm sorry I wasn't quite sure what you were referring to because I couldn't find that function in the API document, so I instead created my own that effectively does what you say. My function sends five packets (start, address write high byte, address write low byte, re-start, read) to complete the reading of a register, in this case Model ID. My understanding is this will generate 5 packets of 9 clock pulses on the SCL line, and then 5 packets of clock pulses corresponding to the relevant bit data on the SDA line. Unfortunately, that is not what I measured. It looks like the sensor attempts to begin the transmission but receives no further coms. This is in line with an I2C scanner I ran which showed no addresses found.
In contrast, these are the signals from a good OTS board that I know works. It shows 45 SCL pulses and data on the SDA line as I expected.
My wires are not very long. They are about 120 mm. This is leading me to believe either I positioned the component incorrectly, my wiring is wrong, or there is some short/manufacturing defect. Is there any other oversight potentially? It's a bit hard to see, but below I believe I positioned the component correctly. Thanks again for any and all help, John and any others who may come across this.