Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

220V relay with AT89C52

Status
Not open for further replies.

emmos

Member level 2
Joined
Dec 30, 2003
Messages
47
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,288
Activity points
472
at89c52


Hi everyone I am doing a system including a motor and I am using 220V AC relays and AY89C52 to control the system.

Everything was going fine until I connected the microcontroller circuit with the relays as when the relays are switched on or off they reset the microcontroller circiut.

What can I do to over come that.
 

microcontroller 220v relay board

How did you connected the RELAYS?? Did you OPTISOLATE with OPTCOUPLERS ...That's the only way to do it!
 

220v relay

Here is the solution 4 your problem:

The moment of "closing" and "openning" of the relay switch MUST be sincronized with zero crosing of the 220 AC Voltage!!!.

For example, if U switch ON the relay, when phase angle is 90 degree, a huge amont of curent will go into your relay causing a huge Electromagnetic Interference (EMI) with your circuits. This can also damage your trafo

Also if U switch OFF the relay, for example, when phase angle is 90 degree, the huge curent will be sudenly interupted.
From the Lentz low folow that a huge voltage wil be induced in your Trafo ,caled Back-ElectroMagnethic Field (Back-EMF), wich can damage your circuit!!!
A simple solution to block the Back-EMF is to use a DIODE in paralel with your trafo.

But again, if your Trafo has a big power (and it has, since you are driving a motor), the corect solution is to sincronize the ON and OFF time of the relay with the zero crossing of the 220 AC voltage!!!
 

how to make delay for 220v ac relay

Since you dont know the exact delay between the time you change the output pin of the microcontroller and the time the that contact actualy operates, you cant do a precise zero level crossing operation. This technique works well when using a triac and usally some isloators like MOC3041 have a built in zero cross detection.

When using relays, the AT89C51 is a very vulnerable processor. Here is what you can do.

1. Try to move the relays to another PCB.
2. Use some form of "snubber" circuit on the contacts of the relays. This may be an RC or a MOV.
3. Use opto-isolators between relay driving transistor and controller output.
4. Try using a different version of C51 controller, preferably without an ALE pin. Some newer version have a software ALE inhibit.
5. Try using a different package like PLCC44 is less suceptable to noise.
6. Properly decouple the controller with a short lead 0.1uf ceramic
7. Improve the PCB design to provide good power planes to controller.
 

at89c52 site:edaboard.com

Hi,
Probably you have a pcb with poor gnd connection, try to make a pcb with a ground plane if you use 4 layer pcb, or insert a gnd plane around signal traces for 2 layer pcb, and separate uC ground plane from relays ground plane, or better, put some optoisolators. Also, do not forget decoupling caps as close as possible to uC. 100nF for high transient voltage glitches and 10-100uF for lower frequencies decoupling. Also, if you use more than one relay, and you switch them on all at the same time, a serious glitch will appear on your power lines. This effect is known in high speed digital as "ground bounce". This can trigger your reset. Either make sure that you have a powerfull enough power supply (low internal resistance), or try to insert some delay between the switching moment of relays.
 

220v relay circuit

Hi there everyone. I need your help here. Well I am a uni student working on my final project design a trafic light controller. Iam using AT89C52. The problem is whenever I use the relay, the output of the control is not in order. Im using 8 relays.If i dont use the relay it just work normal. I know this cause by "back EMF". I had add diode. Can you guys please have look at my schematic diagram. Please help me. Thank you so much
 

at89c52 with relay

Hi endikus,

your schematic is OK as far as I can see.

You must use pullup resistors to +5V (4K7) at each output of your 89C52 which is driving the ULN.

The internal pullups of 8051 are too weak to fully switch on your ULN.

hope this helps, best regards
 

220 v 5v trigger relay

hi endikus

if the problem is with load connected to relays try to use varistors in parallel with the relay contact in order to avoid spark.

Hope this help.
 

220v 5 v relay using at89c52

Hi emmos,

If your target is to switch on/off a lamp use a MOC3041 (or any other optocoupler with internal
zero-crossing detector) combined with a TRIAC that can handle the lamps current/voltages.

-This way you do not need the relays eliminating the sparking contacts surrounding your logic circuits.

-Using optocoupler, the loads don´t share the common ground with the logic.

-Using TRIACS with line-synchronised trigger, you will get very low EMF emitions.

DURING DEVELOPMENT IT´S A MUST:
USE AN ISOLATED TRANSFORMER FOR SECURITY.


Hope this help,

humber555
 

microcontroller 220v switch without relay

pisoiu is right on the money. The source of the problem is the high transient coming in from the current switching. Even if you optically isolate the low level circuit, good grounding is still a MUST for such systems. The idea is to reduce the loop area since the magnetic field generated by a current carrying loop is directly proportional to the loop area. So, if the current loop created by the circuit which turns the relay on should be small AND the current loop on your board which has the load current should also be very small.

In addition, the grounding on your mail CPU section MUST also be good. That means, again, you should minimise the loop area on the signal lines (4 layer boards work very well here). This is because, again, the voltage generated in a loop in a varied magnetic field is also proportional to the area of the loop.

Zero level crossing detection is not necessary for relay outputs due to be unreliable knowledge of the actual contact switching time with respect to the time you turn the relay coil on. However, a snubber on the contact may help.

Best way to defend against such problems is to prevent the relay turning on from creating bad transients. In case it did, be sure that your circuit is not affected by it.

Ajay
 

relays 220

Why dealing with the "efects" trying to correct it with snubbers, decoupling capacitors and pcb lay-outs.
To solve this kind of problems you must eliminate or minimize the "cause".

humber555
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top