Shop OBEX P1 Docs P2 Docs Learn Events
Controlling ground for unknown specs on many automotive relays / coils? — Parallax Forums

Controlling ground for unknown specs on many automotive relays / coils?

eagletalontimeagletalontim Posts: 1,399
edited 2013-10-24 04:18 in Propeller 1
I would like to be able to control basically any standard 12V automotive relay using the prop, but before I put more pads on my circuit board, I would like to know I have the design correct. I have chosen this NPN transistor : http://www.digikey.com/product-detail/en/PN2222ATF/PN2222ATFCT-ND/3504402 The NPN will simply supply the "ground" connection for any 12V automotive relay that is connected to it. From what I have read, putting a 220 ohm resistor between the prop pin and the base of the NPN will be sufficient enough to drive the base with enough current to prevent any heat. I am still learning the DC current gain spec and am trying to understand how to use it to calculate resistor values. Could someone maybe pitch in and help me understand this better? Is the 220 ohm resistor sufficient enough to drive the transistor for what I am needing with the output of the prop pin? Also, I have no way of ensuring a fly-back diode would be used on the relay or solenoid so I don't have a way to protect the transistor. Maybe I need to use something other than a transistor?

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2013-10-21 20:10
    I would think most standard automotive relays are going to be greater than 1 Amp which is the maximum rating for that transistor. As a general rule of thumb I try to rate the transistor that has the capability to drive at least 2 times what my requirements are. As far as the fly-back diode, you can place it directly across the E-C junction of the transistor with the Anode going to the Emitter and the Cathode going toward the Collector.
  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-10-21 20:10
    Consider an N-channel FET; you don't need any real current from the IO pin and many come in small packages that can switch a lot of current. I'm using the SI2312CDS in a design; it comes in a SOT-23 package and is spec'd for 6A. I would always use a fly-back diode in the circuit, especially in an automotive environment (long wires, lots of noise).
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-10-21 20:25
    Hmm, not messed with an FET before. Would that connect directly with the Prop pin and I would just pull it LOW to fully turn on the FET? I am researching those now.. Maybe I will actually learn something :)
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-10-21 20:47
    Ok, I had that wrong! The N channel FET is controlled similar to the NPN transistor, but requires a threshold voltage(?) to be met to turn on. With the SI2312CDS, the threshold voltage is 1V at max. So feeding the prop pin directly to the gate is more than enough voltage, but to prevent the prop pin from being "maxed out", I would need to put in a current limiting resistor. Also, a resistor would be recommended from the gate to ground to prevent the gate from "floating". Here we go again with the math! How would I calculate the resistors needed to drive the FET properly?
  • RaymanRayman Posts: 14,662
    edited 2013-10-22 02:54
    The ULN2803 is another way to go. It's a darlington array meant to drive relays... Each of the 8 outputs is 1/2 amp and you can combine them for higher current. And, many inputs can be fed from one Propeller pin. It has a protection diode built in.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-10-22 03:34
    Ok, I had that wrong! The N channel FET is controlled similar to the NPN transistor, but requires a threshold voltage(?) to be met to turn on. With the SI2312CDS, the threshold voltage is 1V at max. So feeding the prop pin directly to the gate is more than enough voltage, but to prevent the prop pin from being "maxed out", I would need to put in a current limiting resistor. Also, a resistor would be recommended from the gate to ground to prevent the gate from "floating". Here we go again with the math! How would I calculate the resistors needed to drive the FET properly?
    Don't put too much stock in that "threshold" figure in the datasheet because that's the threshold when the device just starts to conduct. However in this case it does mean at 3.3V drive that it will turn on fully as it seems to be mostly on at 2V according to the "On-Resistance vs. Gate-to-Source Voltage" graph which is one of those that you should always check. You don't really need a current limit resistor to drive the gate though although any old pull-down resistor is advisable (try 10K but almost any value will work).

    @Jon - nice part
  • pmrobertpmrobert Posts: 675
    edited 2013-10-22 08:35
    I have used 2222s with standard Bosch coils hundreds of times without any trouble. The protection diode is essential and I use 10K on the base. All the Bosch style relays I've experienced have always had 80-90 ohm coils in them so max current is always under 200ma even in worst case (80 ohm w/ 14.8v =185ma).
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-10-22 13:54
    pmrobert wrote: »
    I have used 2222s with standard Bosch coils hundreds of times without any trouble. The protection diode is essential and I use 10K on the base. All the Bosch style relays I've experienced have always had 80-90 ohm coils in them so max current is always under 200ma even in worst case (80 ohm w/ 14.8v =185ma).

    The trouble is that the OP asked that it drive "basically any standard 12V automotive relay" and normally an NPN like the 2N2222 along with a diode would do. Did you say you used 10K in the base of that? How would that drive it into guaranteed saturation? You would need at least a 1K or less.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-10-22 16:04
    Hi eagletalontim;

    MOSFET drivers are far superior relay drivers in almost every way.
    PropRelayDriver01.png

    STD50NH02L-1
    RFD14N05L
    IRF3708L
    SiHLU014
    These MOSFETs all come in small TO-151 or TO-262 packages. Not much bigger than the TO-92 package of the PN2222. Yet are capable of driving mush more current.
    Read this to mean they hardly get warm.

    Take a look at all the parts I list at:
    N-Chanel MOSFETS

    Duane J
    469 x 372 - 8K
  • pmrobertpmrobert Posts: 675
    edited 2013-10-22 16:15
    The trouble is that the OP asked that it drive "basically any standard 12V automotive relay" and normally an NPN like the 2N2222 along with a diode would do. Did you say you used 10K in the base of that? How would that drive it into guaranteed saturation? You would need at least a 1K or less.
    Peter, I left out a word or two - where I said "standard Bosch coils" I meant the coil in a standard Bosch style auto relay. I also meant 1K (1000 ohms) as well. I need to stop using my phone when concise statements are needed. Thank you for the corrections!
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-10-22 16:17
    Hi Beau;
    As far as the fly-back diode, you can place it directly across the E-C junction of the transistor with the Anode going to the Emitter and the Cathode going toward the Collector.
    Ya, you can connect the diode across the transistor but it's NOT a fly-back diode. Current would never flow through it.

    A fly-back diode is connected across the inductive load, a relay in this case. The Cathode, banded end, is connected to the positive side of the relay and the Anode to the Collector of an NPN transistor or Drain of an N-Channel MOSFET driver.

    Duane J
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-10-22 17:29
    pmrobert wrote: »
    Peter, I left out a word or two - where I said "standard Bosch coils" I meant the coil in a standard Bosch style auto relay. I also meant 1K (1000 ohms) as well. I need to stop using my phone when concise statements are needed. Thank you for the corrections!
    I know that every time I post a comment I increase the chances of making mistakes. Solution? don't post comments :) So you see this is where we are at and I was thinking that maybe you did a typo and meant 1K anyway as there is no way 10K will cut it and you have had them working.

    As for MOSFETs I have been using fairly rugged dual devices in a single 8-pin pack for about the same price as the tiny SOT-23 devices (which are still good).

    About the "fly-back" or or freewheeling diode, I suppose it's a term we use for any diode that's used to "catch" the energy from a collapsing EM field. A fly-back diode across a relay's coil will slow down release times as current continues to flow which is why the other approach is to let the induced voltage rise and be clamped as is the case when using MOSFETs and their body diode which acts like a Zener. So the body diode is across the "collector-emitter" if you like (drain-source) and performs the same action except the induced voltage is clamped rather than completely "shorted'. Well, that's my simple explanation anyway.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-10-22 18:46
    Hi Peter;
    About the "fly-back" or or freewheeling diode, I suppose it's a term we use for any diode that's used to "catch" the energy from a collapsing EM field. A fly-back diode across a relay's coil will slow down release times as current continues to flow
    True. A conventional diode, 0.7V or so, does slow down the release of a relay.
    A conventional diode is simple to use, especially for relays which don't need to be switched rapidly as in automotive applications.
    which is why the other approach is to let the induced voltage rise and be clamped
    Agreed. As with a zener & diode clamping circuit across the coil.
    as is the case when using MOSFETs and their body diode which acts like a Zener. So the body diode is across the "collector-emitter" if you like (drain-source) and performs the same action except the induced voltage is clamped rather than completely "shorted'. Well, that's my simple explanation anyway.
    Yes, but using the zener that's across the drain-source in some MOSFETs is generally bad practice unless extensive testing is done to prove the reliability.

    There are some MOSFETs that are designed to do this, but the spec sheet clearly states this capability. Normal MOSFETs should not be used for this.
    And bipolar transistors which usually don't have a zener can be damaged when run in avalanch mode. Just don't do it.

    Duane J
  • Mark_TMark_T Posts: 1,981
    edited 2013-10-23 10:03
    Don't put too much stock in that "threshold" figure in the datasheet because that's the threshold when the device just starts to conduct. However in this case it does mean at 3.3V drive that it will turn on fully as it seems to be mostly on at 2V according to the "On-Resistance vs. Gate-to-Source Voltage" graph which is one of those that you should always check. You don't really need a current limit resistor to drive the gate though although any old pull-down resistor is advisable (try 10K but almost any value will work).

    @Jon - nice part

    I would say don't put much stock in the Rds(on) v Vgs graph, since this is a graph of a "typical" device - there are
    no guarantees (on-voltages vary a lot in FETs from part to part and batch to batch). Go always by the Vgs value
    quoted in the Rds(on) spec, and use the maximum Rds(on) quoted, this is what is guaranteed for all devices
    across all temperatures and allows for aging...

    And as for Vthr, you pretty much ignore this in a switching application, so long as its positive!

    Oh, yes, if you want a more capable bipolar switching transistor than the ancient 2222, look at the
    specs of the ZTX851, far better at high current and much much lower Vsat.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-10-23 15:26
    Mark_T wrote: »
    I would say don't put much stock in the Rds(on) v Vgs graph, since this is a graph of a "typical" device - there are
    no guarantees (on-voltages vary a lot in FETs from part to part and batch to batch). Go always by the Vgs value
    quoted in the Rds(on) spec, and use the maximum Rds(on) quoted, this is what is guaranteed for all devices
    across all temperatures and allows for aging...

    And as for Vthr, you pretty much ignore this in a switching application, so long as its positive!

    Oh, yes, if you want a more capable bipolar switching transistor than the ancient 2222, look at the
    specs of the ZTX851, far better at high current and much much lower Vsat.

    While I agree with what you are saying my main point is "please ignore that Vthr" as many interpret this as a switching threshold and ignore all other parameters of which Rds(on) is "one" of those that you should check and never assume the 25'C readings are what to expect. Smoking is bad for your health and for electronics too.

    I also agree with the superior BJT parts too but it seems almost everybody is stuck either on ancient transistors or the very latest MOSFET and these super BJTs we have now and that industry is using get left out. You mightn't be able to increase the Prop's Voh but you can increase the drive current!
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-10-23 17:09
    Ok, I am lost :p I am liking the Mosfets, but now have no idea what to chose since i am ordering through DigiKey. I have a HUGE parts order I am finishing up along with my circuit board that I am about to order. It takes sooo long for OSHPark, but I like their quality, so I have time to test before the boards get here... I just need parts to test with :p
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-10-23 17:28
    Ok, I am lost :p I am liking the Mosfets, but now have no idea what to chose since i am ordering through DigiKey. I have a HUGE parts order I am finishing up along with my circuit board that I am about to order. It takes sooo long for OSHPark, but I like their quality, so I have time to test before the boards get here... I just need parts to test with :p

    This is just tech banter in general, go with the MOSFETs that Jon came up with.

    BTW, HUGE is a relative amount, I order in full reel quantities even just for my proto/preproduction stock, and that is not HUGE when it comes to production!
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-10-23 20:26
    Hi eagletalontim;

    Just a short question?
    Are you making a PC board?
    If so use that SI2312CD in the SOT-23 package that Jonny suggested.
    There are other dual MOSFETs in surface mount packages.
    See the ones I have tested here:
    N-Channel MOSFETs.
    BTW, those that have a graph are parts I personally tested. Vgs vs Rdson is very usefull.
    or
    Experimenting and using a "Plug Board"?
    If so use one of the ones I suggested in message 10. They are in the TO-251 or TO-262 packages.
    These are nice because the leads are easily plugged into breadboards.

    Duane J
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-10-24 04:18
    Well, $100 to me is HUGE. I have over 40 components that I am ordering and I like Digikey's system since they can all be named and saved for a later date. :)
Sign In or Register to comment.