Post topics, source code that relate to the Arduino Platform

User avatar
By Joe Job
#49919 Well I swapped the PIR over to just connecting to ESP on GPIO 2, I am now receiving incorrect reading, I have the following PIR, which is reading correctly using the ATMEGA328P.

http://www.ebay.es/itm/Sensor-Movimient ... 1704139252?

In the new version I used the JPI 3 pin which allows for power by 3.3v and connected this to GPIO2, it is basically detecting motion when motion is not present the pattern is pretty much:


1
1
1
0
0
1
1
1
0
0
1
1
0
0
1
1
1
0
0
1
1

Over and over again even when there is absolutely nothing in view, any idea what could be causing this? I have tweaked the sensitivity etc but no joy.
User avatar
By trackerj
#49921 Used exactly the same one a while ago, take a look at the related blog post: ESP8266 - PIR motion sensor detection

What I remember about is that you need to calibrate it based on desired range, etc. Also avoid direct Sun light. And keep it at least 4-5cm away from the ESP8266 module. Otherelse worked as advertised. Not the best in town but for simple door entrance detection can do the job. Max range used without false positives: 4.5m.
User avatar
By Joe Job
#49931 Yer that is not happening for me, there are two breadboards space inbetween the ESP and the sensor. In fact it is not picking up when my hand is right in front same pattern near enough all the way through, plus it keeps losing MQTT connection.
User avatar
By trackerj
#49940 Strange enough. Are you sure that you are properly processing the interrupts events generated by PIR?
Are you coding in Arduino IDE or something else? Take a look at my code for an idea how can be done, even if is not C++.