JSR SR04-T 2.0 support ?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Dodfr
Normal user
Posts: 12
Joined: 12 Feb 2017, 11:17

JSR SR04-T 2.0 support ?

#1 Post by Dodfr » 14 Mar 2020, 12:07

Hello,

I am wondering if the (not so new) 2.0 version of this waterproof ultrasonic distance sensor is supported by EaspEasy ?

regards.

TD-er
Core team member
Posts: 2342
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: JSR SR04-T 2.0 support ?

#2 Post by TD-er » 14 Mar 2020, 12:17

Do you have a specific link describing what the differences are?
When I search for it, the first hit I get is this one: https://www.youtube.com/watch?v=N42Y-QOqwtA
That title suggests (Have not seen the video myself) not to use it.

Dodfr
Normal user
Posts: 12
Joined: 12 Feb 2017, 11:17

Re: JSR SR04-T 2.0 support ?

#3 Post by Dodfr » 14 Mar 2020, 13:56

I have viewed this video and after that I read the comments and found this interesting one that seems to say problem was that milliseconds delay is slightly different and needs to be changed :
I found a sample program at https://www.dfrobot.com/wiki/index.php/ ... on_Diagram
This worked correctly on an Arduino Uno at 5 volts and an ESP8266 WEMOS-R1D2 at 3.3 volts.
The datasheet at https://www.jahankitshop.com/getattach. ... pe=Product says that the Echo pulse goes high after 38 msecs if no obstacle is detected, so I changed the sample program instruction
"int distance = pulseIn(ECHOPIN, HIGH,26000); // Read in times pulse"
to wait for up to 40000 microseconds instead of 26000 microseconds.
And another comment say :
I was having a problem with this also. I found it was working ok when I used a level shifter to shift the signal to 5V and powered the board from 5v but on 3.3v exactly the same problem. Always 169cm
Plus this one :
Voltage supply and particular ardinuio boards more than likely have an affect here generally - they did for me, however, the real issue is that the ping command uses a default trigger time of 10 microseconds. The spec sheet lists 10 as the minimum (thus easy see why its sometimes not enough); by using a custom script you can set a larger delay: 20 microseconds worked for me.
And finally I found an arduino library here about a project for integration into a car :-)

https://github.com/kd8bxp/jsn-sr04t-2.0-car-sensor

TD-er
Core team member
Posts: 2342
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: JSR SR04-T 2.0 support ?

#4 Post by TD-er » 14 Mar 2020, 16:14

So in short, what is needed is to document the use of 5V (or else fluctuations) and use some minimum (configurable) delay?
There is a plugin using the new ping library, so you may check that one to see if it is already performing well.
That one does have some settings for max (and min?) distance.

If you test it and have it clear what needs to be changed, please add an issue for it on Github.

Micha_he
Normal user
Posts: 129
Joined: 07 Feb 2018, 19:14

Re: JSR SR04-T 2.0 support ?

#5 Post by Micha_he » 14 Mar 2020, 17:21

I've two of the V2.0. Works perfectly, also with 3.3V. One of them for ~1 year in my water-cistern.
Last edited by Micha_he on 15 Mar 2020, 02:21, edited 1 time in total.

Dodfr
Normal user
Posts: 12
Joined: 12 Feb 2017, 11:17

Re: JSR SR04-T 2.0 support ?

#6 Post by Dodfr » 14 Mar 2020, 20:46

Connected ... Working like a charm with a 8cm error comparing with my Laser meter, adding %value%+8 do not fix the problem in serial output.
Last edited by Dodfr on 14 Mar 2020, 21:09, edited 2 times in total.

TD-er
Core team member
Posts: 2342
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: JSR SR04-T 2.0 support ?

#7 Post by TD-er » 14 Mar 2020, 21:04

The formula is only applied when you query the value.
For example, if you send its value to a controller.

The debug output generated by the plugin is almost always the raw value, so not using the formula as the plugin simply has no knowledge of what is done with the data.

Dodfr
Normal user
Posts: 12
Joined: 12 Feb 2017, 11:17

Re: JSR SR04-T 2.0 support ?

#8 Post by Dodfr » 14 Mar 2020, 21:09

Right if I look at the web interface the device value showed here is correct so it's all fine :-)

I need it to check my sump/well close to the house because its water level is the same as my cave when it is flooded :-( so I ill start monitor it to be warned when water come close to cave floor level (once a year for a few days since last 3 years, since a huge amount of water flooded the region).

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests