Talk About the Latest in Home Automation/Home Electronics -
Home Automation Forum

Smarthome Forum
Insteon Home Automation
Login or Register
Home | Profile | Register | Active Topics | Search | FAQ | Smarthome | Security and Privacy
 All Forums
 General Discussion
 Lighting and Appliance Control
 DIY an LED that will automatically turns On/OFF
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 02/02/2018 :  7:19:22 PM  Show Profile  Reply with Quote
I've read an article which talking about Contemporary LED Lighting Technology and Application in Our Daily Life(==> this article, it introduced the working principle and characteristics of LED in detail. LED is widely used in our daily life nowdays.And it can be used in many designs. Here is a simple and low cost automatic bathroom light circuit that we can build by ourselves.
We turn On the lights in our washroom when we enter it and turn them off when we leave. We sometimes forget to turn Off the lights after leaving the washroom. This may lead to power wastage and also the lifetime of the lights may decrease. To avoid these problems, we are going to make a circuit which automatically turns On the lights when a person enters the washroom and it automatically turns it Off when he leaves it.The light automatically turns on when the bathroom door is opened, and remains lit in the occupied state. When the door is opened again the lamp turns off after a very short delay. This automatic circuit saves energy and greatly assists your visitors, especially at night. The ¡°single-chip¡± circuit, built around the popular decade counter CD4017 (IC1), is very compact, and can be powered from any 5VDC/500mA mobile phone travel charger/similar smps adaptor. After construction, try to enclose the whole circuit in a suitable plastic case for total convenience. Next, arrange the door switch (S1) such that when the door is closed it should be in closed state.

Schematic of the Automatic Bathroom Light Control Circuit

How does the automatic toiled light works?
The heart of this circuit is CD4017 (IC1), CMOS counter with decoded output. On each pulse received on its clock input, this IC drives high the next output. Output 0 (pin 3) of IC1 drives a green ¡°Toilet Free¡± indicator (LED1), and output 1 (pin 2) of IC1 drives the 1W light source (LED2) through a driver transistor (T1). Note that T1 (2N2222) is here wired as an emitter-follower to avoid the use of a base resistor.

Initially when the circuit is powered, IC1 is resetted by the RC network R1-C1 and as a result LED1 lights up. When the door is opened for the first time, switch S1 is opened and as a result IC1 is clocked by the clock pulse generator R2-C2. Now LED1 goes off and LED2 lights up. IC1 stays in this condition to provide the interior lighting, even if the door is closed. However, when the bathroom door is opened again IC1 is clocked again, and this resets the chip by the signal from Output 2 (pin 4) of IC1 through D1 (1N4148). When IC1 activates its Output 2 and reset itself, LED1 lights up again!

Component Selection

Regarding components selection, nothing is really critical. But try to use a good quality ¡°normally-opened¡± (N/O) switch as S1. The 3.6V/1W White LED (LED2) current is limited by resistor R3. It may become necessary to adjust this value to get the best from your circuit.

¡¤IC1: CD4017(datasheet for reference:
¡¤T1: 2N2222
¡¤D1: 1N4148
¡¤LED1: 5mm Green
¡¤LED2: 3.6V/1W White
¡¤R1: 10K #188; w
¡¤R2: 100K #188; w
¡¤R3: 2.2¦¸ #188; w (see text)
¡¤R4: 1K #188; w
¡¤C1,C2 : 10#181;F/16V
¡¤C3: 100nF
¡¤S1: N/O Push Switch (see text)
¡¤J1: DC Socket ¨C PCB mountable

Lab Note

Since the clock generator for IC1 is realized using a tricky RC network, erratic switching may be occurred. Although the bumps are rare, you can defeat this by adding a manual reset switch (again one N/O push switch) between +5V and pin 15 of IC1.

Edited by - Shaon on 02/02/2018 7:21:11 PM

Advanced Member

803 Posts

Posted - 02/03/2018 :  07:59:41 AM  Show Profile  Reply with Quote
This is 40 years old technology. Using an 8-pin micro, such as ATTiny85 you cut the number of components and cost in half, while preventing any erratic switching to the boot.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Smarthome Forum © 2000-2018 Smartlabs, Inc Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07