Shop OBEX P1 Docs P2 Docs Learn Events
How to use transistor to drive a reed relay — Parallax Forums

How to use transistor to drive a reed relay

bear_phillipsbear_phillips Posts: 14
edited 2005-01-19 14:14 in BASIC Stamp
Hi,

I am wanting to control a 5 volt reed relay with a BS2 (Radio Shack 275-232). I have read several posts that say you should use a transitor to drive the relay instead of driving the relay directly from a stamp pin.

Using a transitor for this is probably simple stuff for you guys, but I have googled for a while and can't find a simple diagram on how to do this. Would anyone help me out with a simple explanation on how to drive a 5 volt reed relay with a stamp?

thanks
chad

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-18 05:03
    The attached schematic should be pretty self explanitory -- when the Stamp pin goes high the transistor will conduct and allow current to flow throw the relay coil.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
    345 x 456 - 8K
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-18 15:19
    Yes, and that diode in there is because when you try to 'turn-off' the coil, the collapsing magnetic field generates a current. The diode gives that current someplace to go.
  • steve_bsteve_b Posts: 1,563
    edited 2005-01-18 19:37
    Further to allans comments about the diode....

    Some relays have the diode built in!· Make sure you know if it is or not!·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://members.rogers.com/steve.brady
    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-18 20:43
    Steve,

    What are the implications if you put a diode on a relay, motor, or whatever inductive load, that already has one on it?

    Jim
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-18 20:56
    The diode with the lower forward voltage (usually 0.6) will take all the current. This is not a problem. And you've spent an extra $0.10 (or whatever) on a diode, and you had to install it.
  • steve_bsteve_b Posts: 1,563
    edited 2005-01-18 21:01
    Like allan said...no big deal.· Just didn't want people to assume that since this little·silver one had it, that all little silver ones had it!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://members.rogers.com/steve.brady
    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • The Dead BugThe Dead Bug Posts: 73
    edited 2005-01-18 21:19
    One thing Chad might need to know, (forgive me if you do already) is that the transistor shown in the schematic is NPN. 2N2222 or 2N3904 would work fine for a reed relay. Don't try PNP transistors. They won't work like this.
    Bruce

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Name: Bruce Clemens

    Work:· Clemensb@otc.edu
    Bolg: http://theDeadBug.journalspace.com
  • RTurleyRTurley Posts: 8
    edited 2005-01-19 01:58
    Help me out here.· I have used a PNP transistor (PN2907A) to switch on/off a relay coil, as shown in the attachment.· I used this because I could use a low output from teh Stamp to switch the transistor, and there is a slighly more generous budget for low current than high current on the Stamp-2.

    By my estimation, there is no need for a resistor on the base leg, because the base current is low.· I calculate this at about 1.6 mA, assuming a 5 volt supply and a 300 Ohm coil.

    Help me out here if I am wrong.

    The data sheet for the PN2907A can be found here.

    http://www.fairchildsemi.com/ds/PN/PN2907A.pdf

    Thanks.



    RTurley
    250 x 267 - 6K
  • BeanBean Posts: 8,129
    edited 2005-01-19 14:14
    RTurley,
    Your circuit is an emitter-follower.
    When you make the stamp pin LOW it will draw current until the emitter reaches 0.7volts.
    So your relay will only see 4.3Volts acrossed it. (That may be okay though).

    Assuming a hFE of 100 the current at the stamp pin will be very low ((4.3v / 300ohms) / 100hFE), but I would STILL use a resistor to protect that precious stamp pin.

    Bean.
Sign In or Register to comment.