Go Down

Topic: JSN-SR04T-2.0 (Read 24749 times) previous topic - next topic


Can anyone tell me how the new JSN-SR04T-2.0 differs from JSN-SR04T?

I have ordered a lot of JSN-SR04T but have got JSN-SR04T-2.0.

The code I use works fine on JSN-SR04T but when I try with JSN-SR04T-2.0 only 0 is printed

Thank you


I have same problem.

I put 10K pullup resistor and it started to work, but not stable. With 4,7K resistor looks better, but still not as good as SR04T. Does anyone solved this problem already?


Hi M_a_x,

Thank you for the quick response.

Can you please provide the circuit that you use?

Thank you


Just solder resistor between +5V pin and Echo pin.
But it's just a try which not solved my problem at all - sensor works unstable..


I have the same problem, does somebody has any other tip?


Same issue. I tried the new ping library also tried giving my own trigs and monitoring echo, none worked. I dont see the echo coming up at all on the scope. Not seen anything but zero with Jsn-sr04t 2.0.

Please advice if someone found a solution. Unfortunately the unit doesn't have any datasheet either for reference.


Found a document (unfortunetly I don't speek chinese) however google translate too. I have tried JSN-SR04T-2.0 mode 0 with R27 open however I don't get any sign on trigger. https://pan.baidu.com/s/1sllkK93 check the doc  + google translate maybe it helps for somebody.

some text from google translate :-)

Mode 1: R27 = open The pattern is described below
1, the basic working principle:
(1) using IO port TRIG trigger range, to a minimum of 10us high letter.
(2) module automatically send 8 40khz square wave, automatically detect whether there is a signal to return;
(3) a signal to return, through the IO port ECHO output a high level, high time is the duration of ultrasound from the launch to the return time. Test distance = (high time * sound velocity (340M / s)) / 2;
(4) module is triggered after the distance measurement, if you can not receive the echo (the reasons beyond the measured range or the probe is not on the measured object), ECHO port will automatically become low after 60MS, marking the End of measurement, whether successful or not.
(5) LED indicator, LED non-power indicator, it will receive the trigger signal after the module, then the module is working.
Mode 2: R27 = 47K is the welding 47K resistance. This mode shows that the following serial output format is TTL level. Note: The module automatically outputs the distance value in units of 100 ms. Serial baud rate: 9600, n, 8,1. Module power recognition, directly into the working mode, the module to carry out a distance every 100ms, and from the pin TX output of a frame, with four 8-bit data. Frame format: 0XFF + H_DATA + L_DATA + SUM 1.0XFF: for a frame start data for judgment; 2.H_DATA: the upper 8 bits of the data; 3.L_DATA: the lower 8 bits of the data; 4.SUM: Data and, for the effect of its 0XFF + H_DATA + L_DATA = SUM (only lower 8) Note: H_DATA and L_DATA synthesis of 16-bit data, that is, the distance in millimeters, for example: product response FF 07 A1 A7 which check 0xA1 is the distance of the low order data; distance value is 0x07A1; converted to decimal for 1953; unit is: millimeter (mm07 + 0xA1 + 0Xff) & 0x00ff 0x07 for the distance of the high order data;
Description: The module outputs the nearest distance value in the dead zone, and outputs 0 if the module does not measure the data or it is out of range.


Mode 3: R27 = 120K is the welding 120K resistance. In the serial port mode, the module enters the standby state after the module is powered on. The serial output format is TTL level and the serial port baud rate is 9600, n, 8,1. When the RX port receives the 0X55 instruction, the module starts a ranging and outputs one frame from the pin TX with four 8-bit data. The frame format is: 0XFF + H_DATA + L_DATA + SUM 1.0XFF: Data, used to determine; 2.H_DATA: the upper 8 bits of the distance data; 3.L_DATA: the lower 8 bits of the distance data; 4.SUM: data and, for the effect of its 0XFF + H_DATA + L_DATA = SUM 8 bits) Note: H_DATA and L_DATA synthesize 16-bit data, that is, the distance value in millimeters. Description: The module outputs the nearest distance value in the blind area. If the module does not measure the data or outputs it out of the range.

1, this module should not be charged connection, to live connection, then let the module first GND connected, otherwise it will affect the normal work of the module.

2, distance measurement, the measured object area of not less than 0.5 square meters and the plane as required to smooth, otherwise the results of the measurement


Has anyone found a solution for JSN-SR04t-2.0. I'm still lost


Received a couple of the version 2.0 and was a bit taken back when i discovered that they were not backwards compatible with the original.
In my case i'm using a 3v ProMini with the JSN-SR04T-2.0 @ 5v. Rather than using an external 4.7k pull up resistor (Echo to 5v) I enabled the internal pullup resistor "pinMode(echoPIN,INPUT_PULLUP);" and that worked.  Originally i had a voltage divider but now Echo Out is dropped through only a 1k resistor to the Arduino.  My guess is echo signal is now somewhat less than on the original so it may not be needed at all but it will stay until i get more info.
Both of the new versions test the same and are giving quite reliable soundings.
I cant speak for the libraries that are out there for these devices but if your coding it yourself you should be able to get to work with these little tweaks.  I attached a very basic example as a starting point.
When i get a bit of time the serial open looks interesting to explore. 


I have gotten a very stable operation ... I just configured the echo as "INPUT_PULLUP" ... thats all.
Code: [Select]

int Trig=8;
int echo=7;

void setup() {



void loop() {
  int distancia=0;
  digitalWrite(Trig, HIGH);
  delayMicroseconds(20);    //Retardo necesario para la inicializacion
  digitalWrite(Trig, LOW);
//  distancia=pulseIn(Pin, HIGH);
//  distancia=(int)distancia*0.017;

  while(digitalRead(Pin)==1){// && distancia<=500){
    delayMicroseconds(58);  // Tiempo que tarda la honda en recorrer 2cm a la velocidad del sonido
  }                         // 1cm de ida y 1cm de vuelta


The sample code here works for both V1.0 and V2.0


Hi, I want to place the module inside a box and I want the connector that is on top of the board not to be exposed in the outside.

So I am looking for extra connectors to place on the box.

Does anyone know the connector model?



sebaspz Thanks for Code, its worked.



Hi guys, I bought a couple of these (JSN-SR04T-2.0), i plugged them and then the problems started. Unstable readings. I tried all the things mentioned in every possible threat here but nothing worked. I was ready to give up, BUT! I disconnected the serial cable (usb) and connected through a bluetooth module I had, and an external battery pack. I uploaded the code and the readings were great (1 out of 10 readings was wrong). Does anyone has an idea what is going on? 30 mA is not gonna drain my laptops usb energy ( i think usb provides up to 500mA), and when i plug the battery and connected through serial-usb cable it's not working. Please let's solve the riddle with this thing.



Anyone resolve this issue?  I spent the entire day trying to get this 2.0 sensor to work.  I had readings at one point.  The data was coming through fine and i was so excited.  Then the readings went erratic, then they stopped coming entirely.  I have no idea why.  Input_pullup has no effect.  No matter which version of the sketch i used, pullup or no-pillup, i got no readings.

Is anyone having luck with adding a resistor? 

I have a water storage tank and really need to be able to monitor the level.  Any alternative sensors or solutions?

If anyone has this working please post explicit details on how you did so.  Also, an example of a very basic sketch would be appreciated.

Thanks in advance.


Go Up