Decoupling capacitors

Discussion in 'General Electronics Chat' started by cmartinez, Jul 15, 2015.

  1. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    3,554
    2,509
    Normally, I use decoupling 0.1 µF capacitors (X7R, SMT type) between the Vcc pin and ground for all of the chips in my 5V digital circuits.
    Would using 0.2 µF caps provide even better protection against glitches caused by instabilities in the Vcc line? Or would it be overkill?
    For example, I'm under the impression that a standard 2.2 µF electrolytic paired with a 0.1 µF X7R is good protection. But is using a 4.7 µF electrolytic with a 0.2 µF X7R even better?
     
  2. crutschow

    Expert

    Mar 14, 2008
    12,981
    3,221
    Actually it may be worse since larger capacitors tend to have higher stray inductance. It's the parasitic inductance that generally limits the high frequency attenuation of the capacitor.
    For that reason sometimes a 0.01 µF capacitor works better for decoupling high frequency noise than a 0.1 µF one.
    You can go to the capacitor data sheets and look for the impedance versus frequency of the different values to see this effect.
     
    cmartinez likes this.
  3. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    3,554
    2,509
    I knew that the question sounded kind of stupid when I posted it, but I just had to make sure... and it's paid off, thanks to you.
     
  4. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,301
    880
    Neither; a 0.2uF capacitor might not even be as good as 0.1uF or 0.047uF, because of its high-frequency characteristics. Besides, taking care of "instabilities in the Vcc line" is properly a job for one or more bulk storage capacitors-- for me, typically, that would be aluminum electrolytics in the range of 10uF-100uF.

    I doubt it.

    My general rule of thumb is for CMOS logic, one 0.1uF X7R per chip; for medium-speed opamps, one or 2 0.1uF or 0.047uf X7R's per chip (depending on whether the chip is operated off a single supply or dual supplies); for high-speed opamps, a 0.1uF X7R in parallel with a 0.01uF X7R; and for all others, capacitance according to the device data sheet recommendations.

    But bigger capacitors are NOT always better, because bigger capacitors are likely to have more effective series inductance.
     
    cmartinez likes this.
  5. dl324

    Distinguished Member

    Mar 30, 2015
    3,214
    619
    A larger electrolytic may help because it's also a smoothing capacitor. But the value for high frequency decoupling depends on the frequencies you're trying to decouple.
     
    cmartinez likes this.
  6. alfacliff

    Well-Known Member

    Dec 13, 2013
    2,449
    428
    a too large value of capacitance will cause more surge current on power up. remember all the decoupling caps are in paralell, and have to be charged up on power on.
     
  7. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    3,554
    2,509
    Let me be more specific then. I built this circuit that switches a solenoid valve on and off every 25 ms. The solenoid is switched on for the first 0.5 ms using 120VDC pulses (around 14 Khz) controlled by a FET. After that, it stays on for about 7 more ms powered by 12VDC and then it shuts down.

    So I have three voltage levels in this circuit, that is 12, 5 and 120VDC. The primary source is 12VDC, the 5V is produced by a 7805 regulator, and the 120VDC by a switch mode power supply being fed by the 12VDC source.

    When I turned the circuit on, the MCU (an AT89LP4052) would reset itself constantly every time it tried to switch the valve on. And it wasn't until I placed real heavy caps (100 µF) at both the input and output pins of the 7805 that things began to improve. They finally stabilized when I placed a 10 µF electrolytic paired with a 0.2 µF X7R at the MCU's Vcc pin and ground.

    My fear is that later on as I start interfacing more things to the circuit, the MCU's input pins might be affected by this noise too.
    Is there a better way to protect the digital side of this circuit other than the decoupling capacitors I just mentioned?
     
  8. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,301
    880
    No wonder you asked about decoupling caps... yowza!!

    Yes, I can think of several things.
    • Even bigger caps, like 220uF or even 470uF, fore and aft of the 7805;
    • A filter choke, like a couple of hundred microhenries, ahead of the 7805 input and its filter cap;
    • A separate choke + filter cap ahead of your 120VDC switching regulator, to isolate it from the +12V going to the 7805;
    • Very, VERY careful attention to ground topology, so that the switched currents from your solenoid don't pass through (or even near) the grounds of your digital logic; and
    • Keep all connections to your solenoid as tight as possible to avoid forming a large-area current loop on the board which could inductively couple to your digital logic.
    If anything else comes to mind, I'll post it...
     
    cmartinez likes this.
  9. JohnInTX

    Moderator

    Jun 26, 2012
    2,339
    1,022
    First, I'd be sure that you aren't getting noise into the RST input. Temporarily strap it to the power supply pin (depending on whether its active high or low) then try your test.

    The big caps on the 7805 may help any droop but be sure your power/ground paths are separate i.e. don't share uC power wires with big loads. Run power/GND for each on separate wires to the regulator with heavy decoupling there.

    FWIW, an old Intel Apnote decscribed decoupling cap selection. Small, high freq caps e.g. ceramics close to the power pins of the logic with low-inductance wiring to provide a local source of switching current. Bigger tantalum caps nearby to recharge the small decoupling caps and a large Al electrolytic near the power input to provide a local supply downstream of power supply wiring etc. The types and values are somewhat dependent on what the demands of the device(s) are but .1 ceramic || 1uF tant is my starting point for all power pins.

    I did a lot of PIC work for a process analyzer with lots of 24bit ADC's sharing the board with 5V PICs. The engineers used spectrum analysis to select the types and values of the decouplers - 8 caps of various types and values on each power pin. It was quiet enough to get a genuine 24bits of data out of it.

    Good luck!

    EDIT: OBW got in under me - you can reduce the effects of magnetic coupling by twisting the coil wires.
     
    cmartinez likes this.
  10. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    3,554
    2,509
    Thanks! it's good to know that bigger is better, at least in this case. I hadn't considered the chokes. Would you please clarify what you mean with the word ahead? Native spanish people like me tend to interpret things backwards sometimes when they're described in a foreign language.

    Actually, the AT89LP4052 reset pin works at logic high. But that pin's already taken care of, by it being tied to ground through an 8k2 resistor, and decoupled to Vcc with a 10 µF cap.

    Twisted pair cabling to the solenoid, and from the 120VDC power supply is something that I hand'n considered. Thanks for mentioning it.
     
    Last edited: Jul 15, 2015
  11. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,301
    880
    "Ahead of" = "at the input to", or "between the +12V source and the input to"
     
    atferrari and cmartinez like this.
  12. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    3,554
    2,509
    yup... I had it backwards... glad I asked and you clarified... thanks!
     
    atferrari likes this.
  13. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    3,554
    2,509
    This is what I have available right now for the choke between the 12VDC and the 120VDC power supply... but it's far from being "a couple hundred mH". You think it might work?
     
  14. JohnInTX

    Moderator

    Jun 26, 2012
    2,339
    1,022
    I would tie it to GND as a test. PICs used to be very sensitive on MCLR/, even with an RC attached. uCHIP eventually put in a digital delay on MCLR which helped. Don't know about the AT.
     
    cmartinez likes this.
  15. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,301
    880
    Couple of hundred microhenries, not a couple hundred millihenries. The value was meant as a minimum, so what you have available there (20 mH) will probably do the trick nicely.
     
  16. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    3,554
    2,509
    :eek: I wasn't paying attention to the M vs m thingy here... but hey... what's three orders of magnitude among friends? :D

    So I'll place that choke between the 12VDC power source and the 120VDC PSU, plus a filter cap between the choke and the 120VDC PSU, or a filter cap between the 12VDC source and the choke, or both? or there would be no difference as to which side I mount them on?
    I have a few 1000 µF @ 63V electrolytic caps laying around... would that do the trick?
     
  17. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,301
    880
    Connect the choke between the 12VDC source and the input to your 120V switcher, and your filter cap between the switcher input and ground. 1000μF should be more than enough...
     
    cmartinez likes this.
  18. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    3,554
    2,509
    Will do... thank you very, very much!
     
  19. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,281
    1,232
    @cmartinez
    I have another 2 cents worth of ideas.
    There are a few things that are just good to do. For example you don't want the high current passing thru the 12 volts or ground for the logic. So the old star ground thing applies.
    Since everything is "made" from the +12 and power supply decoupling seems to fix it one thing to look at is the distance of the 12 volt supply from the board. Twisting these wires will help reduce the inductance in those lines. Also a "big cap right at the board. I'm not so sure about the inductor as now the decoupling caps on the 12 volts have to supply the current for a while.
    The 120 volts flying around at 14Khz could easily couple into logic signals if their lines are close.
    I think you have a scope so it might be useful to see what part of the cycle the noise is getting in. It's probably still around even when it's working. Might be able to fix it at it's source if we knew what it was.
     
    cmartinez likes this.
  20. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,003
    1,517
    I know ceramic caps are cheap and that you guy's all say one for each chip, but the TTL and CMOS cookbooks recommend one cap for every six chips. Is there a reason why there is such a discrepancy?
     
    OBW0549 likes this.
Loading...