HC-SR04 vs VL53L0X: two ways to measure distance
Both parts answer the same question, how far away is an obstacle, but they use different physical signals and different interfaces. Here is what our own material records.
Study guideElectronicsSensors
The recorded difference
The HC-SR04 guide uses sound. A trigger pin starts an ultrasonic pulse and the echo pin stays HIGH until the pulse returns. The board measures the round-trip time, halves it and multiplies by the speed of sound. The guide notes that the speed of sound depends on temperature, that a short wait between pulses prevents echoes from mixing, and that soft fabric or angled surfaces weaken the return.
Our robot parts library records the VL53L0X as a Time-of-Flight light sensor with an I2C interface, SCL and SDA lines, an XSHUT pin, a 25 degree field of view, a recorded 5 cm to 2 m range and a recorded deviation of 3 mm. These are library catalogue values for a teaching model, not a promise about a real measurement.
HC-SR04 vs VL53L0X side by side
| Question | HC-SR04 | VL53L0X |
|---|---|---|
| Measurement principle | Ultrasonic pulse and echo timing | Light-based Time of Flight |
| Signal pins in our model | Trigger and echo on separate pins | SCL and SDA, plus XSHUT |
| Pin count in our model | Four: power, trigger, echo, ground | Five: Vin, Gnd, SCL, SDA, XSHUT |
| Recorded conditions | Temperature affects sound speed; soft surfaces weaken echo | 25 degree field of view in the parts library |
Read both columns against the same question. A difference in interface or recorded range is a reason to choose, not a claim that one part is generally better.
Evidence from our own material
HC-SR04 wiring
Trigger goes to Arduino pin 3 and echo to pin 4; the two signal lines are kept separate so they do not mix. (source: en/devre/hc-sr04-ile-mesafe-olcme.html)
Distance relation
One-way distance is half the product of echo time and the speed of sound. (source: en/devre/hc-sr04-ile-mesafe-olcme.html)
ToF part record
The library records I2C, a 25 degree view angle, XSHUT and a 5 cm to 2 m range for the VL53L0X. (source: js/robot-kutuphane.js)
Which one to pick
Best for learning how timing becomes distance: the HC-SR04, because the guide walks through trigger, echo, halving the round trip and the temperature note.
Best when a project already uses an I2C bus: the VL53L0X as described in our parts library. Choose by interface and by the conditions you can control, not by an unmeasured superiority claim.
A short check you can do now
Question 1. Why are trigger and echo on separate pins?
Question 2. Why is the echo time halved?
Question 3. Which sensor uses SCL and SDA lines?
If you can answer all three without rereading, move on. If not, go back to the table and one source note — that is usually enough.
Next steps in the library
Continue with a hands-on guide, a browser simulator or a free account.
Generated from DersTeders' own material. Source files: en/devre/hc-sr04-ile-mesafe-olcme.html (contains no measurement value or accuracy claim) · js/robot-kutuphane.js (VL53L0X library record). Names such as Uno, Nano, DHT11, DHT22, HC-SR04, VL53L0X, servo and stepper are used as component identifiers only. This page records documented behaviour and interface differences; it makes no cost comparison, no maker ranking, no commercial endorsement and no performance promise.
Save your progress. Create a free account to keep your place across lessons, quizzes and circuits.
Save your progress