Shop OBEX P1 Docs P2 Docs Learn Events
BS2 Problem driving relay — Parallax Forums

BS2 Problem driving relay

tcicatellitcicatelli Posts: 8
edited 2012-02-17 08:26 in BASIC Stamp
Hi-

I tried driving a relay from a pin through a 2N2222 and noticed the relay was blinking on and off. It was on for a second then blinked off and repeated. I then replaced the circuitry with a reed relay that requires 20ma. The load is 420ma, and I still am having an issue with the load blinking about once per second. It is on more than off, but I'd like to get the relay to stay on 100% when the pin is high. If I drive the coil with +5vdc, the load stays steady. What am I doing wrong?

Thanks,
-Tom

Comments

  • $WMc%$WMc% Posts: 1,884
    edited 2012-02-13 19:01
    With out seeing the code your using,We'll never know
  • tcicatellitcicatelli Posts: 8
    edited 2012-02-13 20:13
    Sorry about that. There really isn't any code. I just sent "HIGH 11" to the stamp.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2012-02-14 00:24
    tcicatelli,

    There is an implemented END command after you set the pin HIGH... Do a search in the manual for the "END" statement ... "If the BASIC Stamp is powering an LED when END executes, the LED will stay lit after END, but every 2.3 seconds, there will be a visible wink of the LED as the output pin switches to the input direction for 18ms." ... this behavior is a result of the inactive low-power mode of the Basic Stamp.

    Try something like this after you set the pin HIGH...

    KeepAlive:
    GOTO KeepAlive
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2012-02-17 08:26
    You could also place a STOP command after the HIGH command, for example:
    HIGH 11
    STOP
Sign In or Register to comment.