Shop OBEX P1 Docs P2 Docs Learn Events
help with 5v relay — Parallax Forums

help with 5v relay

nottoobrightnottoobright Posts: 6
edited 2011-04-28 19:51 in BASIC Stamp
I am working with a 5 volt dpst relay. If I run the following code in a bs2:

do
high 0
pause 1000
low 0
pause 1000
loop

im not getting contact closure. I tested the coil for continuity and didnt get a tone, so I thought the relay
was bad. I hooked vss & vdd to relay coil directly just to make sure and clicked shut. oh....i thought maybe the code wasnt running right, so i hooked a meter into pin 0 and the meter runs up to 4.8 something volts then back off......like it should. what in the world am i missing here?

thanks for any insight

Comments

  • spudduditspuddudit Posts: 10
    edited 2011-04-26 14:06
    ran into the same issue, i used a 2n2222A transiter / relay driv er circuit to fix it ( pretty sure its because not enough current is supplied.
  • spudduditspuddudit Posts: 10
    edited 2011-04-26 14:10
    try using this circuit with IN being from i/o 0 and +/- coming from vss/vn

    e56dffa7.jpg
  • nottoobrightnottoobright Posts: 6
    edited 2011-04-26 14:23
    thanks spud, ill give it a try. any idea why i wouldnt get continuity across the coil? my meter throws up some numbers but no tone.
  • spudduditspuddudit Posts: 10
    edited 2011-04-26 14:26
    i don't think there is enough current to fully close the the contacts inside the relay only partially. in my time lapse controller i ran into this it "clicks" but its soft compared to when i run it with the above driver.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2011-04-26 14:52
    With a 2n2222 you will be able to pull most small relay with the setup in post # 3

    You might need to change R1 to 500 ohms
  • ercoerco Posts: 20,256
    edited 2011-04-26 16:06
    A Stamp pin can only source 20 mA or sink 25 mA reliably, you risk damaging your Stamp drawing more than that.

    You can drive a 5V, 20 mA reed relay directly, but that's about it, unless you can find my favorite DPDT relay: an Aromat/NAIS TF2-5V, also 20 mA.
  • nottoobrightnottoobright Posts: 6
    edited 2011-04-26 17:52
    thanks a bunch for the help guys. i thought i was loosing my mind.
  • nottoobrightnottoobright Posts: 6
    edited 2011-04-28 17:44
    spuddudit

    I just got around to trying the circuit you recommended and the relay is clicking beautifully. Thanks a bunch.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-04-28 19:51
    Spend a few minute glossing over the FAQ
Sign In or Register to comment.