ESP easy+nodemcu+HC-SR501 problem

Moderators: Voyager, BertB, rtenklooster, Stuntteam, Martinus, grovkillen, TD-er

Post Reply
Message
Author
jollyroger
Normal user
Posts: 6
Joined: 01 Jul 2018, 12:23

ESP easy+nodemcu+HC-SR501 problem

#1 Post by jollyroger » 01 Jul 2018, 16:54

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?

User avatar
grovkillen
Normal user
Posts: 1900
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP easy+nodemcu+HC-SR501 problem

#2 Post by grovkillen » 01 Jul 2018, 17:54

Please give us info on what exact PIR module you got. Some are useless.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

jollyroger
Normal user
Posts: 6
Joined: 01 Jul 2018, 12:23

Re: ESP easy+nodemcu+HC-SR501 problem

#3 Post by jollyroger » 01 Jul 2018, 20:18

this is my sensor PIR: HC-SR501


Shardan
Normal user
Posts: 971
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP easy+nodemcu+HC-SR501 problem

#5 Post by Shardan » 01 Jul 2018, 21:49

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
Regards
Shardan

User avatar
grovkillen
Normal user
Posts: 1900
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP easy+nodemcu+HC-SR501 problem

#6 Post by grovkillen » 01 Jul 2018, 22:38

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.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Shardan
Normal user
Posts: 971
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP easy+nodemcu+HC-SR501 problem

#7 Post by Shardan » 02 Jul 2018, 00:28

Oooops...
missed that over my unwanted hiatus, sorry
Regards
Shardan

User avatar
grovkillen
Normal user
Posts: 1900
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP easy+nodemcu+HC-SR501 problem

#8 Post by grovkillen » 02 Jul 2018, 06:12

Happy to have you back! ;)
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

jollyroger
Normal user
Posts: 6
Joined: 01 Jul 2018, 12:23

Re: ESP easy+nodemcu+HC-SR501 problem

#9 Post by jollyroger » 02 Jul 2018, 16:12

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.

Shardan
Normal user
Posts: 971
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP easy+nodemcu+HC-SR501 problem

#10 Post by Shardan » 02 Jul 2018, 16:46

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.
Regards
Shardan

jollyroger
Normal user
Posts: 6
Joined: 01 Jul 2018, 12:23

Re: ESP easy+nodemcu+HC-SR501 problem

#11 Post by jollyroger » 11 Jul 2018, 16:24

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.

rfmon
Normal user
Posts: 7
Joined: 23 Feb 2017, 10:53

Re: ESP easy+nodemcu+HC-SR501 problem

#12 Post by rfmon » 12 Jul 2018, 11:55

Dear all, i bought this pir wifi sensor with esp8266. Can yoy help me to program it with espeasy and domoticz?
Attachments
20180703_194424.jpg
20180703_194424.jpg (3.11 MiB) Viewed 383 times
20180703_194024.jpg
20180703_194024.jpg (3.1 MiB) Viewed 383 times
20180703_193808.jpg
20180703_193808.jpg (2.79 MiB) Viewed 383 times
20180703_193721.jpg
20180703_193721.jpg (2.78 MiB) Viewed 383 times
20180703_193533.jpg
20180703_193533.jpg (2.4 MiB) Viewed 383 times

User avatar
grovkillen
Normal user
Posts: 1900
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP easy+nodemcu+HC-SR501 problem

#13 Post by grovkillen » 12 Jul 2018, 12:36

If you are able to send me one I can make an official guide.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

rfmon
Normal user
Posts: 7
Joined: 23 Feb 2017, 10:53

Re: ESP easy+nodemcu+HC-SR501 problem

#14 Post by rfmon » 12 Jul 2018, 13:33


User avatar
grovkillen
Normal user
Posts: 1900
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP easy+nodemcu+HC-SR501 problem

#15 Post by grovkillen » 12 Jul 2018, 15:39

Sure but I don't have the funds to buy it myself right now. We'll have to wait then 8-)
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

rfmon
Normal user
Posts: 7
Joined: 23 Feb 2017, 10:53

Re: ESP easy+nodemcu+HC-SR501 problem

#16 Post by rfmon » 12 Jul 2018, 17:04

: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

User avatar
grovkillen
Normal user
Posts: 1900
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP easy+nodemcu+HC-SR501 problem

#17 Post by grovkillen » 12 Jul 2018, 18:10

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
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

rfmon
Normal user
Posts: 7
Joined: 23 Feb 2017, 10:53

Re: ESP easy+nodemcu+HC-SR501 problem

#18 Post by rfmon » 12 Jul 2018, 20:02

I'm trying to flash it, but where is the vcc + chpd connected?
Attachments
ontatti.jpg
ontatti.jpg (185.05 KiB) Viewed 346 times

TD-er
Normal user
Posts: 1052
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP easy+nodemcu+HC-SR501 problem

#19 Post by TD-er » 14 Jul 2018, 07:57

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

User avatar
grovkillen
Normal user
Posts: 1900
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP easy+nodemcu+HC-SR501 problem

#20 Post by grovkillen » 14 Jul 2018, 08:14

It seems that there's another notation about RX/TX as well. But I believe I found the 3.3V via. See attached pictures.
Attachments
IMG_20180714_081103.jpg
IMG_20180714_081103.jpg (506.86 KiB) Viewed 320 times
IMG_20180714_081201.jpg
IMG_20180714_081201.jpg (629.62 KiB) Viewed 320 times
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

rfmon
Normal user
Posts: 7
Joined: 23 Feb 2017, 10:53

Re: ESP easy+nodemcu+HC-SR501 problem

#21 Post by rfmon » 15 Jul 2018, 12:47

I had seen the 3v3 pin but I can not find the chpd pin that goes bridged with the 3v3. I keep trying

jollyroger
Normal user
Posts: 6
Joined: 01 Jul 2018, 12:23

Re: ESP easy+nodemcu+HC-SR501 problem

#22 Post by jollyroger » 28 Jul 2018, 20:13

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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests