Shop OBEX P1 Docs P2 Docs Learn Events
Filtering caps — Parallax Forums

Filtering caps

Jeff DegeJeff Dege Posts: 85
edited 2006-02-17 16:04 in BASIC Stamp
I'm on my second project in which I'm using a Basic Stamp to switch relays.

Last time, the relays drove some small moters, and I found that when I actually had the motors attached, the Stamp would reset. I stuck capacitors everyplace I could think of, and it fixed the problem, but I was never sure exactly why.

In my current project, I'm using relays to switch doorbell chimes - 1A, 16VAC.

I could just stick random caps all over, again, but is there some standard set of filtering and bypass caps folks use to keep a Stamp from browning out in a noisy environment?

Comments

  • Jeff DegeJeff Dege Posts: 85
    edited 2006-02-17 04:18
    Oh - doorbell chimes are 1A, 16VAC solenoids. That may not have been clear.
  • BillMBillM Posts: 1
    edited 2006-02-17 05:52
    You might want to use a SSR like a PD2401.· It has a rating of 1 amp.· Just Google "pd2401" and check out the Datasheet.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-02-17 07:42
    Sticking capacitors randomly everywhere might work, but what do you learn?

    First of all, you might try to understand what a capacitor is and what a coil is. They are really the opposite of eachother in terms of how electricity behaves when you disconnect or connect the circuit.

    Not only are they opposites, but they seem to cancel eachother's effects when properly used.

    The coil in the selonoid or motor is making huge voltage spikes when it turns on and off.
    The capacitor eats these spikes before they reach your BasicStamp and cause confusion or damage.

    Often the best place to solve the problem is nearest the source. So a filter capacitor across the coil might help a lot, but it may also affect timing on the motor.

    The second place we usually use capacitors is to protect the ICs right at their power entry. Usually we use by-pass capacitors for noise, but larger capacitors tuned to spikes might be required

    The third place we usually use capacitors is to reduce ripple and spikes on the power supply.

    Hopefully you will consider a basic electronics course. I started studying electroning in 1960, when I was 12 years old. Much of what I am say is what I learned way back then -- and it is still useful.

    If you just muddle around, you are likely to damage things and give up on a useful and enjoyable hobby. Sooner or later you are going to discover that capacitors may act like a straight connect or a short when 'tuned' with an AC frequency, then something will get destroyed.

    I am here because I still learn more everyday. I am not the greatest engineer, but at least I am having fun and growing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Jeff DegeJeff Dege Posts: 85
    edited 2006-02-17 15:38
    Somebody said...
    Sticking capacitors randomly everywhere might work, but what do you learn?

    Nothing. That's why I'm asking questions.
    Somebody said...
    Hopefully you will consider a basic electronics course.

    I've had that, for limited meanings of "basic". I took a couple of elective EE courses when I was in college - basic electronics and digital circuits. Calculating how big a resister to use to get the right level of current through a transistor or an LED - no problem.

    But how much capacitance I need to deal with these sorts of spikes? Not a clue.
    Somebody said...
    Sooner or later you are going to discover that capacitors may act like a straight connect or a short when 'tuned' with an AC frequency, then something will get destroyed.

    I've done a pretty good job destroying things simply by connecting the leads of a 7805 backwards, thank you very much. I don't need to get fancy smilewinkgrin.gif

    I'm aware that any capacitor/resistor pair has a characteristic time constant, and that determines how they will respond to any given AC frequency. But what that relationship is? Also not a clue. My classroom exercises had me calculating RC time constants - they didn't help much in explaining what to do with them.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-02-17 16:04
    Please forgive me. I just presumed that you were starting from scratch.

    Capacitors and Inductors have two design points of view.

    One is AC and and the other is DC.

    In AC, we see capacitor linked amplifier stages in old tube amps.
    They allowed the AC to pass from one stage to another, but left behind the 300-400 volts DC.
    Each stage added a bit more until you got a powerful output.

    In DC, we look at how the charge and discharge create an impedance [noparse][[/noparse]or temporary resistance].
    The formula for capacitance relate to the change in CURRENT over time.
    The formula for inductance relates to the change in VOLTAGE over time.

    I think that these charge and discharge concepts are where most people give up with electronics.

    Since the number is a 'best guess', you often see a variety of values [noparse][[/noparse]like by-pass capacitors at 0.1 mf; 0.047 mf; and 0.001 mf]. They all seem to work pretty good as no one knows the 'exact' time factor of a one-time spike.

    When I was younger, I thought that all electronics had to have exact numbers, but when you are playing with megahertz and nanoseconds, you can never get it really that tight.

    Sometimes there is a minimum limit and everything that exceeds that limit works.
    That seems to be the case with the 7805 voltage regulator. I see in the manufacturing specifications that 10mf is enough to do usually filter both the inputs and outputs. But when I look at what other people are doing I see values going into 10,000mf with the regulator.· The manufacturer actually notes that these big capacitors can actually cause damage to the voltage regulators when they discharge [noparse][[/noparse]because you have a lot of electricty going in the wrong direction] and provide instructions on how to add protective diodes if you feel that you must have the added filtering.

    Granted some of this may be needed because there is a big·motor somewhere and the noise of its brushes are causing trouble, but there are intelligent choices.

    Instead of just adding a big capacitor to the whole supply, I see that Hewlett-Packard has a ferrite bead on the power leads coming out of the motor [noparse][[/noparse]a very nice and intelligent approach]. And I have a cheap R/C model car that has a 0.1mf capacitor connects directly across the power connections on the toy dc motor [noparse][[/noparse]a cheap quickie approach].

    The truth of the matter is that without owning a good oscilloscope, you really have no way of accurately placing the capacitors where they do the most good and you have no way to 'tweak' their values to the optimal results.

    Like all of us, we generally guess and if it works that's it. Real engineers invest in a lot of good equipment as they have to follow up their design estimates with real observation. They everything goes back into redesign until it is gotten right.

    What I have been trying to point towards is the genral 'rule of thumbs'.· Use a by-pass capacitor on the supply to each chip, follow the manufacturer's spec sheet, and trap noise before it gets into the power system where you have to become concerned with it being amplified and distributed everywhere.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 2/17/2006 4:17:03 PM GMT
Sign In or Register to comment.