Source: https://mokxi.com/parts/jsnsr04t
Updated: 2026-11-17

Part

# 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.

See every part

- 4 pins
- 2 settings
- In 1 project

Drawn live by the editor's own code, at the size you see it.

At a glance

## 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 T meters a second, as on the HC-SR04.

Pins

## 4 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

Role

What it does

5V

Input or output

Supply, 3.0 V to 5.5 V. A 3.3 V board runs it too.

TRIG

Input

Input. In pulse mode, high for 10 us or more fires a ping; in serial-command mode it is the module's RX.

ECHO

Output

Push-pull output. In pulse mode, high for the round trip; in the serial modes it is the module's TX, idling high.

GND

Input or output

Ground.

How to use 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.

Part pin

Board pin

5V

5 V (3.3 V works too)

GND

GND

TRIG

Pin 12

ECHO

Pin 11

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.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

Common errors

## Common Waterproof ultrasonic, JSN-SR04T errors and fixes

What goes wrong

The fix

It reads 20 cm when the water is right under the probe.

That is the blind zone: nothing nearer than about 20 cm can be heard. Mount the probe at least 25 cm above the highest water and treat 20 to 25 cm as too close.

pulseIn() returns 0 or a 40 ms pulse every time.

Nothing came back within 6 m, or the probe is not pointing at the water. Check the probe’s cable and that the target is inside the range.

Serial reads nothing from ECHO.

In pulse mode the board times pulses; it only sends frames with M1 or M2 set. Set the mode property to serial-auto or serial-command to match the sketch.

An old board ignores a 10 us trigger.

Many 1.0 and 2.0 boards want a longer pulse, about 20 us. The 3.0 board, the one modeled here, takes 10 us.

Questions

## 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.

How it is modeled

## 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 ECHO high for the round
trip, 58 us a centimeter at 20 °C. With no echo ECHO falls by itself after 40 ms,
as the datasheet says. NewPing.h and plain pulseIn() 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 0x55 commands 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 ECHO rising 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.

Projects

## See the Waterproof ultrasonic, JSN-SR04T in a project

One built-in project uses it. It opens in the editor, already wired.

Boards

## The boards it is shown on

This board has a built-in project with the Waterproof ultrasonic, JSN-SR04T in it.

- Arduino Uno R3

Libraries

## 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.

- NewPing

Keep going

## Keep going

- Ultrasonic ranger
- Parallax PING))) ranger
- Water level sensor
- Float switch, ZP4510

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## 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.

Start building free Open the editor
