Go Down

Topic: offset correction for analog input (Read 1 time) previous topic - next topic

AMPS-N

Dear all,

I am trying to read the value from potentiometer through analog pin A0.I have provided 3.3 v as reference voltage from arduino board  And output is connected to A0 input. I just pasted simple code(http://arduino.cc/en/Tutorial/ReadAnalogVoltage  ) and changed 5.0v to 3.3v .

observation at output side : if i compare voltage across  pins using multimeter and Serial monitor there is difference of 0.2v-0.3v. How can correct this 0.2v difference in voltage. such way that actual coming from serial monitor and multimeter. similar thing has observed if i give reference voltage of 5v.

Please suggest me formula/links/ code to correct the factor.




AMPS

SurferTim

Is your problem an offset or scaling error? Is it a constant offset, or does it change with the analog value? Input 0v and 3.3v. Is the offset the same with both?

If it is offset, add or subtract the offset from the final value.
If it is scaling, change the 1024 value to adjust the scaling factor.

PaulS

That code does not use an external reference voltage. If you have, indeed, connected a voltage to ARef, you need to tell the ADC that.
http://arduino.cc/en/Reference/AnalogReference

majenko

How accurate is your 3.3V reference voltage?  How accurate is your multimeter?

AMPS-N

Its offset , offset of plus or minus 0.2 to 0.3v and it is not stable. 0.2 v at starting and at end -0.3v  approximately.



Is your problem an offset or scaling error? Is it a constant offset, or does it change with the analog value? Input 0v and 3.3v. Is the offset the same with both?

If it is offset, add or subtract the offset from the final value.
If it is scaling, change the 1024 value to adjust the scaling factor.

AMPS

SurferTim

I would use 0v input to adjust the offset to get 0v reading 0v. Then adjust the 1024 value to minimize the scaling error at 3.3v. It may not be possible to exactly match the same voltage over the entire input range.

AMPS-N

for the reference voltage it showing exactly 3.4 v .  But  i compare out put between Serial monitor and multimeter toward  gnd side showing 0.2v difference in voltage and toward Aref side showing -0.2t0-.3 v of voltage difference when pot has been moved.



How accurate is your 3.3V reference voltage?  How accurate is your multimeter?
AMPS

SurferTim

If the reference voltage is showing 3.4, then use that in your calculation instead of 3.3

AMPS-N

Dear all.

can some one tell me for above code how can use this formula y=mx+c

where c is correction factor.Since out put is linear i think is i can use correction factor it might work.
AMPS

SurferTim

m is the scale correction, c is the offset correction.

Groove

Dear AMPS-N,
When are you going to stop relying on the forum to do the most basic tasks, and start thinking for yourself?
Per Arduino ad Astra

AMPS-N

#11
Feb 26, 2013, 02:30 pm Last Edit: Feb 27, 2013, 02:47 am by AMPS-N Reason: 1
Thanks one all for the long support provided by you.

i changed following in my code in order to match the reading of multimeter and Serial monitor data

replace (5/1023)=(0.0048828125

if using 3.3 as reference voltage (3.3/1023)= 0.003225806
AMPS

AMPS-N

Thanks for suggestion. yes i accept that i  am relie on forum for small basic tasks.According to me the basic steps only solve the major cause.

I have posted my major problem where people like you not come to resolve it and they discussing other things.If you really wanna help please solve the problem i posted in Solar tracker.if u didn't get it.this problem

I wanna do some cheap solar tracking application( I have already achieved using GPS/RTC/Inclinometre/Arduino  boards/linear actuator)to reduce cost i just get reed of GPS/Inclinometre. I wanna use only RTC and linear actuator.SO here no feed back sensor to record the position . Using linear actuator and RTC how can i do it. i think you can give me idea. I don't need ether net . recording power achieved facility and all which are already posted in forum .I hope you will solution instead of giving suggestion









Dear AMPS-N,
When are you going to stop relying on the forum to do the most basic tasks, and start thinking for yourself?
AMPS

Go Up