I would like to control normal household appliances like lamps, pumps etc. using my Arduino with up to 5 A. I looked a little around, but it seems, that most relais draw more current than the Arduino is capable of supplying.

How can I switch an 230 V AC current using my Arduino?

  • My advice would be: don't do it unless you're perfectly aware of the danger. Rather use a dedicated isolated device for that (eg an SSR). – jfpoilpret Sep 12 '14 at 4:32
  • @jfpoilpret relays are also isolated. The only safely advantage of SSR are that they usually have screw terminals instead of just leads. – Gerben Sep 13 '14 at 9:38

The good advice to people asking how to drive a relay to control mains voltage is: don't.

Start with a complete solution such as those from PowerswitchTail.com and sold by many places: Powerswitch Tail

You can get these already built or in kit form. The 20 $ price is small price compared to damage to people or home you might incur with a home built solution.


Get a logic level n-channel MOSFET that is rated for your relay's voltage and current requirements, and an external DC power supply that's able to put out enough current to drive the relay. Feed the power supply into the relay coil. Connect the ground of the coil to the drain of the MOSFET. Connect the source of the MOSFET to ground. Connect the MOSFET gate to your Arduino control pin.

You might be able to find a relay that will run on 5V at low enough current that you can drive it with a MOSFET and the 5V out from your Arduino, but make sure you don't exceed the total current limit of your Arduino's regulator.

Make sure you put a flyback protection diode in parallel with your relay coil, pointing to block the normal flow of current through the coil, so you don't fry your transistor.

Alternatively you can buy solid state relays that can switch large AC loads using logic level signals, but they're expensive.

  • A regular transistor instead of a MOSFET should be fine too. Relay coils don't use that much current. – Gerben Sep 13 '14 at 9:32
  • True. The Transistor should be run in saturation. However, with a BJT transistor it's harder to pick the right transistor and run it in saturation. Logic MOSFETs have VERY low gate current, and very low drain-to-source resistance. – Duncan C Sep 13 '14 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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