I am doing the basic projects as suggested in the arduino tutorial book. I am currently working on 'MOOD CUE' where we are using servo motors and potentiometer. My question is why are we using decoupling capacitors in parallel with the potentiometer and the servo motorr in the circuit? The book doesn't give a clear in-depth explanation and I am finding it very difficult to move forward without understanding it's purpose.
From my understanding, a capacitor tends to act like an "open circuit" with a constant voltage across it after it has been charged from a DC source. I assume that in the circuit as per the book, they want to have constant voltage across the potentiometer and the servo motor. If this is correct, why do they want to have a constant voltage across these two things?
The decoupling capacitors act to smooth out the signal and remove high frequency components (which would give strange readings). Think of a capacitor as something that has inertia - it tends to resist change. True, it pulls no current once it is charged to some voltage (well, except for leakage), but it resists change so that noise etc. on the signal tend to get absorbed by the capacitor. That is one function. Along similar lines, you usually will have a capacitor across the power and ground pins of an IC - the purpose there is to absorb the switching transients generated by the IC and prevent them from causing other issues with other chips (or even the chip it is across). You will typically find ceramic caps very close to IC's on any well designed circuit board.
DrAzzy:
Is that a correct use of the term "decoupling"? I would call the cap you often put on a pot like that a filter, not decoupling...
That is sort of a fuzzy area - true, it is part of a filter, however, it can also be viewed as "decoupling" the input to the arduino from the noisy source. Both terms apply, the trick is understanding just what the capacitor is doing in the circuit.
I would say that decoupling is a special case of filtering where the filter you are designing is a DC pass filter. A bit of a conceptual headache so that is why it has its own special name.
The basic difficulty to understanding is that at high frequency (more exactly with load changes rapidly), the
power supply wiring is dominated by stray inductance, so a 0.01 ohm piece of wire behaves like it has 10's,
100's or even 1000's of ohms - it is no longer a stiff voltage source at all, but very "floppy"!
So you need to bolster the supply near to the load with a stiff voltage source (a capacitor acts as
such at high frequencies/short time scales). This means the length of supply wiring between load and
stiff voltage source is much less, so the stray inductance is much less, so the load sees a stiffer voltage
source.
For logic chips < 1cm is a good distance to the nearest decoupling capacitor, because the timescales are
nanoseconds at which a few nanohenries of inductance matters.
For a motor a few inches is fine, but the capacitor needs to be thousands of times larger, and it also acts
to supply extra current during the peaks.