Distance Sensors HC-SR04, JSN-SR04T and more
Moderators: grovkillen, Stuntteam, TD-er
Re: Distance Sensors HC-SR04, JSN-SR04T and more
I've ordered some and are considering using it at ground floor directed downwards. That should eliminate the triggers from the next room.
I'm done rewriting it, test phase is next...
I'm done rewriting it, test phase is next...
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Please let me know as per my test the micrwave irradiates from the modules in all directions no matter how I position it
I know there are similar modules with different chipset and some kind of shielding on one side of the board in order to "cut" waves to goin that direction (so they cover only 180°)
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Definitely. These sensors are omnidirectional.papperone wrote: ↑14 Aug 2017, 17:29Please let me know as per my test the micrwave irradiates from the modules in all directions no matter how I position it
I know there are similar modules with different chipset and some kind of shielding on one side of the board in order to "cut" waves to goin that direction (so they cover only 180°)
I can make it work if i go to a wall made from ferroconcrete.
Anyways it should be possible to shield the antenna if you cover two or three sides
of a case with aluminium foil for example. But don't put the foil too near to the module,
keep some centimeters distance. Maybe use a plastic case, mount the module at the mid of the lid and cover bottom and sides for shielding...
I didn't test that yet.
Regards
Shardan
Regards
Shardan
Shardan
Re: Distance Sensors HC-SR04, JSN-SR04T and more
How about using the same kind of shielding/focus as on a HC-SR04? Some kind of a thin metal tube glued over the sensor...Shardan wrote: ↑14 Aug 2017, 19:49 Definitely. These sensors are omnidirectional.
I can make it work if i go to a wall made from ferroconcrete.
Anyways it should be possible to shield the antenna if you cover two or three sides
of a case with aluminium foil for example. But don't put the foil too near to the module,
keep some centimeters distance. Maybe use a plastic case, mount the module at the mid of the lid and cover bottom and sides for shielding...
I didn't test that yet.
Regards
Shardan
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Microwaves are electromagnetic waves of some cm wavelengt. A metal tube very near the sensor influences the antenna tuning.LisaM wrote: ↑15 Aug 2017, 13:39How about using the same kind of shielding/focus as on a HC-SR04? Some kind of a thin metal tube glued over the sensor...Shardan wrote: ↑14 Aug 2017, 19:49 Definitely. These sensors are omnidirectional.
I can make it work if i go to a wall made from ferroconcrete.
Anyways it should be possible to shield the antenna if you cover two or three sides
of a case with aluminium foil for example. But don't put the foil too near to the module,
keep some centimeters distance. Maybe use a plastic case, mount the module at the mid of the lid and cover bottom and sides for shielding...
I didn't test that yet.
Regards
Shardan
So it is better to keep some cm distance to the microwave antenna - it wil still misstune it a bit but not too much i hope.
Another way might be to tune the shielding into resonance with the antenna so it works like a radar dish or a Yagi antenna.
Might work or not, i won't predict any result.
But that won't make the microwave sensor usable for my purposes as i need a distance + threshhold.....
Regards
Shardan
Shardan
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Hi LisaMLisaM wrote: ↑13 Aug 2017, 23:26 Please let me know if anyone is using the STATE mode, state mode means that the distance is below the threshold set in the form earlier. When state mode is reached, distance below threshold, then a sensor switch event is send.
If nobody is using it, i can as well take it out...
Would it be possible to include median function of the New ping lib?(optional with parameter on device page). It can be done using a dummy device and rules, however it can b very handy when using t distance sensor a water level sensor.
Regards seb
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: Distance Sensors HC-SR04, JSN-SR04T and more
No problem, i'll add another pulldown (normal, median).
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Thanks
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Volunteers wanted...
Tested with HC-SR04 and JSN-SR04T...
Tested with HC-SR04 and JSN-SR04T...
Re: Distance Sensors HC-SR04, JSN-SR04T and more
I'll test as soon as i have some spare time.... might take a while.
Regards
Shardan
Regards
Shardan
Regards
Shardan
Shardan
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Same here... unfortunately
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Hello Lisa,
I've unpacked the plugin to my source folder and compiling with platformio failed.
Is there a library missing in the .zip-file?
Regards
Shardan
I've unpacked the plugin to my source folder and compiling with platformio failed.
Code: Select all
Compiling .pioenvs\normal_4096\FrameworkArduino\Updater.o
D:/ESP_MEGA_Clone/ESPEasy-mega_20170818 - HCSR04/src/_P013_HCSR04.ino:12:21: fatal error: NewPing.h: No such file or di
rectory
#include <NewPing.h>
^
compilation terminated.
Regards
Shardan
Regards
Shardan
Shardan
Re: Distance Sensors HC-SR04, JSN-SR04T and more
The newping lib can be found here: https://bitbucket.org/teckel12/arduino- ... /wiki/Home
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Quick breadboard setup, tested with the last Github version.
Distance - works
Threshhold - works
Free mem - 21624 constant.
Looks good so far. Can't test the JSN-SR04T, i don't have one yet.
Regards
Shardan
Distance - works
Threshhold - works
Free mem - 21624 constant.
Looks good so far. Can't test the JSN-SR04T, i don't have one yet.
Regards
Shardan
Regards
Shardan
Shardan
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Great, thx for testing!
i have a JSN-SR04T running for week now, hopefully this can be confirmed by somebody else also. After confirmation, it's time to upload it into P013...
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Anytime
I'll let the breadboard run for a while and look if memory changes or such,
maybe combine it with a BME280 or such to see if anything interferes.
Regards
Shardan
I'll let the breadboard run for a while and look if memory changes or such,
maybe combine it with a BME280 or such to see if anything interferes.
Regards
Shardan
Regards
Shardan
Shardan
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Hello,
I tested both sensors.
the hc-SR04 ------- distance = 180cm - ok ---- distance <to 20cm --- ok
the JSN-SR04T --- distance = 180cm - ok --- distance <to 20cm --- NOK
the JSN-SR04T looks less good for distances <20cm
excuse me for English .... google translate
I tested both sensors.
the hc-SR04 ------- distance = 180cm - ok ---- distance <to 20cm --- ok
the JSN-SR04T --- distance = 180cm - ok --- distance <to 20cm --- NOK
the JSN-SR04T looks less good for distances <20cm
excuse me for English .... google translate
sorry for my English ! i use google translat.
Re: Distance Sensors HC-SR04, JSN-SR04T and more
That is true, the specs for the JSN-SR04T clearly indicate that the JSN-SR04T is not useable for distances less then 20cm:rol-rider wrote: ↑05 Sep 2017, 01:32 Hello,
I tested both sensors.
the hc-SR04 ------- distance = 180cm - ok ---- distance <to 20cm --- ok
the JSN-SR04T --- distance = 180cm - ok --- distance <to 20cm --- NOK
the JSN-SR04T looks less good for distances <20cm
excuse me for English .... google translate
Electrical parameters: JSN-SR04T
Working voltage: DC 3.0-5.5V
Working current: <8mA
Acoustic emission frequency: 40khz
Farthest distance: 600cm
Nearest distance: 20cm
Distance accuracy: ±1cm
Module size: 42mm*29mm*12mm
Resolution: about 1mm
Angle: 75 degrees
Working temperature: -20℃—+70℃
Re: Distance Sensors HC-SR04, JSN-SR04T and more
OK !
its good
and even with vcc 3.3V
its good
and even with vcc 3.3V
sorry for my English ! i use google translat.
-
- New user
- Posts: 3
- Joined: 12 Dec 2017, 03:30
Re: Distance Sensors HC-SR04, JSN-SR04T and more
So the waterproof JSN-SR04T version is not measuring closer than 20cm correctly?
HC-SR04 with some selfmade waterproofing it will be then
HC-SR04 with some selfmade waterproofing it will be then
-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: Distance Sensors HC-SR04, JSN-SR04T and more
It seems that this PLUGIN_13 from LisaM
never was integrated in the Mega branch. The version in the Mega branch has a header like this
viewtopic.php?f=5&t=3432&hilit=HC+SR04+ ... =10#p18413//#######################################################################################################
//#################################### Plugin 013: Ultrasonic Sensors ###################################
//################ models: HC-SR04, SRF05, SRF06, DYP-ME007, JSN-SR04T & Parallax PING ##################
//#######################################################################################################
never was integrated in the Mega branch. The version in the Mega branch has a header like this
For what reason, it was not integrated?//#######################################################################################################
//#################################### Plugin 013: HC-SR04 ##############################################
//#######################################################################################################
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.
Re: Distance Sensors HC-SR04, JSN-SR04T and more
That's an interesting question.
I've been testing that plugin for a while, it worked nicely for me.
I've been testing that plugin for a while, it worked nicely for me.
Regards
Shardan
Shardan
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Could you please add an issue here: https://github.com/letscontrolit/ESPEasy/issues ?
It keeps merging/fixing things a lot easier.
It keeps merging/fixing things a lot easier.
-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Sherdan and TD-er ... thanks for your acknowledge.
Opened issue: https://github.com/letscontrolit/ESPEasy/issues/782
Opened issue: https://github.com/letscontrolit/ESPEasy/issues/782
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Please share firmware (bin) 4096kB and / or 1024 with support JSN-SR04T.
Re: Distance Sensors HC-SR04, JSN-SR04T and more
So, now i'm at home and can check:
I've compiled the plugin with ESP-Mega with Sources from Aug. 18. 2017.
I've a compiled version for 4096KB on my HDD, it is attached.
Please remember that this is not an officially supported version.
Regards
Shardan
I've compiled the plugin with ESP-Mega with Sources from Aug. 18. 2017.
I've a compiled version for 4096KB on my HDD, it is attached.
Please remember that this is not an officially supported version.
Regards
Shardan
Regards
Shardan
Shardan
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Hi,
there is an update for the US plugin. I have fixed some errors, now multiple sensors are possible. The plugin supports the median filter from the NewPing class, output as cm or inch (although this was possible with a formula expression already). I have changed also the calculation from integer to float so that you will see fractions of cm or inches.
For better troubleshooting, some more detailed errors will be shown in the log.
there is an update for the US plugin. I have fixed some errors, now multiple sensors are possible. The plugin supports the median filter from the NewPing class, output as cm or inch (although this was possible with a formula expression already). I have changed also the calculation from integer to float so that you will see fractions of cm or inches.
For better troubleshooting, some more detailed errors will be shown in the log.
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Hi
Read it this morning, was nearly to jump ship for that measurement, you make my day, will test tonight
Read it this morning, was nearly to jump ship for that measurement, you make my day, will test tonight
Belgium and land of ESP ... counting
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Great job JoJoS!JojoS wrote: ↑04 Oct 2018, 15:18 Hi,
there is an update for the US plugin. I have fixed some errors, now multiple sensors are possible. The plugin supports the median filter from the NewPing class, output as cm or inch (although this was possible with a formula expression already). I have changed also the calculation from integer to float so that you will see fractions of cm or inches.
For better troubleshooting, some more detailed errors will be shown in the log.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Hello
I've tested my JSN-SR04T (not version 02) , never used with last Mega build 20200328. It does not work. Measure = 0
I i use my HC-SR04, it works fine.
should it work for both with same plugin ?
Im' a bit los of what I shall do. I don't have a scope to idetnify the problem
Any idea ?
Thank you
Thomas
I've tested my JSN-SR04T (not version 02) , never used with last Mega build 20200328. It does not work. Measure = 0
I i use my HC-SR04, it works fine.
should it work for both with same plugin ?
Im' a bit los of what I shall do. I don't have a scope to idetnify the problem
Any idea ?
Thank you
Thomas
Re: Distance Sensors HC-SR04, JSN-SR04T and more
This datasheet (https://www.makerguides.com/wp-content/ ... asheet.pdf ) does mention a resistor on R27 to switch between different modi.
Open = similar behavior to the well known other Ultrasonic sensors
47k = switch to serial mode continuously sending distance in mm
120k = serial mode starting in stand-by and you have to wake it.
Open = similar behavior to the well known other Ultrasonic sensors
47k = switch to serial mode continuously sending distance in mm
120k = serial mode starting in stand-by and you have to wake it.
Re: Distance Sensors HC-SR04, JSN-SR04T and more
thanks. I know the R27.TD-er wrote: ↑10 Apr 2020, 19:21 This datasheet (https://www.makerguides.com/wp-content/ ... asheet.pdf ) does mention a resistor on R27 to switch between different modi.
Open = similar behavior to the well known other Ultrasonic sensors
47k = switch to serial mode continuously sending distance in mm
120k = serial mode starting in stand-by and you have to wake it.
I don't have this resistor on my PCB
still searching
thank you anyway
T.
Re: Distance Sensors HC-SR04, JSN-SR04T and more
How is the board powered?
Can you measure the voltage you supply to the sensor?
Maybe switch to 5V for powering the sensor and then add a small voltage divider to make sure the output of the signal pin is not over 3v3?
Maybe the GPIO connected to the trigger pin should have its pull-up resistor enabled?
Can you measure the voltage you supply to the sensor?
Maybe switch to 5V for powering the sensor and then add a small voltage divider to make sure the output of the signal pin is not over 3v3?
Maybe the GPIO connected to the trigger pin should have its pull-up resistor enabled?
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Wemos D1 mini, powered by USB. JST module powered by 5V. Echo output is connected to PIN5 via a zener+Resistor to decrease level (works for hc-sr04). I tried also withoutTD-er wrote: ↑10 Apr 2020, 19:38 How is the board powered?
Can you measure the voltage you supply to the sensor?
Maybe switch to 5V for powering the sensor and then add a small voltage divider to make sure the output of the signal pin is not over 3v3?
Maybe the GPIO connected to the trigger pin should have its pull-up resistor enabled?
I tried this very simple code without success (always 0 cm)
Code: Select all
#define ECHOPIN 5// Pin to receive echo pulse
#define TRIGPIN 4// Pin to send trigger pulse
void setup(){
Serial.begin(9600);
pinMode(ECHOPIN, INPUT_PULLUP);
pinMode(TRIGPIN, OUTPUT);
digitalWrite(ECHOPIN, HIGH);
}
void loop(){
digitalWrite(TRIGPIN, LOW); // Set the trigger pin to low for 2uS
delayMicroseconds(2);
digitalWrite(TRIGPIN, HIGH); // Send a 10uS high to trigger ranging
delayMicroseconds(15);
digitalWrite(TRIGPIN, LOW); // Send pin low again
int distance = pulseIn(ECHOPIN, HIGH,26000); // Read in times pulse
distance= distance/58;
Serial.print(distance);
Serial.println(" cm");
delay(50);// Wait 50mS before next ranging
}
Re: Distance Sensors HC-SR04, JSN-SR04T and more
Maybe the trigger you try to send does not have the right voltage level?
Have you tried using a PNP transistor to increase the output level?
Have you tried using a PNP transistor to increase the output level?
Re: Distance Sensors HC-SR04, JSN-SR04T and more
I was talking about the trigger signal from the ESP to the ultra sonic sensor.
Maybe the logic level is too low for that sensor to act on it?
Maybe the logic level is too low for that sensor to act on it?
Re: Distance Sensors HC-SR04, JSN-SR04T and more
I didn't try. I cannot find example with this sensor requiring this hack on the web
I've ordererd i a new JSN.
In meantime, I've installed a HW-SR04T that will work the time to receive the waterproof one hopefully...
Thank you
Thomas
Re: Distance Sensors HC-SR04, JSN-SR04T and more
You can also try to use the Serial Proxy plugin (highly experimental) and switch this sensor to output the serial values.
These can then be sent to a controller (e.g. MQTT controller) as a string, so you may send the data directly to the receiving end and not having to mess with real time aspects of the ESP.
These can then be sent to a controller (e.g. MQTT controller) as a string, so you may send the data directly to the receiving end and not having to mess with real time aspects of the ESP.
Who is online
Users browsing this forum: No registered users and 5 guests