A simple flyback diode question

Thread Starter

gte

Joined Sep 18, 2009
357
I believe understand the concept of a flyback diode, I was wondering how I could use it in this particular situation.

I have a circuit board with a NPN transistor connected to the low side of a bosch 12v relay via a copper wire and the high side of the relay inductor is connected to 12v. I'd like to put a flyback diode on the pcb to protect the transistor against a voltage spike.

I tried using a 1n4001 and I thought connecting the anode to the transistor collector and connecting the cathode to Vcc was the correct way to do this (as pictured below, without the 1n4001 in place) but looking at it and testing it on the scope I'm still seeing ~100% increase in voltage when the mechanical connection is broken spiking inductance. Can anyone tell me what I'm doing incorrect?



 

joeyd999

Joined Jun 6, 2011
5,283
Your schematic is badly labeled. I cannot find Vcc anywhere, but I do see +12VDC. Is that it?

The diode must be wired in parallel to the coil, with the cathode connected to the +12VDC side.

The diode must be able to withstand the peak current seen by the coil at the moment the transistor is turned off.
 

Lestraveled

Joined May 19, 2014
1,946
The diode should be connected in parallel with the coil of the relay. The cathode should be connected to the positive side of the coil.
 

Papabravo

Joined Feb 24, 2006
21,225
Have I missed something? I would connect the cathode to the collector of the transistor and the anode to +12VDC. The positive spike which occurs when the switch opened is returned to +12VDC.
 

Thread Starter

gte

Joined Sep 18, 2009
357
Thank you for the replies. Yes 12v is Vcc.

Is there a way to protect the transistor, as it is connected directly to the low side of the coil, without also having to supply the 12v directly from the pcb? Can the diode's cathode be connected to a path to Vcc (since they share the same power supply and ground) on the pcb or does it have to be as close as possible to the other side of the relays coil (meaning the pcb would have to supply 12v to the non transistor side of the coil)?
 

Lestraveled

Joined May 19, 2014
1,946
......Can the diode's cathode be connected to a path to Vcc (since they share the same power supply and ground) on the pcb or does it have to be as close as possible to the other side of the relays coil (meaning the pcb would have to supply 12v to the non transistor side of the coil)?
That is a "less than optimal" configuration. Most often the "kick back" diodes are connected directly across the coil terminals, if the relay is mounted off of the PCB. View this "kick back" pulse as something you want to control, as in, keep away from the other parts of the circuit.
 

MikeML

Joined Oct 2, 2009
5,444
I agree with Les. To be most effective, the diode should be directly between the ends of the relay coil, remote from the pcb.
 

joeyd999

Joined Jun 6, 2011
5,283
Thank you for the replies. Yes 12v is Vcc.

Is there a way to protect the transistor, as it is connected directly to the low side of the coil, without also having to supply the 12v directly from the pcb? Can the diode's cathode be connected to a path to Vcc (since they share the same power supply and ground) on the pcb or does it have to be as close as possible to the other side of the relays coil (meaning the pcb would have to supply 12v to the non transistor side of the coil)?
The diode must be parallel to the coil, regardless what the physical topography looks like. The coil current, upon turn-off, will circulate through the diode and back to the coil.

Why not just mount the diode to the coil?
 

crutschow

Joined Mar 14, 2008
34,420
If you want to suppress the effects of stray inductance of the leads as well as the relay inductance then connecting the anode directly to the transistor collector and the cathode back to the supply is the preferred way. The idea is not to abruptly stop any of the current going through the coil and the leads, allowing the diode to carry the complete loop current when the transistor switches off.

The spike you see in the oscilloscope trace may be due to this stray inductance.
 

Lestraveled

Joined May 19, 2014
1,946
crutschow
I get your concept that putting the diode between collector and Vcc deals with both coil and lead inductance, but I think the more important issue is, the path that the energy stored in the coil of the relay takes, when discharged. Since the coil is charged up at 12 volts and is discharged across a very low resistance, a lot of pulse current will be generated when the field collapses. I want to control where that discharge current goes, so that voltage spike are not induced on a line that other components are connected to. Putting the diode directly at the coil terminals accomplishes this. So, in other words, if I had one diode to deal with both lead inductance and coil kick back, I would use it to control kick back because I see that as a far worse issue than lead inductance. Anyway, that's my two cents.
 

Thread Starter

gte

Joined Sep 18, 2009
357
Hi Crutschow,

Thanks for the reply. Is my understanding of what you've described, correct?





If you want to suppress the effects of stray inductance of the leads as well as the relay inductance then connecting the anode directly to the transistor collector and the cathode back to the supply is the preferred way. The idea is not to abruptly stop any of the current going through the coil and the leads, allowing the diode to carry the complete loop current when the transistor switches off.

The spike you see in the oscilloscope trace may be due to this stray inductance.
 

crutschow

Joined Mar 14, 2008
34,420
crutschow
I get your concept that putting the diode between collector and Vcc deals with both coil and lead inductance, but I think the more important issue is, the path that the energy stored in the coil of the relay takes, when discharged. Since the coil is charged up at 12 volts and is discharged across a very low resistance, a lot of pulse current will be generated when the field collapses. I want to control where that discharge current goes, so that voltage spike are not induced on a line that other components are connected to. Putting the diode directly at the coil terminals accomplishes this. So, in other words, if I had one diode to deal with both lead inductance and coil kick back, I would use it to control kick back because I see that as a far worse issue than lead inductance. Anyway, that's my two cents.
The pulse current can be no greater than the coil current so I'm not sure what you mean by "a lot of pulse current"?
Suppressing the effect of the lead inductance can be important for long leads and higher currents. Of course it's less so for smaller relay coil current if the relay is close to the transistor.
 

Lestraveled

Joined May 19, 2014
1,946
The pulse current can be no greater than the coil current so I'm not sure what you mean by "a lot of pulse current"?
I set up an experiment and you are right. The pulse current was less than the relay energizing current. For some reason I had it in my head that the kick back current was significantly larger than the energizing current.

I stand corrected.
 

ian field

Joined Oct 27, 2012
6,536
I believe understand the concept of a flyback diode, I was wondering how I could use it in this particular situation.

I have a circuit board with a NPN transistor connected to the low side of a bosch 12v relay via a copper wire and the high side of the relay inductor is connected to 12v. I'd like to put a flyback diode on the pcb to protect the transistor against a voltage spike.

I tried using a 1n4001 and I thought connecting the anode to the transistor collector and connecting the cathode to Vcc was the correct way to do this (as pictured below, without the 1n4001 in place) but looking at it and testing it on the scope I'm still seeing ~100% increase in voltage when the mechanical connection is broken spiking inductance. Can anyone tell me what I'm doing incorrect?
There is a Tyco relay appnote that fills in a lot of the blanks, its getting harder to find - but I think its on the Element14 website somewhere.
 

Attachments

Top