Waterproof ultrasonic, JSN-SR04T
A sealed probe on a cable, 20 cm to 6 m: HC-SR04 style TRIG and ECHO or 9600 baud frames, for NewPing.h.
- 4 pins
- 2 settings
- In 1 project

The Waterproof ultrasonic, JSN-SR04T in brief
What it is, and every setting the properties panel gives it.
The JSN-SR04T is the waterproof ultrasonic ranger: a small control board and, on a long cable, one sealed probe in a rubber boot that both sends the 40 kHz burst and hears it come back. That one transducer is why it can live in a water tank, a sump or a car bumper, and why it is deaf for the first 20 centimeters: the probe is still ringing from its own burst, so anything nearer reads as about 20 cm, never less. The 3.0 board runs from 3.0 V to 5.5 V and reaches 6 meters. Its header is 5V, TRIG, ECHO and GND. With the mode pad open it works like an HC-SR04, a 10 microsecond trigger and an echo pulse 58 microseconds a centimeter long, which falls by itself after 40 ms when nothing comes back. Short M1 or M2 and the same two pins become a 9600 baud serial port sending four byte frames: 0xFF, the millimeters high and low, and a checksum. The part’s mode property is that pad, and the distance is a slider.
- Family
- Sensors
- Pins
- 4
- mode
- pulse (or serial-auto, serial-command)
- what the mode pad on the board is set to.
- temperature
- 20
- the air in degrees Celsius, 20 by default. The echo travels at
331.3 + 0.606 Tmeters a second, as on the HC-SR04.
4 pins
Named as the editor names them, so a wire lands where you expect it.
How to measure a water tank with a JSN-SR04T and an Arduino
The JSN-SR04T’s control board stays dry outside the tank and its probe goes through the lid, looking down at the water. 5V goes to 5 V, GND to GND, TRIG to pin 12 and ECHO to pin 11. With the mode pad open, as the board ships, it speaks exactly the HC-SR04’s protocol, so NewPing.h and plain pulseIn() both read it unchanged.
The sketch asks NewPing for the distance in centimeters, takes it from the probe-to-bottom distance of 200 cm to get the depth, and prints the depth as a percent of the tank. Drag the slider: at 1 m the water is 98 cm deep and the tank 57% full, at 40 cm it is 93% full.
Now drag the slider under 20 cm. The reading sticks at 20 and never goes lower, because the probe sends and listens with one transducer that is still ringing from its own burst. A tank filled right up to the probe reads two thirds full, so the sketch treats anything under 25 cm as the blind zone, and the probe belongs at least 25 cm above the highest the water can get.
Set the mode property to serial-auto and the board sends a frame every 100 ms on ECHO instead: 0xFF, the distance in millimeters as two bytes, and the low byte of the sum, at 9600 baud. Serial-command waits for a 0x55 on TRIG and answers with one frame. The board works its millimeters out at 348 meters a second, so a meter in 20 °C air reads 1013 mm.
The 3.0 board runs from 3.0 V to 5.5 V and its ECHO swings to its own supply, so on an ESP32 or a Pico power it from 3.3 V and wire TRIG and ECHO straight to two GPIO pins.
Common Waterproof ultrasonic, JSN-SR04T errors and fixes
Questions and answers
What is the minimum distance of the JSN-SR04T?
About 20 cm. The single transducer is still ringing from its own burst, so anything nearer reads about 20 cm. Treat readings under 25 cm as too close.
Does the JSN-SR04T work with the NewPing library?
Yes. With the mode pad open it uses the HC-SR04’s trigger and echo, so NewPing, pulseIn() and any HC-SR04 code read it unchanged.
What is the JSN-SR04T serial frame?
Four bytes at 9600 baud: 0xFF, the distance in millimeters high byte then low byte, and the low eight bits of the sum of those three. FF 07 A1 A7 is 1953 mm.
What is true about the Waterproof ultrasonic, JSN-SR04T, here
In its help article’s own words: what the simulation gets right, and where it stops.
Modeled
- Pulse mode is the HC-SR04's: a 10 us trigger, then
ECHOhigh for the round trip, 58 us a centimeter at 20 °C. With no echoECHOfalls by itself after 40 ms, as the datasheet says. NewPing.h and plainpulseIn()both work. - The blind zone. Nothing is heard until the probe stops ringing, the time sound takes to go 20 cm and back. A target nearer than that reads as the edge of the blind zone, about 20 cm, never nearer. A sketch has to treat 20 to 25 cm as "too close", not as a distance; ESPHome's driver throws away anything under 25 cm for this reason.
- The serial frames, their checksum, the 100 ms period of serial-auto and the
60 ms least gap between
0x55commands of serial-command. - The module's arithmetic. The board works out millimeters at the datasheet's 348 m/s, about 28 °C, so in 20 °C air a wall a meter away reads 1013 mm in the serial modes. That is the module, not the model.
Not modeled
- No sound is simulated: the slider is one number, not a tank to bounce sound around. The 75 degree beam, echoes off the tank's walls, foam, ripples and condensation on the probe are not modeled, and a reading has no jitter.
- In the blind zone real boards read 20 cm or nonsense; the model gives the steady 20 cm edge, not the nonsense.
- The delay from the trigger to
ECHOrising is not in the datasheet; the model uses the HC-SR04's 460 us. - With nothing in range the serial modes send no frame; the datasheet does not say what a real board sends then.
- The PWM-automatic, low-power and switch modes (200k, 360k and 470k on the mode pad) are not modeled.
- Older 1.0 and 2.0 boards (mode resistor R27) are often reported to need a longer trigger, about 20 us. This is the 3.0 board, which takes 10 us.
From JSN-SR04T waterproof ultrasonic sensor, in full.
See the Waterproof ultrasonic, JSN-SR04T in a project
One built-in project uses it. It opens in the editor, already wired.
The boards it is shown on
This board has a built-in project with the Waterproof ultrasonic, JSN-SR04T in it.
Arduino libraries for the Waterproof ultrasonic, JSN-SR04T
Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.
Keep going
The rest of the bench
Every one of these is drawn and simulated the same way.
Wire up the Waterproof ultrasonic, JSN-SR04T
Open the editor and push it into the breadboard. It is free, and it runs on your own machine.