My Arduino UNO is connected to a SainSmart 4-channel relayboard. Power is provided by a 240/5V 2A switching power supply.
The Arduino receives an on|OFF command via MQTT -- all working fine.
The ON command activates relay 1 on the relayboard -- all working well.
However, when the SainSmart relay drives a contactor (to switch a high load, here 2.5kW heater -- though not connected), two things can happen:
the Arduino/EtherShield combo reboots or
Ethernet connection is lost.
I put a scope on the supply 5V to see if there is spiking going on when the contactor kicks in, but I can see only a 60mV change.
The contactor and power supply share the same 240V connection.
I put a 1000uF cap over the 5V which made no difference.
--------------------
| | 5V to board
^ v
240V -> Power Supply -> Uno (D7) -> SainSmart (K1) -> Contactor coil
v ^
| | 240V to contact of relay 1
-----------------------------------------
Thanks. I do appreciate you providing those, but your schematic really doesn't have enough detail to analyze your problem. Imagine that you are on the other end trying to figure this out. If you have an EMI issue, it is necessary to see how the power and ground lines are laid out, and so on. The contactor is powered from relay contacts? Is there a flyback diode? Are things shielded? Perhaps some photos would be in order.
Even a photo will not show the wiring as it is on the back and front of a switchboard panel... and without a measure, you would have to guess the cable distances. However...
I have built another copy of this circuit, so that I can analyse the problem at my desk (rather than standing in front of a switchboard). It behaves the same way.
All AC wires are 20 cm long, wired as in the schematic... see photo.
I do not believe a flywheel diode has a place in an AC snubber... I figured in the meantime that a snubber (RC in series) could make a difference here... not sure about the values.
I see no shielding and the Arduino ground seems to be floating with respect to mains ground (which doesn't appear anywhere in your photo). That's a recipe for EMI to leak into the digital side of the circuit.
Edit- I would guess you are getting some kind of ground through the Ethernet cable but that might not be a good thing. Depends what is on the other end of it, and how that is connected.
Hmm, looking at the desk picture, the yellow wires (240V) touch the 5V wires of another Arduino: no interference there.
Not understanding much of EMI, and thinking out loud:
Tying common (5V) to neutral (240V) does not seem to be a good idea, given the intended galvanic separation between mains and DC.
Also, the 'problem' circuit and the other Arduinos are fed from the same powerboard at the desk, but are not affected.
I reckon the distance (length of the mains feed) between the power supply and the contactor coil should reduce or eliminate the problem?!
I just removed the 5V supply and fed the UNO via USB like the others; it also kills the Etherner/UNO combo -- as in reset... sometimes only the MQTT connection is lost; or the Ethernet connection is lost... UNO seems to hang in.
Sometimes, even the comms stay up; but definitely the worst impact is sending the OFF command and switching off the coil on the contactor.
Installed an R-C filter with 100 Ohm and 1uF/630V (0.1u should do too) in series, and the lot parallel to the contactor coil; no more comms / reset issues!
MaxG:
Tying common (5V) to neutral (240V) does not seem to be a good idea, given the intended galvanic separation between mains and DC.
No, but normally (at least in 3 different countries I've lived in) there are 3 terminals in an outlet - ground, neutral, and hot. You should never use neutral as a ground, not only for the reason you mention but many others. But you didn't mention why you don't have access to ground, as it appears at every receptacle and inside every electrical box.
The fixed installation has earth connected (yellow/green) to the power supply.
My troubleshoot set-up doesn't...
In any case, the RC filter parallel to the coil fixed the issue.
MaxG:
The fixed installation has earth connected (yellow/green) to the power supply.
My troubleshoot set-up doesn't...
In any case, the RC filter parallel to the coil fixed the issue.
Great. I would recommend checking to see whether the (-) on the 5V side of the PSU is connected to ground, or floating. If it is floating you should ground it.