EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: Lucky-Luka on March 31, 2021, 08:41:14 am
-
Hi all
I've found a schematic in an Arduino book and this is my question: is a decoupling cap needed for a potentiometer to be read correctly by a uC?
Thanks
-
An Arduino is *NOT* a simple MCU, its a MCU board with on-board decoupling. Unless a MCU is very close to a low impedance supply source, local decoupling is usually required for a MCU to function correctly and reliably.
Now lets consider the schematic you posted. RC servos draw large current spikes, especially if a large position change is commanded, so a large decoupling capacitor as close as possible to the servo is essential if they share the same supply as any MCUs or other logic. However the other 100uF decoupling capacitor would be best *NOT* wired across the potentiometer but directly across the Arduino's +5V and Gnd pins. where it could be most effective at minimizing the disturbance from the servo current spikes.
Ideally the potentiometer would be wired up with shielded cable, with the shield grounded at one end (usually the Arduino end) and soldered to the pot body if its metal. If EMI resistance is less important, an unscreened cable consisting of three wires twisted together may be used, or even three adjacent wires in a ribbon cable. Avoid individual wires with a large loop area. Its frequently helpful to add a 100nF capacitor to ground directly at the ADC pin to low-pass filter the voltage from the potentiometer.