Note: From Jan 2022 onwards, JSN-SR04T Waterproof Ultrasonic Module is version 3.
JSN-SR04T waterproof ultrasonic rangefinder module is such an interesting sensor since it comes as a separate printed circuit board and sensor unit. The sensor, which is a single device that acts as both transmitter and receiver, is attached to the PCB using a 2-meter cable. Its usage is as same as HC-SR04, the measurement distance is very accurate and the furthest distance can be measured is 6 meters. It is small so easy to carry , and suitable for a variety of wet and harsh measurement environment. In general we will use it in horizontal ranging, obstacle avoidance, automated control, monitoring of objects and its movement, traffic control, security, artificial intelligence and educational research.
Note: Waterproof of the ultrasound sensor refer to the probe (black color module of the ultrasound transducer) means it can be used in rain condition, not underwater.
Kindly refer to this video from DroneBot Workshop to get more understanding about the JSN-SR04T:
Another interesting aspect of the JSN-SRT04T version 3 is that it can be run in six different operating modes.
Mode selection is accomplished in two ways:
- Mode 0 is how the sensor is configured when you buy it, no need to do anything.
- Modes 1 and 2 are selected by bridging some traces on the front of the PCB.
- Modes 3, 4, and 5 are selected by placing a resistor across some traces on the PCB. The resistor value determines the mode.
![](https://static.cytron.io/image/catalog/products/SN-JSN-SR04T/JSN-SR04T-mode-select_cleanup.jpg )
Mode 0 – HC-SR04 Emulation
In Mode 0, which is the default mode, the sensor operates as a replacement for the popular HC-SR04 ultrasonic distance sensor. The pinout is the same, and it’s essentially a drop-in replacement for the HC-SR04. Incidentally, many people have reported that they had intermittent results using that mode and that it doesn’t seem to work well with popular HC-SR04 libraries like NewPing. We have found that by increasing the length of the Trigger pulse from the common 10us to 20us, the sensor operates more reliably.
Mode 1 – Serial Data
In Mode 1, the sensor calculates the distance by itself, which is great as it alleviates this task from the microcontroller. The result is transmitted as serial data at 9600 baud (8-bits and 1 stop bit). This mode is activated by placing a jumper or a blob of solder across the “M1” points. You can also put the sensor into Mode 1 with a 47k resistor across the “mode” points. The format of this data is illustrated in the following illustration:
![](https://static.cytron.io/image/catalog/products/SN-JSN-SR04T/JSN-SR04T-serial-protocol_cleanup.jpg )
The four bytes of data sent by the sensor are as follows:
- Byte 0 – Header – This is always a value of hexadecimal FF, it indicates the start of a block of data.
- Byte 1 – Data 1 – The high end of the 16-bit data, with the distance value in millimeters.
- Byte 2 – Data 0 – The low end of the 16-bit data.
- Byte 3 – Checksum – The addition of the previous three bytes. Only the lower 8-bits are held here.
The checksum is used to validate the data, you perform the same math (D0 + D1 + D2), take the lower 8-bits, and compare it to the received checksum. If it differs, then the data is corrupt.
Mode 2 – UART Controlled Output
As with Mode 1, this mode also sends out serial data, using the same format previously described. However, in Mode 2 you need to request the data. A data request is made by sending a hexadecimal 55 character to the sensor’s RX pin. Once the sensor receives this request, it will measure the distance and send back the result. You enter Mode 2 by placing a jumper across the M2 points, it can also be activated with a 120K resistor across the “mode” points.
Mode 3 – Automatic PWM
In Mode 3 the sensor acts like an HC-SR04, except there is no need to provide a trigger signal. Instead, the sensor provides its own trigger signal every 200ms. You read the data on the Echo pin in the identical fashion as you would with an HC-SR04. Mode 3 is activated by placing a 200K resistor across the “mode” pins.
Mode 4 – Low-Power HC-SR04
In Mode 4 the sensor operates, once again, as an HC-SR04, but it uses far less current. This is accomplished by disabling the sensor’s internal watchdog timer, reducing idle current consumption to less than 70uA. Mode 3 is activated by placing a 360K resistor across the “mode” pins.
Mode 5 – Switched Output
Mode 5 turns the JSN-SRT04T into a switch, preset at a distance of 1.5 meters. When an object is detected within this range, the Echo pin will go HIGH, otherwise, it remains LOW. No actual distance readings are returned. This mode could be useful for intruder detection or as a backup alarm for a vehicle. Mode 5 is activated by placing a 470K resistor across the “mode” pins.
Warranty Period: 12 months