Go Down

Topic: communication between two JSN - SR04T (Read 2260 times) previous topic - next topic

DaveEvans

...according documentation this sensor might work underwater...
I'm skeptical.  Please provide a link.

lukasSirh

Ups i can't found documentation, but in every ebay, aliexpress, etc... and there is mention about waterproof.

DaveEvans

#17
Oct 25, 2017, 08:48 am Last Edit: Oct 26, 2017, 07:56 am by DaveEvans
"Waterproof" does not necessarily mean "works when submerged."

This paper seems to suggest that the JSN-SR04T will work when submerged.

Load up the NewPing library and the simple example sketch.  Get the sensor working reliably in air first.    Then  find a body of water (such as a swimming pool or small boat harbor) that is approximately  (30 to 40 cm x speed of sound in water / speed of sound in air) deep.  Submerge the business end of the sensor a few cm deep and point the sensor at the bottom.  If testing in a swimming pool, keep the sensor a meter or two away from the walls; if in a harbor, keep the sensor away from boats, piling, etc.  Measure the depth with a tape measure, too (attach a weight to the tip of the tape if needed).  Please report the measured depth and the sensor readings here.


jremington

#18
Oct 25, 2017, 06:44 pm Last Edit: Oct 25, 2017, 06:48 pm by jremington
I agree, do the test and let us know if it works!

Quote
This paper seems to suggest that the JSN-SR04T will work when submerged.
"seems to suggest" is an interesting and appropriate choice of words.

I looked through that thesis and decided that very little of it can be believed.

Figure 4.2 shows extremely noisy and unconvincing depth information in one dimension along X, down to about 70 cm, and the so-called 3D reconstruction is obviously just the 2D data simply repeated along the Y axis.

A much more interesting project is the autonomous lake mapping boat Sea Renderer, which uses the professional Airmar DST800 underwater transducer (cost about $270).

Such a transducer is required for efficient sound energy transfer to water, which has acoustic impedance about 3500 times higher than air.

DaveEvans

"seems to suggest" is an interesting and appropriate choice of words.
Selected with care!  :)

lukasSirh

Load up the NewPing library and the simple example sketch. 
Hello I tested the sensors and works fine. I tested it like depth measurement here is my code:
Code: [Select]
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

#define TRIGGER_PIN 4

// nastavení adresy I2C (0x27 v mém případě),
// a dále počtu znaků a řádků LCD, zde 20x4
LiquidCrystal_I2C lcd(0x3F, 16, 2);
unsigned int counter = 0;

void setup()
{
  Serial.begin(9600);
  Serial.println("Init lcd");
  lcd.begin();
  lcd.backlight(); // zapne podsvětlení
  lcd.print("test");
  delay(10);
  lcd.clear();
}

void loop(){
  digitalWrite(TRIGGER_PIN, LOW);
  delayMicroseconds(4);
  digitalWrite(TRIGGER_PIN, HIGH);
  delayMicroseconds(4);
  digitalWrite(TRIGGER_PIN, LOW);

  Serial.print("Send signal");
  Serial.println();
  lcd.clear();
  lcd.print("ping send ");
  lcd.print(++counter);
  delay(110);
}


Then i tried setup first sensor like trigger
Code: [Select]

#define TRIGGER_PIN 4

void setup()
{
  Serial.begin(9600);
  Serial.println("Init lcd");
}

void loop(){
  digitalWrite(TRIGGER_PIN, LOW);
  delayMicroseconds(4);
  digitalWrite(TRIGGER_PIN, HIGH);
  delayMicroseconds(4);
  digitalWrite(TRIGGER_PIN, LOW);

  Serial.print("Send signal");
  Serial.println();
  delay(50);
}

And second sensor setup for echo:
Code: [Select]

#define ECHO_PIN 10

void setup() {
  Serial.begin(9600);
  Serial.println("Initialization");
}

void loop() {
  long foo;
  pinMode(ECHO_PIN, INPUT);
  foo = pulseIn(ECHO_PIN, HIGH);
  Serial.println(foo);
}


Is it right?

DaveEvans

Hello I tested the sensors and works fine. I tested it like depth measurement...
Fantastic!  Glad to hear it works fine!  That's great!

