as a simple solution ,you can use of photo electric sensors and install them against each other on the door frame so that as you enter the room the beam of light is cut and send a pulse to the electronic circuit to turn on the lamps and when you leave the room again send a pulse to turn of the...