-->
Page 1 of 2

ESP-01 GPIO2 oscillates with PIR attached

PostPosted: Thu Jul 16, 2015 8:07 pm
by BobDork
I'm trying to use a PIR to trigger an ESP-01 to send an email alert when motion is detected. The PIR by itself works perfectly and triggers motion as expected. When I connect the PIR to GPIO2 and use the ESP-01 to monitor, the PIR continually triggers on and off every few seconds regardless of motion or not. I've read several threads here and elsewhere and found a few suggestions. Here's what I have tried so far, but nothing has stopped the oscillation triggers:
Battery power and/or regulated 3V3 1A supply
470uf cap on power rail
.01 cap bypass cap close to ESP-01 power pins
.01 caps from GPIO2 to ground and VCC
various pullup and pull down resistors on GPIO2

Nothing seems to stop the problem. Any suggestions?

Re: ESP-01 GPIO2 oscillates with PIR attached

PostPosted: Thu Jul 16, 2015 10:46 pm
by trackerj
BobDork wrote:I'm trying to use a PIR to trigger an ESP-01 to send an email alert when motion is detected. The PIR by itself works perfectly and triggers motion as expected. When I connect the PIR to GPIO2 and use the ESP-01 to monitor, the PIR continually triggers on and off every few seconds regardless of motion or not. I've read several threads here and elsewhere and found a few suggestions. Here's what I have tried so far, but nothing has stopped the oscillation triggers:
Battery power and/or regulated 3V3 1A supply
470uf cap on power rail
.01 cap bypass cap close to ESP-01 power pins
.01 caps from GPIO2 to ground and VCC
various pullup and pull down resistors on GPIO2

Nothing seems to stop the problem. Any suggestions?


I remember that I had some issues with a PIR Motion sensor. Are you sure is properly calibrated?

Might be also a software problem, not hardware.
How are you doing the motion triggering? Are you detecting falling or rising edge ?

Take a look at my PIR Motion detection project, might be a good starting point.

Re: ESP-01 GPIO2 oscillates with PIR attached

PostPosted: Thu Jul 16, 2015 11:17 pm
by Mikejstb
After much experimentation I found that most PIR sensors are highly supsectable to RF interference from the ESP radio.
The only solution I found which works reliably is to always have the ESP radio shut off while waiting for thr PIR signal to interrupt.
At that point the PIR gpio ports interrupts are turned off, the ESP radio started back up, the WiFi message sent, then the radio is shut back off and the PIR gpio interrupt turned back on.

No amount of caps or shielding would prevent the PIR sensor from spurious interrupts in the presence of the ESP radio signal.

Good luck!

Re: ESP-01 GPIO2 oscillates with PIR attached

PostPosted: Thu Jul 16, 2015 11:39 pm
by tegila
Yesterday I was trying to get triggered events from the PIR but getting weird interference of some signal from the PIR that I bougth in 1688.com. It was labelled 3.3v and I was powering all the system from the breadboard power source at 3.3v. So I decided power only the PIR module by the 5v from the adapter USB TTL PL2303 and the interference goes away and started getting the events only when I move in front of PIR sensor.