But please explain the details of your test(s) and show the results, because those things are not at all clear.  For example, when you say you "tested it like depth measurement," do you mean that you put the sensor slightly below the surface of a deep pool, as recommended, and you were able to use the sensor to measure the depth of the pool?  But your test code (in your uppermost code window) doesn't include pulseIn, so you can't measure distance, even in air.  And you didn't use the NewPing library as recommended.

So it seems your test was not valid.

lukasSirh

Oh sorry i had fail i my copy/paste. I copied the correcd code below
Code: [Select]

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define trigPin 4
#define echoPin 10

// nastavení adresy I2C (0x27 v mém případě),
// a dále počtu znaků a řádků LCD, zde 20x4
LiquidCrystal_I2C lcd(0x3F, 16, 2);

void setup() {
  Serial.begin (9600);
 
  Serial.println("Init lcd");
  lcd.begin();
  lcd.backlight(); // zapne podsvětlení
  lcd.print("test");
  delay(10);
  lcd.clear();
 
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
}

void loop() {
  int duration, distance;
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  Serial.print("Duration:");
  Serial.print(duration);
  Serial.println();
  distance = (duration/2) / 29.1;
  lcd.clear();
  if (distance >= 800 || distance <= 0){
    lcd.print("Out of range");
  }
  else {
    lcd.print(distance);
    lcd.print(" cm");
  }
  delay(500);
}

Its without NewPing library but it's works fine
And yes i tested it in air on my table.

jremington

Quote
And yes i tested it in air on my table.
How did you conduct the underwater tests, measuring pool depth, and what were the results?

lukasSirh

How did you conduct the underwater tests, measuring pool depth, and what were the results?
I didn't do any underwater tests because it isn't my main goal for now. I need do something for comminicate between my two sensors. :( But i don't know what i must to do.

This measure tests are only for prove that this sensors works fine.

DaveEvans

#25
Nov 16, 2017, 06:40 am Last Edit: Nov 16, 2017, 06:42 am by DaveEvans
If "communicating" underwater isn't your goal anymore, then I suggest you switch to the HC-SR04, re-read post #8, and read the two linked pages in this post: https://forum.arduino.cc/index.php?topic=499887.msg3471626#msg3471626


If you can understand all of that, then you might be able to achieve your goal, albeit with OOK and not FSK.

lukasSirh

If you can understand all of that, then you might be able to achieve your goal, albeit with OOK and not FSK.
NO :-) communication underwater is still my main goal, but if it didn't work on my table - it will never works underwater :(.

I'll try the another sensor HC-SR04, maybe it will give me any idea.

jremington

Even if it works on the table, it won't work underwater.

DaveEvans

#28
Nov 16, 2017, 07:13 pm Last Edit: Dec 02, 2017, 01:48 am by DaveEvans
Do not be misled by the assertion that "it won't work underwater."  That appears to be a long-held belief, seemingly plausible, but apparently unsupported by experiments.

As noted in this thread, it turns out that, in addition to the project linked in my post 17 (above), others have done underwater tests of a relatively inexpensive and easy-to-use ultrasonic sensor intended for use in air (such as I suggested in my post 17, and such as encouraged by post 18). 

It works and appears to work well, for measuring underwater distances up to 50 feet (claimed by one experimenter), with just a little bit of "fiddling" to make sure it is waterproof (especially the connections to the sensor)...

...unless they are not telling the truth about their results.  That's possible, but it seems unlikely.

Note: this does *not* mean that achieving your goal of "communication" between two otherwise unconnected underwater sensors will be easy.  You will need to have a deep understanding of the TX and RX electronics for the sensor you are using.  As deep as that for the HC-SR04 illustrated in the two links mentioned in my post 25.

And, depending on your underwater environment, your sensors could be confused by ultrasonic noise from other sources (dolphins...)

Edited to remove the blue-green laser remark and to include the link to the subsequent thread on the same topic, which has links to three other users claiming successful underwater use of ultrasonic sensors intended for air.

lukasSirh

Even if it works on the table, it won't work underwater.
:-) It's true, but it could be good start >/]

Go Up