HC-SR04 vs IR vs ToF (VL53L0X): Distance Sensors Compared

HC-SR04 vs IR vs ToF (VL53L0X): Distance Sensors Compared

Quick answer: The HC-SR04 (Rs.115) measures distance by timing an echo, the E18-D80NK (Rs.160) is IR that only says "something's within range" with no distance number, and the VL53L0X (Rs.210) is a laser ToF sensor giving 1mm-resolution distance over I2C — but its range roughly halves in bright ambient light versus darkness.

HC-SR04 Ultrasonic Sensor - the part this guide is about, in stock at Compoden
HC-SR04 Ultrasonic Sensor — the actual part this guide describes, photographed from our own stock.

Written and fact-checked by Compoden's engineering team, India. Every spec and price below is read from our live catalogue record for the exact part named. Published 19 August 2026 · Last updated 19 August 2026.

These three sensors get lumped together as "distance sensors" and picked almost at random, but they measure three genuinely different physical things: an echo's travel time, a reflected light beam's brightness, and a laser pulse's travel time. That difference is not academic — it decides whether you get an actual distance in millimetres, or just a yes/no, and whether sunlight quietly breaks your build.

HC-SR04, E18-D80NK and GY-53 VL53L0X — catalogue records checked August 2026
Spec HC-SR04 E18-D80NK IR GY-53 VL53L0X
Price (India, COD) Rs.115 Rs.160 Rs.210
Principle Ultrasonic echo timing Reflected IR brightness Laser time-of-flight
Output Distance (pulse width) Digital yes/no only Distance (I2C, mm)
Interface Digital pulse (2 pins) Digital GPIO I2C
Range 2–400cm (trustworthy to ~3m) 3–80cm, adjustable 30–2000mm dark, 30–1000mm ambient light
Resolution / accuracy 3cm accuracy, 0.3cm resolution N/A — threshold only 1mm resolution, ±5% accuracy
Response time 60ms min. between reads <2ms 30ms latency
Voltage 5V only 5V only 3.3–5V

Verdict in one line: buy the E18 when you only need "is something there" fast and cheap, the HC-SR04 for a real distance number on a budget, and the VL53L0X when you need millimetre resolution and can control the lighting.

Price alone doesn't separate these three cleanly, because you're not paying for more of the same thing at each step up — each price jump buys a different capability rather than more of the cheaper sensor's capability. Rs.115 to Rs.160 buys speed and immunity to most acoustic-timing quirks, not better distance measurement, since the E18 gives up distance entirely. Rs.160 to Rs.210 buys resolution — from a coarse yes/no to 1mm steps — at the cost of that ambient-light range penalty and a fixed I2C address that complicates running more than one. Neither jump is a strict upgrade; each is a different trade.

How does each sensor actually measure distance?

Three different physics. The HC-SR04 emits a 40kHz ultrasonic chirp and times how long the echo takes to return, then divides by the speed of sound — our own HC-SR04 guide covers this in detail. The E18-D80NK shines an IR LED and reads how much of it bounces back onto a phototransistor, comparing that brightness against a potentiometer-set threshold — it never times anything, so it cannot report a distance, only "brighter than my threshold" or not. The GY-53 VL53L0X fires an actual laser pulse and times its round trip directly, the same principle as the HC-SR04 but at the speed of light instead of sound, which is what lets it report distance in single millimetres rather than centimetres.

The practical difference shows up the moment something reflective or dark crosses the sensor's path. The E18-D80NK's own record names this directly as a known issue: "detection range varies with object color and reflectivity — shiny/white objects detected farther, dark/black objects much shorter." A brightness-comparison sensor has no way around this, because its entire measurement IS reflected brightness. The HC-SR04 and VL53L0X are far less sensitive to colour, since sound and laser time-of-flight both depend on the object being physically present in the beam's path rather than on how much light or sound it happens to reflect — a black cardboard box and a white one return the same echo timing.

Which one gives you a real distance, and which just says "something's there"?

Only two of the three report distance at all. The HC-SR04 and VL53L0X both output an actual measurement — pulse width for one, an I2C register value in millimetres for the other. The E18-D80NK's own record is explicit that it is "NOT suitable for precise distance measurement," because its NPN output is a single digital pin that goes low when something crosses its threshold range and stays high otherwise — there is no number to read, only a moment. That makes it faster and simpler to wire for pure obstacle detection, but it cannot tell you how far away something is, only that it crossed an adjustable line.

Why does the VL53L0X's range change with lighting?

Because ambient infrared light competes with the sensor's own laser pulse. Our record states two different range figures for the same part: 30-2000mm in the dark, but only 30-1000mm under ambient light — the maximum usable range is cut roughly in half once bright light is present. Sunlight and strong indoor lighting carry their own infrared content, which raises the noise floor the sensor's receiver has to see through, so it gives up detecting a return pulse sooner. This matters directly for outdoor or window-facing builds: a robot that ranges reliably to 2m on a bench in a dim room may only manage 1m in daylight.

VL53L0X maximum range in darkness versus ambient light The VL53L0X time-of-flight sensor's maximum range is 2000 millimetres in darkness, but only 1000 millimetres under ambient light — bright light roughly halves its usable range. VL53L0X maximum range — drawn to scale Dark2000mm Ambient light1000mm Bar widths proportional: 440px = 2000mm, so 1000mm = 220px. Both figures are the sensor's own stated range under each condition, per our catalogue record.
The same sensor, the same setup — only the lighting changes, and the usable range roughly halves. Figures read from our catalogue record for this exact part.

