I didn't know much yet so I went to talk with a teacher about it. He gave me this circuit for me to try:
So I made a list of all the components and went to the electronics shop to buy them.
Quick enough, I had everything that I needed so I started making the circuit. The first the part of it, is responsible for turning on the red LED when the light is ON, for example indicating that room is being used. This is it:
This part is composed of 3 branches in parallel:
- First the LED and a resistor;
- Then 3 diodes in series with the same polarity as the LED, responsible for guaranteeing a voltage of 2.1V (3x0.7V) for the LED branch and also as a pathway for the current to the light bulb.
- And then the third branch which is just a single diode with reverse polarity, to protect the LED against the negative cycle of the AC wave.
Then the second part of the circuit, which is responsible for lighting up the green LED when the light switch is OFF:
Now this part is more simple, it just has an LED in parallel with a diode in reverse polarity, to protect the LED from the negative part of the AC wave, then both of them in series with a power resistor. The resistor must have a power rating of at least 1W because it will be responsible for dissipating the power of almost all of the 230VAC, since the bulb is OFF and the LED only needs around 2.1V, the rest of the voltage will be consumed by the resistor, which means, it will heat up a lot.
By the way, in the image, the wires for the LED are organized like a coil just to fit in the picture, I made them long to be able to put the circuit on the back of the switch and the LED on the front, but their length was being a problem for the photo. They are not meant to be or act as an inductance.
Having created both parts, it's now time to put it all together:
These are the basic connections to be made. After connecting everything I put all circuitry inside the switch and tested it.
As you can see, the green LED lights up, indicating the light bulb is OFF.
And when I turn the switch the light comes ON and the red LED as well.
I made this circuit back in 2006 and I left it working on a room for over 2 years. It never gave any problem, although during cold nights, I noticed the light switch was a bit warm because the power resistor heated up pretty well inside.