Remove Offset Vales from Calculating Analog Port Outputs

Hello all.

I have one question.

When 0 volt is applied on an analog pin of Arduino, still we get an integer value as output.

For this, we can't get the exact voltage across any resistance.

My question is, what is the technique to remove this offset voltage?

Any help would really be highly appreciated. :slight_smile:


Where are you getting this 0V from, does it share a common ground, are you measuring a voltage drop across a resistor (eg measuring a 4-20 mA ouput), how many readings are you taking? are you using a rolling average or taking 10 readings, ignoring the largest and smallist and taking the average of the rest?

Thanks a lot for the questions.

Actually, I'm trying to show the present voltage of a power source (0-30 volts) on Arduino serial port. I'm following the exact steps shown here:

When I want to see the output, I see that when the power source has, let's say, 10 volts, the serial monitor is showing nearly 13 volts.


are you using the exact value of resistors? have you measured them and entered the values into the program? 30% is a huge offset!

I'm using potentiometers.