Relay with the hiccups
Joe-Bot
Posts: 24
Im having trouble with my relay. I added a LED to the circuit, to make the issue more visual.
When I set the I/O pin on my basic stamp to HIGH 7 and follow it with a PAUSE for the duration I need, it works fine, with no hiccup. But I cant program any maneuvers for the Boe-Bot until that duration is over. I tryed putting it on HIGH 7 without a PAUSE duration and I see the LED flicker like a slow pulse, in conjunction with the hiccup on the music module. So can I get a constant HIGH 7 without adding a PAUSE duration? Or is there something I could add to the relay circuit to absorb the momentary power drops.
I was reading the blog; Looking for simple power relay, by JBWolf, and he said he was directly driving the relay with a capacitor to buffer any fluctuations.
Im wondering if I could use a capacitor, where to put it, and what size should I use?
Joseph.
When I set the I/O pin on my basic stamp to HIGH 7 and follow it with a PAUSE for the duration I need, it works fine, with no hiccup. But I cant program any maneuvers for the Boe-Bot until that duration is over. I tryed putting it on HIGH 7 without a PAUSE duration and I see the LED flicker like a slow pulse, in conjunction with the hiccup on the music module. So can I get a constant HIGH 7 without adding a PAUSE duration? Or is there something I could add to the relay circuit to absorb the momentary power drops.
I was reading the blog; Looking for simple power relay, by JBWolf, and he said he was directly driving the relay with a capacitor to buffer any fluctuations.
Im wondering if I could use a capacitor, where to put it, and what size should I use?
Joseph.
Comments
The relay coil itself is usually about 60ma of load, but your reed relay is even less.
You could run a few tests.
A. Check your battery pack for voltage without load.
B. Check your battery pack for voltage with relay coil load
C. Check your battery pack for voltage without relay coil load and with the BOE-bot servos rotating. (This last test is most important)
The whole problem may just be that your batteries are either not fresh or not powerful enough. Fresh alkaline batteries work best. Rechagible batteries may have lower intial voltages and not last as long.
What to do? If you really want to continue with AA cells, buy one of Parallax's 5 cell holders for the BOE-bot. Or switch to a 7.2 volt Lithium ion pack.
Why the hiccups? The battery drops below the reset voltage for the BasicStamp, everything is reset and it tries again, and again. This is a very common 'brown out' failure mode.
Also I’m testing the relay with the switch in the #1 position so the servo’s don’t come into play. And if the stamp was resetting, it should sound the alarm, and it’s not.
I can play the music module over and over again as long as I use a duration which is 27000 ms. long, but as soon as I take the PAUSE 27000 duration and LOW 7 away that’s when I see the hiccups.
By the way thanks for your patients while I try to explain.
So this is what I’ve programed;
'Robotics with the Boe-Bot - TestMusic2.bs2
'Test music modole Pin 7 on/off.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Test Music Module"
FREQOUT 4, 500, 3500 ' Signal program start/reset
PAUSE 1000
HIGH 7
PAUSE 27000
LOW 7
If you want your robot to do something while the music is playing, you just turn the module on (with a HIGH 7), then go do whatever your robot needs to do and keep track of roughly how much time that takes. If you're using a BoeBot, you have some kind of main loop based on the 20ms requirement for control pulses for the servo motors. That gives you a 20ms time "tick" that you can count (each time through the main loop). When the counter indicates that 27 seconds or whatever has gone by, your program does a LOW 7 and stops counting.
1) Drop your transistor bias resistor from 470 to 330 or even 220 to see if performance improves.
2) Your 20 mA reed relay can be driven directly by a Stamp pin, no driver transistor. Just use the flyback diode, but forget the LED unless it's a 1 mA type.
I just tried something, from Pin 1 threw a 220 resistor, to a LED then Vss(-). At HIGH 1 without a PAUSE duration it has that same pulse like blink.
Is there any way to stabilize that momentary power drop with out adding a duration?
If someone could solve this little issue, well that would make my endeavor fun again, and I’d like to buy that person a drink.
BTW, if your program just ends, the BS2 resets every 2.5 seconds, which would blip your relay that often. Is that the stuttering you are seeing?
Will these reed relays behave well at 3.5 volts?
And yes that must be the stuttering I ‘m seeing, it’s about every 2.5 seconds. That’s what’s causing my blip, how can I cure that?
DO : LOOP
Boy do I feel dumb, so all I had to do, was get out of the test mode and program so maneuver (like Mike was suggesting) and the basic stamp would not reset every 2.5 seconds. You know I had some maneuvers programed and I ran them, now I’m not sure what happened. I know I wasted a lot of time. Live and learn.
Okay so I owe you both a drink. Now I have a good reason to come to the convention. :thumb:
Thanks again for your patients.