The circuit it to turn on or off a AC bulb by a microcontroller. My question is, can we somehow safely add a manual override switch near the bulb, so that even if the microprocessor is not working, we can turn the switch on/off manually? If yes, how will the circuit then look like? Sorry if this is a simple question as I am just starting in electronics and electrical circuits.
no with the switch wired like that to turn off the bulb you'd have to cut the 5v power.
otherwise you need a three way switch. cut the wire to the collector
arrange it so the one position has the that connection broken - (this is override off) another has that connection made (this is microcontroller control) and the third has the relay connected to ground (this is override on ) the third position can have the cut connection either made or broken
another option (if you have an on-off-on switch and want the middle position to be microcontroller control) is to have one of the on's ground the base and the other ground the collector.
It can be done the same way as a normal 2 way lightswitch.
You need a single pole changeover relay unit controlled by the micro, the common contact is fed by supply and the 2 other contacts feed a pair of wires between the relay and your manual switch. The manual switch of course picks off whichever of the 2 wires happens to be live to turn on the light - the manual switch is of course also a single pole changeover with the common terminal to the lamp.
Sorry Jeff and others for the cross posting. These being my first posts to these groups, I was not sure which group would answer the query better. Will keep in mind in future. And thanks for the help everybody!
Your micro needs to drive a DT (double throw) relay), the manual switch also needs to be a double throw switch which is a common stock item at your local electrical supplier for lights.
Lets assume the relay's CP (Center Pole) is connected to 120 volts AC>
and the CP of the switch is connected to the L1 (High side) of the Lamp. Then you simply combined the poles of the switch to the poles of the Relay..
As long as 120 V is at the CP of the relay, it will not matter if the processor is working or if it happens to have the relay already pulled in. The manual switch will simply place the lamp in a opposite operation.
You can go one step further by making the circuit a 4 way and up! all that simply involves doing is taking the 2 leads that are being used to bridge the poles together between the relay and switch, and pass them through a DPDT (double Pole, double throw) switch to reverse/flip the leads orientation between the relay and manual switch.. In fact, you can have as many of these DPDT switches you want between the relay and manual switch..
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.