[SOLVED] library for VL530lox LIDAR sensor

Please do not post requests
raufjay
Posts: 2
Joined: Wed Feb 03, 2016 3:31 am

[SOLVED] library for VL530lox LIDAR sensor

Post by raufjay » Thu May 18, 2017 2:00 am

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

User avatar
ahull
Posts: 1578
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: stm32duino library for VL530lox LIDAR sensor

Post by ahull » Thu May 18, 2017 10:33 am

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?
- Andy Hull -

zmemw16
Posts: 1371
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: stm32duino library for VL530lox LIDAR sensor

Post by zmemw16 » Thu May 18, 2017 8:03 pm

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

ag123
Posts: 717
Joined: Thu Jul 21, 2016 4:24 pm

Re: stm32duino library for VL530lox LIDAR sensor

Post by ag123 » Mon May 22, 2017 3:43 am

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

MartinP
Posts: 20
Joined: Fri Nov 25, 2016 8:49 pm

Re: stm32duino library for VL530lox LIDAR sensor

Post by MartinP » Sat Jun 03, 2017 9:58 am

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!

User avatar
zoomx
Posts: 473
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

Re: stm32duino library for VL530lox LIDAR sensor

Post by zoomx » Fri Aug 04, 2017 7:51 pm

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.

User avatar
RogerClark
Posts: 6703
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: stm32duino library for VL530lox LIDAR sensor

Post by RogerClark » Fri Aug 04, 2017 9:32 pm

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.

User avatar
zoomx
Posts: 473
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

Re: stm32duino library for VL530lox LIDAR sensor

Post by zoomx » Sat Aug 05, 2017 6:28 am

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.

User avatar
RogerClark
Posts: 6703
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: stm32duino library for VL53L0X LIDAR sensor

Post by RogerClark » Sun Aug 06, 2017 12:05 pm

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

User avatar
RogerClark
Posts: 6703
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: stm32duino library for VL530lox LIDAR sensor

Post by RogerClark » Sun Aug 06, 2017 12:13 pm

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

Post Reply