8

I'm a beginner in electronics from the software industry. With some self-taught things, I'm trying to implement some basic Arduino circuits. My confusion is about capacitors mainly. My understanding about capacitors is that they act as power storage for few seconds or milliseconds.

I found that most IC's must have capacitors connected to their pins.

My confusion is how to find out which pins need a capacitor, and how to find the correct capacitor for a circuit or a capacitor for an IC.

Finally, why are capacitors necessary in a circuit in such situations?

Daniel
  • 1,600
  • 3
  • 16
  • 24
Sandeep Thomas
  • 639
  • 9
  • 20
  • 9
    That's what the IC's datasheets are for. –  Aug 28 '17 at 18:17
  • 11
    One weird trick to successful electrical engineering: *read the datasheet* – Cuadue Aug 28 '17 at 19:27
  • 2
    First, RTFM (refer to the fine manual, aka datasheet). – Spehro Pefhany Aug 28 '17 at 19:28
  • 4
    @SpehroPefhany `RTFM (refer to the fine manual)` What a kind way to put it, I've only ever heard it as the alternative `Read the f****** manual` XD – DerStrom8 Aug 28 '17 at 19:48
  • 11
    @Cuadue I tried it, and I couldn't believe what happened next... – nitro2k01 Aug 28 '17 at 20:29
  • 2
    These comments are not helpful.. this is a legitimate question, and anyone who's read a datasheet knows that although it tells you which pins to decouple, it doesnt't tell you why it needs it or the justification for the value recommended, nor more basically why decoupling is needed in the first place. So, how about giving the guy some help rather than smart ass answers? For what a useful answer should be like, refer below to @DerStrom8 answer – jrive Sep 01 '17 at 19:41
  • @jrive Thanks for understanding my concern.. for a beginner data sheets cant do anything... – Sandeep Thomas Sep 02 '17 at 03:30

6 Answers6

21

What you are referring to is called a decoupling capacitor and is used to decouple the IC supply pins from the bus. In other words, it prevents a sensitive IC from being "starved" if another device on the bus turns on quickly and draws significant current, which would drop the bus voltage for a period of time. The capacitor supplies the extra current required to start up the device, as well as to prevent its chip from suffering the effects of a sudden loaded bus. This is generally required for high-speed devices that switch very quickly, as this tends to draw significant current. The capacitor is not necessarily chosen by its capacitance, but by its ESR (equivalent series resistance) and its ESL (equivalent series inductance). Ideally you would determine the speed at which the device would turn on, and pick the capacitor with the lowest ESR/ESL for that speed. The most common decoupling capacitor value is probably 0.1uF but for faster circuits you may require 0.01uF or 0.001uF (again, depending on their ESR and ESL at those speeds). If multiple devices with different speeds exist on the same bus, you may need more than one decoupling capacitor, one for each speed.

99 times out of 100 the datasheets will tell you exactly what value decoupling capacitors to use on which pins, so read the datasheet. This tutorial from Analog Devices is also a great resource.

DerStrom8
  • 21,042
  • 8
  • 61
  • 95
  • I feel this answer looks good but isn't really complete or strictly correct. ESR and ESL are more important to serve the switching currents of digital circuits without loading the rest of the bus, which is the reverse of your definition of decoupling caps. Turn-on speed is not that important, and ESR and ESL are constant parasitics and don't change with "speed" as you imply. The value of the capacitor doesn't really matter for high-speed ICs decoupling, only the ESL/package does (different for bulk caps obviously). You're right to look at the datasheet, but I think the explanation is flawed. – jalalipop Aug 29 '17 at 17:33
  • @jalalipop If you look at the datasheet for a capacitor you'll notice that the ESR/ESL changes over a range of frequencies. There is a certain point in the frequency range where the ESR/ESL is at a minimum. This is what I am referring to. See this image: https://i.stack.imgur.com/zmMpK.gif – DerStrom8 Aug 29 '17 at 19:55
  • 1
    You want to pick a capacitor whose lowest impedance value is at the frequency you're switching at – DerStrom8 Aug 29 '17 at 20:28
  • First, that's a plot of impedance, not ESR/ESL, although they are obviously related. Second, it's incorrect that your switching frequency matters. Decoupling in digital circuits is really concerned with the frequency content of your rise/fall time, which is irrespective of switching frequency. The plot you've posted actually demonstrates that, in the high frequencies that actually matter for decoupling (aka for HF noise and for digital signals edge rates), all capacitors in a similar package perform about the same due to parasitic inductance. I could go on... – jalalipop Aug 29 '17 at 21:01
  • I admit "switching frequency" was not the correct term to use, though decoupling *does* become more of a requirement in faster circuits due to the rise and fall times during the power-on and/or switching sequence. That is what I meant by this line: `Ideally you would determine the speed at which the device would turn on, and pick the capacitor with the lowest ESR/ESL for that speed`. A device that switches on more quickly (meaning power-up or the switching of the output from high to low) will need decoupling selected depending on the ESL for that speed. And impedance = resistance + jreactance – DerStrom8 Aug 29 '17 at 21:14
  • No. Just no..... – jalalipop Aug 30 '17 at 11:43
  • @jalalipop I don't see you offering a better answer.... – DerStrom8 Aug 30 '17 at 12:30
  • You may benefit from reading the link I just added to the end of my answer. – DerStrom8 Aug 30 '17 at 12:47
