I want to switch ON and OFF an incandescent bulb using MCU. Please suggest an electric switch (like relay or something) for 220V 50Hz AC line which can be used here. I would prefer something very cheap to keep the total project cost minimum.

EDIT: Don't limit this to incandescent bulb. The solution should be applicable to every daily life electrical appliances.


3 Answers 3


The cheapest solution is an ordinary mains relay with normally open contacts. Put the bulb in series with the contacts and the mains supply, and control it with a low voltage on the relay coil. Relays with coils that can be switched with the output from an MCU are readily available. Don't forget to put a diode or snubber across the relay coil. If you use a transistor driver, you can probably use a very cheap, less sensitive relay.

  • \$\begingroup\$ are all the spacings ok for 220v with that kind of solution? \$\endgroup\$
    – kenny
    Commented May 21, 2011 at 11:30
  • \$\begingroup\$ The relay should be OK, if it is designed to switch mains voltages. It's up to the PCB designer to ensure that the board clearances are correct. \$\endgroup\$ Commented May 21, 2011 at 11:47
  • 1
    \$\begingroup\$ Relays have ratings too, check them. \$\endgroup\$ Commented May 21, 2011 at 15:42
  • \$\begingroup\$ @LeonHeller- What rating of relay should I go for? Here in my country we get 220-230V, 50Hz AC supply? What is VAC parameter in a relay's rating? \$\endgroup\$
    – 0xakhil
    Commented May 22, 2011 at 8:50

The best solution for an incandescent lamp is a SSR (Solid State Relay) with zero-crossing detection. (Zero-crossing switching increases the bulb's life.) An SSR module is the most convenient, but they're not cheap. If price is an issue you can better build the SSR from discrete components. Below is an example using the MOC3041 as opto-triac.

enter image description here

Despite Leon's comment this is an inexpensive solution. In this thread I calculated the cost as 2.10 euros; an electromechanical relay (+ transistor, diode, ...) often costs more.

  • \$\begingroup\$ He wants something very cheap! \$\endgroup\$ Commented May 21, 2011 at 11:10
  • \$\begingroup\$ Please explain how SSR enhances a bulb's lifespan? \$\endgroup\$
    – 0xakhil
    Commented May 21, 2011 at 18:07
  • 10
    \$\begingroup\$ @oxakhil - It's not just the SSR, it's the zero-crossing switching. You may have noticed that incandescent bulbs always fail when they're switched on. That's because the mains phase can be near its maximum when switching on. Combined with the low resistance of a cold bulb this results in a high current peak, which may burn the filament. When you switch on a zero crossing you avoid these peaks. \$\endgroup\$
    – stevenvh
    Commented May 21, 2011 at 18:20

Gembird Power manager They exist for USB, ethernet, WLAN. To easily control electronic appliances from your PC.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.