LIDAR lite gives superman vision!

I have some fantastic news! I was hacking my LIDAR lite range finder, trying to improve its precision and scanning a region near my wall, using a servo controlled base. I started having some strange images that looked like a human shade… then I realized the image wasn’t from my side of the wall! Here is one of the last images, after a few hours of testing and improvement:

wall-image Continue reading “LIDAR lite gives superman vision!”

LIDAR lite and Beaglebone Black I2C signals

In my previous post about the LIDAR lite I said its I2C signals were 5V. Well, if you go to their new support page you can check in this FAQ that I was wrong. They are 3.3V.

If you connect 5V to any of the 3.3V pins of the Beaglebone you will probably kill it so just to make sure I power up my Rigol scope (I got it after listening to this eevblog review, thanks Dave;-) and check the voltage on one of the I2C pins of the LIDAR lite. Humm… in the unconnected pin I have 3.6V. A little higher then 3.3V. Lets check the Beaglebone absolute maximum ratings. I’m using the I2C2 pins (connector P9, pins 19 and 20). From the Beaglebone electronic diagram they go into the TI AM3358 processor. In the AM3358 datasheet I see that the maximum voltage is 3.8V… we are pretty close to the maximum but it should be ok. This is the processor chip so we need to be careful! If I measure the voltage on the I2C2 Beaglebone side (unconnected pins) I get 3.2V.

Continue reading “LIDAR lite and Beaglebone Black I2C signals”

LIDAR lite with Beaglebone Black and Arch Linux

Its been a few months now since I received my new LIDAR lite from the crowd funded campaign on Dragon Innovation but only now I have some time to play with it. I got interested in range finder hardware after doing this great Udacity course on Artificial Intelligence for Robotics by Sebastian Thrun (the new one is here). One of the key hardware components is a good inexpensive range finder and Pulsedlight is doing it.

I want to try it out on my Beaglebone Black, the first challenge are the data pins voltage, the LIDAR is working at 5V and the Beaglebone at 3V3.

(EDIT) Well, figures out that I was wrong about LIDAR lite I2C levels, even thought it works with the logic levels converter, it is not necessary to use it, check my new post here.

I have hanging around a 4-channel I2C-safe Bi-directional Logic Level Converter – BSS138 from Adafruit. It is perfect for this. Here are some photos of the connections, I’ll publish the wiring in a few days when I have more time:

lidarlitewiringConnection to the Beaglebone via ssh.
The Beaglebone is running Arch Linux, to install the i2c tools:

# pacman -S i2c-tools

Check if the LIDAR is there:

# i2cdetect -r -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- --
60: -- -- 62 -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Looking good! LIDAR Light detected at address 0x62.  Now, from its manual, we need to write 0x04 at its address 0x00 to make a measurement:

# i2cset -y 1 0x62 0x00 0x04

and wait for a couple of seconds to make sure the measuring is finished, then read the measured value:

# i2cget -y 1 0x62 0x8f w
0x7500

so I’m getting 117cm. It works! And the distance from it to my wall is around that value. Can’t find my meter so I can’t check its precision right now. I made a simple script to make it run for a while and save the measuring in a file, I’ll let you know my findings about repeatability later. Here is the script:

#!/bin/sh
date >> lidar.txt

while :
do
i2cset -y 1 0x62 0x00 0x04

sleep 2

i2cget -y 1 0x62 0x8f w
i2cget -y 1 0x62 0x8f w >> lidar.txt
done

I couldn’t use the i2cdump command. Each time I do:

# i2cdump -y 1 0x62

I get an answer the first time with some values but if I do the i2cdump again the result is all zeros, it looks like something gets stuck and the LIDAR no longer responds. The only way to make it work again is to power down / up the LIDAR. I’ll investigate this another day.