Voltage sensor module
The 0 to 25 V voltage sensor module from every sensor kit: two resistors that make S a fifth of the voltage on its screw terminal.
A small red board with a green two-way screw terminal and a three-pin header, sold as "0 to 25 V DC". Aliases: voltage sensor, DC voltage sensor, voltage divider module, 0-25V sensor.
There is no chip on it. It is a 30 kohm resistor from the terminal's VCC to S
and a 7.5 kohm resistor from S to the terminal's GND, so S is a fifth of the
voltage on the terminal. A sketch reads S and multiplies by 5.
Pins
| Pin | What it does |
|---|---|
VCC |
Screw terminal: the plus of the voltage to measure. |
GND |
Screw terminal: the minus of the voltage to measure. |
S |
The divider's middle, a fifth of the input. To an analog pin. |
+ |
Not connected on the board. |
- |
The same trace as the terminal's GND. To the Arduino's GND. |
Properties
None. The voltage comes from the circuit.
Two resistors in the circuit
The part is the two resistors, really in the circuit, so the reading is whatever the
circuit's voltage is, not a number on a slider, and the circuit is loaded by the
board's 37.5 kohm. A source with a few kohm behind it reads low, as it does on a bench.
S has the two resistors in parallel behind it, 6 kohm, which an Arduino's analog
input is happy with. The readout on the board shows the voltage across the terminal
as the simulation computes it.
What the model gets right
There is no datasheet for this board; the numbers are the ones every listing and tutorial gives (for example the components101 "Voltage Sensor Module" page):
The ratio. 30 k and 7.5 k make S = VIN / 5. 12 V on the terminal is 2.4 V on
S, which an Uno reads as 491.
The 25 V limit is the ADC's. On a 5 V Uno, S can go up to 5 V, which is 25 V
on the terminal. On a 3.3 V board (an ESP32, a Pico, an Arduino Due) the same board
reads at most 3.3 x 5 = 16.5 V. The resistors do not change.
The resolution. One step of a 5 V, 10-bit converter is 4.9 mV at S, so 24.4 mV
on the terminal. 9 V reads as 8.99 V on an Uno, and that is the converter, not the
board.
The shared ground. The terminal's GND and the header's - are one trace, so
wiring - to the Arduino puts the measured circuit's minus on the Arduino's ground.
That is how a bench supply's minus gets to ground in the DC voltmeter template.
What it does not model
The resistors' tolerance (1% or 5% on real boards; here the ratio is exactly 5, so a
real board may need a calibration factor), their power rating, and what happens past
25 V on a 5 V board: on a real one S goes over the converter's supply and the
microcontroller's input protection diode conducts through the 30 kohm. Nothing on the
board isolates the measured circuit, so it cannot measure mains or anything that must
not share a ground with the Arduino.
Common mistakes
Measuring above 16.5 V on a 3.3 V board. The "25 V" on the listing assumes a 5 V Arduino.
Leaving - unconnected. Without a shared ground the Arduino has nothing to measure
S against.
Wiring the measured voltage to the header's +. It goes nowhere on the board; the
voltage goes in the screw terminal.
Measuring AC or mains. This is a resistor divider with no isolation. Use a ZMPT101B for mains.
See it in action
DC voltmeter reads a bench supply on an I2C LCD; step the supply's voltage while it runs. Open it at /templates.