Go Down

Topic: Setting up an arduino controlled relay causes main short circuit (Read 5460 times) previous topic - next topic


Hi guys,

I've been experimenting a little bit with home automation using my arduino. I've had great result in controlling lights activated via my Android phone through an Arduino Uno connected to my computer. However, when I connect a heater up through the relay circuit, it causes my diode to "pop" and flips the circuit breakers in the house. I have insulated all circuits so I don't think a short circuit is causing this.

It feels strange to me as I'm using a 5V circuit to activate the 240V relay, of which, the flyback diode is part of.

I'm following this guide:

I'm using a 5V, 2.0A AC adapter externally instead of using the arduino as it draws too much when using multiple relays.

Any help with this would be great!


You've got what sounds like a very dangerous situation going on.

First, if you're gonna switch 220vac, you want to switch both sides of it simultaneously.
Make sure to have properly rated fuse holders between the 220vac source & the relays.
Don't rely on circuit breakers to save you.

There should be absolutely no connection from either side of the 220vac to that board except thru the relays contacts.
If you measure any connection between the relay coil & the relay contacts, something is dangerously miswired.
There should not be any connection from the 220vac to any part of that board except thru the relay contacts.

I can't know what relay(s) you're using but make sure it is / they are rated for 220vac & the appropriate current.
Make sure you take into account the load's inrush current as well as its operating current when you size the relays.

Now you know.......as little as I do.



You have a short plain and simple...

Disconnect the 240v side, now listen for the click noise whrn you power the relay, if that works,  check your mains wiring (or a photo)


HI, we need to see a circuit diagram to help you as well as the type of relay and its type number.
It sounds like you have not wired the relay correctly but the above info will help.
Check the info plate on your heater, 2400W is >10Amps, probably more at switch on.
Everything runs on smoke, let the smoke out, it stops running....


