
OpenSimpleLidar - lovelearning
https://github.com/iliasam/OpenSimpleLidar
======
iliasam
Hi everyone. I am the author of the OpenSimpleLidar. If you have any questions
about this project, you can ask them here.

Here is another my Lidar project:
[https://github.com/iliasam/OpenLIDAR](https://github.com/iliasam/OpenLIDAR)

That project has a wiki:
[https://github.com/iliasam/OpenLIDAR/wiki](https://github.com/iliasam/OpenLIDAR/wiki)

A big article in Russian about it:
[https://geektimes.ru/post/275442/](https://geektimes.ru/post/275442/)

------
bri3d
This is the same low-cost triangulation approach used in other inexpensive
laser rangefinders, like the one on a Neato vacuum: [https://www.diva-
portal.org/smash/get/diva2:995686/FULLTEXT0...](https://www.diva-
portal.org/smash/get/diva2:995686/FULLTEXT01.pdf)

It's dramatically different from the $20k+ LIDAR units you'd find on a self-
driving car, which generally use time-of-flight.

~~~
asteli
100% this.

Any laser scanner you'd put on a vehicle is going to be ToF, as far as I know.
While this is useful for indoor sensing, you'd completely wash out the laser
illumination once you have to compete with sunlight.

This would be better described as a structured light scanner. The principle is
more similar to what something like a Kinect uses than a Velodyne/SICK/Hokuyo
etc.

~~~
durge
Some out there are pursuing non-ToF systems:
[https://blackmoreinc.com/](https://blackmoreinc.com/)

------
gene-h
The scan rate and accuracy may not be the best, but the fact that they are
using a linear photodiode array impresses me. The fact they were able to do
all this for $35 is even more impressive, and I await the day I can purchase
this from chinese electronics hobbyist websites.

~~~
lucb1e
Me too! I've been looking for something like this, but wasn't been able to
find anything. Very nice to see this here, perhaps I'll build one if I have
time at some point, or order one if it becomes available.

------
Dangeranger
Thanks for this. When I first started working in LiDAR nearly ten years ago
the cheapest hardware you could acquire was $25,000 and completely
proprietary.

It’s nice to see a simple hardware hack for playing with the technology. Maybe
this will encourage some intrepid engineers to build the next wave of hobbyist
point cloud collection devices.

There are lots of fun applications like home surveying to 3D model generation.

~~~
rburhum
Velodyne?

~~~
rtkwe
Personally, anywhere I can't see a price without contacting a sales rep from
the company I hesitate to call hobbyist.

~~~
nix0n
I agree, definitely not for hobbyists. List price seems to be $8,000 if you're
just buying one of their cheapest product.

[http://velodynelidar.com/docs/news/This%20Palm-
Sized%20Laser...](http://velodynelidar.com/docs/news/This%20Palm-
Sized%20Laser%20Could%20Make%20Self-
Driving%20Cars%20Way%20Cheaper%20_%20WIRED.pdf)

------
EgoIncarnate
Seems... dangerous? Project states it uses "3mw 780nm Infrared IR Diode
Laser". 3mw is enough to damage your eye if you don't blink or turn away.
Since it's infrared, you won't blink, or possible even notice anything (there
are no pain receptors in the retina) until it's too late.

Wikipedia list "780–1400 nm (near-IR) - Pathological effect: cataract, retinal
burn"

~~~
yonkshi
In the US 5mW is the legal limit for laser pointers. I think that can be used
as a guideline, 3mW IR is much less energetic than a 5mW green/blue laser,
perhaps it's not powerful enough to cause huge concern? But I agree no amount
of laser is safe for the eye. Police LIDAR guns are 905nm at 50mW, that can
technically damage you too.

[https://en.wikipedia.org/wiki/LIDAR_traffic_enforcement#How_...](https://en.wikipedia.org/wiki/LIDAR_traffic_enforcement#How_it_works)

~~~
tsukikage
The limit for visible light is as high as it is because of the blink reflex.
An IR laser, having a beam you don't perceive as being bright, won't make you
blink.

------
flyingcircus3
There's also a company called Scanse that has a very affordable LIDAR unit,
and a ROS driver. Not open source hardware, but at $350, a pretty good deal.
They use the Garmin Lidar Lite v3, which has an I2C interface, and all
measurements are actually computed in the sensor. The sensor itself is around
$120. They also use a shaftless gimbal motor, with a slip ring, which allows
for continuous rotation.

scanse.io

They were also generous enough to leave an exploded CAD model of their design
on their kickstarter page, about halfway down, just in case you wanted to see
whats going on inside, or perhaps make your own, as its mostly commercial off
the shelf parts, with a custom PCB to control the motor.

[https://www.kickstarter.com/projects/scanse/sweep-
scanning-l...](https://www.kickstarter.com/projects/scanse/sweep-scanning-
lidar)

------
kersny
Joe Grand developed a similar product for Parallax a while back, with a lot of
interesting technical details on his site:
[http://www.grandideastudio.com/laser-range-
finder/](http://www.grandideastudio.com/laser-range-finder/)

~~~
gregsadetsky
The laser range finder you linked to is different than the OP's 360 degree
scanning LIDAR (... as the former doesn't scan!) :-)

------
le-mark
What kind of precision can you get with a device like this? The image on the
github page looks very imprecise, like on the order of cm of error. If one
were to scan a 3d model, could one get sub millimeter resoluton for example?

~~~
rubenbe
According to the hackaday page [0], the precision is indeed in the order of
centimeters: 5 cm at 2 m and 10 cm at 3 m.

[0] [https://hackaday.io/project/20628-open-simple-
lidar](https://hackaday.io/project/20628-open-simple-lidar)

~~~
dbcurtis
The Neato sensor does anlittle better, about 2cm at 5m

------
donquichotte
I still don't quite understand how this works. Main components are:

\- Laser

\- Lens

\- TSL1401 line image sensor

I was always under the impression that LIDAR includes a time-of-flight
measurement, which does not appear to be the case here - the TSL1401 sensor
has integration times and pixel transfer times in the range of dozens of
microseconds, a timespan in which light travels dozens of kilometers.

~~~
fisherjeff
Based on the diagram, I believe they're estimating distance based on parallax
rather than time of flight

~~~
donquichotte
I agree.

The wikipedia article on LIDAR says

"Lidar [...] combine[s] laser-focused imaging with the ability to calculate
distances by measuring the time for a signal to return using appropriate
sensors and data acquisition electronics."

So this is not LIDAR. Still impressive though, I love the simplicity!

~~~
adamweld
The LIDAR acronym doesn't specify the specific measurement technique, although
Time Of Flight is by far the most common. There are other designs with
interesting differences, for example Strobe[0] which varies the frequency of
the transmitted light and measures the freq and phase delay of the returning
light rather than straight delay.

I believe this design still qualifies as LIDAR, just with significantly worse
performance than a typical system.

[0] [https://spectrum.ieee.org/cars-that-
think/transportation/sel...](https://spectrum.ieee.org/cars-that-
think/transportation/self-driving/gm-cruise-snaps-up-solidstate-lidar-pioneer-
strobe-inc)

~~~
Kubuxu
As far as I know "varies the frequency of the transmitted light and measures
the freq and phase delay" is the standard way of measuring ToF in case of
lasers. You modulate the laser diode by a signal of a wide range of
frequencies and you subtract returned signal (after cleanup). The observation
is done on a spectrum. Low frequencies give you wide range but low precision
and high frequencies higher precision but lower range but you can use them
enhance precision of the former.

------
pette
Did the same exact thing back in 2015 that used the omnivision sensor in
wiimotes, having the benefit that the sensor readily reports the position of
detected infrared spots, so no cpu-heavy postprocessing needed. The 20MHz
clock for the sensor was taken from CLKOUT from the controlling avr cpu, so
only three parts on the rotating part (laser, cpu, sensor).

I would recommend adding a slit and a bandgap filter to reduce the amount of
non-laserlight, because i had big problems with false positives from stray
light (sunlight etc).

------
syntaxing
This is super awesome! I've been taking Udacity's SDC and I wanted to play
with some LIDAR mapping on my own. Been debating for the longest time to get
the Neato XV-21 LIDAR but it doesn't really make sense to get an obsolete
hardware that people salvage from old vacuums. I wish s/he will sell the PCB
on a crowd-funded run like Crowd-Supply or Tindie

~~~
jotux
You can buy 360 degree lidar dev kits for a few hundred dollars:

[https://www.seeedstudio.com/RPLiDAR-A2M8-Laser-Scanner-
Dev-K...](https://www.seeedstudio.com/RPLiDAR-A2M8-Laser-Scanner-Dev-Kit-with-
Adapter-Certification-p-3000.html)

[https://www.seeedstudio.com/RPLIDAR-360-degree-Laser-
Scanner...](https://www.seeedstudio.com/RPLIDAR-360-degree-Laser-Scanner-
Development-Kit-p-1823.html)

~~~
syntaxing
I was going to buy the RPLidar when they did a fire sale on the first
generation. But I read there was some refresh rate error so I didn't pull the
trigger. Do you know if the Sweep (by Scanse) is comparable to the RPLidar
(Dev version)?

~~~
Jack000
it is not, afaik. The sweep has greater range in theory but its data is much
noisier.

------
amelius
What happens when someone looks into the laser? Is the damage cumulative?

~~~
lucb1e
The thing you're looking for is the class of the laser. Class 1 is completely
harmless, class 2 is harmless unless you intentionally stare at it, class 3 is
immediately harmful and class 4 is the kind of laser that cuts bone and metal.

I'm not sure what class this is, but it should be mentioned somewhere.

~~~
gregsadetsky
The BOM[0] specifies that this is a "3mw 780nm Infrared IR Diode Laser" with a
link to eBay[1].

I'm finding 780nm 2.5mw and 3mw laser diodes rated at classes 3B and 3R. See
[2] and [3]. The 3B class rating is given for a high end Edmund Optics laser
which most probably gives out the "full" 3mW. A 3B class laser is "hazardous
for eye exposure" [4].

So... hard to say, but not great?

I fondly remember a sticker that was on a lab's (very scary) laser: "Do not
look into laser with remaining eye"...

[0]
[https://github.com/iliasam/OpenSimpleLidar/blob/master/Total...](https://github.com/iliasam/OpenSimpleLidar/blob/master/TotalBOM.xlsx)
(XLS file)

[1]
[https://www.ebay.com/itm/322300023463](https://www.ebay.com/itm/322300023463)

[2]
[https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=14...](https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=1487#7796)

[3] [https://www.edmundoptics.com/lasers/laser-
sources/780nm-3.0m...](https://www.edmundoptics.com/lasers/laser-
sources/780nm-3.0mw-modulation-elliptical-beam-laser-diode-module/)

[4] [http://www.lasersafetyfacts.com/3B/](http://www.lasersafetyfacts.com/3B/)

------
albemuth
Having only played with simple breadboard stuff years ago, could someone
explain how the wiring works when connecting to something that's spinning?

edit: found it in case anyone was curious:
[https://en.wikipedia.org/wiki/Slip_ring](https://en.wikipedia.org/wiki/Slip_ring)

~~~
taneq
Slip rings are noisy and wear out. A lot of scanning LIDAR systems use a
rotating mirror with stationary electronics to avoid them. You could also use
stationary magnets with coils on the rotating part to transmit power
(basically a mini-alternator on the spinning side), and IrDA or something to
communicate.

~~~
dbcurtis
Exactly what the Neato 2nd gen does. Coils for power and IrDA for data.

------
flyingcircus3
With the latest Tesla crash in the news, seeing the point cloud got me
thinking.

Since mirrors do not create the specular reflections required for LIDAR to
work, does this mean a box truck covered in mirrors would be able to render at
least the LIDAR portion of an autonomous vehicle useless?

Sounds like an attack vector to me.

~~~
web007
It would only apply to a mirror that's offset to point your LiDAR to the sky
or at some odd angle. If it's a flat mirror, it will just see itself
approaching from 2x the distance / speed between the car and mirror.

~~~
flyingcircus3
Do I interpret your comment correctly as saying there is some redundant system
that is specifically looking for anomalies in sensor readings? Would a top of
the line lidar system be able to "understand" that its current inputs were
resulting in erroneous outputs?

I am reminded of one of the recent Japanese satellites that was effectively an
infant mortality, because of some quirk in its redundant systems. I've
forgotten the details, but more or less, there were cascading failures across
a primary system, its secondary redundancy, and its tertiary redundancy. So
the feedback loops designed by the engineers to be negative, and mitigating,
ended up being positive, and therefore aggravating, in the cruel vacuum of
space. It came down to some error in an orientation sensor, and somehow, the
redundant system actually ended up relying on information from the primary
system. The boosters designed to slow down the rotation relied on the notion
of the satellite's actual rotation, according to the original sensor.

As the story goes "Does the machine ever give the right answer given the wrong
inputs, Mr Babbage?" Nearly 200 years later, we may finally becoming around to
seeing that the woman that asked the question had a point, and Charles simply
dismissed it out of hand.

~~~
web007
I'm only suggesting that mirrors work both ways.

If you stand 1m away from a mirror, you will see "yourself" 2m away as a
reflection. (1m you:mirror + 1m mirror:reflection) If you move 1m backward,
you will see the reflection now 4m away (2m you:mirror + 2m
mirror:reflection). Speed works the same way, if you step toward the mirror at
1m/s your reflection will approach you at 2m/s.

The same thing applies to LiDAR, either it sees the mirror and calculates the
proper distance, or it sees the things reflected in the mirror at 2x actual
distance and/or 2x relative speed.

------
edhu2017
As somebody with software engineering experience but little hardware
experience, how do I get started with building my own Lidar? I notice he
provides STL files for base plates and a component list
[https://hackaday.io/project/20628/components](https://hackaday.io/project/20628/components).
Still not too sure how to start though.

~~~
gregsadetsky
There's a bit of work, especially on the PCB side (there are 3 separate ones).
You would have to order PCBs based on the Gerber files, and all of the
components, and have a way of soldering them (they are "surface mount", which
adds to the complexity).

Overall, it would be much easier if the "final" PCBs were sold as a kit.
Assembling this kit would be much easier (and fun) then starting from scratch.

~~~
sannee
> Assembling this kit would be much easier (and fun) then starting from
> scratch.

What is so fun on assembling a kit? The populate-the-PCB is probably the most
mind-numbing part of the whole hardware engineering business. Design and
debugging is where it's at

------
MasterScrat
A cool project would be an autonomous LIDAR-enabled vacuum cleaner, that would
actually map out the room it's cleaning to optimize its path.

~~~
iliasam
Neato and Xiaomi vacuum cleaners have integrated Lidars.

------
kalimatas
It's kinda surprising to find comments in Russian in code :)
[https://github.com/iliasam/OpenSimpleLidar/blob/master/Firmw...](https://github.com/iliasam/OpenSimpleLidar/blob/master/Firmware/lidar4_main_code/encoder_handler.c#L32)

~~~
BWStearns
It just translates the code above it into Russian (or perhaps the one above
translates it into English?).

------
jbob2000
Oh man this is cool! Now we just need OpenSimpleLaserWindow and we can listen
to conversations and track people's movements just like the CIA!

I forget where I read about this, but essentially, as you speak, your sound
waves vibrate nearby windows, and these vibrations can be picked up with a
laser and translated back into sound.

~~~
godelski
There's a few ways you can do this. The cheapest is to just get a laser and a
photo diode. It's rough, but you can get sounds. An interferometer works
better. It's harder to make and more expensive, but in the hobby range, at
least to get decent quality. There's tons of videos and documents that you can
find showing you how to make either. You can also do a lot of cool
measurements with these setups

~~~
jbob2000
I had never heard of an interferometer, it actually sounds like something out
of a movie haha. Thanks for sharing!

~~~
godelski
The design is extremely simple. The hard part is aligning things. That's
actually the hard part about most optics. If you're really OCD you need to be
even more.

Here's a little animation of one:
[https://www.youtube.com/watch?v=UA1qG7Fjc2A](https://www.youtube.com/watch?v=UA1qG7Fjc2A)

------
wotbbcicxinu
Shipped with a ROS driver?? I love you. I’ve beeen stuck on v1 Xbox 360
kinects.

Ima build this immediately.

~~~
photojosh
The new Intel Realsense D435 is giving us fantastic data, and I've got two of
them plugged into ROS.

~~~
voxadam
This is great to hear. The new D400 devices look quite promising on paper but
I have seen virtually no 3rd party reports on how well they perform in the
real world.

Are you using the D435 outdoors as well?

~~~
photojosh
We've only done some quick tests outdoors for now, as our device will only
operate indoors. But it works well, even when pointed into the sun. Email in
profile, send me a message if you want some sample video.

------
rqs
Dig little deeper on Youtube:
[https://www.youtube.com/user/iliasam3/videos](https://www.youtube.com/user/iliasam3/videos)

Awesome!

------
rajangdavis
Can Lidar provide the topography of a sidewalk?

~~~
joshvm
Yes, but this system won't. It's an infrared triangulation system, not a LIDAR
and at 780nm it probably won't work outdoors.

------
dalore
My flatmate has a robot and he has a laser that does 3d scanning of a room,
pretty much like this but 3d.

------
inetknght
What is the maximum range of this?

~~~
dbcurtis
Well, do you want an eye-safe laser? And want to operate outdoors?

The Neato is about 5m indoors, 2m outdoors with a sun shade. That reflects a
lot of effort fighting the "sun blindness" problem that having a powerful IR
source shining in through your picture window causes for the vacuum cleaner.

Practically, you want to modulate the laser so that you can filter for an AC
signal.

~~~
Gibbon1
> "sun blindness" problem that having a powerful IR source.

Just point out it's not as bad as one would think since sunlight has much less
IR than visible light energy. The deeper IR you can go and the narrower your
filters on the receiving side the better.

Other issue I had dealing with an IR comm link 30 years ago was it sucks
compared to RF because your sensor aperture is very small compared to an
antenna. And as you mentioned the the ground floor is much higher with IR than
RF.

------
4ff618
I really want to know the math behind the triangulation process

~~~
danielvf
You know the angle of light entering the lens. The tangent of that angle gives
you the ratio of (the distance between the lens and the laser) and (distance
between the laser and the target). Which lets you work out the distance
between the laser and target.

Trigonometry rocks!

------
ausjke
nice, high quality LIDAR are quite expensive for any robots still.

------
ris
This is not LIDAR.

~~~
naikrovek
It isn't time of flight, but I'd say that it is lidar.

~~~
ris
No. I'm sure that you _could_ argue that _technically_ , if you go by the
literal acronym, it is "LIDAR", I really don't think that flies. When you use
the term LIDAR, you imply a certain amount of robustness and error rejection
you only get using ToF.

Sticking the same parallax technology people have been using since the 80s on
a board and calling it "LIDAR" isn't really honest.

------
atomical
Pretty cool. This could be a good primer for Uber devs.

~~~
SlowRobotAhead
Last article that was talking about Uber I asked why LIDAR wouldn’t have lit
up that lady up. The response was “LIDAR might have been disabled”... as if
that was any sort of acceptable scenario.

~~~
imh
"Because I was driving with my eyes closed" or "Because I wasn't looking"
would be the human equivalent. Imagine if the driver used the same excuse,
when asked why she didn't see the pedestrian and take over.

~~~
bigiain
So motorcyclists here have an acronym "SMIDSY" \- stands for "Sorry mate, I
didn't see you" \- which is almost universally the first words out of a car
drivers mouth after they've driven into a motorcycle.

~~~
rimliu
Which is because almost universaly motorbikes move faster than traffic and
between lanes. So unless you stare at your rear view mirror constantly you may
well miss them aproaching. Alas, at least here seeing a motorcycle driving
at/under speed limit is an exception, not a rule.

~~~
DanBC
Parent poster was talking about car drivers hitting motorcyclists.

You're saying that car drivers don't check their mirrors correctly when
manouvering, which to me sounds dangerous.

~~~
xcvbxzas
Not saying I agree, but he leaves room open for other alternatives such as
hitting a motorcycle while weaving within a lane. You won't hit a car that
way, but you might take out a lane splitting bike.

