Shop OBEX P1 Docs P2 Docs Learn Events
Load through contacts of relay affecting BS1 operation?! — Parallax Forums

Load through contacts of relay affecting BS1 operation?!

brettmbrettm Posts: 36
edited 2006-08-21 17:08 in General Discussion
I am having problems with my BS1 which I first thought was a power supply problem and started this thread: http://forums.parallax.com/showthread.php?p=600677·· However I have discovered that with certain changes to the circuit it does work with this power source, so I must have a different problem.

I am using the BS1 to drive 2 relays and 3 LEDs (all through 2N4400 transistors with 10k resistors to the base)·and·the LEDs and relays work perfectly when I do not have a load going through the relay contacts.· However when I attach the solenoids that I wish to control to the relay contacts the BS1 no longer works properly and will freeze up after a short period of use.

Since the relay contacts aren't even connected to the circuit (only the relay coil), I don't understand why having a load through the contacts would affect the circuit and the BS1...?




(I'm using 12v relays but have also tried 5v relays fed from VDD rather than the 12v power source; same problems)

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-08-15 19:25
    BrettM -

    If you're driving any relay or solenoid directly from a Stamp pin, you're really just looking for trouble, in the long run. Using a circuit such as that below will block the back EMF from the relay/solenoid, and provide a driver transistor to take the load of the coil:

    http://www.hobbyprojects.com/the_diode/diode_protection_circuits.html

    Hope that helps.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-08-15 19:46
    It is an interesting problem. You say that the contacts -- which are physically isolated -- from the 5 volt supply and the BS appear to be affecting the BS1 operation.

    That sounds like broad spectrum EMI from the contacts. How many amps are you switching?· It sounds like a lot.
    You might have to find ways to quite the noise on the 12 volt circuit [noparse][[/noparse]like a low pass transient filter inline with the 12volts].· Also, you might take a look at how many ohms the coils are.· The collapse from actual use may be harsher than when there is no load.

    You might make sure that there is no common ground between the 12volt and the 5volt.· I took a look at your other thread and it seems like you might do much better with Opto-isolation and have the BS avoid any ground the the automotive circuitry.· I know that raises the question of how to supply power to BS. But if the isolation does eliminate the problem, you can return to designing a supply that is fully filtered.

    Automobiles are a very harsh electrical environment.· Lots of different kinds of noise and all contained within relatively short circuit distances.· For digital electronics it as difficult to not get their digits scrambled.· Just turning off the headlights or honking the horn can put everything out of whack as one minute there is a high demand and then there is none.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 8/15/2006 7:56:53 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-08-15 19:57
    Well I didn't realize you started a new thread and I replied to the old one...You perhaps should put a message at the end o the other thread stating that you started a new thread to avoid more confusion.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • brettmbrettm Posts: 36
    edited 2006-08-15 20:17
    Bruce Bates said...
    BrettM -

    If you're driving any relay or solenoid directly from a Stamp pin, you're really just looking for trouble, in the long run. Using a circuit such as that below will block the back EMF from the relay/solenoid, and provide a driver transistor to take the load of the coil:

    http://www.hobbyprojects.com/the_diode/diode_protection_circuits.html

    Hope that helps.

    Regards,

    Bruce Bates

    I forgot to mention that I do have a diode across the relay·protecting the transistor.· I am ot driving a relay or solenoid off a Stamp pin, I am going from the Stamp to a transistor to a relay to a solenoid.
  • brettmbrettm Posts: 36
    edited 2006-08-15 20:25
    Kramer said...
    It is an interesting problem. You say that the contacts -- which are physically isolated -- from the 5 volt supply and the BS appear to be affecting the BS1 operation.

    That sounds like broad spectrum EMI from the contacts. How many amps are you switching?· It sounds like a lot.
    You might have to find ways to quite the noise on the 12 volt circuit [noparse][[/noparse]like a low pass transient filter inline with the 12volts].· Also, you might take a look at how many ohms the coils are.· The collapse from actual use may be harsher than when there is no load.

    You might make sure that there is no common ground between the 12volt and the 5volt.· I took a look at your other thread and it seems like you might do much better with Opto-isolation and have the BS avoid any ground the the automotive circuitry.· I know that raises the question of how to supply power to BS. But if the isolation does eliminate the problem, you can return to designing a supply that is fully filtered.

    Automobiles are a very harsh electrical environment.· Lots of different kinds of noise and all contained within relatively short circuit distances.· For digital electronics it as difficult to not get their digits scrambled.· Just turning off the headlights or honking the horn can put everything out of whack as one minute there is a high demand and then there is none.
    I can't say I know much of anything about the practical implications of EMI.· The solenoids pull about 800mA each, the rest of the circuit running the Stamp, LEDs and relays pulls under 100mA at all times.· The coils in the relays are 335 ohms.· I am using a common ground but can't think of a practical way to isolate the systems.

    I know automobiles are a harsh electrical environment, but this last round of testing was done directly off the 12v battery with the vehicle turned off.· I would think that would be a very clean source of power...?· I have also tried making a low pass filter for the stamp using a resistor and capacitor and I've tried feeding the Stamp through a 7805 5v regulator.· Neither helped.· And regardless, the relays and LEDs work fine off this source when the relays aren't hooked up to the solenoids, so I can't see how that's a power supply problem.

    ·
  • brettmbrettm Posts: 36
    edited 2006-08-15 20:32
    (in the other thread) Kramer·said...
    I see...
    You are using the relay to drive a more powerful solenoids.

    The problems is a huge inductive field collapse of solenoid that is sending a spike of high voltage back to the BasicStamp.

    Nasty, nasty stuff.

    are you talking about the field collapse of the relay coil?· or of the solenoid itself?

    how would I filter this spike?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-08-15 20:34
    This two threads is awkward, maybe whacko.

    You have a Stamp driving a transistor that is driving a relay that is driving a solenoid.

    The Stamp needs the transistor or some other device to isolate it AND to help you magnify the power output. You may or may not need the relay in the middle.

    Your end of the line device, the solenoid that is attached to the relay contacts is your culprit. Collapse of the solenoid causes a spike to surge back to the BS1 and lock up [noparse][[/noparse]if not eventually die].

    Your best bet is to opto-isolate the BS1, independently supply power to it, AND to find a solid-state relay or power fet to eliminate the sparking from the solenoid shut down. I don't really know if the later solution is attainable. It depends on how much power is in that solenoid. Starter motor solenoids handle something like 100 amps. Light switching can be 20-30 amps. Look at the fuse box in the automobile, some go up to 50 amps.

    As you might notice, the automotive people haven't gotten too far away from electro-mechanical devices because they need low voltage, high amperage. Lots of sparking and Lots of EMI.

    The diode across the relay is needed, but it is just a small detail within the bigger picture.

    Thing isolation, isolation, isolation in this instance.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Mike GreenMike Green Posts: 23,101
    edited 2006-08-15 20:48
    Can you post a circuit diagram? Please include rough lead lengths. There may be a spike even on the ground wires if they're long enough. It does sound like the Stamp is getting reset.
  • brettmbrettm Posts: 36
    edited 2006-08-15 20:52
    Kramer said...
    This two threads is awkward, maybe whacko.

    You have a Stamp driving a transistor that is driving a relay that is driving a solenoid.

    The Stamp needs the transistor or some other device to isolate it AND to help you magnify the power output. You may or may not need the relay in the middle.

    Your end of the line device, the solenoid that is attached to the relay contacts is your culprit. Collapse of the solenoid causes a spike to surge back to the BS1 and lock up [noparse][[/noparse]if not eventually die].

    Your best bet is to opto-isolate the BS1, independently supply power to it, AND to find a solid-state relay or power fet to eliminate the sparking from the solenoid shut down. I don't really know if the later solution is attainable. It depends on how much power is in that solenoid. Starter motor solenoids handle something like 100 amps. Light switching can be 20-30 amps. Look at the fuse box in the automobile, some go up to 50 amps.

    As you might notice, the automotive people haven't gotten too far away from electro-mechanical devices because they need low voltage, high amperage. Lots of sparking and Lots of EMI.

    The diode across the relay is needed, but it is just a small detail within the bigger picture.

    Thing isolation, isolation, isolation in this instance.

    The solenoids aren't real powerful, under 1 amp each.· A 5 amp fuse feeds them and some other small stuff.

    I'm not very good at drawing circuit diagrams, but I'm attaching one I threw together.· I didn't show the relay contacts since I didn't think them important.· I'm simply running the same 12v source that feeds the Stamp, LEDs and relays to the common pin and the solenoid to the normally open pin.
  • brettmbrettm Posts: 36
    edited 2006-08-15 20:55
    Mike Green said...
    Can you post a circuit diagram? Please include rough lead lengths. There may be a spike even on the ground wires if they're long enough. It does sound like the Stamp is getting reset.
    I just posted a rough circuit diagram.· The power and ground to the battery are roughly 20 inches, the rest is on a breadboard.· The outputs to the solenoid go into the vehicle wiring and I can guess that there is about 4 feet of wiring between the breadboard and the actual solenoid (which has it's own ground).
  • brettmbrettm Posts: 36
    edited 2006-08-15 22:48
    I am not familiar with opto-isolators, though I've just started reading now (http://en.wikipedia.org/wiki/Opto-isolator, http://electronents.v21hosting.co.uk/optocoupler-applications.htm, http://www1.jaycar.com.au/images_uploaded/optocoup.pdf)

    Since the solenoids are causeing the problem, and are only linked to the BS1 by sharing power and ground, the interference must be coming through one of those, correct?· Can I use optocouplers to isolate the power and ground, or only to send signals?
  • brettmbrettm Posts: 36
    edited 2006-08-16 02:54
    I found this thread that deals with automotive power, relays, solenoids, power spikes, etc: http://forums.parallax.com/forums/default.aspx?f=19&m=32501&g=32514#m32514

    it suggests that a simple diode with the solenoid would filter out these spikes. any input? I'll give it a try...
  • T ChapT Chap Posts: 4,223
    edited 2006-08-16 04:01
    I think you should meter the current consumption with all the stuff turned on. SEEMS more like a lack of current of problem than anything else. The solenoids may be causing a dead short almost when on. Try metering current first, then metering the voltage off the battery under the strained conditions and note what is taking place. That would be the best info to start with.
  • brettmbrettm Posts: 36
    edited 2006-08-16 05:04
    HAH!· Victory!

    a simple diode across the solenoids (like I already had across the relays) and it works perfectly.· once again the Parallax forums come through,·I wish I would have found that other thread in a search earlier, and I'm kinda surprised I didn't think of a diode earlier.· With all the confusion this has put me through I was sure it was going to be a more complicated fix.

    Thanks guys!·
  • nick bernardnick bernard Posts: 329
    edited 2006-08-18 13:53
    freewheel diodes are your friend!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    engineer, fireman, bowler, father, WoW addict [noparse];)[/noparse]
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-08-21 17:08
    Certainly simpler that opto-isolators.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Sign In or Register to comment.