Summary
A LiDAR sensor measures distance by timing an infrared light pulse’s round trip. This guide explains time of flight, compares single-point, 2D and 3D LiDAR, and sets LiDAR against ultrasonic and IR sensors using datasheet specs. It also covers robotics uses and connecting LiDAR to Arduino, Raspberry Pi and ROS.

A LiDAR sensor measures distance with light. It fires a short pulse of infrared laser light, times how long the reflection takes to return, and multiplies that time by the speed of light. Halving the result gives the distance, because the light travels out and back. Repeating this thousands of times a second builds a map.
What Is a LiDAR Sensor?
A LiDAR sensor is a distance sensor that uses light. LiDAR stands for Light Detection and Ranging. The sensor emits short pulses of infrared light and measures how long each pulse takes to bounce back from an object. The result is a distance reading accurate to a few centimetres, taken up to thousands of times per second.
A single LiDAR reading tells you how far away one point is. Spin the sensor or sweep its beam, and those readings become a map of everything around it. That is why LiDAR is the main navigation sensor in robot vacuums, warehouse robots and self-driving cars.
Compared with an ultrasonic sensor, which times sound, or an IR sensor, which usually measures reflected brightness or angle, LiDAR offers a much narrower beam, longer range and faster readings.
Components and Supplies
How LiDAR Works: Time of Flight
Most LiDAR sensors work on the time-of-flight (ToF) principle. Light travels at a fixed speed, so the time a pulse takes to go out and come back tells you the distance.

The sensor times the gap between firing the pulse and catching its echo; half that path is the distance to the object.
The LiDAR sensor working principle follows four steps:
- Emit. A laser diode, VCSEL, or LED fires a short pulse of infrared light, usually at 850 nm or 905 nm.
- Reflect. The pulse hits an object, and part of the light scatters back towards the sensor.
- Detect. A photodiode behind a lens catches the returning light.
- Calculate. A timing circuit measures the round-trip time and converts it to distance.
The distance formula is:
d = (c * t) / 2
Here, d is the distance, c is the speed of light (about 3 × 10^8 m/s), and t is the round-trip time. You divide by 2 because the light travels to the object and back.
Worked example: an object 2 m away returns the pulse in about 13.3 nanoseconds. To resolve 1 cm, the electronics must detect a timing difference of roughly 67 picoseconds. This is why LiDAR modules use dedicated ranging chips rather than a microcontroller timer.
Triangulation LiDAR
Not every LiDAR uses time of flight. Budget 360° scanners such as the RPLIDAR A1 use laser triangulation: a camera sensor sees where the laser spot lands, and the angle gives the distance. Triangulation is cheap and accurate at short range, but its error grows with distance and it struggles in direct sunlight.
Types of LiDAR: Single-Point, 2D Scanning, and 3D
The types of LiDAR we see in robotics projects differ in terms of how many directions they measure at once.

