Arduino hangs when connect 220VAC to COM and NO contacts on relay

Hello everyone i hope you are doing great .
in short words i'm making temperature control module it control 6 fans through comparing the temperature of the room by the dht11 and the specified temperature needed by the user through a Potentiometer , the controller should activate optocoupler the optocoupler should activate a transistor the transistor activate the relay and the relay should then activate a contactor that activate a 3 phase motor blower fan used for cooling , everything works well the relays are opening and closing and everything is fine untill i connect the coil of the contactor to the COM and NO of the relay , the controller works for a bit of time then it hangs and needed to be restarted ,
i'm using :
1-HI link 12v 1.65a (input voltage 220vac output voltage 12vdc 1.65A) as the main power supply for the whole circuit.
2- arudino nano as main controller.
3- lcd 20x4 i2c.
4- dht11 as temperature and humidity sensor.
5- lm7805 (power the lcd - dht11- pot) and lm7809 (power the arduino) voltage regulator.
6- 4 capacitors 1uF .
7- 6 PC817 optocoupler + 6 resistor 380 ohm.
8- 6 2N2222 transistors + 6 resistor 280 ohm.
9- 6 1n4007 diode .
10- 6 12VDC relay
11- 6 lED for indication + 6 resistor 280 ohm.
12- 2 potetiometer 1 control 5 relays and 1 for the last relay
13- 2 switches that force turn off the relays (1 for 5 relays the other for the last relay as well)
here is the schematic .


note :
all grounds are connected together.
z is the common 220VAC for the coil contactor
r1-r2-r3----r6 : is contactor 1 ----- contactor 6 .

i haven't tried anything yet i need to collect some infos first and a lot of solutions to try , so i will be glad if you guys can help me with this circuit .
but i have think about isolating the arduino power supply from the main supply using mobile adapter 5v , i have read that this is EMI/RFI problem across the contacts of the relays so RC snubber is a must but i'm confused about because the contacts of the relay should be isolated from the coil ?? i really do not know what to do next and i'm really confused .

What is the specs of the blower motor?
Is it fed from the same line as the arduino?
Can you shield your arduino from the blower? (Put it in a metal box).
Adds some 100 nF ceramic capacitors to your 1 uF capacitors.
Increase value of 1 uF capacitors according to recommended values...
Congratulations for a good schematic!

the module i'm trying to make will be installed in a control panel that has 3 Phase voltage it has 12 contactors each 2 will be energized when 1 relay is energized . i have a 1 0 1 selector that switch between automatic mode and manual mode , manual mode will turn on all the contactors , automatic mode will turn the temperature control module on ( supplying hilink with 220vac that supply the whole circuit) that will control the 12 contactors based on specific temperature a user will enter through potentiometer and i have designed a 3 d printed case for the module to hold the pcb and be ready to be installed in the control panel.


Right, you have to add filters to each switched load.

if everything fails then replace the relays by SSR, without mechanical contacts.

1 Like

Your board design is asking for trouble.
Keep 220V lines as short as possible.
Do not let them surround your micro controller.
Your micro controller is now inside a 1 winding coil...

So i should put the snubber across the base and emitter of the transistor or across the coil of the relay or across the coilof the contactor , i have seen a lot of connection and i'm confused

both

1 Like

Hi, @tareksh92
Welcome to the forum.

Can you please post jpg EXPORTED images of your PCB pattern?

It looks like you do not have the COM and NC pins of the on board relays as close as possible to the output terminals.

If the onboard relays are switching 220Vac, these tracks need to be as short as possible to keep switching noise, especially inductive coil noise, away from your low voltage control circuit.

It is usual practice to place relay output adjacent to their output terminals, and keep their tracks away from other other tracks.

You need bypass capacitors on your PCB close to the NANO pins, I would also suggest, 0.1uF caps from each U3 and U10 outputs to gnd.


The red circled tracks are your worst nightmare.
Not sure what signals flow on the green terminal strip, but 220Vac should have its own separate terminal pair and the COM NO connections of the relays.

Tom.. :grinning: :+1: :coffee: :australia:
PS. I suggest a new redesigned PCB, sorry.

1 Like

Do you really want to kill the outputs by capacitive load without current limitation?

I'd place the contactor pins on top, side by side with the relays and away from any signal lines, and with screw headers.

Do you realize you have only a 280Ω resistor, 12V relay coil and a reverse biased LED between +12V and the Arduino's 3.3V output?
Looks dangerous to me.
What is the wattage of the AC contactor coils?

1 Like

You are right :frowning:

The LED should be powered by the relay supply or, if possible, be lit by the opto coupler transistor or coil current.

2 Likes

And another thing I find wrong, when using a SPDT relay as a SPST, I always connect the load to the COM terminal and power to NO. When power is connected to COM and relay is OFF, there is power voltage on the NC terminal, just waiting for a wandering finger or ohmmeter (or ammeter) probe, a finger could get a hard shock, a meter could get a blown fuse or be destroyed.
Best to insulate unused terminals.

3 Likes

Nice Schematic!!! The control voltage should be isolated from the Mains power. Connecting grounds is not recommended. That can be a path for EMI. If it were me I would use solid state relays, they can be gotten for less than your relay and opto coupler circuit. Here is a picture of one:
image They can be purchased wit zero cross logic as well. Let us know how you do.

1 Like

What do you mean, 0.1uF on linear voltage regulators is basic practice.
Bypass on the 5V pin of the Nano.......... Not the output pins.

Tom.. :grinning: :+1: :coffee: :australia:

yes i have made a terrible mistake routing the 220vac around the whole board surrounding all my signal with the magnetic field of the 220vac i should have rerouting the 220vac to be close as possible to the T-blocks terminal .
as for the pins on the left they are for the lcd i2c connection 2 potentiometer and 2 selectors mounted on the front of the case of the module and connected through wires that are soldered in the pcb .
the terminals at the bottom are as follows :
1- 220vac
2 - N
3 - COM 220vac
4- contactor 1
5-contactor 2
6-contactor 3
.
.
.
9- contactor 6
10- 5v for dht11
11-signal for dht11
12- gnd for dht11

i have already put 1uf capacitor at the input and the output of u3 and u10 , u3 will then power u10 and the arduino and u10 will power the lcd and potentiometers the selectors and the dht11.
should i move the 1uf capacitor close to the vin of the arduino ?? or should i add another one close as possible to the vin ??

pardon my bad schematic i'm all new to this , but what do you suggest to make it better design ?? these leds are just indication that the contactor is on or off .

all i can find in the datasheet of the contactor that they are 220vac and
Inrush power in VA : 70 VA 60 Hz cos phi 0.75 (at 20 °C)
70 VA 50 Hz cos phi 0.75 (at 20 °C)

thx for the compliment actually this is my first design :slight_smile: i searched alot and came across that emi problem facing alot of people when trying to control any ac current using a relay and i was thinking maybe rc snubber circuit across the coil of each relay or rcd circuit but i'm not sure , alot of engineers suggest that using solid state relay will solve the problem and i was thinking to try it too m i'm collecting as much infos to get my components all at one time and start trying each solution one by one , so what do u think ??

Hi,

If you look in the Files tab, you should find EXPORT, this will let you make an image of your PCB that will be easy to see.

Tom... :grinning: :+1: :coffee: :australia:

1 Like