Lidar Lite V4

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
slowjim
 
Posts: 40
Joined: Fri Sep 27, 2019 3:49 am

Lidar Lite V4

Post by slowjim »

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

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)

User avatar
dastels
 
Posts: 15656
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lidar Lite V4

Post by dastels »

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

User avatar
slowjim
 
Posts: 40
Joined: Fri Sep 27, 2019 3:49 am

Re: Lidar Lite V4

Post by slowjim »

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

User avatar
dastels
 
Posts: 15656
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lidar Lite V4

Post by dastels »

Hmm. Same Code (other that printing to the 7-segment display) as I used (https://learn.adafruit.com/garmin-lidar ... nge-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

User avatar
dastels
 
Posts: 15656
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lidar Lite V4

Post by dastels »

For your reference:
The CircuitPython module: https://github.com/adafruit/Adafruit_Ci ... darlite.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

User avatar
slowjim
 
Posts: 40
Joined: Fri Sep 27, 2019 3:49 am

Re: Lidar Lite V4

Post by slowjim »

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

User avatar
dastels
 
Posts: 15656
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lidar Lite V4

Post by dastels »

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

User avatar
slowjim
 
Posts: 40
Joined: Fri Sep 27, 2019 3:49 am

Re: Lidar Lite V4

Post by slowjim »

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

User avatar
dastels
 
Posts: 15656
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lidar Lite V4

Post by dastels »

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

User avatar
oldblackcrow
 
Posts: 221
Joined: Tue Jun 20, 2017 5:54 pm

Re: Lidar Lite V4

Post by oldblackcrow »

I'm getting the same error. Tried the reset, checked my connections, cleaned the lenses, moved the sensor around, and still no data.

I can see the red "laser" flashing inside the sensor but still says "measurement error".

User avatar
oldblackcrow
 
Posts: 221
Joined: Tue Jun 20, 2017 5:54 pm

Re: Lidar Lite V4

Post by oldblackcrow »

Question: I have this connected to a PyPortal Pynt and VIN is on the 3.7v... should I be on 5v?

User avatar
dastels
 
Posts: 15656
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lidar Lite V4

Post by dastels »

The Lidar needs to be powered with 5v (although the logic is 3.3v which is good for the Pynt).

Dave

User avatar
oldblackcrow
 
Posts: 221
Joined: Tue Jun 20, 2017 5:54 pm

Re: Lidar Lite V4

Post by oldblackcrow »

dastels wrote:The Lidar needs to be powered with 5v (although the logic is 3.3v which is good for the Pynt).

Dave
So, I'm assuming that's just cutting or soldering that trace near the I2C connector?

User avatar
dastels
 
Posts: 15656
Joined: Tue Oct 20, 2015 3:22 pm

Re: Lidar Lite V4

Post by dastels »

You might be able to since the Lidar uses 3.3v I2C. change that jumper and connect the V+ line from the 4-pin JST to the Lidar power. IFrom the datasheet on the Lidar, it uses 3.3v I2C which will make the Portal happy.

Dave

User avatar
oldblackcrow
 
Posts: 221
Joined: Tue Jun 20, 2017 5:54 pm

Re: Lidar Lite V4

Post by oldblackcrow »

Ok... I'll give that a shot next weekend. Thanks for all your help. If you can cross your fingers for me, that would be awesome! :-D

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”