VL6180 Breakout needs Reset?

Hi,

I’m working with a [ToF Range Finder Breakout - VL6180 but I’m not getting the desired results.

I’ve tested with an Arduino Uno (by following [this guide) as well as a Raspberry Pi 4 (by following this guide [this guide), with their respective libraries.

I couldn’t read any values on the Arduino, neither on the SDA and SCL pins nor on the A4 and A5 pins.

On the Raspberry Pi 4, I was able to read the illuminance values (lux) but not the distance values (as seen in the image below).

[

In fact I’m getting the error 11, which, if I’m not mistaken, according to the Table 1 from Page 2 from [this document, it says the sensor need to be reset.

How do I reset the board?
and

What could I have missed from this to not be working on the Arduino?

Thanks in advance,

Luke](https://www.st.com/resource/en/design_tip/dm00114111-vl6180x-range-status-error-codes-explanation-stmicroelectronics.pdf)](https://imgbb.com/)](Python & CircuitPython | Adafruit VL6180X Time of Flight Micro-LIDAR Distance Sensor Breakout | Adafruit Learning System)](VL6180 Hookup Guide - SparkFun Learn)](SparkFun ToF Range Finder Breakout - VL6180 - SEN-12784 - SparkFun Electronics)

The most detailed version of its documentation https://cdn.sparkfun.com/assets/learn_t … onNote.pdf doesn’t mention a physical reset, only via software. It also mentions range error 11 being: “ambient conditions too high; measurement invalidated” which could either be secondary to the settings being loaded or its use (something nearby might be upsetting the sensor?)

Also please ensure you are using the SparkFun libraries (https://learn.sparkfun.com/tutorials/vl … okup-guide has links to them), as if you happen to be running the adafruit ones that might be causing issues - try it with default settings

Hi Russell,

When I tried it on the Arduino I followed [that exact guide with those libraries.

I only used the Adafruit guide and libraries when I tried to use it on the Raspberry.

Here’s the Arduino’s Serial Monitor when I run the SparkFun_VL6180X_demo.ino

[

First, the light levels and the distance measured don’t change whether I cover the sensor or not.

Second, the program actually stopped running before I took this screenshot (sometimes it can print a lot more lines, other times it just prints a few like the picture).

It also mentions range error 11 being: “ambient conditions too high; measurement invalidated”

Ok, so they are supposed to be read as binary. I wasn't sure so thank you.

(something nearby might be upsetting the sensor?)

Within 10 feet I only have the arduino itself (of course haha) and my laptop some 4 feet from it. I doubt these would cause any problems. Would they?

try it with default settings.

Here's the thing, I just followed the [[Hookup Guide](https://learn.sparkfun.com/tutorials/vl6180-hookup-guide) and used the demo [[provided on the Github](https://github.com/sparkfun/ToF_Range_Finder_Breakout-VL6180/blob/master/Libraries/Arduino/examples/SparkFun_VL6180X_demo/SparkFun_VL6180X_demo.ino) with the mentioned libraries. I changed no code. What could I have missed?
int VL6180X_Init() {
    char reset;

    reset = ReadByte(0x016);
    if (reset==1){ // check to see has it be Initialised already

///////////////////////////////////////////////////////////////////
// Added latest settings here - see Section 8
///////////////////////////////////////////////////////////////////

        WriteByte(0x016, 0x00); //change fresh out of set status to 0
    }
    return 0;
}

([Application Note, page 21)

Is this what I have to do to reset the board?](https://cdn.sparkfun.com/assets/learn_tutorials/2/5/7/VL6180_ApplicationNote.pdf)](ToF_Range_Finder_Breakout-VL6180/Libraries/Arduino/examples/SparkFun_VL6180X_demo/SparkFun_VL6180X_demo.ino at master · sparkfun/ToF_Range_Finder_Breakout-VL6180 · GitHub)](VL6180 Hookup Guide - SparkFun Learn)](https://i.ibb.co/wzrJkN3/arduino-serial.png)](VL6180 Hookup Guide - SparkFun Learn)