Electrical – Voltage Divider – Arduino Pro Mini 3.3V – Smartphone Battery (4.2V max) – which resistance values

arduinobatteriesvoltage

I want to measure the battery voltage on my arduino pro mini (3.3V version), which runs from a Li-ion smartphone battery (max 4.2V).

I used the typical voltage divider setup with R1 = 5.6M and R2 = 2M, because of this formula:

// ((R1+R2)/R2)*1.1 = Vmax = 4.2 Volts
// 4.2/1023 = Volts per bit = 0.004105572
float batteryV = sensorValue * 0.004105572;
int batteryPcnt = sensorValue / 10;

But it doesn't seem to work.. currently it is giving me a voltage of 1.28V, but my multimeter is measuring 3.86V.

What am I doing wrong?

Best Answer

Well, apparently the input impedance of the Arduino ADC is much lower than you thought. You need to make the resistors of the divider one or two orders of magnitude smaller.