How-to · Beginner · 3 min read
Voltage Sensor Modules
Dividers, Attenuators and Measuring Voltage Safely with Arduino and ESP32
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
Microcontroller ADC pins read only 0 to 3.3 V or 5 V. A voltage sensor module is a precision divider that scales a higher voltage (often up to 25 V) into that range. Connect it with a common ground, read the ADC, then multiply by the divider ratio. Calibrate against a multimeter, and use an INA219-type sensor when you also need current or higher accuracy.
Key specs at a glance
- Principle
- Resistive divider (for example 5:1)
- Input range
- Commonly up to 25 V on small modules
- Output
- 0 to 5 V or 0 to 3.3 V analog
- Accuracy
- About 1 to 3% before calibration
- Resolution
- Set by the ADC (10 to 12 bit)
- Alternatives
- INA219/INA226 power monitors over I2C
How a voltage sensor module works
Two resistors form a divider. A module with a 30 kΩ and 7.5 kΩ pair divides the input by 5, so 25 V becomes 5 V at the output. Your code multiplies the ADC reading by the ratio to get back the real voltage. The voltage divider tool works out resistor values and output.
Wiring
- 1Connect the module's ground to your microcontroller's ground.
- 2Connect the input terminals to the voltage you want to measure; check polarity.
- 3Connect the signal pin to an analog input.
- 4Read the pin and calculate: voltage = ADC value / full scale × reference × divider ratio.
- 5For a 3.3 V board choose a module whose output stays under 3.3 V at the maximum input.
Accuracy tips
Use a stable reference, average several samples and calibrate against a multimeter at two known voltages. ESP32 ADCs are non-linear and benefit from calibration tables; see ADC basics and the ADC resolution tool. Add a small capacitor across the output to reduce noise.
Safety
Dividers draw a small current and do not isolate you from the input. Never measure mains with a bare module. For battery packs above the module's rating, use a bigger divider ratio or an isolated measurement device. See power supply basics and multimeter use.
When to use an INA219
An INA219 or INA226 measures voltage and current over I2C with a built-in shunt amplifier, which suits battery monitors and power meters; see battery fuel gauges and ACS712 current sensors.
Try it: Voltage divider calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Not sharing ground with the microcontroller.
- Exceeding the module's maximum input.
- Using a divider that outputs more than the ADC range.
- Assuming the reading is perfectly linear on ESP32.
- Using a bare divider on mains.
Frequently asked questions
What is the maximum voltage I can measure?
Check the module label, often 25 V.
Can I measure 12 V with ESP32?
Yes with a divider that brings it under 3.3 V.
Why does my reading drift?
ADC reference drift, noise or the resistor tolerance.
Do I need a capacitor?
A small one can smooth noise.
Can it measure current?
No. Use a current sensor or INA219.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 33 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.


