The honest range
The box says 4 m and Lonely Binary's own documentation says design for 2 to 3. That gap is unusually honest for this category, and it is worth understanding rather than splitting the difference.
Four bands, not one number
Move the target, and change what it is made of.
The specification and the working range are different claims about different situations, and both are true.
Under 2 cm: blind. The burst takes a finite time to leave, and inside a couple of centimetres the echo is back before it has finished. Nothing here is salvageable in software.
2 to 100 cm: accurate. About ±1 cm, resolving to roughly 0.3 cm. This is the band where the sensor is genuinely good and where most projects live.
100 to 300 cm: usable. It works, and the numbers wander. Design for a few centimetres of error, take a median of several readings, and do not build anything that fails badly when one reading is wrong.
300 to 400 cm: the specification. Real, and measured against a large flat wall in still air, square on. It is not a lie; it is a best case, and best cases are a poor foundation.
The surface decides everything
Distance is only half of it. What the burst hits decides whether there is an echo at all.
A flat wall reflects almost all of it and is where the 400 cm comes from. A cardboard box is fine indoors. A wall at more than about 15 degrees reflects the burst away rather than back — the same geometry as a torch on a mirror — and a curtain or a jumper absorbs 40 kHz almost completely.
The important thing is what those failures look like: they look identical. Soft, angled, too far, and nothing there at all all produce no echo, and there is nothing in the reading to tell them apart.
Which is why zero is dangerous
A sketch that converts a timeout into a number reports either 0 cm or its maximum. Both are confident measurements of something that was never measured.
Treat no-echo as its own state — -1, NaN, a separate boolean, whatever your
code likes — and make the project decide what to do about it. A door that opens
when the distance is under 50 cm will open permanently the first time the sensor
sees nothing and reports 0.
The specifications worth knowing
| Blind zone | under 2 cm |
| Accurate | 2 to 100 cm, about ±1 cm |
| Usable | to about 300 cm |
| Specified | 400 cm, ideal conditions |
| Resolution | about 0.3 cm under a metre |
| Beam | roughly ±15 degrees |
| Measurement cycle | 50 ms GPIO, 100 ms on a bus |
| Supply | 3.3 to 5 V |
| Current | 2 to 3 mA typical; the listing rates it at 15 mA |
| Operating temperature | −40 to 90 °C |
The two current figures disagree and we have not reconciled them: Lonely Binary's own documentation says 2 to 3 mA at 5 V, and the Amazon listing's specification field says 15 mA. The likeliest reading is that one is an average and the other covers the moment a burst is being driven. Budget for 15 mA and you will not be caught out either way — and for a battery project, switching the sensor off between readings is worth more than getting this number right.
When it does not work
That is the blind zone. Closer than about 2 cm the echo starts arriving before the burst has finished going out, so there is nothing clean to time. It does not degrade gradually as you approach — it works, then it does not, and a sketch that treats no-echo as zero reports an object touching the sensor at the moment it stops seeing one.
Normal, and it is the echo weakening rather than the sensor faulting. Take the median of three or five readings rather than the mean — a median throws away the occasional wild value, an average lets it drag the result. Then design for a few centimetres of error rather than one.
Neither is a good ultrasonic target. A chair is mostly gaps and angled surfaces, and a person is soft and curved. Both return far less than a flat wall does, so the usable range against them is a fraction of the specification. Test against what you will actually be pointing at.
About 15 degrees either side, which is the figure quoted across the whole ultrasonic family rather than one measured on this board — so treat it as a rough cone, not a specification. It also means the sensor reports the nearest thing anywhere in that cone, which is why a doorframe or a table edge at the margin can quietly become your reading.
Yes — it is rated from −40 to 90 °C, which is wider than most people expect. What outdoors costs you is accuracy rather than function: the temperature swing changes the speed of sound, and wind and rain both scatter the burst.
Why a reading calibrated indoors is wrong in a cold garage.
Warm air is fast air →Edit this page — content/books/ultrasonic-sensor/the-honest-range.mdx
Questions about this product
See what other owners have asked, and read their solutions.
Ultrasonic Distance Sensor
Loading discussions…
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.