HC-SR501 with Wemos D1 Mini - Staying on continuously

Hello There,

I’ve a few HC-SR501 lying around so I thought of putting them to use but when I did the wiring and coding through ESPHome it stays on forever…

The wiring is as follows -
Sensor G = Wemos G
Sensor Vin = Wemos 5v
Sensor Out = Tried D2 as well as D5

Note:- I’ve also tried using Arduino but it has same results… So it is not about the code… Not sure what I’m doing wrong…

I’ve tried 2-3 different Wemos and sensor all brand new out of the box…

Can anyone of you guys help… I’m just out of ideas been messing around with it for 2-3 days now…