i2C Stall: Nano and VL53L0X

Hi,

I’m a complete beginner with arduino and DIY-tech, so I set out to give it a try.

I bought the following:

  1. Arduino Nano (?clone)
  2. VL53L0X time-of-flight sensor
  3. Small breadboard + wires
  4. USB-powered solder kit.

So far:
→ Pins are soldered on
→ IDE is installed
→ Blink program runs without problem (compiled as ATmega328P (old Bootloader), since the ATmega328P produced a compile error)

Problem is:
→ When i wire the VL53L0X through the breadboard (as shown in attached pictures),
I get no output from the sensor on two programs:

  1. Adafruit VL53L0X (downloaded from the library)
  2. i2Cdetect

→ Both programs show evidence of successful upload, but the sensor seems to give no feedback.
→ What is interesting is that the i2Cdetect stalls completely, with no run through the range. However, when i removed the SDA wire (as shown in the last photo, it will run through the range, only showing no input, since the wire is removed)

My Question:
→ Does anyone have the knowledge of what may be causing this?
→ With a search online, the forums, and some attempt at logic I can only guess that it is a power issue or the sensor itself is defective. My soldering is not the neatest, but I have inspected closely and given it a second-run with no change.

Attached:
→ 3 screenshots (the run of Adafruit VL530L0X, the run of i2Cdetect with SDA connected to sensor, the run of i2Cdetect with SDA disconnected)

→ 2 photos (the wiring setup, the SDA disconnected as in the 3rd screenshot)

Any advice is much appreciated.

(deleted)

Indeed, my “first-time-soldering” is far from aesthetic :slight_smile: - however, on close inspection there is definite contact with the whole surface of the relevant PCB connections - i reckon this points to something more complex than the pins, however I will get some more practice in at the soldering too!

Thanks for the input.

(deleted)

deadboard:
My soldering is not the neatest, but I have inspected closely and given it a second-run with no change.

Any advice is much appreciated.

A cold solder joint is not necessarily visible. Take the advice and redo *all * the joints. Also, put a dab of flux on the ones which don't have a nice pyramid shape before heating. This will help the solder flow completely onto the pad. Excess flux can be removed with a toothbrush and some isopropyl alcohol.

Sound advice all round. Thanks to both of you for the quick replies.

I'll get on it with a solid soldering redo and a read around pull-up resistors (the few examples i seen online didn't show those being used, so I've got a good bit of reading ahead).

Will repost with an update if it all figures out.

Update:

  • I took the advice and done a second run of soldering. (got myself some flux, wick and new solder)

The job is neater looking than the first run, however the outcome is the same - the software side shows the same problems as in the first set of screenshots.

Is there anyone with knowledge of the software side who has encountered this type of problem? (i’ve not looked at pull-up resistors as yet, since none of the working examples I’ve seen for this setup have shown them, and I’m keeping my efforts focussed for now due to time constraints)

Thanks.

The info on the 1530 should list an I2C address. Will the 1530 demo run correctly *without * the detect program?

→ What is interesting is that the i2Cdetect stalls completely, with no run through the range. However, when i removed the SDA wire (as shown in the last photo, it will run through the range, only showing no input, since the wire is removed)

Typically this means that SDA/SCL are shorted to each other or ground. Try running this i2c scanner program and see if it hangs or reports nothing found. If it hangs, rerun the program with nothing connected to the nano. If it then reports nothing found, then the short is on the VL53LOX module.

// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011

#include <Wire.h>

void setup() {
  Serial.begin (115200);

  // Leonardo: wait for serial port to connect
  while (!Serial) 
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  for (byte i = 8; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

@OP

1. Please, practice soldering as per following picture. Place the tip of the soldering iron at 450 inclination with stuff. Wait until the tip is hot enough. Pour solder not on the soldering iron's tip but at the opposite side. The solder will be automatically flowed to the lead.
solderPrac.png

solderPrac.png

Hi,
OPs pic.
9225d6fe8a6bcfa904fb4ac5130070ce1aa951a0.jpg

Now can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Hand drawn is good.

Thanks… Tom… :slight_smile:

Hi,
Try running this I2C scanner;

// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011


#include <Wire.h>


void setup() {
  Serial.begin (115200);
//  Wire.begin(4, 15);
 pinMode(16, OUTPUT);
  digitalWrite(16, LOW);
  delay(50);
  digitalWrite(16, HIGH);
  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;


  Wire.begin();
  for (byte i = 8; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
    {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
    } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup


void loop() {}

Tom… :slight_smile:

Thanks for all the input. - and problem solved (somehow)

I ran the i2c scanner cattledog put up and it detected the device without problem. I then ran the original i2cdetect script, and it found the device too (when it had not before). I then ran the adafruit VL53LOX script - it now runs without problem! (the demo would not run with or without i2cdetect previously)

I changed nothing in the setup to account for this - so it was either my laptop's usb causing issue or something that the new i2c scanner script resolved, although I'm not sure how this would work.

In any case, thanks for the help.

To answer TomGeorge about a circuit diagram - I wouldn't have a clue. I've been goal-oriented with this thing for now, so it will take me a while to work "back to basics". - I am a "2 week in" hobbyist with no related cross-over experience. I attached a photo of the wiring on the first post, if thats the same idea.

All the tips on soldering etc, will also be useful going forward.

Cheers.