Shop OBEX P1 Docs P2 Docs Learn Events
automotive relay driver — Parallax Forums

automotive relay driver

LoopyBytelooseLoopyByteloose Posts: 12,537
edited 2010-09-06 08:43 in General Discussion
@jim
Using a 2n2222 will allow this to drive most automotive relay coils. For 3.3volts = Vin, a 220 ohm or higher resistor between the micro and the base would be wise. For 5.0 volts, a 330 ohm or higher.

The 2n2222 can handle 500ma. I think that might be enough for most larger automotive relays, but more amps costs more money.
301 x 391 - 37K

Comments

  • jmspaggijmspaggi Posts: 629
    edited 2010-09-05 10:35
    Hi Loopy,

    I just bought the Automotive Relay. It's a 77ohms. So 156mA. So the 2N2222 will be way enought. I will connect it to the Propeller, so 3.3V, which mean 220 ohm.

    I will try to wire that this afternoon or tomorrow.

    BTW, what is D1? I have some diodes, but I'm not sure which one to use...

    Thanks a lot for the schema!

    JM
  • ercoerco Posts: 20,260
    edited 2010-09-05 10:49
    It's a flyback diode. Note that it is reverse-biased across the coil. Doesn't look like it does anything, but very important to damp high voltage spikes when the coil switches off. You can use almost any type of diode, like a rectifier 1N4001, or small signal 1N4148.

    http://en.wikipedia.org/wiki/Flyback_diode
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-09-05 11:33
    Yes, the diode is important because when a coil shuts down it causes a rapid 'out rush' of voltage and the diode prevents that from going into the transistor.

    When the circuit will work without the diode, it won't last as long. On the web, you will often see the diode forgotten in examples, but it should always be there with either motors or coils. And in some cases, a capacitor is added as well as a diode, but that usually is for cleaning up noise that a DC motor generates (I think it has to do with the brushes).

    I'd use the 1400x series for the higher amp rating. The small signal diode is for faster response, but handles less amps.

    Automotive ratings can be a bit tricky. It isn't a true 12 volt (that is a nominal figure). When charging a battery, the automotive circuit runs as high as 14.5 Volts at the extreme. So, you really have the relay drawing 188 milliamps in that condition. This is why I hate working close to marginal values - they aren't reliable in the real world.

    It is better to use a 2N2222 that can handle 500ma or more than to cut it close with a transistor rated at 200ma.
  • JavalinJavalin Posts: 892
    edited 2010-09-06 05:14
    >but that usually is for cleaning up noise that a DC motor generates (I think it has to do with the brushes).
    I think that's capacitors to "snub" the arc'ing between the bushes and the motor insides?

    James
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-09-06 08:43
    Maybe both, but for brushed motors in general. After all, arcing generates a heck of a lot of noise - doesn't it.

    The above Wiki on fly-back diodes has a good explanation of how to choose diodes. Schottky diodes seem preferred for low forward voltage (which means quicker response), and power rating is to be considered if you are using 'big' DC motors. For most hobby motors, the amount of energy is rather minimal.

    Jim is switching under 200 millamps and for a fan control. So just about any diode will do. But if one is using a high power stepper, both the rapid on/off cycle and the amount of power would indicate taking more care in the selection of a diode.
Sign In or Register to comment.