A simple flyback diode question

Discussion in 'General Electronics Chat' started by gte, Nov 14, 2014.

  1. gte

    Thread Starter Active Member

    Sep 18, 2009
    347
    4
    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?

    [​IMG]

    [​IMG]
     
  2. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,693
    2,765
    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.
     
  3. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    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.
     
    gte likes this.
  4. Papabravo

    Expert

    Feb 24, 2006
    10,179
    1,800
    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.
     
  5. ISB123

    Well-Known Member

    May 21, 2014
    1,239
    527
    [​IMG]
     
    gte likes this.
  6. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,693
    2,765
    This is fine if you like toasty diodes for breakfast...
     
  7. Papabravo

    Expert

    Feb 24, 2006
    10,179
    1,800
    Sorry, never had that experience, but I was thinking of high side switches. You are correct. ISB123's picture is correct
     
  8. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    Burnt diodes in the morning with coffee........NFW!
     
  9. gte

    Thread Starter Active Member

    Sep 18, 2009
    347
    4
    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)?
     
  10. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    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.
     
  11. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    I agree with Les. To be most effective, the diode should be directly between the ends of the relay coil, remote from the pcb.
     
  12. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,693
    2,765
    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?
     
  13. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    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.
     
  14. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    .... and also to the (non-linear) resistance presented by the diode when it becomes forward-biased.
     
  15. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    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.
     
  16. gte

    Thread Starter Active Member

    Sep 18, 2009
    347
    4
    Hi Crutschow,

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

    [​IMG]



     
  17. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    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.
     
    gte likes this.
  18. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    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.
     
    gte likes this.
  19. gte

    Thread Starter Active Member

    Sep 18, 2009
    347
    4
    So is my most recent diagram correct?
     
  20. ian field

    Distinguished Member

    Oct 27, 2012
    4,415
    784
    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.
     
Loading...