Single-point LiDAR (1D)
A single-point LiDAR measures one distance straight ahead, like a laser tape measure that updates 100 or more times a second. It has no moving parts, weighs a few grams and connects over UART or I2C. Typical uses include drone altitude hold, liquid-level sensing, parking detection and front bumpers on robots. The TFmini and TF-Luna are popular examples.
2D scanning LiDAR
A 2D LiDAR spins a ranging core on a motor, measuring distance at every angle around a full 360° circle. The output is one horizontal slice of the room, made up of thousands of points per rotation. This slice is exactly what SLAM (Simultaneous Localization and Mapping) algorithms need to build a floor map, so 2D LiDAR is the standard sensor for indoor mobile robots. The RPLIDAR A1 and LD19 are common choices.
3D LiDAR
A 3D LiDAR stacks many beams vertically (16, 32, 64 or more) or uses solid-state steering to scan both horizontally and vertically. The result is a full 3D point cloud. 3D LiDAR is used in autonomous cars, outdoor robots and surveying drones, and it costs far more than 2D units.
2D LiDAR vs 3D LiDAR at a glance
| Feature | Single-point (1D) | 2D scanning | 3D |
|---|---|---|---|
| What it measures | One distance | One 360° horizontal slice | Full 3D point cloud |
| Moving parts | None | Spinning core | Spinning head or solid-state |
| Typical range | 8–12 m | 12–40 m | 100 m and more |
| Best for | Altitude, level, proximity | Indoor SLAM and navigation | Self-driving, outdoor mapping |
| Blind spots | Everything off-axis | Anything above or below the scan plane | Very few |
The key limit of 2D LiDAR is the scan plane: a robot with a LiDAR at 15 cm height will not see a table top at 70 cm. We recommend pairing it with a bumper, depth camera, or ToF sensor to cover that gap.
Not sure which LiDAR fits your project? We compare the RPLIDAR A1M8, TFmini, PONO TSD10 and VL53 modules side by side in our guide to the best LiDAR sensors for robots in India.
LiDAR vs Ultrasonic vs IR Sensor
LiDAR offers 40× the range of an IR proximity module and a 2.3° beam instead of the 15° cone of an ultrasonic sensor. The table compares four popular modules using figures from their datasheets.
| Specification | HC-SR04 (ultrasonic) | IR proximity module (LM393) | TFmini (single-point LiDAR) | RPLIDAR A1M8 (360° LiDAR) |
|---|---|---|---|---|
| Measures using | 40 kHz sound | Reflected IR, on/off threshold | IR time of flight, 850 nm | Laser triangulation, 785 nm |
| Range | 2–400 cm | 2–30 cm (set by potentiometer) | 0.3–12 m (90% reflectivity), 5 m at 10% | 0.15–12 m |
| Accuracy | Up to 3 mm (flat target) | No distance value; detects presence only | ±6 cm (0.3–6 m), ±1% (6–12 m) | 1% (≤3 m), 2% (3–5 m), 2.5% (5–12 m) |
| Beam width | 15° cone | 35° | 2.3° | 360° scan, ≤1° steps |
| Readings | 1 per trigger pulse | Continuous digital output | 100 Hz | 8,000 samples/s, 5.5 Hz scan |
| Sunlight | Not affected (uses sound) | Interferes; shield or keep in shade | Rated to 70 klux; range drops to 7 m | Indoor, or outdoor out of direct sun |
| Output | Echo pulse width | Digital HIGH/LOW | UART | UART (USB adapter) |
How to read this table:
- Choose ultrasonic for cheap obstacle detection under 4 m when a wide cone is fine. Soft fabrics and angled surfaces can absorb or deflect the sound.
- Choose IR for yes/no detection under 30 cm, such as line followers, edge detection or touchless dispensers. It tells you something is there, not how far away it is.
- Choose single-point LiDAR when you need a narrow beam, metres of range or outdoor use.
- Choose 360° LiDAR when the robot must map a room, not just avoid one obstacle.
For compact optical ranging under 4 m, a ToF chip like the VL53L1X sits between IR and LiDAR. See our VL53L1X vs VL53L0X guide. For more sensor options, read Top 10 Object Detection Sensors and How They Work.
Where LiDAR Is Used
LiDAR for robots is the most common use for makers, but the same sensor family runs everything from vacuums to cars.
| Application | LiDAR type | What LiDAR does |
|---|---|---|
| Robot vacuums | 2D scanning (the round turret on top) | Maps each room, plans cleaning lanes and returns to the dock |
| AGVs and AMRs in warehouses | 2D scanning, often two units | Localises against a stored map, detects people and stops safely |
| Drones | Single-point facing down; 3D for surveying | Holds altitude over uneven ground; maps terrain from the air |
| Autonomous and ADAS cars | 3D, multi-beam or solid-state | Builds a 3D view of vehicles, pedestrians and road edges, day or night |
| Smart parking and gates | Single-point | Detects a vehicle at the barrier |
| Liquid and bin level | Single-point | Measures fill level without touching the contents |
In every case, LiDAR is valued for the same three things: it works in the dark, it gives true distance rather than an estimate, and its narrow beam reports exactly where an object is.
Using LiDAR With Arduino, Raspberry Pi and ROS
Single-point LiDAR, such as the TFmini or PONO TSD10, sends its distance readings over UART or I2C, so an Arduino Mega or ESP32 can read it directly. Use a board with a spare hardware serial port, because SoftwareSerial on an Uno is unreliable at 115200 baud.
A 360° LiDAR, such as the RPLIDAR A1, plugs into a Raspberry Pi or PC through its USB adapter. An Arduino can read its data, but it can't build a map from it.
On ROS and ROS 2, the scanner's driver publishes each rotation on the /scan topic. Mapping and navigation packages such as slam_toolbox and Nav2 read that topic to build a map and plan a route.
Here is a basic example of how to read a TFMini LiDAR sensor using an Arduino:
// Arduino code to read TFMini LiDAR via Hardware Serial
void setup() {
Serial.begin(115200); // Debug output
Serial1.begin(115200); // TFMini LiDAR connection
}
void loop() {
if (Serial1.available() >= 9) {
if (Serial1.read() == 0x59 && Serial1.read() == 0x59) { // Frame header
int dist = Serial1.read() + (Serial1.read() << 8); // Distance in cm
int strength = Serial1.read() + (Serial1.read() << 8);
Serial1.read(); // Reserved
Serial1.read(); // Checksum calculation
int checksum = Serial1.read();
Serial.print("Distance: ");
Serial.print(dist);
Serial.println(" cm");
}
}
}
We walk through the wiring, the Arduino code and the ROS 2 setup step by step in our guide to the best LiDAR sensors for robots in India.
Shop the sensors
These are the LiDAR sensors we stock for the projects in this guide:
- TFMini Micro LiDAR Sensor Module · Single-point · 0.3–12 m range, 100 Hz, UART. Built for drone altitude hold and robot obstacle sensing. View product
- PONO TSD10 Single-Point ToF LiDAR · Single-point · 0.05–10 m range, 50 Hz, UART. Its 5 cm minimum range suits ground robots that work close to walls. View product
- DFRobot SLAMTEC RPLiDAR A1M8 360° Laser Range Finder (12 m) · 360° 2D scanning · 0.15–12 m range, 8,000 samples/s, USB adapter, ROS support. The standard starter LiDAR for SLAM projects. View product
Conclusion
A LiDAR sensor turns the speed of light into a distance reading: fire a pulse, time the echo, halve it. For most maker projects, we suggest starting with the job. Use ultrasonic or IR for cheap, short-range obstacle checks. Choose single-point LiDAR for a narrow, long-range or outdoor reading, and 360° LiDAR when your robot needs to map and navigate.









