Power 'Pulsing' when pin set high
I recently purchased the Stamp Works Experiment kit with the BSII. I've been trying to switch relays by following several online tutorials, namely using a single transistor. It seems to work, but the relay pulses on and off. The signal from the high pin off of the basic stamp seems to be pulsing. I cleared the stamp and all code except for that which sets the pin to high on boot, and in what is supposed to be a steady high state, it appears to be fluxing. Any ideas? is this normal stamp behavior and if so, is there a way to compensate for the fuxuation so as to keep the relay on?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Does anyone else notice a voltage fluctuation on a pin set to high? I'm really just curious as to whether that is normal behavior for the bs2 or not.
Without a schematic I am only guessing here, but I doubt the issue is with an output pin pulsing. More likely the BASIC Stamp on-board regulator is thermally cycling or the brownout is causing a reset. Also, what code are you using? Unless you have a STOP command or infinite loop, the pin will cycle every 2.3 seconds once the program has completed. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
' {$STAMP BS2}
' {$PBASIC 2.5}
HIGH 10 'set pin 10 high
with just that, and no circuit, pin 10 reads 5.0 volts and pulses to 4.5 volts over and over. I've used two multimeters to rule out a faulty one.
when I connect the relay i'm using Figure 3.5 on page 179 of http://books.google.com/books?id=E0_07GfXo2wC&pg=PA178&lpg=PA178&dq=basic+stamp+relay&source=web&ots=pPNxyOxZag&sig=5SmZwwcTjaWgxg_G9_43yblAZsU#PPA179,M1
as a schematic except that i'm using an mps2222a instead of a 2n2222a for a transistor.
The relay cycles in time with the pulses from pin 10
As Chris mentioned, you don't have a STOP or END statement after the HIGH nor do you have a GOTO to a label before the HIGH and these will cause the 2.3 second cycling he mentioned. It sounds like you're seeing something faster, so the over current / over temperature / overdrawn battery is the more likely cause.
In any event, the Stamp doesn't normally have a voltage fluctuation on I/O pins set to HIGH. If you see it, it would be due to one of the causes mentioned already. Check your circuit. Check your power supply. Try a "HANG: GOTO HANG" after the HIGH statement to see what happens.
' {$STAMP BS2}
' {$PBASIC 2.5}
HIGH 10 'set pin 10 high
HANG: GOTO HANG
(using STOP also worked)
the relay stops pulsing, and without the circuit, measured directly between the pin and ground it's a rock steady 5.01v. The relay is firing, but not actually working, which probably has more to do with shopping bulk components on ebay than anything else. Solid state relays have been ordered and are on the way. Thank you guys so much for your help. It's been years since I've messed with anything outside of a computer case and I'm finding the learning curve to be about 90 degrees.
Thank you again for your help and patience!