View Full Version : Basic Stamp Dance!

11-12-2006, 08:40 AM

One thing about being a hobbyist with only a couple of months of fooling around under my belt is I find it truly gratifying in tremendous ways, however I always seem to have this aura of ignorance that looms mischievously above me.

I think an energized relay is acting like a capacitor as I’m getting an interesting phenomena when relays shut off in my circuit, and I would like to know what is causing it, and redesign my circuit to fix it. If need be.

Yes, I designed my first circuit. (Everyone duck!) This circuit reads the signal from a cheap R/C toy-boat radio, and send messages to the input pins on the Basic Stamp. I’m using a 9v relay to isolate the receiver voltages (from the Basic Stamp), and a using a couple of diodes to interpret the state of polarity, and LEDS are added to provide visual feedback on the nine-volt side.

When you move one of the joy-sticks on the R/C transmitter, it simply reverses-polarity on one of the 9v outputs channels on the R/C receiver. If the joystick is in the middle you get zero volts. This is not the best scenario as it gives me only full left-rudder, or full right-rudder, or centered. I have smoothed out the rudder movement using my own servo and refined forward and reverse motor control using a motor-mind B and absolutely delighted with the results!

I can't believe I did it and I didn’t fry a single thing!…yet.

But! when one of the relays turns off, The (other) LED that is not suppose to light flicks a bit? (Just a tiny bit) Everything still works fine and I don’t think it is a problem. I’m simply curious what it is? Perhaps it is diode leakage and I need to use a certain kind of diode? Does an energized coil act like a capacitor? What do we call this? Feedback? How can it be bleed it off in a polarity changing circuit scenario? Have I inadvertently solved the space-time continuum?

You can see my schematic here: (Free cheesy web-site)


P.S. If I remove the relays the phenomena disappears. Also if I use a nine volt battery instead of the radio it still flicks. http://forums.parallax.com/images/smilies/yeah.gif http://forums.parallax.com/images/smilies/hop.gif http://forums.parallax.com/images/smilies/yeah.gif http://forums.parallax.com/images/smilies/jumpin.gif http://forums.parallax.com/images/smilies/yeah.gif

Post Edited (jhoyoza) : 11/14/2006 12:21:48 AM GMT

11-12-2006, 09:45 AM
Well, an energized relay IS like a capacitor in one aspect -- they're both storing energy. In the capacitors place, that energy is charges gathering on the 'plate'. In the relay's case, that energy is an energized magnetic field (holding the relay closed).

Now, that magnetic field means, when you STOP feeding the coil current, the collapsing magnetic field will try to keep some current flowing. So, you need some place for that current to flow to. And it sounds like that current is flowing through your LED briefly while the field collapses.

Which is actually a good thing. If that current has no place else to go, it tends to 'blow' BS2 pins. This is why you'll generally find a "reverse biased" diode across all coils used in BS2 interfacing -- to provide some place for that 'collapsing magnetic field' generated current to go.

11-12-2006, 09:52 AM
Correct me if I'm wrong, but when the magnetic field colapses on the inductor, it creates a transient voltage, and I believe that is where you are seeing the LED flicker maybe this site might help http://hyperphysics.phy-astr.gsu.edu/hbase/electric/indtra.html, not the best site, but better than how I can explain it.

11-12-2006, 10:08 AM
Here's your circuit with the back-emf/protection diodes added.

A collapsing magnetic field induces a reverse voltage and current in the inductor that creates it and that voltage and current is proportional to rate-of-collapse of the field. This last part is potentially scary because you can have an inductor in a low voltage circuit, say 12V, experience reverse voltage and current transients many times larger than the forward voltage. (You can see this behavior in action by manually turning the output shaft of a permanent magnet, DC motor and measuring the output voltage. The faster you turn it, the higher the output voltage and vica-versa. The speed of rotation changes the speed by which the motor coils cut across the magnetic field of the permanent magnet. That speed corresponds to the rate-of-collapse property).

In the circuit given, the flicker is coming from the reverse voltage generated by the collapsing magentic field of the relay coil. Since the two relay/LED circuits are wired in an opposed arrangement, the upper LED will light when the lower relay de-energizes, and vica-versa. Since we don't know what's in the radio receiver box, we don't know how damaging this arrangement is to the driver circuit. Back-EMF ("protection") diodes wired across the relay coils will eliminate the flicker and "take it for the team," so to speak. http://forums.parallax.com/images/smilies/yeah.gif

I wouldn't connect that if I were you...

Vive Le Tour!
July 1 - July 23

Post Edited (aalegado) : 11/12/2006 3:23:41 AM GMT

11-12-2006, 10:27 AM
Well! Mr. allanlane5,

Whatta' you know, it worked!

I simply added a 'reversed biased' diode across the coils of the relays, as you so expertly suggested...and Bingo! No more 'flicker'.

Thank You, and I actually learned something too!


P.S. However, I am disappointed about not, single handedly, solving the space-time-continuum thing.

Post Edited (jhoyoza) : 11/12/2006 4:18:39 AM GMT

11-12-2006, 10:33 AM
Dear Alegado.

Thank you for fixing my schematic so beautifully. Nice!