arduino Controlling Circuit Hangs when controlling 230v ac fan using a relay

Thread Starter

Patel Jyotin

Joined Aug 22, 2016
9
hi.......
i have made a circuit for controlling home appliances like light fan etc.
when i control lightning load arduino works fine but when control fan or operate fan after two or three time operation it hangs/freeze the arduino.
i m using atmega 328 ic, uln2003, 12v relay for controlling 230v ac load.
i have attached the PCB Diagram with thread.
 

Attachments

Papabravo

Joined Feb 24, 2006
21,159
The sheets of a layout is not much to go on for a problem that may involve you application code. How about a schematic diagram and the code for your sketch.
 

Thread Starter

Patel Jyotin

Joined Aug 22, 2016
9
Yep, need that schematic.

What is your plan to suppress the relay kickback?
i dont have any plan for that i will send you my schematic and circuit diagram.
actually i m controlling fan speed by triac firing i have used zero cross detector.
for triac firing i m using moc3021 optocoupler.
my problem is when i on and fan rapidly microcontroller got freeze.
 
You probbably have a software algortithm issue if you can control lighting and not motors.

The triac turns off at both zero voltage AND zero current AND they don;t occur at the same time for motor loads.

If speed is proportional to V, the the first is to map phase angle with the RMS of V.

The second is to constantly PULSE the triac and turn off the pulses when the time is up and control only a half cycle.

You CAN'T just wait for a zero crossing, wait and turn the triac on. Won't work for motors. It will work for lighting.

Aside: If your doing heating, it best to use phase angle vs the RMS of V^2.

Understand the design of the zero cross detector. It can be important.
 

Thread Starter

Patel Jyotin

Joined Aug 22, 2016
9
You probbably have a software algortithm issue if you can control lighting and not motors.

The triac turns off at both zero voltage AND zero current AND they don;t occur at the same time for motor loads.

If speed is proportional to V, the the first is to map phase angle with the RMS of V.

The second is to constantly PULSE the triac and turn off the pulses when the time is up and control only a half cycle.

You CAN'T just wait for a zero crossing, wait and turn the triac on. Won't work for motors. It will work for lighting.

Aside: If your doing heating, it best to use phase angle vs the RMS of V^2.

Understand the design of the zero cross detector. It can be important.
do you have any suggestion for changes in schematic.
 

Thread Starter

Patel Jyotin

Joined Aug 22, 2016
9
by putting 0.1uf capacitor near to microcontroller solved my problem somewhat but problem not solved completely. any other suggestions by experts needed.
 

ErnieM

Joined Apr 24, 2011
8,377
Add lots more 0.1 uf caps across the board. One at every device as close as you can.

Can't tell what C2 is, should be a nice tantalum cap say 10 uf, PLUS a 0.1 too.
 
Top