Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

HC-SR04 vs VL53L0X vs JSN-SR04T — which distance sensor?

Ultrasonic HC-SR04, laser ToF VL53L0X and waterproof JSN-SR04T compared on range, beam, blind zone, weatherproofing and price — with the right pick for tanks and robots.

Community draft — report a mistake

HC-SR04VL53L0XJSN-SR04T
MethodUltrasonicInfrared laser time-of-flightUltrasonic, sealed probe
Useful rangeAbout 2–400 cmUp to about 2 m (around 1.2 m in default mode)About 25–450 cm (varies by version)
BeamCone of roughly 15°About 25° field of viewWider than the HC-SR04 (varies by version)
InterfaceTRIG / ECHO pulsesI2C, address 0x29TRIG / ECHO pulses (some versions also serial)
Supply5 V (3.3 V "P" versions exist)Modules with a regulator take about 2.6–5 V5 V on most boards (varies by version)
WeatherproofNoNoProbe yes, control board no
Struggles withSoft or angled surfaces, closer than 2 cmBright sunlight, dark or transparent targetsAnything closer than about 20–25 cm
Typical price in India₹60–120₹200–400₹400–700

Three very different ways to answer “how far away is it?”. Ranges are typical values from datasheets and seller documentation — clones vary, so test yours before relying on a number. Prices are indicative.

HC-SR04 — the everyday choice

The blue two-eyed module from every kit. It sends a 40 kHz ping and times the echo.

  • Cheap, simple and works up to a few metres.
  • 5 V part: on an ESP32 or Pico, ECHO needs a 1 kΩ / 2 kΩ divider (why).
  • Soft targets (cloth, foam) and surfaces at an angle reflect the sound away and give no echo.
  • Not sealed — inside a closed water tank, condensation corrodes it within months.

Guides: HC-SR04 with Uno, with ESP32. Reads zero? Fix.

VL53L0X — small, fast and precise up close

A laser time-of-flight sensor on a tiny I2C board.

  • Millimetre resolution and a narrow beam — good for detecting a hand, a small object, or the edge of a table.
  • I2C, so it shares wires with displays; 3.3 V friendly.
  • Struggles in direct sunlight and with very dark or transparent targets. Not for water levels.
  • Remove the protective film over the window before testing — easy to miss.

Component page: VL53L0X.

JSN-SR04T — the water-tank sensor

Pinout, wiring and errors: JSN-SR04T component page.

The same TRIG/ECHO idea, but the transducer is a sealed, waterproof probe on a long cable, connected to a separate control board.

  • Survives the humid, closed space inside an overhead tank far better than an HC-SR04.
  • Blind zone of about 20–25 cm: mount it high enough that the full water line is never closer than that.
  • Keep the control board dry, in a box away from the tank lid.
  • Several versions exist with different modes and supply ranges — check your board’s markings.

Verdict

Project Pick
Learning, robots, parking sensors, dustbins HC-SR04
Overhead or underground water tank JSN-SR04T
Short-range precision, gestures, small robots, edge detection VL53L0X

Our water tank alarm and parking assistant projects show both ultrasonic sensors in use; day 13 of the learning path explains how the echo timing works.

↑↓ to move · Enter to open