Shop OBEX P1 Docs P2 Docs Learn Events
Basic STAMP 2 and Relays. — Parallax Forums

Basic STAMP 2 and Relays.

Derek126Derek126 Posts: 1
edited 2011-11-07 13:39 in BASIC Stamp
Hello!

I am having a bit of a problem using the stamp to power on and off some relay switches.
What I am trying to accomplish is have the stamp turn on two relays at the same time
to power to other devices. I have used a transistor and it turns on one relay just fine.
When I mimic the circuit and try and turn two on (using separate pins) one will turn on,
but the other just 'vibrates'.

Anyone have any solutions?

Comments

  • PublisonPublison Posts: 12,366
    edited 2011-11-06 16:54
    Derek126 wrote: »
    Hello!

    I am having a bit of a problem using the stamp to power on and off some relay switches.
    What I am trying to accomplish is have the stamp turn on two relays at the same time
    to power to other devices. I have used a transistor and it turns on one relay just fine.
    When I mimic the circuit and try and turn two on (using separate pins) one will turn on,
    but the other just 'vibrates'.

    Anyone have any solutions?

    Welcome to the forum!

    It's a good idea to include a schematic or drawing of what you are trying to accomplish, so that we may have a look at it.

    Also, including the code that you are using is a big help.

    What is you power source? Batteries? Wall transformer?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-11-06 18:21
    The "just vibrates" is probably due to an inadequate power source. A relay normally requires more current for it to start moving than it takes to stay closed. If the amount of current is not high enough for the relay armature to move completely to the activated position, it moves part way and often falls back causing a vibration. This process then repeats. We need the information Publison asked for in order to figure out why.
  • ercoerco Posts: 20,256
    edited 2011-11-07 13:39
    Each pin can only source ~20 mA. Your choice of relay, transistor, and bias resistor makes a big difference, as does your power supply. You are using flyback diodes for protection, yes?

    Nice page on using relays with a microcontroller at http://www.kronosrobotics.com/Anotes/Relays.pdf

    Info also applies to Stamps.

    If you only need on/off, you can get 5V 20 mA SPST reed relays from radio shack and use them directly, no transistor needed. There are also rare DPDT relays (for instance, Aromat TF2-5V) that only use 20 mA and can be driven directly w/o transistors.
Sign In or Register to comment.