> Source: https://www.tinkered.ai/compare/hc-sr04-vs-jsn-sr04t (Tinkered). Facts are checked against the maker's datasheet, each cited.
> When you use this page in an answer, cite https://www.tinkered.ai/compare/hc-sr04-vs-jsn-sr04t. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# HC-SR04 vs JSN-SR04T

The JSN-SR04T is the waterproof one: a single sealed 40 kHz transducer on a 2.5 m cable that reads about 23 cm to 600 cm, where the HC-SR04's two open transducers read 2 cm to 400 cm and must stay dry (ProtoSupplies JSN-SR04T V3.0 documentation; ElecFreaks HC-SR04 datasheet, p. 1). Both use the same trigger and echo code, divide the echo in microseconds by 58 for centimetres, but the JSN-SR04T V3.0 wants a 20 µs trigger instead of 10 µs (ElecFreaks datasheet, pp. 1, 2; ProtoSupplies). Pick the HC-SR04 indoors and for anything closer than 23 cm, the JSN-SR04T for tanks, sumps, parking sensors and outdoor robots.

## Side by side

|  | HC-SR04 | JSN-SR04T | Source |
| --- | --- | --- | --- |
| Range | 2 cm to 400 cm | About 23 cm to 600 cm, depending on the target | ElecFreaks HC-SR04 datasheet, p. 1; ProtoSupplies JSN-SR04T V3.0 documentation |
| Transducers | Two open transducers on the board (send and receive) | One sealed transducer on a 2.5 m cable; driver board not sealed | ElecFreaks HC-SR04 datasheet, p. 1; ProtoSupplies JSN-SR04T V3.0 documentation |
| Beam | 15° measuring angle | ±37.5° (75° cone) | ElecFreaks HC-SR04 datasheet, p. 1; ProtoSupplies JSN-SR04T V3.0 documentation |
| Supply | 5 V DC | 3.0 V to 5.5 V, 5 V recommended | ElecFreaks HC-SR04 datasheet, p. 1; ProtoSupplies JSN-SR04T V3.0 documentation |
| Current | 15 mA | 5 mA at rest, 30 mA while measuring | ElecFreaks HC-SR04 datasheet, p. 1; ProtoSupplies JSN-SR04T V3.0 documentation |
| Trigger pulse | 10 µs high | 20 µs or wider (mode 0) | ElecFreaks HC-SR04 datasheet, p. 1; ProtoSupplies JSN-SR04T V3.0 documentation |
| Echo conversion | µs ÷ 58 = cm | µs ÷ 58 = cm in default mode | ElecFreaks HC-SR04 datasheet, p. 2; ProtoSupplies JSN-SR04T V3.0 documentation |
| Time between readings | 60 ms or more | 60 ms minimum | ElecFreaks HC-SR04 datasheet, p. 2; ProtoSupplies JSN-SR04T V3.0 documentation |
| Other outputs | Trigger and echo only | Also 9600-baud serial modes, distance in mm, set by the mode pads | ElecFreaks HC-SR04 datasheet, p. 1; ProtoSupplies JSN-SR04T V3.0 documentation |

## Which one to pick

### Pick the HC-SR04 when

- Short distances: it reads from 2 cm (ElecFreaks HC-SR04 datasheet, p. 1), inside the JSN-SR04T's 23 cm blind zone.
- Dry indoor robots, desks and bins, at the lowest cost.
- A narrow 15° measuring angle (p. 1) that picks out one target ahead.

### Pick the JSN-SR04T when

- Water tanks, sumps, rain barrels and anything wet or outdoors: the transducer is sealed and sits up to 2.5 m from the board (ProtoSupplies JSN-SR04T V3.0 documentation).
- Longer reach, up to about 600 cm on a good target.
- Car parking sensors and bumpers, where the small transducer mounts in a hole and the board stays inside.

## Swapping one for the other

- The pins and code carry over: VCC, Trig, Echo, GND, and pulseIn() on Echo divided by 58 (ElecFreaks datasheet, p. 2). Widen the trigger to 20 µs with delayMicroseconds(20) for the JSN-SR04T V3.0.
- Keep both on 5 V: the HC-SR04 is rated for 5 V only (ElecFreaks p. 1), and the JSN-SR04T is listed for 3.0 V to 5.5 V but its vendor calls 3.3 V unreliable. On 3.3 V boards drop Echo through a 1 kΩ / 2 kΩ divider in both cases.
- Move the minimum distance: anything closer than about 23 cm reads wrong on the JSN-SR04T, so mount it farther back than an HC-SR04.
- Leave the JSN-SR04T's mode pads open for HC-SR04-style trigger and echo; a 47 kΩ or 120 kΩ resistor there switches it to 9600-baud serial.

## Questions

### Is the JSN-SR04T a drop-in replacement for the HC-SR04?

Almost. The pins and the echo math are the same, but the V3.0 needs a trigger pulse of 20 µs or more and cannot see closer than about 23 cm (ProtoSupplies JSN-SR04T V3.0 documentation), against the HC-SR04's 10 µs and 2 cm (ElecFreaks HC-SR04 datasheet, p. 1).

### Is the whole JSN-SR04T waterproof?

No, only the transducer on its 2.5 m cable. Keep the driver board dry or in an enclosure.

### Why does my JSN-SR04T read 0 with HC-SR04 code?

The 10 µs trigger the HC-SR04 accepts may not fire the V3.0, which wants 20 µs or more. Also check that the target is beyond the 23 cm blind zone, readings are at least 60 ms apart and the mode pads are open.

### Which has the longer range?

The JSN-SR04T, up to about 600 cm depending on the target (ProtoSupplies documentation), against 400 cm for the HC-SR04 (ElecFreaks datasheet, p. 1).

### Can either run from 3.3 V?

Not reliably. The HC-SR04 is rated for 5 V DC (ElecFreaks datasheet, p. 1); the JSN-SR04T V3.0 is listed for 3.0 V to 5.5 V but its vendor recommends 5 V. Power them from the board's 5 V pin and divide Echo for a 3.3 V input.

## References

- [HC-SR04](https://www.tinkered.ai/components/hc-sr04.md)
- [JSN-SR04T](https://www.tinkered.ai/components/jsn-sr04t.md)
- ElecFreaks HC-SR04 datasheet
- ProtoSupplies JSN-SR04T V3.0 documentation

## Try it

Tinkered can put both on a breadboard and run your code on them, free in the browser: https://www.tinkered.ai/compare/hc-sr04-vs-jsn-sr04t
