Skip to the page
Circuit Rebels Join a game

Lidar or ultrasonic: which sensor should a robot use?

By Duron Epps · · 5 min read

Two runs through the security wing in the Circuit Rebels story, seen from above. With lidar, the robot bumps a glass display case because the laser passes through the glass. With ultrasonic, the robot notices every glass case and door and gets through.

Quick answer

It depends on what's in the way. Ultrasonic times an echo of sound: it hears glass but misses soft things, tilted walls and anything past about 4 m. Lidar times a flash of laser light: it measures one exact spot out to 12 m or more, but its light goes straight through clear glass. Many robots carry both.

Ultrasonic and lidar sensors do the same job: they tell a robot how far away things are. They even use the same idea: send something out and time how long it takes to come back. The difference is what they send. Ultrasonic sends sound and lidar sends light, and that one difference decides what each sensor can and can't see.

How does each one measure distance?

Both use the same formula, because the signal goes there and back:

distance = speed × time ÷ 2

What changes is the speed, and the shape of the signal:

Ultrasonic Lidar
Sends A chirp of sound, too high to hear A flash of laser light you can't see
Speed About 343 meters per second About 30 cm every nanosecond (a billionth of a second)
A wall 3 m away answers after About 17.5 milliseconds About 20 nanoseconds
Shape A wide cone (15° to each side in the simulator) One thin beam: one exact spot
Range About 4 m 12 m or more

Light is about 870,000 times faster than sound, so a lidar needs a super fast timer. A thin beam measures one spot, so many lidars spin to measure thousands of spots every second. Put the dots together and you get a map called a point cloud.

What does each one miss?

Every sensor has a blind spot. These come straight from the lessons' sensor simulator:

What's in the way Ultrasonic Lidar
A glass door ✓ Sound echoes off glass like any hard wall ✗ The laser goes straight through
A couch or curtain ✗ Soft fabric soaks up the sound ✓ The laser bounces back
A wall turned more than 15° ✗ The sound bounces off to the side ✓ Light scatters off the wall, so some comes back
A wall 6 m away ✗ Too far: the echo is too weak ✓ Well inside its range

Lidar has other weak spots too: mirrors bounce the laser away, and fog or heavy rain scatter it.

When a sensor misses something, the robot doesn't know it missed. It hears no echo or sees no reflection, so it decides the path is clear and drives on. That's the Sense step failing, even though the Think step did exactly what it should.

So which should a robot use?

Pick for the place the robot will work:

  • Ultrasonic when there's glass, and when the things to notice are hard and close.
  • Lidar when there are soft things, angled surfaces or long distances, or when the robot needs a map.
  • Both when it has to work everywhere. Using different sensors together is called sensor fusion.

Real robots do this. Many robot vacuums use lidar to map the room, bump sensors for anything the lidar missed, and infrared cliff sensors underneath so they don't fall down the stairs.

See it in the story

In the first episode of the Circuit Rebels story, students guide their robot, Volt, through a dark archive, one sensor at a time. Each area is built on the same simulator, so the right sensor changes from room to room:

  • The reading room: a velvet curtain 1.2 m away, a fallen shelf leaning 35° and a far wall 6 m off. Of Volt's four sensors, only lidar gets through.
  • The security wing: glass display cases and a glass door. Only ultrasonic gets through. Lidar's laser passes through the glass, and Volt bumps the case (the picture above).
  • The hall at the exit: glass cases and velvet curtains. No single sensor gets through, but ultrasonic and lidar together do.

Before each run, students predict whether Volt will make it. After it, they see each checkpoint Volt noticed or missed, and why.

Teaching it

Ask the class one question before the lesson: "A robot vacuum keeps bumping into a glass door, but its lidar says the way is clear. Which sensor would notice the door?" Let students argue, then test it in the Sensor Showdown. The answer is ultrasonic, because sound bounces off glass.

The Showdown has three sensors (ultrasonic, lidar and infrared) and five targets, and the goal is to find one thing each sensor can't see. Have students predict each result before they test it, then compare what they found with the table above.

In Bot Arena

In Bot Arena the choice is about tactics. The Lidar sensor maps the enemy exactly, so dodging barely works against it, but at 12 kg it's the heaviest sensor. The Ultrasonic sensor weighs 6 kg; it aims okay and dodges better. Ask students which one fits their robot's plan, and why.

Questions and answers

Can lidar see glass?

Usually not. A laser goes straight through clear glass, so a glass door can look like an open doorway to a lidar. Sound bounces off glass, so an ultrasonic sensor hears it.

Why can't an ultrasonic sensor see a couch?

Soft things like couches and curtains soak up the sound instead of echoing it back. The sensor hears nothing and thinks the path is clear. A lidar's laser bounces off the couch, so lidar sees it.

How far can lidar and ultrasonic sensors measure?

A typical classroom ultrasonic sensor reaches about 4 meters. A common low-cost lidar reaches 12 meters or more. In the lessons' simulator they reach 4 m and 12 m.

Why do robot vacuums use lidar?

On many robot vacuums, the round bump on top is a spinning lidar. Spinning sweeps one thin laser beam all the way around, measuring thousands of spots every second, so the vacuum can build a map of the room.

What is sensor fusion?

Using different kinds of sensors together, so one catches what another misses. A robot with both ultrasonic and lidar can notice glass doors and couches.

Keep reading

Free for every class

Try it with your students

Circuit Rebels is a free, browser-based robotics program for grades 5 to 8, made in New York City by Duron Epps. Students learn how machines sense, think and act through 5-minute lessons and class games. No student accounts are needed to play, and it runs on Chromebooks.