Driver for SparkFun VL6180 ToF Range Finder Sensor
John Abshier
Posts: 1,116
The VL6180 is an IR range sensor that uses Time Of Flight and claims to be more accurate and resistant to noise than sensors that rely on reflected light intensity or reflected angles. Range is 10 to 100mm and perhaps up to 254mm depending on the target. Update rate is 40 to 60Hz. The program is mostly a translation of the Arduino code provided by SparkFun and uses the I2C driver written by Jon "JonnyMac" McPhalen . Lots of work left to do: Read the ambient light sensor, change I2C address to allow multiple sensors on the same I2C bus, perhaps a read multiple sensor command.
Here is the SparkFun product page that has links to documentation: https://www.sparkfun.com/products/12785
John Abshier
Here is the SparkFun product page that has links to documentation: https://www.sparkfun.com/products/12785
John Abshier
Comments
John Abshier
Any idea how to get further?
https://www.tindie.com/products/onehorse/vl6180x-proximity-sensor-via-ir-laser-range-finding/
Erlend
Second, make sure that the constants for SDA and SCL in VL6180Demo correspond to the pins you are using.
Third, make sure grounds are connected.
Fourth, check the return value from SetupRanger method. The demo program doesn't do this.
John Abshier
The SetupRange never returns it seems. - never gets beyond "I2C bus set up"
Frustrating. And I do not own a protocol anlalyzer, so I am a bit blind.
Erlend
John Abshier
Looks like someone is trying to read, but get no answer.
Erlend
John Abshier
Erlend
Agree it is kind of silly that the device does not keep its new adress after power down, it makes it less useful as a bus device. But I am wanting to have 2 or 3 on one bus, and I got the idea that the GPIO0 pin (Reset) which normally is pulled up to V+ can be connected to gnd with a capacitor, and if that capacitor is sized differently for each device, it means that the devices will boot at different times. With an initialization routine that rewrites device address to the first one to boot, then with a time interleave rewrites to the next one to boot, and so on, it should be possible to do a high number of rewrites even within one second. Once done the devices will respond on ther individual addresses. Using a 100k pull up, capacitors with a different multiple of 10nF or so should do the trick I think.
Erlend
John Abshier
Erlend