Page 1 of 1

ESP easy+nodemcu+HC-SR501 problem

Posted: 01 Jul 2018, 16:54
by jollyroger
Goodmorning everyone. I have a problem with the PIR motion sensor. I connected it to the nodemcu with ESP easy mega firmware (ESP_Easy_mega-20180624_normal_ESP8266_4096) by following the instructions here (https://www.letscontrolit.com/wiki/index.php/PIR_Sensor), but on the module page it always gives me or 1 or 0 fixed; on the same nodemcu I have a DHT22 sensor that works properly. I tried to change different configurations and powers for the PIR but without results. an help please?

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 01 Jul 2018, 17:54
by grovkillen
Please give us info on what exact PIR module you got. Some are useless.

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 01 Jul 2018, 20:18
by jollyroger
this is my sensor PIR: HC-SR501

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 01 Jul 2018, 20:24
by jollyroger

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 01 Jul 2018, 21:49
by Shardan
Did you refresh the module page?

The PIR sensors are technically handled as a switch.
The output on the module page is static, so you have to refresh.
Suggestion: Try monitoring the serial, this is much easier for testing PIR.

Another reason might be the setting of the SR-501 (Sensivity and jumper).
Test with a voltmeter from "out" to gnd" on the PIR if you get a correct signal there at all.

For myself I didn't find differences between SR-501 sensorts but my samples are all from the same series.
It might help to put a pullup resistor (10 KOhm) from the GPIO to Vcc (3.3V).

It also might be a good idea to use a separate 5V supply for the PIR for testing. The 5V output from the
nodeMCU is known for some problems now and then. There's a diode in the output that lowers the output
voltage a bit. As the SR-501 uses an internal voltage regulator the Voltage from the 5V pin might be a bit
too low for the regulator.

Regards
Shardan

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 01 Jul 2018, 22:38
by grovkillen
Shardan wrote: 01 Jul 2018, 21:49 The output on the module page is static, so you have to refresh.
Not true anymore Shard, I've made it update automatically. ;)
Shardan wrote: 01 Jul 2018, 21:49 Try monitoring the serial, this is much easier for testing PIR.
Good advice, but the web log is now a tons better with "infinite" logging.

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 02 Jul 2018, 00:28
by Shardan
Oooops...
missed that over my unwanted hiatus, sorry

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 02 Jul 2018, 06:12
by grovkillen
Happy to have you back! ;)

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 02 Jul 2018, 16:12
by jollyroger
So you want to say that to see if it works correctly I can do it from the frontend of Home Assistant (in my case) and not from the web page of ESP easy? did I get it right?. I tried various ways of power, since my nodemcu card does not have a 5V output pin I tried to power the sensor with 3.3V, through the third pin of the jumper and then to 5V separately. but the result has never changed on the web page.

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 02 Jul 2018, 16:46
by Shardan
Very first check:

Power the SR-501 with 5V.
Put a 10 KOhm resistor from 3.3V to the output pin of the SR-501.
Use a voltmeter / multimeter - or if you have one an oscilloskope - connected from the SR-501 output to gnd.

Check if you get a reliable reaction on the voltmeter. It should show near 0 V if it has detected something, otherwise 3.3V.

Second check:

Put a resistor from 3.3 V to the GPIO
Use a simple switch from the GPIO to zero, or use a Dupont wire to emulate a switch.
Check if connectiong / disconnecting the GPIO shows a result at the webpage.

Then report back.

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 11 Jul 2018, 16:24
by jollyroger
Now it seems to work (at least now I see it on HA). I connected the pir sensor to the vin pin of nodeMCU and then gnd and GPIO10. the problem now is that it continues to detect movement even if it is not there. passes continuously from 0 to 1. I tried to rotate the trimmers but nothing.

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 12 Jul 2018, 11:55
by rfmon
Dear all, i bought this pir wifi sensor with esp8266. Can yoy help me to program it with espeasy and domoticz?

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 12 Jul 2018, 12:36
by grovkillen
If you are able to send me one I can make an official guide.

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 12 Jul 2018, 13:33
by rfmon

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 12 Jul 2018, 15:39
by grovkillen
Sure but I don't have the funds to buy it myself right now. We'll have to wait then 8-)

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 12 Jul 2018, 17:04
by rfmon
:D :D I bought only one for the same reason. :D :D
I'll try to flash it with espeasy and do some testing.
Thank for your support

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 12 Jul 2018, 18:10
by grovkillen
Seems like the visa are accessable easily for RX/TX. Look at the ESP-01 guide and you will most likely get it working. Please give us info on your progress

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 12 Jul 2018, 20:02
by rfmon
I'm trying to flash it, but where is the vcc + chpd connected?

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 14 Jul 2018, 07:57
by TD-er
You may also want to connect the GPIO-0 to GND during flash.
And on the images I could not find the 3.3V point, so that one may be tricky.

Also double-check those USB => serial converters output 3.3V. Some just give 5V on the pins labelled 3.3V

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 14 Jul 2018, 08:14
by grovkillen
It seems that there's another notation about RX/TX as well. But I believe I found the 3.3V via. See attached pictures.

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 15 Jul 2018, 12:47
by rfmon
I had seen the 3v3 pin but I can not find the chpd pin that goes bridged with the 3v3. I keep trying

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 28 Jul 2018, 20:13
by jollyroger
nothing to do, I inserted a 10k resistor between the GPIO and the sensor data output but I continue to have fakes, it goes continuously between the two states

Re: ESP easy+nodemcu+HC-SR501 problem

Posted: 29 Sep 2018, 11:06
by jollyroger
nothing to do probably the sensor model has problems .. I will try to change the manufacturer ..