No detection in ir sensor

I am working on a project where ir sensor detects the person entry and exit , if the detection occurs the light has to turn on. I think the code i gave here is correct in perception, but detection in the ir sensor is not producing the expected out put. Can anybody help me out regarding this

1 Like


Nice project there!

First things first, are you able to detect when a person moves?
Also while the code is in sleep mode, it won’t detect the movement of the people.

I found two types of IR sensors in Market, Some are Active Low and other are Active High. Hope you confirmed it.