Build A Automatic Bathroom Light Circuit

Automatic Bathroom Light

Monday, May 4th, 2015 - Electrical Circuit

Automatic bathroom light is designed for a bathroom fitted with an automatic door-closer, where the manual verification of light status is difficult. Automatic bathroom light is used to automate the working of a bathroom light. The automatic bathroom light circuit also indicates whether the bathroom is occupied or not. The circuit uses only two ICs and can be operated from a 5V supply. As it does not use any mechanical contacts it gives a reliable performance.

Optical Sensor For Automatic Bathroom Light

One infrared LED (D1) and one infrared detector diode (D2) form the sensor part of the circuit. Both the infrared LED and the detector diode are fitted on the frame of the door with a small separation between them as shown in folowing picture. The radiation from IR LED is blocked by a small opaque strip (fitted on the door) when the door is closed. Detector diode D2 has a resistance in the range of meg-ohms when it is not activated by IR rays. When the door is opened, the strip moves along with it. Radiation from the IR LED turns on the IR detector diode and the voltage across it drops to a low level.

Optical Sensor For Automatic Bathroom LightSensor position of automatic bathroom light

Automatic Bathroom Light Principle

Comparator LM358 IC2(a) compares the voltage across the photodetector against a reference potential set by preset VR1. The preset is so adjusted as to provide an optimum threshold voltage so that output of IC2(a) is high when the door is closed and low when the door is open. Capacitor C1 is connected at the output to filter out unwanted transitions in output voltage generated at the time of opening or closing of the door. Thus, at point A, a low-to-high going voltage transition is available for every closing of the door after opening it. (See timing diagram A in the folowing picture.)

Timing diagram of automatic bathroom lightTiming diagram of automatic bathroom light

The second comparator IC2(b) does the reverse of IC2 (a), as the input terminals are reversed. At point B, a low level is available when the door is closed and it switches to a high level when the door is opened. (See timing diagram B in the picture above.) Thus, a lowto-high going voltage transition is available at point B for every opening of the door, from the closed position. Capacitor C2 is connected at the output to filter out unwanted transitions in the output voltage generated at the time of closing or opening of the door.

IC 7474, a rising-edge-sensitive dual-D flip-flop, is used in the circuit to memorise the occupancy status of the bathroom. IC1(a) memorises the state of the door and acts as an occupancy indicator while IC2(b) is used to control the relay to turn on and turn off the bathroom light. Q output pin 8 of IC1(b) is tied to D input pin 2 of IC1(a) whereas Q output pin 5 of IC1(a) is tied to D input pin 12 of IC1(b).

At the time of switching on power for the first time, the resistor-capacitor combination R3-C3 clears the two flip-flops. As a result Q outputs of both IC1(a) and IC1(b) are low, and the low level at the output of IC1(b) activates a relay to turn on the bathroom light. This operation is independent of the door status (open/closed).

The occupancy indicator red LED (D3) is off at this point of time, indicating that the room is vacant. When a person enters the bathroom, the door is opened and closed, which provides clock signals for IC1(b) (first) and IC1(a). The low level at point C (pin 5) is clocked in by IC1(b), at the time of opening the door, keeping the light status unchanged. The high level point D (pin 8) is clocked in by IC1(a), turning on the occupancy indicator LED (D3) on at the time of closing of the door. (See timing diagram C in the picture above)

When the person exits the bathroom, the door is opened again. The output of IC1(b) switches to high level, turning off the bathroom light. (See timing diagram D in the picture above) The closing of the door by the door-closer produces a low-to-high transition at the clock input (pin 3) of IC1(a). This clocks in the low level at Q output of IC1(b) point D to Q output of IC1(a) point C, thereby turning off the occupancy indicator.

Schematic Circuit Of Automatic Bathroom LightSchematic circuit of automatic bathroom light

You may also like, related Automatic Bathroom Light