Hi Guys!
I know for some point, people like myself tend to ask questions about the accuracy of sensors and readings.
Background of my setup:
1x LM35 sensor
2x 220 ohm resistors acting as voltage divider
My objective:
measure temperature and voltage across the divider XD
Question:
I know people tend to use 5v*sensor reading/1024 to get the feed back voltage. And i know it is not accurate, after googling i have found this to get the real voltage reading, codes are here :
long result;
// Read 1.1V reference against AVcc
ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
delay(2); // Wait for Vref to settle
ADCSRA |= _BV(ADSC); // Convert
while (bit_is_set(ADCSRA,ADSC));
result = ADCL;
result |= ADCH<<8;
result = 1126400L / result; // Back-calculate AVcc in mV
return result;
(adopted from Google Code Archive - Long-term storage for Google Code Project Hosting.)
and i have also read up some information about using the Aref in Tutorial: Arduino and the AREF pin | tronixstuff.com
So, lets keep it short, which method is better?
Thanks in advance!!
Regards,