12 of the 13 features in our table differ between the HC-SR04 and the VL53L0X.
Generic module
HC-SR04
Ultrasonic · 2 cm to 4 m · Trigger and echo pulses · 5 V
The classic ultrasonic module: 2 cm to 4 m, a wide beam, and it sees glass and dark objects.
Watch out: It runs at 5 V and its echo pin outputs 5 V: use a divider on a 3.3 V board. Soft surfaces and steep angles return weak echoes.
STMicroelectronics
VL53L0X
Laser time-of-flight · up to 2 m · I²C · 2.6 to 3.5 V
ST’s small laser time-of-flight sensor: up to 2 m in the dark, about 1.2 m on white indoors, over I²C.
Watch out: Sunlight and dark targets shorten the range. Every unit starts at 0x29: to use several, hold the others in reset with XSHUT and change the addresses in software.
Differences
Feature
HC-SR04
VL53L0X
Technology
Ultrasonic
Laser time-of-flight
Range
2 cm to 4 m
up to 2 m
Accuracy
down to 3 mm (maker figure)
within ±3 % (high-accuracy mode)
Field of view
15° (“measuring angle” in the datasheet)
25°
Readings per second
–
50 per second
Interface
Trigger and echo pulses
I²C
I²C address
Not I²C
0x29 (changeable in software)
Supply
5 V
2.6 to 3.5 V
Current while measuring
15 mA
19 mA
Current between readings
–
3 µA
ESPHome
ultrasonic
vl53l0x
Status
Generic module
Available
Choose the HC-SR04 if you need
a longer range (4 m against 2 m)
a wide beam that also sees glass and dark surfaces
What is the difference between the HC-SR04 and the VL53L0X?
The HC-SR04 offers a longer range, a wide beam that also sees glass and dark surfaces, and a 5 V supply. The VL53L0X offers a standard I²C bus shared with other sensors and a 3.3 V supply without a 5 V rail.
Which has the longer range, the HC-SR04 or the VL53L0X?
Range: 2 cm to 4 m for the HC-SR04, up to 2 m for the VL53L0X. Accuracy: down to 3 mm (maker figure) and within ±3 % (high-accuracy mode). The target’s colour and material, and sunlight, change both.
Can I replace the HC-SR04 with the VL53L0X?
Not as a drop-in: the HC-SR04 uses trigger and echo pulses and the VL53L0X I²C, so the wiring and the code change. Check the supply too: 5 V for the HC-SR04, 2.6 to 3.5 V for the VL53L0X.