EMI from relay

A sudden switching of relay or contactor generates EMI that stops the communication between microcontroller and computer. But my question is, could it also damage the microcontroller if you just keep it that way?.. cause I was thinking of creating a code that will automatically disable/enable the port. But I was concerned about the other effects of EMI.

You are unlikely to damage the processor. It has protection diodes on all the inputs which will take care of low-power interference such as EMI picked up on input wires. The diodes won't take care of high-power problems such as connecting the power supply backwards.

Serial communication should always assume the input is subject to interference. You need to check that the input parameters are received completely and correctly before updating variables within your program. Even if you know exactly when your relay switches, nearby electronic equipment added in the future may cause other problems.

dazmehard:
A sudden switching of relay or contactor generates EMI that stops the communication between microcontroller and computer. But my question is, could it also damage the microcontroller if you just keep it that way?.. cause I was thinking of creating a code that will automatically disable/enable the port. But I was concerned about the other effects of EMI.

My crystal ball shows a Micro and a 2-channel relay board.
A Micro has bad decoupling of the 5volt rail.
Problems if you power the relay board from the Micro's 5volt rail.
If I'm right, add a 100-470uF electrolytic cap across the supply/ground pins of the relay board.
If I'm not, post a diagram/picture of your setup.
Leo..

may I add, with my humble experience…;

you did add a back-emc diode over the relay right…?

otherwise you’ll be kicking some serious voltages over your lines every time it switches off.
(and that does destroy electronics)

:slight_smile:

regards,
vincent
:slight_smile:

I’ve attached my setup of the system.

My crystal ball shows a Micro and a 2-channel relay board.

lol. i apologize that you have to use your crystal ball, but I was surprise that it was actually right…

I will try to move the arduino away from the relay and contactor and add some RC network between the contacts of relay and contactor. should I add MOV too together with RC?.. How will I connect it?

MOV (metal oxide varistor) is used for big spikes, like lightning strikes. It won't protect against a direct strike but most lightning related damage is caused by induced currents in circuits in the local area of the actual strike. MOV is not relevant to relay switching noise.

Yes a RC snubber network on the relay outputs might help but only if you know what equipment is connected to the output. My crystal ball is cloudy but it is telling me the probability of this is unlikely to help.

Have you tried Wawa's suggestion?

Yes a RC snubber network on the relay outputs might help but only if you know what equipment is connected to the output. My crystal ball is cloudy but it is telling me the probability of this is unlikely to help.

the relay contact is controlling the contactor and the contactor is controlling the Air conditioning unit. Im not sure if the one that is causing the interference was the relay or contactor or both.