Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Lidar Lite V4
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Lidar Lite V4

by slowjim on Tue Sep 15, 2020 8:18 am

Hi

I am having trouble getting my Garmin LiDAR-Lite V4 (Product ID 4441) to fire up. I am using the sample code below to print the distance in the REPL, however I receive a repeated error message:

Measurement failure
Measurement failure
Measurement failure
Measurement failure
...

I also get the occasional "System failure" message from time to time.

In terms of hardware, I am using a Feather M4 Express with a AP3602A to get 5Vi for the sensor with a 470uF capacitor. My intent is to shrink to a Trinket M0 at some point with a PowerBoost 1000C and maybe an LCD screen).

I am wondering if anyone has any experience with these sensors and may be able to pick up on what I'm missing.

As always, thanks for your help.

Cheers

SlowJim

Code: Select all | TOGGLE FULL SIZE
import time
import busio
import board
import adafruit_lidarlite

 
i2c = busio.I2C(board.SCL, board.SDA)
 
sensor = adafruit_lidarlite.LIDARLite(i2c)
 
while True:
    try:
        print(sensor.distance)
    except RuntimeError as e:
        # If we get a reading error, just print it and keep truckin'
        print(e)
    time.sleep(0.5)

slowjim
 
Posts: 37
Joined: Fri Sep 27, 2019 3:49 am

Re: Lidar Lite V4

by dastels on Tue Sep 15, 2020 9:21 am

From a quick check of the product pages, the AP3602A can supply 100mA, while the LIDAR-Lite draws 130 during measurements. I suggest powering from USB to confirm this is your problem.

Dave

dastels
 
Posts: 3819
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lidar Lite V4

by slowjim on Tue Sep 15, 2020 9:29 am

Hi Dave

Thanks for your reply. I was still having a tweak on the test bench as your reply came through. I have just tried with 5Vin and the USB pin, unfortunately I still get the same result.

Cheers

SlowJim

slowjim
 
Posts: 37
Joined: Fri Sep 27, 2019 3:49 am

Re: Lidar Lite V4

by dastels on Tue Sep 15, 2020 10:59 am

Hmm. Same Code (other that printing to the 7-segment display) as I used (https://learn.adafruit.com/garmin-lidar-lite-range-finder). It sounds like your wiring is pretty much the same as well. I just fired this up and watched the REPL output... not a single error.

I have to ask... the lenses are43 clean, yes?

Also, does the error frequency vary with what the LIDAR is pointed at? The angle to that surface?

Dave

dastels
 
Posts: 3819
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lidar Lite V4

by dastels on Tue Sep 15, 2020 11:22 am

For your reference:
The CircuitPython module: https://github.com/adafruit/Adafruit_CircuitPython_LIDARLite/blob/master/adafruit_lidarlite.py
Garmin's docs: https://static.garmin.com/pumac/LIDAR_L ... ations.pdf

The status/error register and bitmask are on page 8 of Garmin's doc. Se the read_distance function in the LIDARLite class.

Dave

dastels
 
Posts: 3819
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lidar Lite V4

by slowjim on Wed Sep 16, 2020 6:21 am

Hi Dave

Thanks for the tips, but unfortunately no joy. The lens are now extremely clean although I think they were probably not too bad to begin with. I spent about 10 minutes pointing it at different objects and at different distances but to no avail. I did see that you linked the V3 sensor. I am using the V4 should I expect any different behavior?

Cheers

SlowJim

slowjim
 
Posts: 37
Joined: Fri Sep 27, 2019 3:49 am

Re: Lidar Lite V4

by dastels on Wed Sep 16, 2020 9:22 am

My bad. The v4 is a completely different beast. Same thing applies with leneses and targets, though.

Looking at it's CP code, try calling sensor.reset() before the while loop.

Dave

dastels
 
Posts: 3819
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lidar Lite V4

by slowjim on Wed Sep 16, 2020 10:09 am

Hi Dave

Not good news from tonight's testing. I have set up the same as yesterday. First try and I got the request for asked for pull resistors error. I added 4k7 on SCL and SDA. On subsequent attempts, multiple resets etc the feather cannot even see the sensor (eg no i2c device at address 62). So unfortunately I cannot even test your reset theory. Maybe I should have saved some more money and bought the V3. Anyway in my part of the world it is time to let frustration give way to some sleep. I will try again tomorrow.

Thanks again for your help. Your responses on the forums and your tutorials are excellent. I have learnt so much from them. Despite getting stuck with sensors from time to time this hobby is awesome and I thank you and the team.

Cheers

SlowJim

slowjim
 
Posts: 37
Joined: Fri Sep 27, 2019 3:49 am

Re: Lidar Lite V4

by dastels on Wed Sep 16, 2020 12:39 pm

The LIDAR already has pullups. This seems to happen occasionally in CircuitPython (the "needs pullups" error). Disconnect power from everything and power up again. That will often correct it.

You're right... it is fun, and also sometimes extremely frustrating.

Dave

dastels
 
Posts: 3819
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.