VL53L0X vs VL53L1X vs HC-SR04 for robots

Compare the HC-SR04 ultrasonic sensor with the VL53L0X and VL53L1X time-of-flight sensors, and learn how to wire several time-of-flight sensors on one I2C bus.

Reference
RE-3795
Published
Read
5 min

About the author · Sources, testing and AI policy

Pick the HC-SR04 when you want cheap, long range and a 5 V Arduino; pick a VL53L0X or VL53L1X when the target is soft, angled or close, you need a narrow beam, or the robot works indoors. This guide compares the three from their datasheets and shows how to wire several time-of-flight sensors on one I2C bus.

Status: written from datasheets and manufacturer pages. The code has not been run on a robot here, and no range or accuracy figure below is our own measurement.

How each sensor measures

The HC-SR04 sends a burst of 40 kHz sound and times the echo. Its listed range is 2 to 400 cm, the working supply is 5 V at about 15 mA, and the beam is about 15 degrees wide, according to the ElecFreaks datasheet. Sound reflects off most flat surfaces, so it suits walls and boxes, but soft fabric and sharply angled surfaces send the echo away from the sensor.

The VL53L0X and VL53L1X are time-of-flight sensors from STMicroelectronics. They send short pulses of infrared light from a laser emitter and time how long the light takes to return. ST describes the VL53L0X as measuring absolute range up to 2 m with a 940 nm emitter, and the VL53L1X as ranging accurately up to 4 m at up to 50 Hz. Because they use light, they read soft and angled surfaces better than ultrasound, but bright sunlight and some dark or transparent surfaces still affect them.

Side by side

HC-SR04VL53L0XVL53L1X
PrincipleUltrasonic echo, 40 kHzInfrared time of flightInfrared time of flight
Listed range2 to 400 cmUp to 2 mUp to 4 m
InterfaceTrigger and echo pinsI2C, up to 400 kHzI2C
Supply5 V, about 15 mAChip rated 2.6 to 3.5 V; many breakouts accept 5 VChip rated for a low-voltage supply; check your breakout
BeamAbout 15 degreesAbout 25 degrees is commonly quoted; boards list 15 to 27Typical full field of view about 27 degrees; the region of interest can be narrowed
Weak spotsSoft and angled surfaces, cross-talk between sensorsStrong sunlight, dark or transparent targetsStrong sunlight; long mode is less tolerant of ambient light

The listed ranges are best-case figures from the manufacturers. Real range depends on the target and the light, so test with the material your robot will meet. The beam widths differ between sources, so check the exact breakout board you buy.

Choosing for your robot

  • Wall following or box detection indoors, tight budget: the HC-SR04, with the fixes in the jumping-readings guide.
  • Small robots with soft or angled obstacles: a VL53L0X, which reads these better than ultrasound.
  • Longer range or a narrower view: a VL53L1X. ST’s own driver notes describe a short mode that tolerates ambient light better but is limited to about 1.3 m, and a long mode that reaches 4 m but copes less well with bright light.
  • Several sensors in a ring: ultrasonic sensors can hear each other, so fire them one at a time; time-of-flight sensors need unique I2C addresses, shown below.

Wiring several time-of-flight sensors

Time-of-flight sensors share a default I2C address, so two on one bus clash. The usual fix is to give each sensor an XSHUT pin connected to a microcontroller pin. Hold every sensor in reset, release them one at a time, and write a new address to each as it wakes. The address then lasts until power is removed, so the sketch repeats this on every start.

// Untested outline using an XSHUT pin per sensor.
const int xshut[3] = {4, 5, 6};

void setup() {
  for (int i = 0; i < 3; i++) { pinMode(xshut[i], OUTPUT); digitalWrite(xshut[i], LOW); }
  delay(10);
  for (int i = 0; i < 3; i++) {
    pinMode(xshut[i], INPUT);        // release this sensor from reset
    delay(10);
    // initialise the sensor and set its address to 0x30 + i here,
    // using the method your library provides
  }
}

Check how the XSHUT pin on your breakout is pulled and whether it expects a 3.3 V level. A 5 V Arduino driving XSHUT high directly can be unsafe on some boards; releasing the pin to input, as above, lets the on-board pull-up do the work.

A test plan before you trust any of them

  • Print raw readings for a flat wall at 10, 30, 60 and 100 cm and note the spread, not just the average.
  • Test your real obstacles: a cardboard box, a cloth, a glossy sheet and an angled surface.
  • Test in the room light and by a window, because infrared sensors behave differently in sunlight.
  • Mount the sensor at the height you will use and check the floor does not appear as an obstacle.
  • Write your own results down. A table of your measured numbers is worth more to a reader than any datasheet range.

Related: lidar vs ultrasonic vs IR for robots, getting reliable HC-SR04 distances and the IR sensor with Arduino guide.

Sources: ElecFreaks HC-SR04 datasheet; STMicroelectronics VL53L0X datasheet DS11555 and VL53L1X product page and driver manual UM2510. Last reviewed November 2026. Written, checked and maintained by Jignesh Panchal.

Pass it onWhatsAppLinkedIn

Keep reading

Continue learning

Tutorials

Arduino serial command parsing for robots

Why Bluetooth robots lag, how the Arduino serial timeout works, and a non-blocking command parser with a simple format and a link-loss…

  • Published4 Nov 2026
  • Read4 min

Free: the final-year project pack

A shortlist with BOMs, a report outline that matches the usual chapter scheme, a costing sheet and 40 viva questions. Built for the February–April submission season.

The Build Note

One short email when something is worth your bench time.

A new build sheet, a part price that moved, or a mistake worth avoiding. No daily drip, no recycled news.

One short email when a build or a price is worth your time. Unsubscribe in one click.