Shop OBEX P1 Docs P2 Docs Learn Events
desesperately need help on B Stamp and relays + Solenoids..thanks — Parallax Forums

desesperately need help on B Stamp and relays + Solenoids..thanks

federicofederico Posts: 6
edited 2012-02-19 16:38 in BASIC Stamp
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.

Fede

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

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-19 02:57
    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
  • BobHBobH Posts: 33
    edited 2006-05-20 09:14
    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.
  • Invariant1Invariant1 Posts: 9
    edited 2006-05-27 01:52
    Fede,
    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.

    T.S.
    (Invariant1)
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-27 03:03
    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
    420 x 402 - 20K
  • BrianZBrianZ Posts: 28
    edited 2012-02-18 07:17
    I have a quesion, Chris..
    What if I am driving a solenoid with a TIP120 Darlington transistor which has the following circuit...
    TIP120-circuit.jpg

    Would I still need the diode across the solenoid load?
    775 x 485 - 32K
  • ercoerco Posts: 20,256
    edited 2012-02-18 09:08
    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.
  • stamptrolstamptrol Posts: 1,731
    edited 2012-02-18 12:34
    Gents,
    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.

    Cheers,
  • BrianZBrianZ Posts: 28
    edited 2012-02-18 16:39
    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?
  • davejamesdavejames Posts: 4,047
    edited 2012-02-18 20:05
    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?
  • BrianZBrianZ Posts: 28
    edited 2012-02-19 15:33
    Yes, that made perfect sense. Thank you for walking me through that, and making it easy to see now.
  • davejamesdavejames Posts: 4,047
    edited 2012-02-19 16:38
    BrianZ wrote: »
    Yes, that made perfect sense. Thank you for walking me through that, and making it easy to see now.

    ...welcome - happy to help!
Sign In or Register to comment.