Ultrasonic sensor
486 words ยท 3 min read ยท 2 sources
An ultrasonic sensor measures distance by sending out a burst of sound too high-pitched for humans to hear and timing how long the echo takes to return. Simple, cheap, and widely used in robots for obstacle detection.
The concept concept: An ultrasonic sensor measures distance by sending out
Difficulty 3/5 ยท ClassroomA bat navigates a pitch-black cave at full speed without touching a single wall. It does this not by seeing but by screaming โ emitting bursts of sound far above what human ears detect, then listening for the echoes that bounce back from obstacles. The time between scream and echo tells the bat exactly how far away something is.
๐ก Think of it likeโฆ
Think of it like a household object that does the same job โ the underlying idea is the same, just adapted for robots.
๐ฎ๐ณ In India
A HC-SR04 ultrasonic sensor costs โน80 on Robu.in. It is in every Indian school robotics kit.
Why it matters
Without ultrasonic sensor, many concept systems in robotics simply couldn't work.
๐คฏ An ultrasonic sensor's accuracy depends on the speed of sound โ which changes with temperature. Robots in deserts and freezers need calibration.
๐ฏ Quick challenge
What does an ultrasonic sensor send out?
A bat navigates a pitch-black cave at full speed without touching a single wall. It does this not by seeing but by screaming โ emitting bursts of sound far above what human ears detect, then listening for the echoes that bounce back from obstacles. The time between scream and echo tells the bat exactly how far away something is.
That is, in every meaningful sense, how an ultrasonic sensor works.
What "ultrasonic" means
Sound is a wave of pressure travelling through air. Humans hear frequencies between roughly 20 Hz and 20,000 Hz. Ultrasonic means above that range โ typically 40,000 Hz (40 kHz) in the sensors most commonly used in robotics. At that frequency, the sound is completely inaudible to people but propagates through air just as reliably as the tones you can hear.
The sensor has two components: a transmitter (a small piezoelectric speaker that emits the 40 kHz pulse) and a receiver (a matching microphone that listens for the echo). The microcontroller connected to the sensor starts a timer the moment the pulse is sent and stops it when the echo arrives. Distance is then straightforward arithmetic: distance = (speed of sound ร time) รท 2. The division by two accounts for the round trip.
How precise is it?
In still air at room temperature, sound travels at about 343 metres per second. A budget ultrasonic module like the HC-SR04 โ the most widely used teaching sensor in the world, found in millions of Arduino kits โ can measure distances from about 2 cm to 400 cm with roughly ยฑ3 mm accuracy. That is more than good enough to detect walls, furniture, or a person's leg.
The catch is that accuracy drifts with temperature, because sound travels faster in warm air. Professional systems compensate with a thermometer reading; hobby projects usually ignore it.
Where robots use them
The iRobot Roomba's earliest models used ultrasonic sensors to detect walls and furniture. Industrial AGVs (Automated Guided Vehicles) โ the flat trolleys that ferry parts around a factory floor โ use rings of ultrasonic sensors to stop before hitting anything. Parking-assist systems in cars are almost always ultrasonic, which is why you hear a gentle beep as you reverse toward a bollard.
What they cannot do
Ultrasonic sensors are essentially blind to soft, sound-absorbing materials like carpets and thick curtains, which absorb the pulse rather than reflecting it cleanly. They also struggle with very narrow objects (a thin wire reflects almost no energy) and with angled surfaces that deflect the echo sideways. For fine detail or long range, lidar or cameras take over. But for close-range, low-cost obstacle detection, nothing else in robotics is as simple or as reliable.
The same time-of-flight principle that lets a bat avoid a cave wall also underpins sonar used by submarines โ just with much lower frequencies and in water instead of air.
Ask R2 Co-pilot anything you didn't understand about Ultrasonic sensor. It'll explain it plainly.
Keep going
A* (A-Star) Pathfinding in Robotics โ Complete Guide
A* finds the shortest path between two points on a grid or graph. It is the most-used pathfinding algorithm inโฆ
ConceptAccelerometer in Robotics โ Complete Guide
An accelerometer measures linear acceleration along an axis. In robotics, accelerometers detect motion, tilt, โฆ
ConceptActuator
The muscles of a robot โ devices that convert electrical or pneumatic energy into mechanical motion.
Last updated ยท 2026-05-19
Community discussion
0 questions & insightsLoading discussionโฆ
Spotted something off? Report an error โ