I am trying to build an automatic room light controller that will turn on a lamp when a person enters a room and maintains it in the on state as long as the room is occupied. once the room is empty, the lamp will switch off. I intend to use a PIC for this project, together with an infrared emitting diode and phototransistor for detecting entry and exit. But my major problem is making the circuit direction sensitive. How can I differentiate between entry and exit? I only need help with the design, as I would gladly carry out the construction on my own.
I would really appreciate any help I can get. Thank you.
I would really appreciate any help I can get. Thank you.