16

It's all due to inductance:

Say your microcontroller draws supply current which ramps up from 1mA to 11mA in 5ns then back to 1mA every time it processes an instruction.

di/dt = 10mA/5ns = 2 000 000 A/s

Now, the voltage across an inductor is v = L di/dt and the trace from the power supply to the microcontroller has, let's say 50nH inductance...

v = L di/dt = 100mV drop on the supply.

OK, it doesn't crash yet, because it's a slow micro, doesn't use lots of current... but a faster micro, or other chip drawing faster/higher current spikes needs to have its power come from a low inductance source to avoid voltage sag when it draws current pulses, and a capacitor placed close is a good way to achieve that.

Just as important is the fact the capacitor keeps the noisy current drawn by your micro in a small local loop.

Loop antenna efficiency is proportional to area, thus amount of radiated noise will be much less when the capacitor is close.

Also if you have other components, say an opamp on the same supply, then the capacitor at the micro will prevent the micro's noise from screwing up the opamps' supply, which tends to cause some garbage at the output...

So here you have it, the caps do:

  • power integrity: caps serve high di/dt supply current locally
  • EMI: reduce loop antenna area
  • EMC: keep the noise out of the other sensitive devices

Now, how to choose the value:

  • A roll of 100x 25V 0805 X7R costs €1.40 for 100nF and €5.40 for 1µF. So, buy a roll of 100 of 1µF.
  • Every time you got to put a decoupling capacitor on your circuit, remember if you spend 10 minutes to read the datasheet and you discover 100nF will work, well you just lost 10 minutes and saved 4 cents if you only build one unit...
  • I just put in 1µF, guaranteed to work every time. Also it has less ringing, works better with lowish-ESR electrolytics, etc...
  • Also I use 25V caps so I only have to stock one value for 3.3V to 15V...
bobflux
  • 70,433
  • 3
  • 83
  • 203
  • A concise summary indeed. – analogsystemsrf Aug 29 '17 at 04:50
  • 2
    If you go around sticking in 25V X7R's, do you not consider any DC derating that renders the cap ineffective? The derating on a typical +/- 15V supply might be >50%... – Paul Uszak Aug 29 '17 at 21:04
  • 1
    Yes, you are right about the derating. I agree considering an engineering point of view, if you make thousands of board, you need to think about this. I disagree considering a DIY electronics setting. I have a reel of 1µF/25V which costs little due to quantity discount. So they are like 300-500nF at 15V... 100nF would be enough... So this reel of caps is basically "decoupling caps whatever the value is" and... it will work. – bobflux Aug 29 '17 at 21:13
6

So my confusion is how to find to which pins we need a capcitor to connect

For each chip you use, there will be a data sheet that tells you and if it doesn't tell you it's because the chip comes from a particular logic family (for instance) and there will be a manufacturer's generic data sheet for the family that will tell you.

Also how to find the correct capacitor for a circuit or a capacitor for an IC.

See the above - it's in the data sheet.

And finally why capacitor is necessary in a circuit in such situations?

A lot of chips will "consume" pulses of current and the capacitor will provide those pulses of energy so that the whole of the power supply wiring (or tracks on a PCB) don't have to handle those instances. This means better reliability and less radiated and conducted emissions to other chips and systems.

Some ICs such as op-amps will rely on capacitors for maintaining performance and avoiding instabilities on the output especially when driving some loads.

Andy aka
  • 434,556
  • 28
  • 351
  • 777
2

For what I know, the capacitance is not so important, it's just for some 'too much' energy between VSS and GND. That's why normally very low capacitors are used. I use mostly ceramic ones with 104 marking (meaning 10e4) which is 10e4 pF which is 0.1 uF.

Michel Keijzers
  • 13,867
  • 18
  • 69
  • 139
2

Level 1 (often good enough. not always.): Just slap on >10uF and 100nF paralleled, the latter with as short leads as possible.

Level 2: Just read the datasheet, as suggested.

Level 3: Read Linear Technology Appnote 47.

Also, consider using ferrite beads in your decoupling circuits.

rackandboneman
  • 3,085
  • 9
  • 13
-1

Give each power pin a 0.1 µF ceramic cap,preferably size 0805 or smaller, in parallel with a 10 µF tantalum or ceramic. You can probably omit the 10 µF cap, or replace it with something smaller,if you are concerned only about high-frequency noise.The location of larger capacitors intended for low-frequency bypassing is not quite as critical,but these also should be close to the IC—within a half-inch.

Webllena
  • 57
  • 1
  • 1
  • 5