I am having problems with spikes/drops in potentiometer readings and am trying to find out what is causing it. The setup I have consists of an Uno R3 connected to a 9V power supply and also connected to an OTG Tablet via the USB Type B connector. The Tablet is running on it’s own battery.
Sensors used are a B1K potentiometer (I also have a B5K which shows the same problem) and a Melexis US1881 Hall-effect sensor) and the Arduino is also doing the PWM for a servo. The servo is quite grunty (33kg/cm) and has its own 5V/3A power supply. The servo has ground connected to one of the Arduino GND pins and the also to the GND of the power supply. The potentiometer and Hall-effect sensor share 5V from the Arduino, as well as GND (the second GND pin). Please see attached drawing.
The wiring is heat-shrunk together from the Arduino. The potentiometer is about 75cm from the Arduino, the rest of the wiring then goes to the HE sensor and the servo. The servo’s power supply wiring is a separate wire but is joined by the GND from the Arduino close to the servo. So the GND and PWM wires for the servo is in the same heat-shrunked section as the the wires for the pot and HE sensor. The wires are quite thin (7 strands tinned copper).
Typcially problem readings look like this: (circled areas on graph)
515,501,513 (drop of 14)
516,533,514 (spike of 17
A possible remedy could be to discard these spikes/drops, but I would like to find out what is causing these and would appreciate any feedback as to what can be fixed or improved to improve stability as I have occasionally very jumpy readings or stable readings with spikes/drops.