Overview
LiDAR (laser detection and ranging) is widely used in autonomous driving and vacuum-cleaning robots. Wider adoption reflects both improved performance and reduced cost. Depending on scanning method, LiDAR types include MEMS, flash, phased-array, and mechanical rotating models; by number of scan lines they can be single-line or multi-line.
A Bilibili creator built a single-line mechanical rotary LiDAR as a hobby project over about six months. The build combined hardware design, mechanical design, FPGA development, and 3D printing.
Core Components
The project used the following basic components:
- An FPGA development board based on the Xilinx Zynq-7000 SoC. The board provides an HDMI interface capable of up to 1080p60 output and around 32 GPIOs. The board handles data acquisition, processing, and display.
- A DC geared motor: rated voltage 12 V, gear ratio 1:30, maximum output speed 300 rpm. A 500-line optical encoder mounted at the motor tail provides angular position of the output shaft.
- A laser rangefinder sensor: ranging accuracy 1 cm, range up to 12 m, measurement rate 1000 samples per second, serial output.
These are the essential parts for a homemade LiDAR; the remaining work is mechanical and electronic integration.
Mechanical and Structural Design
Because the sensor head must rotate continuously, signal transmission between the head and the base cannot use fixed wires (to avoid cable winding). A conductive slip ring is used to transfer signals across the rotating interface. The slip ring contains brushes that allow electrical connection while the head rotates.
The device is divided into a base and a rotating head, connected by a rotating shaft. The rangefinder is fastened to the head with screws. A rotor PCB is fixed inside the head, while the stator PCB, slip ring, and motor are fixed in the base.
To accommodate likely misalignment between the motor output shaft, slip ring, and rotation center, a flexible coupling is used to compensate for axial offset.
A pair of infrared emitter/detector sensors between the head and base provides an index signal to determine the head's home position.
Structural parts were modeled, support structures were added, slices were generated, and parts were produced on a 3D printer. Printed parts included the head base, head cover, and base housing.
Hardware and PCB Design
The electrical design separates the rotor PCB and the stator PCB. Power and isolation are arranged so that motor control and other circuits remain electrically isolated during motor operation to prevent interference. The LiDAR connects to the FPGA board via ribbon cable.
PCBs were designed for both rotor and stator. After assembly and wiring, the system hardware was complete.
Software and FPGA Development
Software is split into two domains: the PS (processing system) side for embedded development, and the PL (programmable logic) side for FPGA development. The PL-side FPGA work is more complex. A major challenge was overlaying LiDAR point data onto the video data stream for display.
Performance and Files
Due to the rangefinder's measurement frequency, each full rotation of the head collects about 500 points, yielding a scan rate of roughly 2 Hz. For visualization, a scan line overlay was added to the video stream.
The project files, including mechanical designs and PCB layouts, were uploaded to GitHub for reference.
ALLPCB