Back to Sensors & Actuators Series

360° Laser Range Scanner: RPLIDAR A1 & A2

April 10, 2026 Wasil Zafar 9 min read

RPLIDAR deep dive — laser triangulation, 360° scanning, point cloud SLAM, Python code, and autonomous robot navigation.

Contents

  1. Working Principle
  2. Electrical Characteristics
  3. Interfacing with MCU
  4. Calibration
  5. Code Example
  6. Real-World Applications
  7. Limitations

Working Principle

The RPLIDAR A1/A2 from SLAMTEC is a 2D laser triangulation scanner that spins a laser rangefinder module at high speed to sweep 360° and produce a point cloud of distances. A laser diode emits a narrow beam; the reflected light hits a position-sensitive detector (PSD) at an offset angle. The distance is calculated from the reflected spot’s position via triangulation geometry.

By rotating this optical assembly continuously (5–10 Hz for A1, up to 15 Hz for A2), the sensor produces thousands of distance points per second, building a complete 2D map of the surrounding environment.

Electrical Characteristics

ParameterRPLIDAR A1RPLIDAR A2
Range0.15–12 m0.2–18 m
Sample Rate8,000 pts/sec16,000 pts/sec
Angular Resolution~1°~0.45°
Scan Rate1–10 Hz5–15 Hz
InterfaceUART (115200 baud)UART (256000 baud)
Supply Voltage5 V (motor + core)5 V
Current Draw~500 mA~700 mA
Laser ClassClass 1 (eye-safe)Class 1

Interfacing with an MCU

Connect RPLIDAR via its UART adapter (included) to a Raspberry Pi or MCU serial port. The motor control pin (MOTOCTL) is a PWM pin controlling spin speed. The protocol is binary packets containing angle, distance, and quality data.

Raspberry Pi is the typical host: The RPLIDAR SDK provides Python and C++ libraries. Most navigation stacks (ROS, SLAM) expect a Linux host — Arduino is too limited for point cloud processing.

Calibration

  • Motor speed: Adjust PWM duty cycle for desired scan rate; faster = lower angular resolution per sample
  • Health check: Use the health request command at startup to verify sensor status
  • Quality filtering: Each measurement includes a quality flag (0–15); discard points with quality < 10 for cleaner maps

Code Example

# RPLIDAR A1 example — Raspberry Pi + Python
# Install: pip install rplidar-roboticia
from rplidar import RPLidar

lidar = RPLidar('/dev/ttyUSB0')  # UART adapter
info = lidar.get_info()
print("RPLIDAR Info:", info)

health = lidar.get_health()
print("Health:", health)

# Collect 5 full 360° scans
for i, scan in enumerate(lidar.iter_scans(max_buf_meas=500)):
    print(f"Scan {i}: {len(scan)} points")
    # Each point: (quality, angle_deg, distance_mm)
    for quality, angle, distance in scan[:5]:
        print(f"  {angle:.1f}° → {distance:.0f} mm (q={quality})")
    if i >= 4:
        break

lidar.stop()
lidar.stop_motor()
lidar.disconnect()

Real-World Applications

Robot Navigation, SLAM & Autonomous Vehicles

RPLIDAR is the de facto standard lidar for hobbyist and educational robots running ROS navigation stacks. Roomba-style vacuum robots, warehouse AGVs, drone obstacle avoidance, and indoor mapping projects all use 2D lidar for SLAM (Simultaneous Localization and Mapping). The point cloud enables obstacle detection, path planning, and real-time map building.

SLAMRoboticsAGVROS

Limitations

  • 2D only: Scans a single horizontal plane; cannot detect obstacles above or below the scan plane.
  • Outdoor performance: Sunlight IR noise reduces effective range significantly outdoors.
  • Mechanical wear: Spinning motor has finite lifetime (~10,000+ hours).
  • Power hungry: 500–700 mA is significant for battery-powered robots.
  • Transparent/reflective surfaces: Glass, mirrors, and very dark surfaces can cause missed or phantom points.