Another illustration that demonstrate the uses of Analog to measure the voltage of an external battery and integrate the area under the curve to arrive at the useful capacity of a battery mAH.
If you’re going to calculate the desired voltage range, you need to use the following voltage divider. The voltage divider has a following formula see below the example.
Voltage Out will be 5v ADC and Voltage In will be max voltage value to be measured.

Voltage Out = (Resistance 1* Voltage In) / Resistance 1 + Resistance 2)
VOut = (R2 * VIn) / R1 +R2)

Connect your components as shown of the diagram below and choose your resistance value base on the desired voltage range. To measure 0 ~ 10v you need to choose R1 as 100k and the R2 will be 100k, and if your choose 0 ~ 15v you need to connect R1 as 100k and the R2 will be 50k and to measure 0 ~ 25v you’re going to use the R1 as 100k and the R2 will be 25k and the last one range to measure is 0 ~ 55v you need to connect R1 as 100k and the R2 will be 10k. Test your resistors before going to hook it up to test before changing your code to gain the accurate measurement.

Here is the list resistant to calculate the range of voltage.

  • Measuring 0 to 10v: R1 = 100k | R2 = 100k
  • Measuring 0 to 15v: R1 = 100k | R2 = 50k
  • Measuring 0 to 25v: R1 = 100k | R2 = 25k
  • Measuring 0 to 55v: R1 = 100k | R2 = 10k

Required Components

  • Arduino Board.
  • 1x 10k Resistor
  • 1x 100k Resistor
  • 1x OLED Screen (Optional)
  • Jumper Wires / DuPont Wires
  • Solder less Bread Board

Wiring Diagram


Code for Serial Communication

Code with OLED Screen on U8glib 

Download Required Libraries 

Download the U8glib here | Zip 

OLED Voltage Meter on Voltage Divider
Tagged on:                     


One thought on “OLED Voltage Meter on Voltage Divider

  • at

    For 50k Ohm resistor use two 100k in parallel. For 25k use four 100k in parallel. Cause it is more acurate as 47k or 22k. Or a generic 10k resistor. May by Metallfilm 1% is fine.


Leave a Reply

Your email address will not be published. Required fields are marked *