Ultrasound sensor JSN-SR04T (waterproof) not working

Hello, I want to set up a level measurement with a waterproof ultrasound sensor JSN-SR04T. The sensor is connected to an Arduino nano but not giving back any readings. Is it defective? The sensor itself is creating a light "click" sound whenever it is triggered. Is that normal or should I hear an ultrasound? Also on the sonsor board the red LED between R20 and R10 is light. Is that good or bad? Voltage at the inputs of the sensor is approx. 4.7 V. Is this too low and can be the reason for my problem? I already tried different sketches with different pins but the result is always the same. Thanks in advance for any help or hints!

One more information: I am using the JSN-SR04T V2.0 but I found the adapted sketches that should work with V2.0.

The sensor itself is creating a light "click" sound whenever it is triggered. Is that normal or should I hear an ultrasound?

The click is normal. You will not hear ultrasound, by definition.

You can hear the intermodulation products of ultrasound due to non-linear effects, and the switch on and off will have spectral scatter across a whole range of frequencies. The intermodulation effect has some novel uses: https://en.wikipedia.org/wiki/Sound_from_ultrasound

If you could hear it you wouldn't want to, they are very loud in absolute terms.

How exactly is it all wired up? Where is your code?

Thanks for the replies! I was not expecting to hear ultrasound of course, but wondering if the "click" is all you hear from the sensor in operation or if there are any higher frequencies to be heard.

I used (among other sketches) the following code from here:

https://forum.arduino.cc/index.php?topic=474759.msg3262434#msg3262434

#define triggerPIN 7
#define echoPIN 8

int returnCM;                           // Variable containg processed sounding

//****************** SETUP **********************
void setup() {
  pinMode(triggerPIN, OUTPUT);          // Set the trigPin as an Output (sr04t or v2.0)
  //pinMode(echoPIN, INPUT);            // Set the echoPin as an Input (sr04t)
  pinMode(echoPIN,INPUT_PULLUP);        // Set the echoPin as an Input with pullup (sr04t or v2.0)
  Serial.begin(9600);
  // End of setup
}

//******************* LOOP **********************
void loop() {
  int distanceCM = 0;                     
  unsigned long durationMS = 0;           
  // Do sounding here
  distanceCM = 0;
  durationMS = 0;
  // Clear the trigger pin
  digitalWrite(triggerPIN, LOW);
  delayMicroseconds(2);
  // Sets the trigger on HIGH state for 10 micro seconds
  digitalWrite(triggerPIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(triggerPIN, LOW);
  // wait for the echo
  durationMS = pulseIn(echoPIN, HIGH);
  // Calculating the distance
  distanceCM = (((int) durationMS * 0.034) / 2);
  // Prints the distance on the Serial Monitor
  Serial.print("Sample: ");
  Serial.println(distanceCM);
  // Pause between soundings at least60 ms
  delay(1000);
  // End of Main Loop
}

The wiring is trigger of the sensor wired to pin D7 of the Arduino, echo to pin D8. GND and 5V of the sensor are connected to the respective pins on the Arduino.

  • red led from the board indicates that it is powered, so it is ok.

  • try change echo / trig wires to see if makes any difference. If you are not getting readings, it means that you are not sending nothing or you are not getting nothing... What exactly prints on the screen?

  • use a ready made library, i use this: https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home

1.The red led on the Board JSN-SR04T-2.0 should flash with a frequency of incoming pulses on input “Trigger”. If the led is not flashing, that means the input “Trigger” not do the pulses from Arduino.
2.The voltage level at the Board input “Trigger” in the absence of signal equal to the supply voltage Vcc (on Board HC-SR04 level is 0), so I use negative pulse as signal “Trigger”, i.e. a sequence of HIGH-LOW(10mks)-HIGH. This seems to be a feature of the program written to the microcontroller on the Board stm8s003f3p6.
3. The sound You hear comes from the transformer on the Board.

Now I included the NewPing library and ust this code:

// ---------------------------------------------------------------------------
// Example NewPing library sketch that does a ping about 20 times per second.
// ---------------------------------------------------------------------------

#include <NewPing.h>

#define TRIGGER_PIN  7   // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     8  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

void setup() {
  Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
}

void loop() {
  delay(500);                     // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
  Serial.print("Ping: ");
  Serial.print(sonar.ping_cm()); // Send ping, get distance in cm and print result (0 = outside set distance range)
  Serial.println("cm");
}

The red LED on the sensor board is blinking with the trigger pulses and I hear the sensor clicking, but still no reading:

Ping: 0cm

Changing trigger and echo pin is stopping the sensor to click, so the first way seems to be correct.
It seems the the sensor is triggered without problems but is not listening.

Aim the sensor on a hard surface, at a distance of about 1 meter. Try to change the digital pins on the Arduino. For example, the "trigger" to connect with the terminal 12, and "echo" 11. Don't forget to make changes in the program! By the way, have You seen my pictures from the oscilloscope?

Cool! That did the job! No idea why id did not work with the other pins... Bad contact? Anyway the sensor works at last! Thanks a lot! No I did not see you pictures. Where can I see them?

I'm glad it all worked out. Underneath my message (#6), there is an attached file. You need to download and open in a graphics editor.

Hi, does anyone has used aj-sr04m???, seems a chinese version of jsn or something, but used in serial mode, because, the r19 resistor (similar to r27) needs a 120K to work with the command 0x55, but I welded and works in mode 2 (continuous), I need to start the module in mode 3. thanks

ralftech: Hi, does anyone has used aj-sr04m???, seems a chinese version of jsn or something, but used in serial mode, because, the r19 resistor (similar to r27) needs a 120K to work with the command 0x55, but I welded and works in mode 2 (continuous), I need to start the module in mode 3. thanks

I had received that AJ-SR04M sensor once when I had ordered JSN SR04T. Personally I found it quite unstable in terms of readings. Instead of hassling with soldering of resistors on JSN-SR04T/AJ-SR04M to make it work in mode 3 UART, I personally switched to a better sensor from here (https://www.ebay.com/itm/253978673298).It has less minimum detection/blind distance of around 3cm as compared to JSN-SR04T/AJ-SR04M and it works in mode 3 i.e UART mode out of the box directly.