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 a laser diode, a webcam sensor, and stepper-driven rotation at five scans per second.
by iliasam
RoboticsAI
- difficulty
- ●●●●○
- time
- a long weekend
- license
- MIT
- repo
- repo ACTIVE2,546 stars
●●●●○ · a long weekend · MIT · 2,546 stars · repo ACTIVE
WHAT YOU’LL NEED
- 3D printer + filament — printable parts — files are in the repo
- Electronic parts — full list with part numbers in the repo BOM
- Dev board / microcontroller — runs the project firmware
- Soldering kit + basic tools — one-time buy, serves every future build
Partner
COMPAREE VERDICT
This is a genuine 2D scanning lidar built from hobby parts: a red laser dot, a rolling-shutter camera sensor watching where that dot lands, and a stepper motor spinning the whole assembly five times a second. The PC software reconstructs distance from the timing of each laser flash in the camera frame, then stitches scans into a live SLAM map as a robot drives. The engineering is clever and the results work, but this is not a weekend project unless you have already built motor controllers and debugged rolling-shutter camera timing. The biggest trap is the electronics: there is no PCB layout, just a schematic and a photo of hand-soldered protoboard. You will spend more time wiring the STM32, stepper driver, and camera than assembling the mechanics. Calibration is mandatory and involves measuring pixel-to-angle offsets while the head spins. The laser is 100mW class 3B, which requires eye protection and is illegal to use outdoors in many jurisdictions without certification. If you want a lidar to experiment with SLAM algorithms and you are comfortable with embedded bring-up and calibration procedures, this will get you there for under two hundred dollars. If you want a working lidar next weekend, buy a YDLidar X4 for ninety dollars and save yourself the month.
IN THE REPO
NOT IN THE REPO
- —Complete STM32 firmware, Windows and Linux PC software for viewing and mapping, Python scripts for SLAM processing.
- —Mechanical CAD for the rotating head and mount provided as STEP files.
- —Full assembly guide with photos, calibration procedure documented in separate doc.
- —Bill of materials includes laser module spec (650nm 100mW), stepper motor part number, and camera sensor (OV7670 or similar small CMOS).
- —Licence is MIT — commercial use permitted.
- —No PCB Gerber files — the electronics are assembled on prototyping board following a hand-drawn schematic; you wire it yourself or design your own board.
Can I build this?
Build at your own risk. Projects involve tools, electronics and sometimes mains voltage — follow the creator’s safety notes.
Partner · KickstarterHeyGears G1: 10M+ colors and transparent parts in one print, plus UV printing on flat objects. Figures, parts and labels — no painting.
Gallery
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.Order the laser module and camera first(The 650nm 100mW laser module and OV7670 camera are the longest-lead items and the hardest to substitute — get the exact spec or expect calibration trouble.)
- 3.Print the mechanical parts(STEP files for the rotating head and mounts. Print in PLA, no supports needed for most parts.)
- 4.Wire the electronics following the schematic(No PCB files — you solder this on protoboard. The photo in the repo shows one working layout.)
- 5.Flash the STM32 firmware and run the calibration procedure(Calibration measures the pixel-to-angle mapping and compensates for camera and laser alignment errors. Mandatory before the distance data is accurate.)
Resources
Documentation, files and community threads for this build — we link straight to the original sources and never rehost the creator’s files.
Partner · KickstarterCORE POWER BANK S: 0.2" thin, 2.8 oz, 5000 mAh with 22.5W fast charging. Semi-solid battery, carbon fiber, IPX7 waterproof.
KNOWN ISSUES
- There are no PCB Gerber files — you wire the STM32, camera, and stepper driver on protoboard from a schematic and a reference photo. If you have never hand-wired a microcontroller project, this will take longer than the rest of the build combined.
- The laser is class 3B (100mW). You need real laser safety glasses (OD4+ at 650nm) and a workspace where no one else can walk into the beam. If you do not already own laser PPE, add that to the budget and the prep time.
- Calibration is not optional. The distance calculation depends on knowing the exact pixel offset between the laser and camera optical centers and the rolling shutter timing. Expect to spend half a day on this after the hardware works.
- The camera is a bare OV7670 sensor module, not a USB webcam. You configure it over I²C and read raw pixel data in firmware — if you have only used UVC cameras before, the learning curve is real.
- The SLAM processing runs in Python on a PC, not on the STM32. You need a laptop or Raspberry Pi traveling with the robot, connected over serial. This is not a standalone sensor.
- Stepper motor vibration can blur the camera image at high speeds. The default five scans per second is a compromise; faster rotation needs better damping or a stiffer frame.
Can I use a different laser wavelength?
Green (532nm) lasers are brighter to the camera and work better in daylight, but you must recalibrate the pixel sensitivity and update the safety wavelength in your PPE. Infrared (808nm or 980nm) avoids the visible dot but requires an IR-pass filter on the camera and removes all visual feedback during alignment.
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 triangulation and rolling-shutter timing. 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 repository reports 6 meters maximum range indoors and ~3cm accuracy at 2 meters. Performance degrades in bright light (the camera cannot see the laser dot) and on very dark or shiny surfaces.
Can I run the SLAM software on the STM32 instead of a PC?
Not with the existing code — the Python SLAM scripts use libraries that do not run on microcontrollers. You would need to rewrite the mapping algorithm in C and fit it in the STM32's RAM, which is 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 is enough for a slow-moving robot, but faster rotation blurs the camera image. How would you damp the vibration — stiffer frame, lower stepper microstepping, or a different mount altogether?
iliasam
A hardware engineer who built this lidar as an exploration of triangulation-based ranging using hobby components. The project demonstrates that you can achieve lidar-grade mapping without time-of-flight sensors if you are willing to calibrate rolling-shutter timing.
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.

CompareeTEAM1mo agoedited
Practical notes from our verification: the repository includes working firmware, SLAM scripts, and mechanical CAD, but no PCB layout — the schematic and a photo of protoboard wiring are what you get, so this build spends more time on electronics than on printing. The laser spec (100mW class 3B at 650nm) is a real safety constraint: you need OD4+ laser glasses and a controlled workspace, and outdoor use without certification is illegal in most places. Calibration is mandatory and takes half a day once the hardware spins. The results are genuine SLAM-grade mapping at one hundred fifty dollars in parts, but expect a month from ordering to working maps, not a weekend.