PIR Sensor not working

Im using nodemcu esp8266 with logic level converter 5v to 3.3v bidirectional to connect PIR with esp8266. But the output is just high even without movement. Im already wiring it right and the GPIO is also right, anyone know what to do? It just HIGH and LOW repeatedly with specific time


1 Like

Hi, welcome to the forum.

Which is likely not needed. Post a link to the sensor. Common PIR sensors used with the Arduino are 3.3volt-logic, and can be directly connected to an ESP8266.

Post code as text, with code tags. Not as an image that we can't read.
Read the "how to post" sticky.

All I see is a bunch of spaghetti. A wiring diagram might help too.
Leo..

Take a look at Troubleshooting PIR Sensor and sensitivity adjustment

You can cross-check your code with this tutorial:

But let me tell you one thing, PIR are very likely to give false positive output when connected to an ESP8266 or ESP32.
You will find some solutions to this problem in the following links:

https://www.esp8266.com/viewtopic.php?p=82976

1 Like

Try pointing it away from all of the RED leds, they may be flooding it.

The diagram post#4 is sort-off wrong.
A HC-SR501 has an internal LDO, to power the PIR with 3volt. It should be powered from the Vin pin of the NodeMCU (~4.5volt). Powering it from the 3.3volt pin reduces LDO headroom, and dips in the 3.3volt rail could reach the PIR.
Leo..

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.