Tried making my first sensor today. Thought I’d start simple and just add a motion sensor, Then I’ll add lux and temp etc afterwards once I know it’s working. But my Motion sensor is ALWAYS showing motion?
I am using a ESP8266 - D1 mini
And a AM312 PIR.
PIR Pin: V = 5v Pin on D1 (have also tried 3.3v first - no change)
PIR Pin: Data = D4 Pin on D1
PIR Pin: G = G pin on D1
Wires are fairly long (25cm ish) as using Duponts.
Using the following code (the parts excluding name etc):
I’ve tried pin: D4, And pin: GPIO2 too and still no luck.
Can anyone see what I’ve done wrong?
I literally have a box of different sensors and D1s next to me as planned to make one for each room today so I’m beyond disheartened at the moment…
It is really twitchy though, it turns on for 2seconds, then turns off for 2 seconds, then back on for two while I wander around in front of it. It appears that my sensor has a 2 second update interval (I assumed that meant it can change from one state to another once per 2 seconds if required, but if its the same state it would persist).
Could I use the following to correct the behaviour?: