2
\$\begingroup\$

I am trying to troubleshoot communication between Arduino (master) and 3 slave sensors (VL53L0X):

Overview

Below is VL53L0X sensor module I am using. I checked and confirmed that the placement of resistors and capacitors are as recommended by each components' datasheet. XSHUT is a pin on VL53L0X that shuts the sensor down when it is low (active low). When the sensor first boots up, its I2C address is set to its default value, so XSHUT is used to change this address by booting VL53L0X one by one and modifying the address of only one sensor at a time.

enter image description here

Below is schematic of the circuit on the breadboard. I am using 4K7 pullup resistors for I2C. (Sorry I am still learning and I used PowerPoint because schematics software is still difficult for me)

enter image description here

I can reliably communicate with only 1 sensor attached. It worked with 2 sensors attached today (but I was not able to do so yesterday). I ultimately want to connect 3 sensors. When I connect the third sensor as shown above, it stops working and I cannot communicate with any sensor.

Below is oscilloscope measurement with only 2 sensors attached and the 3rd sensor completely disconnected (this worked today). Channel 3 is XSHUT and channel 4 is 5V.

2 sensors

Zoomed in:

2 sensors zoom in

Below is oscilloscope measurement with the 3rd sensor attached with its XSHUT pin connected to ground and SCL/SDA/5V connected as shown in breadboard schematic above:

3 sensors

Zoomed in:

3 sensors zoomed in

It looks like it is working for a while and then suddenly fails in the middle. Once it fails, I have to reset the microcontroller. The point at which it fails varies every time. None of the sensors are broken because they work when connected individually. 5V and XSHUT line look stable. I tried increasing and decreasing the resistance of the pull-ups but did not really help. The oscilloscope also seems to affect the communication (seems to work better when probing) so something about my setup is very fragile (susceptible to small external influence). Could someone point me to where I should look? Thank you.

\$\endgroup\$

2 Answers 2

4
\$\begingroup\$

You have a breadboard in the middle of a whole bunch of things operating at fairly high speed.

This is just asking for things not to work.

Breadboards have wiggly contacts, inviting glitches in your signals and power supplies.

Breadboards have capacitance between all the pins, inviting crosstalk between lines and causing slower rise times on the edges of your signals.

Try the following:

  1. Use a lower data rate. Your modules support up to 400kbit, but you don't have to run them at full speed.

  2. Use shorter wires, and make sure they make good contact with your breadboard.

  3. Consider soldering the connections instead of using a breadboard. Soldering isn't that difficult to learn.

\$\endgroup\$
2
\$\begingroup\$

first a general comment: Probing lines actually adds a resistance (typically 1 MOhm * "the ratio of your probe" which is commonly 10:1= 10 MOhm) and a capacitance typically in the range of a few pF. The phenomenon you describe is typical for lines with a lot of ringing or glitches in the outputs - the additional capacitive loads acts as a low pass filtering/damping higher frequency components.

Now to your case: what makes me nervous is that I2C bus has multiple level shifters built in. IMHO you are mostlikely very lucky that your whole bus does not start oscillating from the very beginning: the multiple buffers basically form something which is very close to a ring oscillator. You could try to drive the lines stronger by decreasing the pull up resistiance. But this only decreases the likelyhood if I see it correctly.

Alternatively you could try to wire all the VL530L0X SDA and SCL together and only use one buffer to translate from arduinos 5V to the 2.8V.

EDIT: I noticed that the datasheet of FXMA2102 actually shows an example archiecture similiar to yours. Seems like their auto direction dectection circuits helps with the oscillation but maybe it fails under certain conditions.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.