Which one responds fastest?

The E18-D80NK, by a wide margin — our record states a response time under 2ms, since it only has to compare a phototransistor's brightness against a threshold, no timing math involved. The VL53L0X follows at a 30ms latency for its I2C-reported distance. The HC-SR04 needs at least 60ms between readings by our own record's stated minimum interval, since each reading has to wait for the previous echo to fully die out before triggering the next ping. For something like a fast-moving line-follower's edge detection, that gap between 2ms and 60ms is the difference between catching an edge and missing it.

How does each one wire up?

Three different wiring shapes. The HC-SR04 needs two digital pins (TRIG and ECHO) — our dedicated wiring guide covers the full table. The E18-D80NK is a single digital pin plus its own adjustment potentiometer, but its NPN open-collector output needs an external pull-up resistor to read cleanly on a microcontroller — our record states this directly. The GY-53 VL53L0X is I2C (SDA/SCL), address 0x29 by default, and also needs pull-up resistors on the bus if your board doesn't already provide them — the same requirement, on a different pair of pins.

Can you run more than one VL53L0X on the same board?

Not out of the box, and this catches people the same way the SSD1306's address ceiling does. Every VL53L0X boots to the same fixed I2C address, 0x29, with no jumper to pick a second one — our record's own address-select notes describe the workaround instead: the address can be reassigned in software by writing a specific register after boot, but only if each extra unit is held in reset via its XSHUT pin while the others are addressed one at a time, and the new address is not retained across a power cycle — meaning your code has to redo the whole sequencing dance on every boot, not just once during setup. This is a genuinely more involved fix than the SSD1306's solder-jumper approach, and worth knowing before you plan a robot with sensors on three sides.

Which real projects actually fit each sensor?

Matching the physics to the job, using the applications already named in our own records. A reversing/parking sensor or general obstacle stop wants an actual distance and tolerates centimetre precision — the HC-SR04. A conveyor-belt object counter or an automatic door trigger only needs a yes/no at a set range, fast — the E18-D80NK, whose sub-2ms response beats both alternatives for this exact job. Liquid level monitoring, gesture detection, or a drone's altitude hold — all named directly in the VL53L0X's own applications field — want millimetre resolution in a controlled, mostly indoor light environment, which is exactly where the VL53L0X's ambient-light range penalty matters least.

Which distance sensor should you actually buy?

For a real distance number on the tightest budget, the HC-SR04 Ultrasonic Sensor (Rs.115). For fast, simple "is something there" detection where you don't need a number — a conveyor counter, a basic obstacle stop — the E18-D80NK IR Proximity Sensor (Rs.160). For millimetre-precision distance, especially indoors or where you can shield the sensor from direct sun, the GY-53 VL53L0X ToF Sensor (Rs.210). All available cash on delivery across India.

What should you read next?

Putting a distance sensor on a robot? Our line follower robot build uses IR sensing for real, and the full HC-SR04 wiring guide covers that sensor's ESP32 level-shifting requirement in depth.

Not sure which distance sensor your build needs? Open Soldr, describe what you're detecting and the lighting conditions, and it will pick the sensor and generate the wiring.

Frequently asked questions

HC-SR04, IR ya ToF sensor - kaunsa distance sensor lein?

Agar sirf itna jaanna hai ki kuch saamne hai ya nahi, aur fast response chahiye, toh E18-D80NK IR sensor (Rs.160) lein - yeh sabse tez hai (2ms se kam) lekin distance nahi batata. Agar actual distance number chahiye kam budget mein, HC-SR04 (Rs.115) sahi hai. Agar millimetre-level precision chahiye aur roshni control mein hai, GY-53 VL53L0X (Rs.210) sabse achha hai - lekin dhoop mein iski range aadhi ho jaati hai.

Does the E18-D80NK IR sensor tell me an actual distance?

No. Our own record for it states plainly that it is "NOT suitable for precise distance measurement" — its digital NPN output only goes low when an object crosses an adjustable threshold range (3-80cm), with no number reported. For a real distance value, use the HC-SR04 or the VL53L0X instead.

Why does my VL53L0X read a shorter range outdoors?

Because ambient infrared light, which sunlight carries plenty of, competes with the sensor's own laser return signal. Our catalogue record states two different maximums for the same part — 2000mm in darkness, only 1000mm under ambient light — so a sensor that ranges to 2 metres on a dim bench may only reach 1 metre outdoors or near a bright window.

Which distance sensor responds the fastest?

The E18-D80NK IR sensor, at under 2ms per our record, since it only compares brightness against a threshold rather than timing anything. The VL53L0X follows at 30ms latency, and the HC-SR04 needs at least 60ms between readings by its own record's stated minimum interval, since it must wait for the previous ultrasonic echo to fully die out first.

What is the price of these distance sensors in India?

At Compoden, the HC-SR04 Ultrasonic Sensor is Rs.115, the E18-D80NK IR Proximity Sensor is Rs.160, and the GY-53 VL53L0X ToF Distance Sensor is Rs.210. All available with cash on delivery across India. Prices checked August 2026.

Back to blog

Open this project in the Soldr app → What is Soldr.ai → parts, wiring and code for what this guide builds