Pages: [1]   Go Down
Author Topic: offset correction for analog input  (Read 669 times)
0 Members and 1 Guest are viewing this topic.
DELHI
Offline Offline
God Member
*****
Karma: 0
Posts: 602
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.




Logged

AMPS

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 116
Posts: 5400
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 553
Posts: 46299
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

UK
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3969
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Why not visit my eBay shop? http://stores.ebay.co.uk/Majenko-Technologies
Replacement for the Arduino IDE: UECIDE - Proper serial terminal, graphing facilities, plugins, overhauled internals.
Java isn't bad in itself, but it has enabled morons to write programs.

DELHI
Offline Offline
God Member
*****
Karma: 0
Posts: 602
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

AMPS

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 116
Posts: 5400
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

DELHI
Offline Offline
God Member
*****
Karma: 0
Posts: 602
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

AMPS

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 116
Posts: 5400
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

DELHI
Offline Offline
God Member
*****
Karma: 0
Posts: 602
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

AMPS

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 116
Posts: 5400
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

UK
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2883
Gorm deficient
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Per Arduino ad Astra

DELHI
Offline Offline
God Member
*****
Karma: 0
Posts: 602
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: February 26, 2013, 08:47:03 pm by AMPS-N » Logged

AMPS

DELHI
Offline Offline
God Member
*****
Karma: 0
Posts: 602
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

AMPS

Pages: [1]   Go Up
Jump to: