Page 1 of 2

[SOLVED] library for VL530lox LIDAR sensor

Posted: Thu May 18, 2017 2:00 am
by raufjay
Hello,
I tried to find VL530lox sensor library to work for bluepill board. So far I could not get one. There are few working well with Arduino, but when I tried it gives some error in Wire.write command.
I don't have enough knowledge in C++ and limited knowledge for C.
Any help or guideline will be appreciated.
Thanks
raufjay

Re: stm32duino library for VL530lox LIDAR sensor

Posted: Thu May 18, 2017 10:33 am
by ahull
You will need to provide a lot more information than that. :D For starters....

Which library are you using?

Where did you download it from?

*Exactly* what is/are the error or errors you get?

Do you have a link for the datasheet for the VL530lox module?

Re: stm32duino library for VL530lox LIDAR sensor

Posted: Thu May 18, 2017 8:03 pm
by zmemw16
google gives a single result
https://github.com/pololu/vl53l0x-arduino
VL53L0X library for Arduino
This is a library for the Arduino IDE that helps interface with ST's VL53L0X time-of-flight distance sensor. The library makes it simple to configure the sensor and read range data from it via I²C.

https://www.pololu.com/product/2490 @ $13.95
datasheet https://www.pololu.com/file/download/VL ... _id=0J1187

that's not the lidar i expected, mine revolves :lol:
stephen

Re: stm32duino library for VL530lox LIDAR sensor

Posted: Mon May 22, 2017 3:43 am
by ag123
found the datasheet, and interestingly it is from ST!
http://www.st.com/en/imaging-and-photon ... 53l0x.html
http://www.st.com/content/ccc/resource/ ... 279086.pdf
but no, i don't think it works as a scanning lidar, more as a laser range detector

Re: stm32duino library for VL530lox LIDAR sensor

Posted: Sat Jun 03, 2017 9:58 am
by MartinP
I've used this sensor on other boards than bluepill (or maple mini). I'm just about to go out for a walk but I'll take a look at it later!

Re: stm32duino library for VL530lox LIDAR sensor

Posted: Fri Aug 04, 2017 7:51 pm
by zoomx
I checked the Adafruit library
https://github.com/adafruit/Adafruit_VL53L0X
and loaded the only one example: it compiles.

I used a core that has some months, 8 April 2017.

Re: stm32duino library for VL530lox LIDAR sensor

Posted: Fri Aug 04, 2017 9:32 pm
by RogerClark
I have that sensor connected to a maple mini on a breadboard at the moment.

So if I have time I will confirm if the adafruit library works

Note. Adafruit often deliberately wire the config pins on I2C devices to the alternative ( non default ) slave address, which means their library's only work "out if the box " on their hardware, because the Chinese made boards tend to use the default address.

In the past I needed to modify their Libs to make them work with some Chinese made modules.

Re: stm32duino library for VL530lox LIDAR sensor

Posted: Sat Aug 05, 2017 6:28 am
by zoomx
It happened to me using their BME280 library but then I discovered that the begin function accept an address.
Maybe this library too accept an address as argument in begin.

Re: stm32duino library for VL53L0X LIDAR sensor

Posted: Sun Aug 06, 2017 12:05 pm
by RogerClark
I've tried 2 different libraries for the STM VL53L0X.

https://github.com/adafruit/Adafruit_VL53L0X
and
https://github.com/pololu/vl53l0x-arduino

Both seem to run OK, however both examples have problems which would make the example unusable.

The Adafruit library reports a "Range Status" and the example checks this is != 4

However, when I turned on the debugging in the Adafruit lib, it reports Range Status 2 as "Signal Fail"
And only values with Range Status == 0 are show as "Valid"
Range only seems to be valid when the distance being measure is < 20 cm

This value is much less than ST's datasheet, which status
It can measure absolute distances up to 2m
http://www.st.com/content/ccc/resource/ ... 279086.pdf

I'm pretty sure the problem is in the library config, but its a shame that the library appears to report values when the library is reporting that the range status is "Signal Fail"

The Pololu library gives very similar results to the Adafruit, but the Pololu library had an example of a "single" reading, which has options for long range, and this seems to be the best mode, because the Pololu library reports a range of 8190 if the distance its measuring goes of range.

But ultimately, I'm not that happy with either library.

I thought ST has written their own "driver" for this device, but I can't find it yet, and looking on ST's community forum, people didnt seem happy with the lack of documentation on this device
e.g.
https://community.st.com/thread/7504

Re: stm32duino library for VL530lox LIDAR sensor

Posted: Sun Aug 06, 2017 12:13 pm
by RogerClark
Just a quick followup to my last post.

It looks like the Adafruit library contains source code written by ST and published via mbed.

The Polulu library seems to have been written by them from scratch, and contains big blocks of code writing arbitrary values to registers in the VL53lox e.g.

Code: Select all

 writeReg(0xFF, 0x01);
  writeReg(0x00, 0x00);

  writeReg(0xFF, 0x00);
  writeReg(0x09, 0x00);
  writeReg(0x10, 0x00);
  writeReg(0x11, 0x00);

  writeReg(0x24, 0x01);
  writeReg(0x25, 0xFF);
  writeReg(0x75, 0x00);
Which makes it hard to work out how they are setting up the device.



I'm forming the opinion, that setting up this device is a bit of a black art, and is similar to getting the OV7670 camera to produce a decent picture