How to convert 10K Pot raw output ADC data to voltage and resistance from arduino uno

adcarduinopotentiometer

I have a simple and basic question. I am using Arduino uno to read the output from a 10K potentiometer. I understand that Uno uses a 10 bit ADC, therefore it can display outputs from 0 as 0V to 1024 as 5V.

Question: I am getting these values from the pot and displayed on the serial monitor of arduino IDE, while I vary the resistance of the 10K Pot. How am I supposed to calculate or know the output voltage and resistance corresponding to the values from 0 to 1024?

Another question is, when I vary the POT's knob to a maximum point i.e. 5V, the output displayed is 1007 or 1008. Isn't it supposed to output 1024 for 5V?

Best Answer

A converted value of 1024 would correspond to 5v - or to whatever voltage you put on the chip's Vref pin. But with 10 bits, the maximum number the converter can deliver is 1023. It's a small difference, but keep it in mind.

To find the voltage corresponding to a the converted value: V = (value / 1024) * Vref. Thus a reading of 1008 corresponds to 4.92v, assuming 5.00 volts at Vref.