Aug 26, 2013, 03:09 pm Last Edit: Aug 26, 2013, 03:14 pm by fanuch Reason: 1
Thanks a bunch for all the replies. I will implement all of them before continuing (haven't touched it since, just been racking my brain over it instead.)

Disconnect the 240v side, now listen for the click noise when you power the relay, if that works, check your mains wiring

I extensively tested the relay/Arduino side of this system before trying it out on AC power. So I am certain that the relays have been wired correctly.

You have a short plain and simple...

Yes, I did think about that, but it works fine when I control two AC, individual lights via two relays over two separate digital pins and it didn't short at all over those couple of days. Also, the heater operates for roughly 20 seconds both times the breaker flipped and the diodes popped. With the lights I had no issue spamming them together and separately in my trials.

Don't rely on circuit breakers to save you.

After the first (of two) times that the breakers flipped i installed a RCBO to prevent electrocution and switch off the electricity on the power board directly as a preventative measure.

Check the info plate on your heater, 2400W is >10Amps, probably more at switch on.

Hmm, all the plate says is 2000W 50Hz

Completed a drawing of the circuitry. Forgive me for it being so crude and non-technical.

This is a picture of the relay:
Thanks guys, Ari


That diagram you are working from is a little misleading as it assumes that the switched side of your relay is also DC, so the GNDs are tied together.

It's also a confusion of the tendency to use GND on DC to denote the negative terminal kf a DC supply being used as a 0v common reference.

You don't want to be connecting your 5V -ve to the AC Earth like that.

I've done a quick sketch and attached it. I've made effort to keep the layout similar to your sketch so that you can hopefully understand it easily.


Thanks for the diagram, it is very helpful.

According to your schematic, an error was attaching the 5v DC to the AC earth, curious to understand the physical reason why the diode might blow, but that might require further research some other time.

Your relationship between the mains and the relay actually makes a lot more sense than what I did.

Just making sure I understand, as I am trying to be careful and comprehend what I'm doing  :)

I have a picture in my head how I'm going to do this, I will attempt it tomorrow and report back.


You should be keeping your two supplies separated. AC Earth and DC Ground are not the same thing.

The AC supply earthing system is a lot more complicated than people generally think, and isn't necessarily always 0V, as it is connected to Neutral and some of the Neutral currents can flow back to source transformers via PME system. Current in the Earth path means voltage gradients, known as Earth Potential Rise and giving rise to considerations of Touch Potentials and Step Potentials. With EPR values of low volts it presents no hazard as humans don't even feel it; it only becomes a consideration with high voltage fault currents and the possible transfer to low voltage neutrals via a common HV/LV earth connection. But, imagine you have an Earth that is actually at 5-10v AC then you are tying your DC -ve to it. That means you would be  transferring that 0-10v AC to your DC circuit and it could be causing unexpected and unpredictable issues with the operation.

I can't tell you exactly what is happening in your project but I suspect that it could be something like this. That common 'ground' connection is the only thing that looks wrong in what you seem to be trying to achieve. If you were using DC on the load then it wouldn't matter.

Is your relay a mechanical relay? If so then you'll have arcing across the contacts every time you open that load and eventually the relay will fail. It would be better to use a Solid State Relay, based on a TRIAC, as that will turn off on Zero Point Crossing.


Ok, I see at least two wiring flaws.

One is due to an incorrect assumption is that there is a "NEUTRAL" wire in 220vac wiring.
There is NOT.
There ARE (2) HOT wires plus a ground.

Secondly, your relays are switching the same HOT 220vac rail in series.
While this by itself is not a "breaker blowing" short, it does make me consider what else you might have miswired.

When switching 220vac, always switch BOTH rails together.
It's fine to use (2) separate relays. You just need to make sure they are on opposite rails.

Also, as others pointed out, get that -5vdc dc off what you think is that 220vac "neutral" connection.
As a sidenote, I'm not seeing any fuses in series before the relay commons.

Now you know......as little as I do.


As far as the UK goes, there is a Neutral, a Live and an Earth.

The neutral is always tied to the mass of earth in at least one position, the Star Point of the Star winding of the distribution transformer. In PME (TNC-S) systems the neutral will also be tied to earth at multiple points along the low voltage distribution cable and forms a combined neutral and earth, meaning one less conductor required in distribution cables. Single phase PME distribution cables are only two conductors. Three phase PME distribution cables are only 4 conductors. Once it reaches a consumer then the system becomes separate neutral and earth (SNE) and you have either 3 wires (for single phase) or 5 wires (for three phase).

You do NOT want to be switching both wires with separate relays. The only time you ever do this is if you have an actual ganged double pole switch or contacts. Something like cooker circuits and immersion heaters will be double pole isolation. Socket outlets in UK will be single pole switched, as will lighting etc. When single pole switching you ALWAYS switch the live, never the neutral.

Switching only the live wire to these heaters is perfectly fine, and no different to switching a socket off or light switch.


Perhaps I should have stated "In the US" as I don't know the location of the original poster.
I will attempt to remember that this forum is international & that utility systems & layouts are different.
Thank you for reminding me of this.



It would be helpful if you could tell us what Country you are in.  AC electrical systems vary by where you live in the world, so it may eliminate some confusion on the replies you are getting.



Assuming this is UK style live-neutral-earth then you never connect anything to live or neutral that can come into
contact with a human, EVER.

Neutral can be any voltage (240VAC if there's a circuit fault for instance).
Normally it will be "close to earth" potential (within a few tens of volts), but you cannot assume this.

You can connect your low voltage circuit ground to the earth, or keep it completely isolated.

[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


Pictures always help

I  barely see a difference between N and PE in your picture ;)
Yes, there is a small dot, indicating that PE is connected to consumers casing. But without a word, it's hard to see that this is the main info of your picture.

N runs "back" all the unbalanced current from L, but there should not be any current on PE.

Are there no ground fault circuit interrupters / residual current devicesin UK ?
Those nasty beasts punishing you for connecting PE and N ...
If there are, what's the correct term ?

Go Up