5 Replies Latest reply on May 18, 2020 11:05 PM by ralphjy

    Any known I2C issues with VL6180X TOF sensor

    ralphjy

      I just got a VL6180X time-of-flight proximity sensor that am going to try to use to do auto focus on my laser set up.  The VL6180X has a range of 5-200mm.  My test setup uses an Adafruit 8266 Feather Huzzah for the controller and I've been using it with VL53L0X TOF sensor that has a 50-1200mm range.  I thought swapping sensors would be easy since both have nearly identical pinouts and functionality (they actually both default to the same I2C address).  I use the specific Adafruit library for each sensor.

       

      I encountered problems immediately after swapping parts - the VL6180X caused the 8266 to reboot continuously with a watchdog reset.  I did a quick I2C scan and the program does not see the VL6180X.  Doing the same scan on the VL53L0X correctly identifies the correct SCL and SDA pins and the I2C address (0x29).

       

      The voltages appear correct on the VL6180X (3.3V in and 2.8V from the on-board regulator) and the pullup voltages are correct.  I tried reducing the frequency for the Wire library from 400KHz to 200KHz but that didn't help.  I inspected the PCB assembly and can't see any obvious issues.

       

      At this point I think I have a defective board and probably will return it, but I thought I'd check to see if anyone knows of any I2C issues with this part/board or had any additional trouble shooting suggestions.  I did a quick search but only saw issues when multiple devices are sharing the same bus (because of the same default address).

       

      Here's the schematic:

      VL6180X Schematic

       

      Thanks,

      Ralph

        • Re: Any known I2C issues with VL6180X TOF sensor
          lui_gough

          I've never used the component you mentioned - so my suggestions are only general. The first thing is to ensure power and ground are well connected - check and double check. It's caught so many people out before ... and make sure you haven't swapped the SCL/SDA lines. Next step would be to scope the lines to see what's happening on the I2C bus and whether the waveforms look right, and what's being sent/received between WDT resets.

           

          The ESP8266 is a very temperamental beast - have some code that runs a little too long without servicing the WI-Fi by using delay(0) or yield() and you're going to see watchdog resets or other issues. Likewise, this could happen because of poor quality code that somehow hangs in case of a communication error. Or perhaps the same routines take longer with the new sensor compared to the old one ...

           

          Perhaps it's worth trying to get it to work with something a little less complex that don't have this kind of time-sensitivity (e.g. a regular Arduino connected directly by USB) first, before migrating it to the ESP8266. Of course, take care regarding voltages as well depending on what your peripheral can handle. Best to try some very simple code first based on the datasheet (e.g. read the Who Am I register).

           

          - Gough

          2 of 2 people found this helpful
            • Re: Any known I2C issues with VL6180X TOF sensor
              ralphjy

              Thanks for the suggestions.  The seller also requested that I try it with a different controller than the ESP8266.  I have rechecked the hookup and the power and the pullups.

               

              I tried the VL6180X sensor with an Arduino Uno and it also failed to respond to the I2C address.  My VL53L0X works with both the ESP8266 and the Arduino Uno.  I'll need to compare the SDA and SCL waveforms between the two sensor boards. Won't have a chance until later.

                • Re: Any known I2C issues with VL6180X TOF sensor
                  lui_gough

                  Did you try an I2C scanner sketch on the Arduino Uno - sometimes some devices may appear at unexpected addresses if they have address select lines which are not connected as expected. Your device doesn't seem to have these lines, but worth having a check. Perhaps check if the device is getting warm, or any unusual current draw. If the pins are accessible, perhaps inspect the package joints for solder bridges - a short between SDA/SCL or from SDA/SCL to either Vcc or GND would take out communications entirely. Also worth reversing the SDA/SCL lines just in case someone labelled it incorrectly - this shouldn't harm anything in theory.

                   

                  A closer look at the schematic shows there to be a level shifter - perhaps it's worth checking the signals on both sides if you have a chance to get access to a scope. I2C and level shifters can be difficult to get working reliably sometimes depending on pin drive strength.

                   

                  - Gough

                  1 of 1 people found this helpful
                    • Re: Any known I2C issues with VL6180X TOF sensor
                      ralphjy

                      Yes, I did try scanning the I2C addresses using both the VL53L0X and VL6180X with the ESP8266 and the Uno and only the VL53L0X worked.  The VL6180X did not respond at any address.  Internally it should default to 0x29 at power up so if it were at any other address it would be a defective part.

                       

                      This is a reasonably inexpensive board ($13) so I don't want to invest a lot of time repairing it (if it were the VL6180X part itself - I wouldn't even try).  I'll probably just get another one.  I was hoping that it was something simple that I could fix without a soldering iron .  I will still take a look at the waveforms and the level shifters when I get a chance.

                      • Re: Any known I2C issues with VL6180X TOF sensor
                        ralphjy

                        I finally got around to looking at the I2C signals on this board and you were right.  There was a damaged MOSFET in the SDA translator. VL6180X TOF Sensor Repaired

                         

                        Thanks Ralph