1
\$\begingroup\$

I am trying to make Arduino work in conjunction with 16-bit ADS1115 ADC and generic 10k potentiometer. However I noticed that there is some serious noise and values are way too inconsistent. Here is the graph when I am rotating the potentiometer between my intended min/max angles (on the right, notice the inconsistency, physically the angles are always the same), and on the left are the values if am not touching anything (I shifted the value by 5 bits to reduce noise, but honestly it's still bad):

Graph

This is the schematic:

Schematic

Any advice on how to reduce noise please? All the wires are not too long (wires to pot are around 30 cm, between Arduino and ADS1115 - 10 cm).

Oscilloscope shows this:

Oscilloscope

\$\endgroup\$
4
  • \$\begingroup\$ Potentiometers have stiction, some types more than others. Don't expect 16-bit accuracy without a properly designed board. \$\endgroup\$
    – DKNguyen
    Oct 9, 2021 at 20:52
  • \$\begingroup\$ Hook up an Oscilloscope in parallel to the ADC - those measurements might be real, and the potentiometer of the "scratchy" type. That is also one reason why modern electronics has switched to rotary encoders for audio type hardware. \$\endgroup\$
    – Turbo J
    Oct 9, 2021 at 21:22
  • \$\begingroup\$ I don't think the ads1115 is adding much value for you vs the mega328 adc. A simple RC filter on the input will go some of the way to reduce the noise - say 10k/100nF. With any input, software filtering is a good thing. For analog input I would use a 1st order IIR filter. You can then dial in the response you want. \$\endgroup\$
    – Kartman
    Oct 10, 2021 at 0:26
  • \$\begingroup\$ @TurboJ I had updated the question. The measurements are real. Do you think I need to replace the potentiometer with rotary encoder? I only have the ones with "steps" though. \$\endgroup\$
    – danshat
    Oct 10, 2021 at 9:01

2 Answers 2

1
\$\begingroup\$

There may be some mechanical hysteresis in the pot due to a loose crimp (or due to how you are attaching to the shaft). Always approaching a position from the same direction (eg. CCW) will help with that. As will a higher quality pot. Most pots are hardly good to 7 bits let alone 16. Unless you have a very long lever arm it's hard to get the pot twice to the same angle. In the extreme you can mount a laser pointer to the shaft and create an optical lever arm.

For a new pot, turn it completely from one end to the other 5 or 10 times to help seat the wiper.

Adding an RC filter (eg. 5K and 10uF) may help with noise as will software filtering.

For precision you have a bad situation- you are deriving the pot excitation voltage from the unstable and noisy Vcc line, but your ADC has an internal reference (which, unfortunately, is not accessible to allow a ratiometric reading). Consider adding another reference for the pot such as an LM4040 or a series reference. Even a lowly penny LM431 shunt reference would be better than using Vcc.

To use a 2.5V LM4040, something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

Connect the pot and LM4040 ground directly to the ground on the ADC board, not to the Arduino or to the power supply ground.

This puts about 280uA through the LM4040 which is more than adequate (80uA is required). The LM431 requires more like 1mA.

\$\endgroup\$
-1
\$\begingroup\$
  1. Check your wirings.
  2. Post your code.
  3. ADC requires sampling, take 10 readings, divide by 10, and you should get a better number, this is already implemented in the arduino library when using built in adc.
\$\endgroup\$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.