Pages: [1]   Go Down
Author Topic: ADC Accuracy  (Read 971 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I'm having some trouble to read accuracy values from analog inputs. Using a modified version of AnalogInput example and a 0.88V in the analog input 3 I'm reading a value of 699 that's iqual to 0.75V.

Now I'm using analogReference(INTERNAL); but I tried with analogReference(EXTERNAL) setting AREF pin to 5V and had the same 0.750V.

My 5VDC source is a 7805 wired to a 12VDC source. I don't have a ocilloscope to see it is flat on 5V then I changed 12VDC to another source and nothing change.

I have a atmega328 in a breadboard. I changed the chip, moved it to arduino board and the same 0.75V was read.

That's my code:

int sensorPin =A3;    // select the input pin for the potentiometer
int sensorValue =0;  // variable to store the value coming from the sensor


void setup() {
  // declare the ledPin as an OUTPUT:
  Serial.begin(9600);
  analogReference(INTERNAL);
}

void loop() {

  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);
  // turn the ledPin on
  Serial.print(sensorValue);
  Serial.print(" - ");
  Serial.println((sensorValue* 1.10) / 1024.00);
  delay(sensorValue);                 
}

Logged


Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17262
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What is your board's +5vdc read exactly on a good digital multimeter? Most regulators have a +/- tolerance and the exact value has a bearing on the ADC 'accuracy'. Even switching from the on-board 5 volt regulator to using USB power can change the ADC readings proportional to the specific difference in voltage from those two sources.

Lefty

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I tested my multimeter and it reading OK. Because some variation on the source I changed from external AREF to INTERNAL.

thanks
Alex
Logged


Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33373
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
My 5VDC source is a 7805 wired to a 12VDC source. ...... then I changed 12VDC to another source and nothing change.
No nothing should, the regulator is producing the same voltage output independent of the voltage source driving it (within limits) that is it's job, it is what you expect.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nothing changed in arduino reading.

I change de source bacause some variation on GND can cause accuracy variation. So, I tested with two diferente DC sources.

Thanks
Alex
Logged


Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33373
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
some variation on GND can cause accuracy variation
No.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17262
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tested my multimeter and it reading OK. Because some variation on the source I changed from external AREF to INTERNAL.

thanks
Alex

You didn't answer my question, what is the exact value of the board's +5vdc reading from a mulitmeter? The answer isn't OK or not OK, it's a number.

Lefty

Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I can't reproduce your problem. Feeding in 0.88V into A3 I get this:

Code:
818 - 0.88
817 - 0.88
819 - 0.88
817 - 0.88
818 - 0.88
818 - 0.88
819 - 0.88
818 - 0.88
820 - 0.88
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
some variation on GND can cause accuracy variation
No.

I had issues using other ADC chips, but this is not the question.

Alex
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I tested my multimeter and it reading OK. Because some variation on the source I changed from external AREF to INTERNAL.

thanks
Alex

You didn't answer my question, what is the exact value of the board's +5vdc reading from a mulitmeter? The answer isn't OK or not OK, it's a number.

Lefty



5V.

Thanks
Alex
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I can't reproduce your problem. Feeding in 0.88V into A3 I get this:

Code:
818 - 0.88
817 - 0.88
819 - 0.88
817 - 0.88
818 - 0.88
818 - 0.88
819 - 0.88
818 - 0.88
820 - 0.88

Thanks for the try. What is your Board/uC ?

Thanks
Alex
Logged


Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Uno Rev 3 with an Atmega328.
Logged

Pages: [1]   Go Up
Jump to: