

ISTM that the OP doesn't need the divider, that he can use the 'secret voltmeter', and he has to do the calibration mentioned by mircho. And then deal with issue number one to determine the sizing of the voltage divider needed to be able to measure the Vin value, if that is what you are after. So deal with issue number two first if you are concerned about having the best Analog calibration accuracy possible. This external reference can be any voltage from around 1.1 to 5vdc.

You can with software commands change the reference to either an internal band-gap 1.1vdc reference or use a external voltage standard applied to the Aref pin. This reference by default and can come from either the USB port or the on-board +5vdc regulator. The Arduino processor uses a voltage source to set the measurement referenace for all analog reads from the analog input pins. This Vin voltage has no effect on the analog reference accuracy of the analog input pins, however you may or may not have a desire to measure the Vin voltage, that is not clear to me. Vin pin is the power supplied from the Arduino external power connector and is in the range of 7.5 to 12vdc depending on what you are using. You are grappling with too different issues. Am I missing something here? I confess I did not understand JLuciani's comment about impedance. But that seems to be a circular problem, since I would then have to measure the positive rail voltage somehow. But then I would have to know the positive rail voltage to know what voltage value was being divided (as well as the resistor values, of course). If a voltage divider is the only way to measure Vin, then I assume that the reason that voltage divider is necessary is to reduce the voltage being measured to less than 5 volts so that the Analog pins can detect it properly.

That would explain the difference above, but still leaves me a little uncertain about the best way to measure Vin. However, both of these values are different from what my multimeter reads for Vin, which remains 5.02.īut then Lefty said that the “Secret Voltmeter” internal voltage is NOT the same as Vin.

That's probably good enough although it seemed odd that it would change between those two values, but maybe that was my computer doing that. I tried the “Secret Voltmeter” mentioned by Raron at, and it worked like a charm, giving a voltage (under USB power) that alternated between 5.073 and 5.051 every few seconds. My goal is to use Vin to supply power for an external circuit but I want to know as precisely as I can what the Vin voltage is. Thanks to everybody who responded, although now I'm confused again.
