Voltage Source, Variable Current and Decoupling Capacitors

Hi,

As a programmer, I wanted to learn about the physical, i.e. electronic level of computing, which I always considered a kind of black magic (and I still do, as it seems), so I got an Arduino Starter Kit with an Arduino Uno and hope to get into electronics a bit.

My first question is about these decoupling capacitors. I'm advised to use these when there are rather quick changes in current draw from some components, because the voltage source of the Arduino couldn't handle such changes very well. This is said to be because changes in current draw cause changes in the supplied voltage, and these changes happen too slow on the Arduino. What I don't understand now is how the supply voltage can change. Isn't it supposed to be a constant 5V at most of the pins?
I have googled a bit and the only thing I can think of is that the actual output voltage differs from the internal voltage because of internal resistance in the voltage supply, and that this is compensated by the Arduino by providing a higher internal voltage, so that the actual output voltage remains at 5V. But then, I could be totally wrong. Is this right? And if so, there must be a limit on how far the Arduino can push the internal voltage up. Do I have to worry about this?
Also, I just thought about what happens when the capacitors are not loaded yet. In that case, for the other components to draw their needed current, the supplied voltage must be higher for a small time, is that the case?
And then, what does "drawing more current" mean in particular? How can a component force more current to flow through it? As I understand that, it could lower its resistance, but then the supply voltage wouldn't have to change, or it could build up some internal electrical field. Now, with a servo motor for example, what is the case?

So many questions!

Thanks in advance!

Hi,

You're right, it's advice that seems like the product of a dark art. The supply voltage will change simply because of demands for more current from the regulator. It will do its best to keep on track, but the voltage supplied to the microcontroller (in this case) will waver slightly. I thought I'd bookmarked a great little writeup by Mike Cook or similar...but can't find it.

This one from hack a day tells the story though for how the lack of them can impact transitions in digital signals, such as those we need to be nice and reliable in an Arduino.

If I find that other link I'll return and past that too...

Cheers ! Geoff

Wouldn't you know it - found it almost instantly after posting. Mike's write-up was hiding in plain sight in his blog.

It is an 'engineering problem'. The regulator can be used in a wide range of circuits with various requirements so the regulator is built simply and the implementation is left to the circuit designer. Distance from the supply can also play a factor so you see may see decoupling capacitors on circuit components. Mainly it is cost. Keep the cost of the regulator down and let the circuit designer add the needed decoupling. Remember, many times this one component will go on hundreds to millions of circuits so adding unneeded cost is marketing suicide.

In theory, the bigger your source the less any one component will affect it. This is like old houses when a motor starts you see the light dim but rarely do in more modern homes with better wiring.

alemariusnexus:
What I don't understand now is how the supply voltage can change.

Imagine a big trough of water. If I use a bucket to scoop out some water there'll be a temporary dip in the level of water where I do it (and quite a few waves sloshing around for a while afterwards).

How can that be? Water in a tank always stays perfectly level, right?

Decoupling is nothing to do with deficiencies with the regulator - its all about serial inductance in the power and ground distribution
allowing the voltage to dip - each decoupling capacitor is like a pit-prop holding up the supply voltage at that point - you add these
props right close to every IC to ensure proper operation.

A logic output signal can swing 5V in 5ns - that's a billion volts a second. If that signal is powering an LED at 20mA, then the
current changes at 4 million amps/second. These rates of change turn even small stray capacitances and inductances into
important circuit components that have a significant effect (a few cm of PCB trace has enough inductance to matter, hence
the need to place the decoupling caps right next to the IC). The stray capacitances cause temporary currents to flow during the
change, increasing the current change through the stray inductances when there is no obvious load like an LED
(for instance 10pF will cause 10mA to flow for those 5ns)

The real issue with decoupling is that it is pattern sensitive - it all depends how many gates switch together and in which direction
as to whether the supply voltage droop is large enough to become a problem - for reliable operation people add enough decoupling
to cover the worst case plus a large safety margin. 100nF on a simple logic chip, 100nF + 10uF on a larger chip or one with significant
loads.

For analog circuitry it all becomes much more important to control noise and limit unwanted feedback along supply rails.