The spec sheet gives a nominal value of 1.1 volts, but states that it can vary from 1.0 to 1.2 volts. That means that any measurement of Vcc could be off by as much as 10%. Such a measurement could be less accurate than our power supply for the Arduino!

From dhenry's comments, I don't understand what his "specific" objections are.

In general, straightforward ADC readings using a microcontroller like Arduino will haveprobably 2-5% error, at best. For 5V, that's as much as 0.25V.

First off, the v.reg voltages are not spot-on 5V, but will have up to 5% error, depending upon the specific v.regs being used. Secondly, whenever you use a voltage divider, the resistors also have their own tolerances, ranging from below 1% for high-precision parts[and who uses these] to 5% for most discrete parts. Therefore, any ADC measurements will be off from the get-go. You can use a precision voltage-reference, but still mustuse precision resistors in the voltage dividers for best results.

It seems to me that the majenko page has some good info to help deal with the firstproblem, of v.reg tolerance, so I don't see d-h's trouble.

From dhenry's comments, I don't understand what his "specific" objections are.

In general, straightforward ADC readings using a microcontroller like Arduino will haveprobably 2-5% error, at best. For 5V, that's as much as 0.25V.

First off, the v.reg voltages are not spot-on 5V, but will have up to 5% error, depending upon the specific v.regs being used. Secondly, whenever you use a voltage divider, the resistors also have their own tolerances, ranging from below 1% for high-precision parts[and who uses these] to 5% for most discrete parts. Therefore, any ADC measurements will be off from the get-go. You can use a precision voltage-reference, but still mustuse precision resistors in the voltage dividers for best results.

It seems to me that the majenko page has some good info to help deal with the firstproblem, of v.reg tolerance, so I don't see d-h's trouble.

Well there are pretty simple methods to deal with both the 'problems' you addressed. First it's possible with proper coding to have an arduino measure it's own exact Vcc voltage to gain the proper value to convert counts to voltage readings. The second problem is easily deal with by using a 10 turn pot (say 5K ohms) for the voltage divider and set it for the division ratio you desire using a DMM to verify that it's accurately set.

Now if either or both those are really needed or even desired depends on the application and it's accuracy requirements or assumptions.

// Function created to obtain chip's actual Vcc voltage value, using internal bandgap reference// This demonstrates ability to read processors Vcc voltage and the ability to maintain A/D calibration with changing Vcc// Now works for 168/328 and mega boards.// Thanks to "Coding Badly" for direct register control for A/D mux// 1/9/10 "retrolefty"

int battVolts; // made global for wider avaliblity throughout a sketch if needed, example a low voltage alarm, etc

Also a question regarding resistor tolerances. These are manufacturing tolerances right? The resistors themselves does not "change" their resistance over time, right? If so then this problem should be overcome by just measuring them and using that exact value in my code. The projects I make is for myself and will not be mass produced hence it's ok for me to measure each resistor manually.

Also I have some 1% and some 5% resistors, the former is much closer to their specified value, of course, but is there any other benefits to use these over the ones with lower tolerances? As I said I do measure them prior to installation.

No, someone already pointed this out (couldn't find this to quote).Tolerances depend on multiple factors.I guess the most known is temperature.Having the resistors in the circuit, might for instance have them pick up ambient temperature as well as temperature possible generated by your cicuit (one could argue that this is also ambient temperature).The temperature generated by the circuit probably differs after an hour running compared to right after starting.You should take that in consideration.Ofcourse you could try to compensate that by using an other sensor, measuring the resistor's temperature, or heat up the resistors to a known fixed temperature.But you also need to know that these methods themselves will also have their own tolerances.

Ofcourse for the sake of learning this is all worth trying, but it's questionable if this will ever get you to read with very high accuracy.

Have a look at "blink without delay".Did you connect the grounds ?Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

What you mean by "exact"? I've seen nothing "exact" in this analog world. Also, on further looking, the bandgap reference in the ATmega 328P datasheet is only specified to within 10% <-- gakk!

Well 'exact' means measuring the actual Vcc relative to the bandgap voltage. And as you said even the bandgap voltage has a tolerance but it usually a steady value within that tolerance range for each specific chip, and that is one parameter in the sketch that does have to be 'tweeked' to account for one's specific chips bandgap value. Once that is done then the sketch (see the comments) will measure any variation of the Vcc that can be used to compensate for the standard analogRead commands rather then just assume that Vcc is always an exact 5.000 which it presently does and we all know it's not necessarily so. I've seen .5vdc differences of Vcc on a standard arduino board just switching from USB power to external power and that is what my sketch was designed to address, a way to measure the real world Vcc the chip has applied to it to come up with a compensation value to use with analogRead statements.Lefty

Ofcourse for the sake of learning this is all worth trying, but it's questionable if this will ever get you to read with very high accuracy.

And that is particularly true when you are working with the limited 10 bit ADC of the arduino. If one jumps into using one of the many 12,14,16, or even 24 bit external I2C or SPI ADC chips then applying principles and practices of good design and calibration will give dividends in trying for the best possible accuracy. The arduino ADC is very useful and simple to use but one shouldn't mistake if for instrumentation quality measurements.

Measurement doesn't need to be super exact. I'll use the arduino to measure battery voltage in my UAV ground station. So it's mostly to make sure I don't run out of battery. Because of that I'll try to keep it as simple as possible but also not introduce any unneccessary errors. I'll also measure a bunch of other stuff such a current sensor, clock, timer, signal strength and buzzers and lights to indicate warnings etc. Information will be presented mostly on a 20x4 LCD.

As you probably figured out I'm an arduino newbie and this is my first project, I'm learning as I go along and really appreciate all input.

All in all, seems like too much variability going on here for OP to read really accuratevalues. Especially, considering powering via USB versus using Vin and the v.reg. Probably best to go with a good external voltage reference chip and 1% Rs, and call it a day.