Shop OBEX P1 Docs P2 Docs Learn Events
problem with relay — Parallax Forums

problem with relay

GiuseppeGiuseppe Posts: 51
edited 2009-01-20 02:37 in BASIC Stamp
Hey guys, I am trying to make a relay click via an I/O pin with a HIGH command (other end of coil is Vss). I cannot get it to work. I know it is better to send a HIGH signal to a transistor for higher current to a relay but I just wanted ti try it out anyway. I can make the relay click with Vss and Vdd but not with the I/O pin. Is this perhaps because the current is higher than it is on a pin making it click? That is the only thing I can think of. The relay is a 5V relay with the a coil resistance of 12 ohms. So I am figuring the current needed to drive should be (5/12) = 0.42 A. Thanks guys.

Comments

  • JonathanJonathan Posts: 1,023
    edited 2009-01-20 00:48
    You are going to destroy the pin connected to the relay if you keep doing this. You need to use a transisitor or FET to switch the relay. You also need a back EMF diode across the coil to prevent damage. VDD can provide the current needed, but an IO pin can't provide the needed current.

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Dave EDave E Posts: 52
    edited 2009-01-20 00:56
    The BS2 can only supply 0.02 amps. You may have damaged the I/O pin. See the Basic Stamp Manual page 8.

    Dave E
  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-20 01:20
    The Nuts and Volts Column #6 discusses how to control more power, current, and/or voltage than a Stamp I/O pin can normally handle. Go to the main Parallax webpage and click on the Resources tab. You'll see a link to the Nuts and Volts Columns index.
  • ercoerco Posts: 20,256
    edited 2009-01-20 02:37
    Il mio amico:

    That's definitely too much relay for the Stamp to drive directly; you can only count on 20 mA from any one pin. If you're using a real Stamp (not using a Homework board or Project board, both which have built-in 220 ohm resistors), you could drive a 20 mA reed relay directly, but that's about it. And you'd want to use a flyback protection diode. Otherwise you have to use a switching transistor.

    I posted a circuit at http://forums.parallax.com/showthread.php?p=773130 which shows one way to use a transistor to switch a bigger relay.



    PS: If you can find these particular NAIS/Aromat 5V DPDT DIP·relays, you can also drive them directly with 20 mA and a flyback diode.

    http://cgi.ebay.com/10-RELAYS-TQ2-5V-5-VOLT-NAIS_W0QQitemZ310116360548

    My very favorite component after the BS2. Stock up if you ever find them at a good price, as they are rare and worth their weight in gold. Must be marked TQ2-5V only. Very sensitive at low current because the coil is polarized. Won't work if you reverse the polarity!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
Sign In or Register to comment.