
Voltage Sensor 0-25V Library for Proteus Simulation

Hello friends, I hope you all are doing great. Today, I am going to share the new Voltage Sensor 0-25V Library for Proteus Simulation. The little red 0-25 V voltage sensor is one of the simplest modules in any kit - two resistors on a board with a screw terminal - and one of the most useful: it lets an Arduino read a battery, a solar panel or a 12 V supply that would destroy an analog pin. With this library you can run a full Proteus simulation of that module, see the divided voltage, the ADC code an Arduino would read at 5 V and at 3.3 V, and the small current the module takes from what it measures.
Voltage Sensor 0-25V Library for Proteus
Latest version: V1.0 (November 2026, this tutorial)
Helping Tools
- Serial Monitor Advance: a serial terminal window for the UART of your board
- Serial Monitor Expert: the serial monitor with extra debugging tools
- LCD Library for Proteus V3.0: 16x2, 20x4 and I2C LCDs to show your readings
The demo watches a 3S lithium pack - three of our 18650 cells in series - while a load discharges it, and switches the load off at 9.0 V before the cells are harmed.
NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the motor driver board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the Voltage Sensor 0-25V Library for Proteus Simulation:
What Is the 0-25 V Voltage Sensor?
The module is a voltage divider: a 30 kohm resistor from the input to the S pin and a 7.5 kohm resistor from S to ground. The voltage on S is the input times 7.5 / 37.5 - one fifth. A 5 V Arduino can read 0 - 5 V on an analog pin, so the module stretches that to 0 - 25 V. On a 3.3 V board such as an ESP32 the limit is 3.3 x 5 = 16.5 V. The blue screw terminal takes the voltage to measure (VCC and GND); the 3-pin header gives S, + and -. On most of these boards the + pin is not connected at all, and - is the same copper as GND.
| 0-25 V voltage sensor module | |
|---|---|
| Circuit | 30 kohm / 7.5 kohm divider, S = input / 5 |
| Range | 0 - 25 V on a 5 V board, 0 - 16.5 V on a 3.3 V board |
| Resolution | 24.4 mV per step with a 10-bit ADC at 5 V |
| Load on the source | 37.5 kohm (0.33 mA at 12.6 V) |
| Pins | VCC, GND / S, + (not connected), - |
| Uses | battery monitors, solar panels, supply voltages, low-voltage cut-offs |
From analogRead() to Volts
An Arduino UNO's analogRead() returns 0 - 1023 for 0 - 5 V. The pin sees the input divided by five, so the input in volts is analogRead() x 5.0 / 1023 x 5. One step of the ADC is 4.9 mV on the pin and 24.4 mV on the input - fine for a battery, where a tenth of a volt matters, not for precision work. Averaging several readings, as the demo does, smooths the noise of a real board.
Loading and Source Resistance
A divider always draws current: 37.5 kohm across a 12.6 V pack is 0.33 mA - about 8 mAh a day, worth remembering on a battery that should last months. On the other side, the S pin has 6 kohm behind it (30 k and 7.5 k in parallel). The Arduino UNO's ADC wants under 10 kohm for its sample-and-hold to charge in time, so the module's values are well chosen.
The Sensor in the Simulation
The model is the divider itself: 30 kohm from VCC to S and 7.5 kohm from S to GND, stamped into the circuit, with GND and - joined and + left open like the board. So the module loads the source and the Arduino's pin exactly like the real one. The pop-up adds what a datasheet would not: the ADC code a 10-bit converter would return at 5 V and at 3.3 V, the value a sketch would print, the current taken from the source, and warnings when S goes over 5 V (the input over 25 V) or over 3.3 V, or when the input is reversed.
Features of the Voltage Sensor 0-25V Library for Proteus Simulation
- A real-looking module: the 26 x 14 mm red board at its real size with its screw terminal, its two resistors and its header.
- A real divider: 30 k / 7.5 k in the circuit, its load on the source and its 6 kohm output.
- The ADC view: the codes at 5 V and 3.3 V, the resolution, the value a sketch would print.
- Warnings: over 25 V, over 16.5 V for a 3.3 V board, a reversed input.
- A pop-up: the divider with its voltages, two ADC bars and the input's trend, eight tiles - graphs, an event log and a check page.
- A complete package: about 2.2 MB with the library, our 18650 cells, IRLZ44N MOSFET and power resistor, our Arduino UNO V4.0 and the demo, without the source code of the model.
The Voltage Sensor in Proteus
The device is VSENSOR25VTEP in TEPVSENSE25.LIB, under Modules > Sensors, with the prefix U and the model TEPVSENSE25.DLL. Search voltage sensor or 0-25V in Pick Devices. On the left are VCC and GND, the voltage to measure; on the right S, + (not connected) and -. The module has no properties: its divider is fixed.
Download Voltage Sensor 0-25V Library for Proteus Simulation
Click the button below to download Voltage-Sensor-0-25V-Library-for-Proteus-v1.0.zip (about 2.2 MB, without the source code of the models):
Voltage Sensor 0-25V Library for Proteus V1.0- README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
- Proteus Library Files:
TEPVSENSE25.LIB,TEP18650.LIB,TEPNMOS.LIB,TEPPOWERRES.LIBandArduinoV4TEP.LIB. - Proteus Model Files:
TEPVSENSE25.DLL,TEP18650.DLL,TEPNMOS.DLL,TEPPOWERRES.DLLandTEPARDUINO.DLL. - Arduino Code: the demo sketch (no library).
- Proteus Simulation: the demo project, its HEX file and copies of the DLLs.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install Voltage Sensor 0-25V Library for Proteus Simulation
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy the files from Proteus Model Files into the MODELS folder.
- Delete
TEPVSENSE25.IDXfrom the LIBRARY folder if it is there. - Start Proteus, press P and search for voltage sensor.
Proteus Simulation of a 3S Pack Monitor
The demo uses an A4 sheet with our Arduino UNO Library for Proteus V4.0, the sensor U1 with VCC on the pack's + and S on A0, three cells from our 18650 Li-ion Battery Library for Proteus in series - a 3S pack, starting at 50 % charge with a battery clock 3600 times faster, so each simulated second is an hour - and a 33 ohm load on the pack, switched by our IRLZ44N from the N-MOSFET Library for Proteus on D7. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open Voltage-Sensor-3S-Pack-Cutoff-ArduinoUnoV4.pdsprj.
The Sketch
The sketch needs no library. It averages eight readings and scales them by the divider:
for (uint8_t i = 0; i < 8; i++) sum += analogRead(A0);
return sum / 8.0 * 5.0 / 1023.0 * DIVIDER;
The guard runs every 10 ms - with the battery clock at 3600 times, the end of a discharge comes fast - and switches the load off at 9.0 V:
if (loadOn && pack < CUT_OFF) {
loadOn = false;
digitalWrite(LOAD, LOW);
Voltage Sensor Simulation Results
Open the project and press Run. The demo runs 5.4 simulated seconds and took about two minutes on our PC with the pop-up open and the pictures being taken. Click the sensor for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.
The Pack Under Load
One second into the run the pack is under the 33 ohm load and the pop-up shows the whole chain at once. The input is 11.261 V - 3.75 V a cell, a pack in the middle of its charge. The divider's 30 kohm and 7.5 kohm turn that into 2.2521 V on S, exactly a fifth, and a 5 V board's analogRead() returns 461; a 3.3 V board would read 698 from the same S. The sketch's formula gives 11.266 V back - five millivolts off, well inside one ADC step of 24.4 mV. The divider itself takes 0.300 mA from the pack through its 37.5 kohm: nothing compared with the load's third of an ampere, but it never stops, even when the Arduino sleeps.
The End of the Discharge
At 3.8 s the pack is at the end of its useful charge, and the trace in the pop-up shows the shape every lithium user learns to fear: a long, gentle slope and then a knee where the voltage starts to drop fast. The input is 9.503 V here, 3.17 V a cell, S is 1.9004 V and the 5 V reading has fallen to 389. This is exactly why the sketch checks every 10 ms instead of every few seconds: on this part of the curve - with the cells' clock at 3600 times - the pack loses a tenth of a volt in a blink.
The Cut-Off
The sketch's guard caught the pack at 8.99 V and printed "Cut-off at 8.99 V: the load goes off". With the load gone the cells recover a little, as real cells do: the pack settles at 9.43 - 9.46 V, 3.14 V a cell, and stays there - safely above the level where lithium cells start to lose capacity for good. At 4.7 s the pop-up shows 9.436 V, S 1.8871 V and an analogRead() of 386. The sensor keeps measuring after the cut-off; only the load is off.
The Graphs, the Event Log and the Check Page
The Graphs page plots the input, S, the ADC code and the current the module draws. The Check page sums up the run: the input at 9.433 V now and between 9.04 and 11.52 V over the run, S at the input divided by 5.00 with the ADC codes 386 (5 V) and 585 (3.3 V), and the 251.6 uA the divider takes from the pack. Its notes repeat the rules that matter: one ADC step is 24.4 mV of input on a 5 V board, a 3.3 V board must never see more than 16.5 V on VCC, and the module's GND has to be the Arduino's GND.
The Arduino's monitor tells the same story four times a second: "Pack 11.22 V (3.74 V a cell) load on" near the start, the numbers sliding down through 11.0 and 10.5 V, the drop speeding up below 10 V, "Cut-off at 8.99 V: the load goes off", and then the pack resting at 9.43 V. A Proteus simulation like this is a cheap way to test a cut-off threshold before a real pack pays for a mistake.
Why a Cut-Off Matters
A lithium cell has no fuel gauge of its own and, as a bare cell, no protection. Below about 2.5 V it starts to lose capacity for good, so every battery-powered project needs something that stops the discharge in time. A 3S pack's voltage tells you the average of its three cells - 9.0 V is 3.0 V a cell - which is a safe, simple rule when the cells are matched. When they are not, only a BMS that sees each cell can protect the weakest one; that is the next library in this series.
Making the Reading Accurate
In the simulation the divider is exactly 5.00 and the 5 V rail is exactly 5 V, so the reading is right to within one ADC step. On a real board two things move it. The first is the resistors: common modules use 1 % or 5 % parts, so the ratio can be a few percent off. The second is the reference: analogRead() compares S with the board's own 5 V, and a USB port often gives 4.8 to 5.1 V - every percent there is a percent in the result. The cure is simple: measure the pack once with a good multimeter, compare it with what the sketch prints, and put the correction into the DIVIDER constant. For a battery cut-off, also leave a margin: switch off at 9.0 V when the cells' real limit is lower, as the demo does, so a small error never costs a cell. Averaging several readings, as the sketch does with eight, takes care of the noise.
Try It Yourself
- Change CUT_OFF to 10.5 V: the load goes off much earlier, with plenty of charge left.
- Start the cells at 100 % (SOC 100): the pack reads about 12.6 V - still inside the 25 V range.
- Put a fourth cell in series (16.8 V): fine on the UNO, but the pop-up warns it would be too much for a 3.3 V board.
- Swap VCC and GND: the pop-up reports the reversed input.
- Print the voltage per cell with one decimal more and watch the ADC's 24 mV steps.
Ideas to Extend the Demo
- A solar panel monitor with a second sensor on the panel.
- A battery gauge on an LCD: the voltage turned into an estimated percentage.
- A low-battery alarm with a buzzer before the cut-off.
Your Own Sketches
The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.
Things to Know Before Using a Real Voltage Sensor
- Range: 25 V on a 5 V board, 16.5 V on a 3.3 V board.
- Grounds: the measured voltage's minus and the Arduino's GND must be joined.
- Battery drain: the divider draws a third of a milliamp at 12 V - all the time.
- Accuracy: the resistors' tolerance sets it; calibrate against a meter.
- Noise: average several readings, or add a small capacitor from S to GND.
Troubleshooting
- The reading is 0: S is not on the analog pin, or the grounds are not joined.
- The reading is stuck at the top: the input is over the range.
- The reading jumps on a real board: average more readings.
- The value is off by a few percent: the resistors' tolerance - calibrate the factor 5.
- The part is not simulated:
TEPVSENSE25.DLLis missing from MODELS and from the project folder.
Limitations of the Simulation
- The divider and its load follow the module's circuit; the module is our own drawing.
- Exact 30 k / 7.5 k: the resistors' tolerance and drift are not modelled, nor the ADC's own error.
- The ADC codes in the pop-up are an ideal 10-bit converter's.
- Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the module's maker.
- Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.
So, that was all about the Voltage Sensor 0-25V Library for Proteus Simulation. I hope it helps you watch your next battery or supply - and stop the discharge before the cells pay for it. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!






















Comments
0