Voltage Sensor Proteus Library -
Connect a variable DC voltage source (or a battery with a potentiometer) to the voltage input terminals ( VCCcap V sub cap C cap C end-sub GNDcap G cap N cap D Output Side: Connect the Signal pin ( OUTcap O cap U cap T
// Voltage Sensor Simulation Code for Proteus const int sensorPin = A0; // Analog input pin float vOUT = 0.0; float vIN = 0.0; float R1 = 30000.0; // 30k ohm resistor float R2 = 7500.0; // 7.5k ohm resistor int value = 0; void setup() Serial.begin(9600); // Initialize Serial Monitor pinMode(sensorPin, INPUT); void loop() // Read the analog value value = analogRead(sensorPin); // Calculate voltage at the analog pin vOUT = (value * 5.0) / 1024.0; // Mathematical conversion back to the original input voltage vIN = vOUT / (R2 / (R1 + R2)); // Print results to the Proteus Virtual Terminal Serial.print("Measured Input Voltage: "); Serial.print(vIN, 2); Serial.println(" V"); delay(1000); // Wait 1 second before next reading Use code with caution. Visualizing Output via Virtual Terminal To view the Serial.print statements inside Proteus:
In the physical world, a standard voltage sensor module (like the 0-25V sensor for Arduino) is simply a . It uses two resistors (typically 30KΩ and 7.5KΩ) to scale down a high voltage to a 0–5V range that a microcontroller's Analog-to-Digital Converter (ADC) can safely read. In Proteus, you have three primary ways to replicate this:
Installing a custom .TEF and .LBK (or .IDX and .LIB ) library file that provides a pre-packaged sensor block with clear input/output pins. 2. How to Download and Install a Voltage Sensor Library voltage sensor proteus library
Press on your keyboard to open the "Pick Devices" dialog box. Type Voltage Sensor in the keywords search bar.
If you do not have a custom ZMPT101B library file, you can build an equivalent circuit in Proteus:
const int sensorPin = A0; float vInput = 0.0; float vOutput = 0.0; // Adjust these values based on your sensor's specific resistor values float R1 = 30000.0; float R2 = 7500.0; void setup() Serial.begin(9600); void loop() int rawValue = analogRead(sensorPin); // Convert raw digital value back to sensor output voltage vOutput = (rawValue * 5.0) / 1024.0; // Calculate original input voltage using the inverse voltage divider formula vInput = vOutput / (R2 / (R1 + R2)); Serial.print("Measured Voltage: "); Serial.concat(vInput); Serial.println(" V"); delay(500); Use code with caution. Troubleshooting Simulation Errors Connect a variable DC voltage source (or a
Proteus Design Suite is an invaluable tool for testing electronic circuits before physical fabrication. However, simulating voltage measurements often puzzles beginners because Proteus does not include a physical-looking "voltage sensor module" (like the common Arduino blue voltage sensor) in its default installation.
Complete Guide to Integrating a Voltage Sensor Library in Proteus
C:\ProgramData\Labcenter Electronics\Proteus 8 Professional\LIBRARY In Proteus, you have three primary ways to
Ensure the files were pasted into the correct LIBRARY folder and that you restarted Proteus.
Paste these files into the Proteus installation directory.
3. Simulating Voltage Without Custom Libraries (The Resistor Method)