Go Down

#### AJITnayak

##### Feb 26, 2013, 02:02 pm
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.

AMPS

#### SurferTim

#1
##### Feb 26, 2013, 02:10 pm
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

#2
##### Feb 26, 2013, 02:11 pm
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

#3
##### Feb 26, 2013, 02:14 pm
How accurate is your 3.3V reference voltage?  How accurate is your multimeter?

#### AJITnayak

#4
##### Feb 26, 2013, 02:16 pm
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

#5
##### Feb 26, 2013, 02:21 pm
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.

#### AJITnayak

#6
##### Feb 26, 2013, 02:21 pm
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

#7
##### Feb 26, 2013, 02:23 pm
If the reference voltage is showing 3.4, then use that in your calculation instead of 3.3

#### AJITnayak

#8
##### Feb 26, 2013, 02:25 pm
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

#9
##### Feb 26, 2013, 02:28 pm
m is the scale correction, c is the offset correction.

#### Groove

#10
##### Feb 26, 2013, 02:28 pm
Dear AMPS-N,
When are you going to stop relying on the forum to do the most basic tasks, and start thinking for yourself?

#### AJITnayak

#11
##### Feb 26, 2013, 02:30 pmLast 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

#### AJITnayak

#12
##### Feb 27, 2013, 02:41 am
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