About the project:
I made a arduino based project which can switch on the light when someone passes by the door to enter the room.
it uses a ultrasonic sensor(distance sensor) to identify when someone cuts the wave and enters the room,then the servo switchs then button.
This can be modified to turn of the light also,but for that you'll need two ultrasonic sensors to count the people entered the room and how many of them left the room so that it can operate accordingly.
(shown in the video)
-If interested you can see the making and working video here:
-for detailed info please visit my project(same) on instructables.com
https://www.instructables.com/id/Motion-Sensor-Light-Switchautomatic-Light-Switch/
-Thanks for being here