# ATMega328 attenuated potentiometer voltage

I've just got this problem: I have a potentiometer with resistance of 50k and i have an arduino nano which has an ATMega328 IC on it.

I attached the potentiometer normally: two pins for source and gnd and one pin going to the arduino nano's analog pin.

If i turn the knob slowly, the potentiometer increase its reading linearly and nicely. But if i were to turn the knob rapidly, say from medium to low, the potentiometer momentarily jumps up to the source voltage and return to its normal reading after 2 seconds or so. I'm suspecting that's because the arduino nano's analog pin attenuate the voltage so much and momentarily give me wrong readings. I checked ATMega328's datasheet and they have an internal resistance of around 60k which makes sense perfectly.

I'm using the potentiometer in an alarm clock to set the time precisely whenever i turn it and it always momentarily jumps to the highest reading or to the lowest reading. I can always wait a moment to make the values stable again but that takes too much time.

I could have simply lower the resistance of the potentiometer to around 10k or 5k but do you guys have another solution for this?

Thanks in advanced.

• Using a pot to set the time? Curious.... You may need to supply more information about how you are handling the ADC value too... that 2S thing sounds suspicious. Jul 17, 2017 at 19:41
• This is most likely a software problem. It would take a huge amount of capacitance to cause the behavior you report over such a long time scale, so that is out. You need to show a minimal piece of code which illustrates the problem. Jul 17, 2017 at 19:44

## 1 Answer

Make a follower aka buffer with an op-amp. Connect the potentiometer's output to the $V_{in}$ of the op-amp and $V_{out}$ to the Arduino.

A follower/buffer is great at making weak signals strong.

• Can you provide some general-purpose buffer parts name so that i can look it up? I know that a simple npn transistor like 2n2222 would be enough to make an emitter follower but the voltage would drop 0.6V so do you recommend any other? Jul 18, 2017 at 5:34
• All kinds of OP-amps can do the schematic above. If you need rail-to-rail (your output will swing from -supply to +supply => go from 0V to 5V) then you need this kind of setup if your op-amp doesn't do rail-to-rail. So a common LM358(doesn't do rail-to-rail) or a LM741(also doesn't do rail-to-rail) or any other op-amp that can be fed with 5 volts, cause that's what you're powering your arduino with, I assume, will work. Jul 18, 2017 at 11:50