BS2 Problem driving relay
tcicatelli
Posts: 8
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
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
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