Help connecting a PIR and or pushbutton

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
404NotFoundZA
New user
Posts: 4
Joined: 15 Nov 2016, 15:17

Help connecting a PIR and or pushbutton

#1 Post by 404NotFoundZA » 18 Nov 2016, 00:18

Hi everyone,

I tried getting a HC-SR501 to work on a regular esp8266 but nothing shows up in the logs, and if I refresh devices, the pin states stay the same.

Connected both VCC to 5V and GND to my psu, and the output to GPIO0. If I check the pins with my multimeter it shows 5V on the
VCC and 3.2V output when there's movement so I think the PIR is good.

Decided to try get input from a regular momentary push button switch connected to GPIO0 and GND, but also had no luck.
I know the state should go on with press and off as soon as you let go of the switch, so I'd hold it down for a while and refresh page.

Device setup:

Image

What am I missing?

Thanks!

rtenklooster
Normal user
Posts: 320
Joined: 15 Apr 2015, 14:17

Re: Help connecting a PIR and or pushbutton

#2 Post by rtenklooster » 18 Nov 2016, 20:52

Disable the pull-up on your input.
Richard - Groningen (NL) - Image

technotools
Normal user
Posts: 11
Joined: 10 Oct 2016, 00:45

Re: Help connecting a PIR and or pushbutton

#3 Post by technotools » 19 Nov 2016, 15:46

if this doesn't work try to force GPIO0 to 0 (for example with an external MQTT client. i use mqtTool for iPhone).

-run your ESP.
-disable inversed
-Send a command to force GPIO0 to 0 (you must maintain pull up in this case because on reboot gpio0 must be set to 1)
-check in the log if the command had success.

-Reboot.

Try again with your PIR

danielchagasrs
Normal user
Posts: 20
Joined: 09 Jan 2017, 20:20
Location: Porto Alegre / Brazil

Re: Help connecting a PIR and or pushbutton

#4 Post by danielchagasrs » 11 Jan 2017, 00:23

I had a PIR connected to GPIO0, but the behavior was erratic, full of false positives... Since Domoticz had an event to turn on a light, associated with 2 other devices (a door contact and a LDR input), you can imagine the result at night, when the lux was low... The light was going nuts, blinking hundreds of times per second...

I tried all possible settings: Pull up, inversed, set the boot mode on hardware tab... nothing worked. The same problem happened when using gpio-0 with a push button.
To solve my problem, I was forced to change the PIR to another GPIO, and now it's running fine, without a single false positive. My event is working.

The only problem is that I have another unusable Gpio sitting on the corner, together with Gpios 9 and 16, leaving only 10 really usable GPIOS for devices (plus 1 ADC).

Post Reply

Who is online

Users browsing this forum: No registered users and 101 guests