Ir sensors lights on and off when people forget to do that

We are making a project with IR sensors of lights on and off with Aurdino and we can not code, its kind of overwhelming to do that now since the person who could write programs is sick
so well so can someone pls tell me how to write the source code
THANKYOU…

It will be really appreciated

@mugdha.powniker

Connect the IR sensor to any one of the Digital Pin. In Arduino, store the digitalRead(pin) function to any variable. Later in the program, if the stored variable is ‘HIGH’, write a function digitalWrite(pin, HIGH/LOW).

I provided you with the logic to use. You can find projects on the internet that will provide you with the arduino code. You can refer to https://www.hackster.io/akshayansinha/contactless-door-bell-covid-19-special-6750f7 for idea of the arduino code.

Do share with us more about the project you’re building and the role of Bolt IoT in it.

Thankyou for your help