Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By mikewen
#15232 Thanks! I was wondering why PIR sensor act strange.
I think big capacitor with fast response on VCC of ESP-12 maybe able to solve the problem. I will test after I got my new modules next week.

Also, maybe using a optocoupler would work?
User avatar
By ArnieO
#15240 For what it's worth:
I have a working project with two PIRs giving signals to an Arduino Nano, that is programmed via Wifi through an ESP8266 (installed in the same enclosure). The ESP is powered by a mini step-down module/regulator (5V to 3.3V), this is one of those small 8x11 mm cheap Chinese modules bought from banggod.com. The PIRs are powered by the same 5V as the Nano.
This seems to be working very well, I have not seen any false PIR triggering, maybe due to the step-down regulator to 3,3V powering the ESP.
So this could maybe be a workaround for others that are struggling? The stepdown converters/regulators cost around 1$.
User avatar
By KmanOz
#28597
Mikejstb wrote:
So the solution was this:
1. turn the radio off
2. turn interrupt on for the PIR gpio
3. when the PIR interrupts:
a. turn PIR interrupt off
b. start a timer alarm to ignore any more PIR activity for n minutes
c. turn radio on - connect to AP
d. when the radio connects publish the mqtt message
e. when the mqtt message is sent
1) turn the radio off
2) turn the PIR interrupt back on
all with alarms to repeat the process over and over


I have exactly the same issue with an ESP-03 module I have installed in a PIR. My solution was to do exactly what you have done. Can I ask, how long is the delay from the PIR being triggered to the MQTT message delivery? Also are you running your PIR from batteries and if so what usage are you getting considering you're putting the ESP to sleep.

Thanks
User avatar
By Mikejstb
#28623 It's been a while since I've looked at my code - I think that when I get the interrupt from the PIR after I disable further interrupts I set a 1 second timer to fire off code to connect to the mqtt broker then I publish the message.

I do not put the ESP into sleep mode - I could never figure out how to wake it up with the signal from the PIR. I power all my PIR sensors from wall wart power supplies .