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.

Relay Driver Circuit

Status
Not open for further replies.

gauravkothari23

Advanced Member level 2
Joined
Mar 21, 2015
Messages
640
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,298
Activity points
6,922
Hi all.
I need to build a relay driver circuit which i can control using my 8051 microcontroller. In my existing circuit i am using NPN Transistor to drive the relay. but the problem here is when i turn the relay ON and OFF continuously with a delay of approx 2 seconds, sometimes the system gets hanged. i have even added a diode to relay coil, but then too i am facing the problem. I am driving 220V AC load using relays.
My only source to power the microcontroller and relay is 5V SMPS. i am powering the microcontroller and SMPS using the same 5V SMPS. is this the problem, if so, can i add two diodes at output of SMPS and differenciate the 5V for both microcontroller and relay.
 

If microcontroller gets hung, voltage spikes could be the culprit; use bypass capacitors generously and make sure your 5V supply has decent filter capacitors. Is your relay takes too much current? What is the DC resistance of the relay coil?
 

Hi the system hanged because of back emf generated from rely coil. You should use a diode across the coil to short circuit back emf to coil itself
Hope you connected small ceramic capacitor near micro controller VCC pin to ground

Relay-schematic.png
 

Hi,

No, the problem is EMI and EMC.
Switching a relay and maybe the relay switching the load causes EMI.
EMI may be transmitted per wire (any electrical connection), but in many cases it is transmitted via air.
If transmitted via air, then separating the power supplies will not solve the problem.

Reducing EMI: use filters on the switched AC signal, use twisted pair wiring (at least wire the power and it's return path in close proximity). This starts with the traces on the PCB.
Reduce switching speed of the bjt driving the relay coil.

EMC.
If the system hangs, then the system is prone to noisy (EMI) signals.
Usually this is caused by a bad PCB layout, sometimes by a wrong schematic.
Learn how to generate a good PCB layout, this usually starts with a rock solid GND plane. No copper puor, no traces in the GND plane.
The next are fast ceramics capacitor at each power supply pin of each IC (and other fast switching parts of the curcuit).
Start thinking that the signals at the traces are HF, which means the traces are antennas for sending out noise as well as antennas receiving noise.
Start thinking that signals are not from "A" to "B", but always think as a loop. Each signal needs it's return path.
--> traces should be short. The area enclosed by a loop needs to be small.

Mind:
For sure you need to reduce sending out EMI noise...
But in your case it's more important to "stabilize" the function of your microcontroller.
Imagine: Maybe you find it more easy to reduce sent out EMI by installing a filter in the AC lines (switched by the relays) ... and this stops your system to hang. (And you think you are safe now)
But the (microcontroller) system still is sensitive to EMI, then any other source of EMI (cellular phone, remote car key, induction oven, microwave oven...) can make your system to hang.

Klaus
 

If microcontroller gets hung, voltage spikes could be the culprit; use bypass capacitors generously and make sure your 5V supply has decent filter capacitors. Is your relay takes too much current? What is the DC resistance of the relay coil?

Yes, exactly.. voltage spikes is creating an issue for my controller. i have used approx 2200uF capacitor at output of SMPS. than too i am facing the issue.
That's why i asked if i can use use two diodes at output of SMPS and differentiate the 5V supply for both controller and Relay. One diode after SMPS will power the controller and other diode after SMPS will power the relay. will this solve my problem
 

Hi,

Yes, exactly.. voltage spikes is creating an issue for my controller. i have used approx 2200uF capacitor at output of SMPS. than too i am facing the issue.
That's why i asked if i can use use two diodes at output of SMPS and differentiate the 5V supply for both controller and Relay. One diode after SMPS will power the controller and other diode after SMPS will power the relay. will this solve my problem

It is expectable that a big 2200uF capacitor does not solve the problem, because they are too slow, the noise is too high in frequency and most probably it's not noise on VCC that causes the "hang".

Maybe the diodes make the circuit to work (temporarily) by accident. But it will not solve the root problem.

Klaus
 

Hi,



It is expectable that a big 2200uF capacitor does not solve the problem, because they are too slow, the noise is too high in frequency and most probably it's not noise on VCC that causes the "hang".

Maybe the diodes make the circuit to work (temporarily) by accident. But it will not solve the root problem.

Klaus

Should i use high frequency ceramic capacitors across 5V and GND. and also can i add a snubber circuit across 220V AC Load.
 

Hi,

did you read post#4?

Klaus
 

The source of voltage transients upsetting the microcontroller is arcing at the 230 V relays contacts. A first step could be connecting MOV voltage suppressors across the load or RC snubbers across the contacts. Suggested bypassing of microcontroller supply with capacitors (e.g. 100 nF ceramic caps) is the other useful measure, but it's only effective with suitable PCB layout. Separation of relays and processor supply could be useless at all.
 

Should i use high frequency ceramic capacitors across 5V and GND. and also can i add a snubber circuit across 220V AC Load.

You can use VARISTOR across your switched AC signal alternatively (instead of snubber circuit).
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top