View Full Version : desesperately need help on B Stamp and relays + Solenoids..thanks

05-19-2006, 09:14 AM
Hi everyone,
I desesperately need help. This is the thing; I’m having big trouble with a piece I’m exhibiting in a show in New York. The piece is titled "Water traces" and on it the optically enlarged image of a drop of ink projected against the ceiling of the gallery generates in real time, via electronic sensors and actuators, lineal drawings in a thin layer of sand. The sand is spread on a 50-inch diameter slab of walnut that slowly rotates at one revolution per minute.

I’m having problems with the basic stamp that controls the ink dripping cycle. The controller is connected using relays to a halogen lamp, a small solenoid (for the ink), a water pump, a big motor, and to a big water valve.

This last one is giving me a so much headache, the valve comprises a big solenoid that works with 110v ac and once in a while, when closes create a electricity spike that in the beginning makes the basic stamp to reset automatically. So I decided to put diodes between the BS and the relays so the electricity doesn’t kick back, but it didn’t work.

So I thought that may be the water valve solenoid takes so much electricity so fast (in addition to the rest of the devices) that makes the ac/dc transformer that power the BS to lose juice and restart it again, since all the devices were connected to the same power strip. So I power the BS from a 9v battery but didn’t work.

Finally I decided to use a Darlington array chip to bust the basic stamp power, because I figure out that may be the problem was that connecting the relays directly to the basic stamps was to much to ask when I was turning two or more relays at once, plus I had the diode protection from the chip.

And although now the BS is not resetting anymore what is happening is that when the relay that power the water valve solenoid should go on, the basic stamp goes in a endless loop turning the relay on and off really fast, like freezing in that line of code.

The only thing I can think about is that I’m putting 14v dc through the Darlington to run the 5v dc relays. But I don’t see how could this affect the BS. Or that the big water valve 110v ac solenoid is not grounded.

Again, I’m kind of desesperate because this has been going on for three weeks already and I run out of ideas.

Any idea?

Thanks a lot guys.


Ps: you can check my work at www.federicomuelas.com or the piece I’m having problems with at www.ps122gallery.org

Chris Savage
05-19-2006, 09:57 AM
It would help to see a schematic of what you have...But chances are you're getting EMI/RFI interference. The diode would normally be placed across the solenoid connections such that the cathode was toward the positive supply. Long leads to the solenoid could cause noise too. You could shield the BASIC Stamp.

Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

05-20-2006, 04:14 PM
I've seen the same sort of thing happen (relay chatter) if you are using separate power supplies for the stamp and relays and don't tie the grounds together.

05-27-2006, 08:52 AM
Your Darlington array idea may produce as good an effect, but my way of heavily buffering my BS pins is to use a transistor driving a reed relay, driving the big power relay. The reed relay switches on at 5V only using 20mA, but is rated at 1/2 Amp at 120VAC at the output side. So you can support a big relay as long as its input coil doesn't draw more than 1/2 amp. Please see attached schematic.


Chris Savage
05-27-2006, 10:03 AM
Actually that way is better suited to a PNP transistor...For NPN the following circuit is one example of how to drive a relay from a BASIC Stamp I/O pin.

Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

02-18-2012, 02:17 PM
I have a quesion, Chris..
What if I am driving a solenoid with a TIP120 Darlington transistor which has the following circuit...
Would I still need the diode across the solenoid load?

02-18-2012, 04:08 PM
First, I'm not Chris... :)

Any coil (solenoid, electromagnet or relay) needs a flyback/freewheeling/snubber diode to absorb the large voltage spike generated when the coil is turned off and the magnetic field collapses. Cheap insurance, that spike can take out the switching transistor and/or the uC on occasion.

02-18-2012, 07:34 PM
Flyback diodes are important in DC inductive circuits, but the OP noted that the solenoid in question is 110 VAC, so discussion of diodes around coils is not the solution here, IMO.

It is more likely the solenoid coil needs a suppressor (snubber) circuit of the RC variety or transorb, etc.

We know the voltage of the solenoid and with some feel for the current drawn, an effective snubber can be recommended.


02-18-2012, 11:39 PM
So, are you saying that the diode within the Darlington schematic I provided won't offer the necessary protection, and it must be across the solenoid itself?

02-19-2012, 03:05 AM
BrianZ - I would say yes to your question.

When a coil has been engergized, one side will be at +V and the other some less-than +V (not necessarily a negative voltage).

When the coil is de-energized, its magnetic field collapses potentially generating a large voltage spike...and if I remember correctly, the spike is reverse polatrity, meaning that the former less-than +V side will have a large positive voltage.

With a diode across the coil as shown in your schematic, this negative spike will forward bias the diode, the diode turns on and the spike current will be re-circulated back into the coil. A few times around the circuit, and the energy in the spike will be spent in the resistance of the relay coil.

All that to say, with the positive spike on the coil/TIP120 connection, the TIP120 clamp diode will be reversed biased and won't short the spike energy to ground. It could find an easier path through one or both of the transistors that make up the darlington circuit.

Did that make sense?

02-19-2012, 10:33 PM
Yes, that made perfect sense. Thank you for walking me through that, and making it easy to see now.

02-19-2012, 11:38 PM
Yes, that made perfect sense. Thank you for walking me through that, and making it easy to see now.

...welcome - happy to help!