Issues with my circuit design.

strantor

Joined Oct 3, 2010
6,798
The diode keeps the current flowing (into the power supply) so that the inductance can discharge slowly.
Without the diode then the inductance creates a rapidly reducing discharge current. The rapid change of current causes the inductance to try to generate a voltage high enough to keep the discharging current flowing slowly. The high voltage is created when the rapid change in the magnetic force cuts across the windings of the coil making a generator.
That's different than what I learned. I read that the purpose of a flyback diode (in addition to preventing arcing across switch and relay contacts) is to prevent negative potential getting back to the power supply. I agree that the coil becomes a generator, but it generates an opposing voltage to that which was applied to it previously, which forward biases the diode, basically shorting out this new generator in the circuit and discharging it's stored energy very rapidly.
 

praondevou

Joined Jul 9, 2011
2,942
That's different than what I learned. I read that the purpose of a flyback diode (in addition to preventing arcing across switch and relay contacts) is to prevent negative potential getting back to the power supply. I agree that the coil becomes a generator, but it generates an opposing voltage to that which was applied to it previously, which forward biases the diode, basically shorting out this new generator in the circuit and discharging it's stored energy very rapidly.
The basics are clear for everyone (a voltage spike is generated) but when it gets into the details or you put everything in another context, things become confusing sometimes. I got confused myself.
First, the purpose of the flyback diode on the coil of a relay is to protect the open switch, in this case the bc549 transistor from overvoltage. In the case described here, when the transistor opens, the negative pole of the inductor is clamped to the positive of the power supply and the positive pole is on the collector of the transistor. This is why the voltage on the collector rises (because it's open).

I don't think a power supply would care too much about a short negative or positive pulse coming back from anywhere. This is how in a Mosfet fullbridge with the Fets having bodydiodes, energy is transfered back to the DC-Capacitors, even though it's not a negative spike...

I was confused about the current in the diode. As Audioguru explained it never goes above the current that was flowing in the relay before turning it off.
However, with diode it takes MORE time for the magnetic field to collapse then without it.

THIS guy explains the whole voltage spike/back EMF issue quite well. I also found the two following pdfs that are worth reading and where you can learn that a simple diode isn't always the best choice to suppress the voltage spike.

http://relays.te.com/appnotes/app_pdfs/13c3311.pdf
http://relays.te.com/appnotes/app_pdfs/13c3264.pdf
 

Audioguru

Joined Dec 20, 2007
11,248
That's different than what I learned. I read that the purpose of a flyback diode (in addition to preventing arcing across switch and relay contacts) is to prevent negative potential getting back to the power supply. I agree that the coil becomes a generator, but it generates an opposing voltage to that which was applied to it previously, which forward biases the diode, basically shorting out this new generator in the circuit and discharging it's stored energy very rapidly.
In this circuit, the voltage spike is positive not negative. Since it is positive then the diode clamps it because it becomes forward-biased then puts the inductor's current into the power supply.
 
Last edited:

strantor

Joined Oct 3, 2010
6,798
The basics are clear for everyone (a voltage spike is generated) but when it gets into the details or you put everything in another context, things become confusing sometimes. I got confused myself.
First, the purpose of the flyback diode on the coil of a relay is to protect the open switch, in this case the bc549 transistor from overvoltage. In the case described here, when the transistor opens, the negative pole of the inductor is clamped to the positive of the power supply and the positive pole is on the collector of the transistor. This is why the voltage on the collector rises (because it's open).

I don't think a power supply would care too much about a short negative or positive pulse coming back from anywhere. This is how in a Mosfet fullbridge with the Fets having bodydiodes, energy is transfered back to the DC-Capacitors, even though it's not a negative spike...

I was confused about the current in the diode. As Audioguru explained it never goes above the current that was flowing in the relay before turning it off.
However, with diode it takes MORE time for the magnetic field to collapse then without it.

THIS guy explains the whole voltage spike/back EMF issue quite well. I also found the two following pdfs that are worth reading and where you can learn that a simple diode isn't always the best choice to suppress the voltage spike.

http://relays.te.com/appnotes/app_pdfs/13c3311.pdf
http://relays.te.com/appnotes/app_pdfs/13c3264.pdf
yes the graph in your last reference confirms AG's statement about the current never going higher than coil current. I less confused about the current in the diode and was more confused about the function of it.

The link to the discussion about inductive spike vs. back EMF was enlightening. Apparently whoever wrote the wikipedia article on flyback diodes is still using the back EMF term.

In this circuit, the voltage spike is positive not negative. Since it is positive then the diode clamps it because it becomes forward-biased then puts the inductor's current into the power supply.
Ok, so are you saying that after the transistor opens, the voltage on the collector of the transistor (coming from the inductive spike) is positive with respect to the emitter (ground)? If so, I agree, I just have been led to believe that the positive voltage at that point does not go back to the power supply, rather it just goes back to the other side of the inductor and that's all.

see this excerpt from wikipedia:

A flyback diode solves this starvation-arc problem by allowing the inductor to draw current from itself (thus, "flyback") in a continuous loop until the energy is dissipated through loses in the wire and across the diode (Figure 3). When the switch is closed the diode is reverse biased against the power supply and doesn't exist in the circuit for practical purposes. However, when the switch is opened, the diode becomes forward biased relative to the inductor (instead of the power supply as before), allowing it to conduct current in a circular loop from the positive potential at the bottom of the inductor to the negative potential at the top (assuming the power supply was supplying positive voltage at the top of the inductor prior to the switch being opened). The voltage across the inductor will merely be a function of the forward voltage drop of the flyback diode, and the distance between the diode and the inductor (according to National Instruments, the flyback diode should be no greater than 18 inches from the inductor). Total time for dissipation can vary, but it will usually last for a few milliseconds.
 

SgtWookie

Joined Jul 17, 2007
22,230
Actually, the collapsing magnetic field around the coil keeps the current flowing through the inductor, and the diode provides a path for that current. If there is no path for the current, and the transistor turn-off time is very short, the current will make a path for itself through whatever is available. This usually has a destructive effect on wherever the path leads if the part is not designed for it.

If you want the current flow from the coil to stop a lot more rapidly, you could use a resistor in series with the diode. Subtract the Vf of the diode from the supply voltage, and divide that result by the coil current when it's energized to get the appropriate resistance.
 

Arius007

Joined Sep 2, 2011
14
Here's my 2 cents worth.

During switch-off the coil becomes the source.
Assume for a moment that the diode has some delay before reacting to the transient spike and conducting. During this period, the path for the current is via the transistor and through the 12vdc supply, only limited by whatever resistance it encounters on this path. I'm going to suggest that the circuit design has done nothing to limit the current through the transistor during this time and that by inserting a suitable resistor between the transistor and relay coil, it would have no adverse effect on the normal operation, but would serve to limit the current as a result of the spike.
 

praondevou

Joined Jul 9, 2011
2,942
This thread has become so loooong that the OP will have a hard time to find the necessary information.:p

@Jemson .. In short: First try to use a faster diode like the ones AG and SGT suggested, 1N914 or 1N4148.
 

Thread Starter

Jemson

Joined Sep 1, 2011
10
Hi All,

Thanks for all the replies! I did not expect to get so many so quickly!
I understand what you are saying about the 1N4004 being to slow, and am happy to get some 1N914 or 1N4148, the only question I have around them is; Is the peak voltage (75V) going to be high enough? The 1N4004 was obviously 400V, so I just would like to clarify if possible.

Thanks again to all for your help, I really appreciate it.
 

R!f@@

Joined Apr 2, 2009
9,918
Well !! I'll be a monkey's uncle. Pish posh
Heck ....It should work fine.
OP should measure the current via the relay after applying 12V to confirm that it does not go above the Tr Ic ratings.
I bet he got the specs wrong.

And if not, why not use a BC639 instead, this has always worked for me. and a 1N4007 diode never fails to protect a transistor u know. Atleast I never had any trouble using the said components
 

Audioguru

Joined Dec 20, 2007
11,248
Your supply voltage is only 12V. The voltage rating of the diode must be a little more than 12V.
The voltage rating of a 1N914 or 1N4148 is 75V or 100V which is plenty.
 

Thread Starter

Jemson

Joined Sep 1, 2011
10
For some reason I thought the voltage created by the relay when the field collapsed could have been substantially higher than the input voltage, but maybe I've confused myself somewhere along the way, and its the current that can spike substantially higher than the input current?

Anyway, I will get some 1N4148s as suggested and start there to see it it fixes the issue.
Thanks again.
 

strantor

Joined Oct 3, 2010
6,798
For some reason I thought the voltage created by the relay when the field collapsed could have been substantially higher than the input voltage, but maybe I've confused myself somewhere along the way, and its the current that can spike substantially higher than the input current?

Anyway, I will get some 1N4148s as suggested and start there to see it it fixes the issue.
Thanks again.
The reason the voltage goes really high without the diode is because the inductor (relay coil) attempts to keep the current constant. when the transistor opens, the resistance goes way up, into the megohms (i think). according to ohms law, if the resistance goes way up, the voltage must also go way up in order to keep the current the same. When you put the diode in there, current has a new low resistance path and so the voltage does not spike.
 

Thread Starter

Jemson

Joined Sep 1, 2011
10
The reason the voltage goes really high without the diode is because the inductor (relay coil) attempts to keep the current constant. when the transistor opens, the resistance goes way up, into the megohms (i think). according to ohms law, if the resistance goes way up, the voltage must also go way up in order to keep the current the same. When you put the diode in there, current has a new low resistance path and so the voltage does not spike.
Gotcha! So the high spike only exists without the diode, which is where I probably got confused. Thanks for clearing that up!
 

SgtWookie

Joined Jul 17, 2007
22,230
IF the diode is not present (or turns on very slowly), the reverse voltage caused by the field collapse can be very high.

The diode provides a current path so that the reverse voltage doesn't exceed the Vf of the diode, once the diode starts conducting.
 

Pencil

Joined Dec 8, 2009
272
The circuit works, but the transistors keeps burning out on the board. Once I replace it, it is ok for a short while then dies again
What is "a short while"?

Can you give part number of relay?

Does the relay have the "protection diode" included internally?

If it is of the type that includes this diode, and the coil was hooked up
with wrong polarity, this would fry the transistor, basically shorting
+12v to ground when transistor turned on.


Another thought, check the Vol (LOW level voltage a.k.a voltage when off)
of the uC output pin. The Vol may be high enough to keep transistor turned
partially on when it should be off. This condition should be alleviated with the addition
of a "pulldown resistor" (probably 10k should do it) from base of transistor to ground.

Just a guess.
 
Last edited:

Thread Starter

Jemson

Joined Sep 1, 2011
10
What is "a short while"?

Can you give part number of relay?

Does the relay have the "protection diode" included internally?

If it is of the type that includes this diode, and the coil was hooked up
with wrong polarity, this would fry the transistor, basically shorting
+12v to ground when transistor turned on.


Another thought, check the Vol (LOW level voltage a.k.a voltage when off)
of the uC output pin. The Vol may be high enough to keep transistor turned
partially on when it should be off. This condition should be alleviated with the addition
of a "pulldown resistor" (probably 10k should do it) from base of transistor to ground.

Just a guess.
Relay is an FRS6-1.

"A short while" can vary. It might be a day or a week, I don't notice it instantly as it is just turning on/off a fan.

I'm not sure about an internal protection diode, but I don't think so, Ican't see anything on the spec sheet anyway.

The Voltage on the uC is 0v in the off state.
When the uC pin is in the off state the relay is not engaged, so I think this may rule out the second theory you have?

I have put the new resistor in and will monitor over the week and see how it goes. If it does fail, I can probably check the voltages etc on each side of the diode, relay etc and advise.
 

Audioguru

Joined Dec 20, 2007
11,248
Try it.
Hold the relay coil terminals in one hand (not two hands because you don't want the voltage spike to go through your heart) and connect the battery. When the battery is disconnected then you will feel a few hundred volts in your hand.
 
I think you can try out using a base resistor value of more than 1.2K ohm to some where between 7K ohm to 10K ohm. This will reduce the base current of the transistor and subsequently the collector current as well. This value should also be enough to supply the 30mA max current as required by the transistor. other parts in the circuit looks okay to me.
 

Pencil

Joined Dec 8, 2009
272
Relay is an FRS6-1.
The Voltage on the uC is 0v in the off state.
When the uC pin is in the off state the relay is not engaged, so I think this may rule out the second theory you have?
That relay doesn't appear to have a built in protection diode.

Verify the voltage of the uC pin when it is off by checking it for
yourself. We are talking about probably less than 1 volt. This
may be enough to turn transistor on just enough to allow some
current to flow through transistor, but not enough to actually
turn on the relay. A quick check would be to check temperature
of the transistor after the relay has been off for a while, it should
not be warm or hot to touch.

On the opposite end of the spectrum, the output of the uC pin
may not be the full 5 volts you think it is. This would mean a
base resistor of a lesser value would be required to assure the
transistor was turned on fully, otherwise, with the transistor only
partially on, heat would cause the transistor to fail over time.
Verify the voltage of the uC pin when it is on. A quick check
would be to check temperature of transistor when relay is on,
it should not be warm or hot to touch.


Which uC are you using? A check of the datasheet would be
a clue to what the range of Voh and Vol of that particular device.

Also, don't rule out wiring errors. An accidental short in the wrong
place (example: small solder bridge between pins) can be very
frustrating to troubleshoot.

I may be barking up the wrong tree, but trying to cover all bases.
 
Top