YOU CAN BUILD A SPINNING LIDAR THAT MAPS A ROOM IN REAL TIME
A spinning laser rangefinder that draws room maps in real time, built from an IR laser, a cheap linear image sensor and a belt-driven head at five scans per second.
by iliasam
RoboticsElectronics
Built withSTM323D printing
- difficulty
- ●●●●○
- time
- a long weekend
- license
- MIT
- repo
- repo ACTIVE2,567 stars
●●●●○ · a long weekend · MIT · 2,567 stars · repo ACTIVE
WHAT YOU’LL NEED
Jump to section
COMPAREE VERDICT
This is a genuine 2D scanning lidar built from cheap parts: an IR laser and a TSL1401CL linear image sensor behind an M12 lens measure distance by triangulation, an STM32F030 on a custom PCB does the maths, and a belt-driven head on a slip ring spins five times a second. The repo has Gerbers, BOMs, firmware, STL/STEP parts and a PC utility, and the parts originally cost under 30 dollars (the TSL1401CL has since become much pricier). It is not a weekend project unless you are comfortable with SMD soldering, optical alignment and calibration — if you want a working lidar next weekend, buy a packaged one.
IN THE REPO
GOOD TO KNOW
- —Complete STM32 firmware (main code plus test builds), two Windows PC utilities for testing and viewing scans, and a ROS driver node for mapping (Hector SLAM example).
- —Mechanical CAD for the rotating head and mount provided as STEP files.
- —Step-by-step assembly guide with photos on the GitHub wiki; calibration is explained in a separate video by the author, and the author asks builders for feedback on the instructions.
- —The BOM (TotalBOM.xlsx) lists the main PCB parts (STM32F030, TSL1401CL linear sensor), M12 lens, IR laser, slip ring and mechanics.
- —Licence is MIT — commercial use permitted.
- —Gerber files and PCB BOMs for several board versions are included.
Parts to buy
9 itemsFrom our check of the build. Exact quantities and part numbers are in the creator’s BOM.
Can I build this?
Build at your own risk. Projects involve tools, electronics and sometimes mains voltage — follow the creator’s safety notes.
More builds like this
All projectsGallery
Start here
Navigation into the creator’s own docs — we don’t rewrite the guide, we route you to the source.
- 1.Read the assembly guide(Covers mechanical assembly, electronics wiring from the schematic, and firmware flashing sequence.)
- 2.Check sensor and laser availability first(The TSL1401CL linear sensor has become expensive and can dominate the budget; TotalBOM.xlsx has the full parts list including the IR laser.)
- 3.Print the mechanical parts(STL and STEP files for the holders and plate are in the Mechanics folder; the base plate and encoder ring come as DXF drawings for cutting.)
- 4.Order and assemble the main PCB (Gerbers, schematics and PCB BOMs for several board versions are in the PCB folder; solder the SMD parts yourself or order assembly.)
- 5.Flash the STM32 firmware and run the calibration procedure(Calibration is the final assembly step: follow the author's calibration video and put the resulting a_coef and b_coef values into the ROS launch file. Without it the distances are not accurate.)
Resources
Documentation, files and community threads for this build — we link straight to the original sources and never rehost the creator’s files.
KNOWN ISSUES
- The main PCB is SMD (STM32F030, TSL1401CL sensor) — Gerbers and BOMs are in the repo, but if you have never hand-soldered fine-pitch parts, budget extra time or order assembly.
- The laser is infrared and invisible, so you get no warning where the beam goes. Check your module's class and power rating, wear eye protection rated for its wavelength during alignment, and keep the head pointed away from people.
- Calibration is not optional. The distance calculation depends on knowing the exact geometry between the laser and the sensor optics. Expect to spend half a day on this after the hardware works.
- The sensor is a TSL1401CL linear image sensor, and its price has risen sharply since 2023 — check availability and cost first, it can dominate the budget.
- Mapping does not run on the lidar's STM32: the lidar streams scans over UART, and you build maps with ROS (the repo has a ROS driver node; the author shows Hector SLAM). Plan for a computer running ROS on or connected to the robot.
- The head is spun by a small 3 V DC motor through a rubber belt (the motor pulley can come from an old DVD drive), with an optical encoder for angle. Keep the belt and slip ring running smoothly, or the scan will be uneven.
Can I use a different laser wavelength?
The design already uses an IR laser with an optional IR interference filter in front of the lens; switching wavelength means matching the filter and re-checking calibration.
Why not use a time-of-flight sensor or a real lidar module?
This project is about building the ranging mechanism from first principles using laser triangulation. A TOF sensor or a packaged lidar module gives you the distance directly but teaches you nothing about how the measurement works. If you want a working sensor, buy the module; if you want to understand lidar, build this.
What range and accuracy does it achieve?
The README specifies up to 4 m range and about 3-5 cm accuracy at 3 m, depending on the colour of the surface; bright light and dark or shiny surfaces make it worse.
Can I run the SLAM software on the STM32 instead of a PC?
Not with this project. The STM32 only measures distances and streams them over UART; mapping is done in ROS on a computer, using the repo's ROS driver node (the README shows Hector SLAM). Running SLAM on the microcontroller would be a separate project.
Community builds
No community builds yet — be the first, we feature the best ones.
Discussion1
FROM THE COMPAREE TEAM
Five scans per second and 4 metres of range is enough for a slow indoor robot — the creator even shows it driving autonomous navigation. What would you put it on first?
iliasam
iliasam builds open-source lidars: OpenSimpleLidar is a cheap triangulation design, following his earlier OpenLIDAR and followed by the faster, longer-range OpenTOFLidar. He published firmware, PCB files, mechanics and a ROS driver, and asks builders for feedback on the instructions.
DISCLAIMER
- Comparee is not the author of the projects featured here. All rights to each project belong to its creator — every page links to the original source, and we never host creators’ files.
- Information is provided without warranty and may become outdated as projects evolve. Prices are indicative bands only — always check the creator’s parts list for current costs.
- Building and operating any project is at your own responsibility. Protective equipment, safe workshop practice and compliance with local regulations are the builder’s responsibility.
CompareeTEAM2mo agoedited
Practical notes from our verification: the repository is unusually complete: firmware, Windows PC utilities, a ROS driver node, mechanical files and several PCB versions with Gerbers, Altium schematics and BOMs, plus a total BOM with price calculations. The design is a triangulation lidar: an IR laser, a TSL1401CL linear image sensor behind an M12 lens, an STM32F030 on a custom board, and a small DC motor turning the head through a rubber belt with a slip ring and encoder. The README lists 5 scans per second, 180 points per rotation, a 4 m maximum range and about 3-5 cm accuracy at 3 m. The creator originally put the component cost under thirty dollars, but notes that the TSL1401CL sensor has become much more expensive since 2023, so check current prices before you commit. Mapping runs in ROS on a computer. He also asks builders for feedback on the assembly instructions, so expect some gaps, and the wiki is the place to start. Correction (4 October 2026): we re-checked this page line by line against the project's own repository, documentation and videos, and fixed errors in earlier versions.