The switch is placed on the wall in such a way that when the door is opened by pushing it completely towards the wall, the normally closed switch gets opened when the door touches the wall. The OPAMP used here works as a comparator. When the switch is opened, the inverting terminal gets connected to the 12V supply, and a voltage of approximately 4V is fed to the non-inverting terminal.
Now, the non-inverting terminal voltage being lesser than that at the inverting terminal, a low logic pulse is generated at the output of the OPAMP. This is fed to the timer IC input through a potential divider arrangement. The timer IC gets triggered with a low logic signal at its input and generates a high logic pulse at its output. Here, the timer works in a monostable mode. When the lamp receives this 12V signal, it glows.
Similarly, when a person comes out of the washroom and closes the door, the switch gets back to its normal position and gets closed. Because the non-inverting terminal of the OPAMP is at a higher voltage compared to the inverting terminal, the output of the OPAMP is at a logic high. This fails to trigger the timer; since there is no output from the timer, the lamp gets switched OFF.
NDRGOUD says:
The switch is placed on the wall in such a way that when the door is opened by pushing it completely towards the wall, the normally closed switch gets opened when the door touches the wall. The OPAMP used here works as a comparator. When the switch is opened, the inverting terminal gets connected to the 12V supply, and a voltage of approximately 4V is fed to the non-inverting terminal.
Now, the non-inverting terminal voltage being lesser than that at the inverting terminal, a low logic pulse is generated at the output of the OPAMP. This is fed to the timer IC input through a potential divider arrangement. The timer IC gets triggered with a low logic signal at its input and generates a high logic pulse at its output. Here, the timer works in a monostable mode. When the lamp receives this 12V signal, it glows.
Similarly, when a person comes out of the washroom and closes the door, the switch gets back to its normal position and gets closed. Because the non-inverting terminal of the OPAMP is at a higher voltage compared to the inverting terminal, the output of the OPAMP is at a logic high. This fails to trigger the timer; since there is no output from the timer, the lamp gets switched OFF.