Zmpt101b Library For Proteus -
ZMPT101B library for Proteus a specialized simulation model used by engineers and hobbyists to test AC voltage monitoring circuits
. Since Proteus does not include this active single-phase AC voltage sensor in its default database, you must manually install an external library to simulate it. Key Features of the Simulation Model AC Measurement:
It accurately simulates the behavior of the ZMPT101B transformer, allowing you to measure mains voltage ranging from 80V to 250V AC Pin Configuration: The model typically includes four pins: Analog Out (for microcontroller signal), and the high-voltage terminals. Analog Simulation:
It provides a varying analog output that can be connected to the ADC pins of virtual microcontrollers like an Arduino Uno How to Install the Library in Proteus
To add the ZMPT101B module to your workspace, follow these standard steps for external Proteus components: Download the Files: Search for and download the library files (typically files) from reputable community sources like Electronic Tree The Engineering Projects Locate the Library Folder: Right-click your Proteus desktop icon, select Open file location , and go back one level to find the Copy and Paste: files into the Proteus file is provided, place it in the Restart Proteus: Close and reopen the software to load the new components. Search for Component: In the Schematic Capture, press 'P' and search for "ZMPT101B" "Voltage Sensor" Programming Note How to Add Arduino Gas Sensor Library in to Proteus 7 & 8
The ZMPT101B is a popular active single-phase AC voltage sensor module used in micro-controller projects to safely measure AC mains voltage. Integrating it into Proteus for simulation requires two distinct parts: the Proteus simulation model (to represent the hardware) and the Arduino library (to handle the software logic). 1. Hardware Integration (Proteus Library)
Since the ZMPT101B is not a native component in the standard Proteus library, you must manually add the simulation files.
Setup: The library usually consists of two files: .LIB (library data) and .IDX (index). These must be copied into the LIBRARY folder within your Proteus installation directory.
Visuals: Once installed, searching for "ZMPT101B" in the component picker will display a module with pins for AC input (L/N) and DC output (VCC, GND, OUT).
Simulation Behavior: Some advanced models allow you to adjust the onboard potentiometer within the simulation to calibrate the gain, mimicking the real-world module's behavior. 2. Software Integration (Arduino Library)
To process the analog signal from the ZMPT101B in Proteus, you need a compatible Arduino library.
Top Choice: The ZMPT101B-Sensor by Remko Kleinjan is the current standard. It is highly rated for its ability to calculate RMS Voltage directly from the analog waveform. Key Features: zmpt101b library for proteus
Calibrate.ino: Includes a vital calibration script to determine the "Sensitivity" value based on a known AC reference.
Architecture Support: Fully compatible with AVR (Arduino Uno/Mega) and ESP32/ESP8266.
Accuracy: It uses an 800-sample window by default to smooth out AC fluctuations and provide stable RMS readings. 3. Practical Usage Tips
HEX File Path: To run the simulation, compile your Arduino code in the IDE, select Sketch > Export Compiled Binary, and then link the resulting .hex file to the Arduino board in Proteus.
Sampling Rate: If the simulation runs slowly ("CPU load high"), reduce the number of samples in the library's .getVoltage() function to lighten the processing load.
Virtual Terminal: Always connect a "Virtual Terminal" to the Arduino's TX/RX pins in Proteus to monitor the voltage readings in real-time. Comparison of Popular Libraries Library Name Key Advantage ZMPT101B-Sensor Remko Kleinjan Best RMS calculation & stability Arduino Docs ZMPT101B-arduino Abdurraziq Simple, based on ACS712 logic GitHub
The ZMPT101B library for Proteus enables engineers to simulate AC voltage sensing in electronic circuits, particularly when interfacing with microcontrollers like Arduino or ESP32. This report details the sensor's function, installation steps, and simulation best practices. 1. Overview of the ZMPT101B Sensor
is a high-precision voltage transformer module designed for measuring AC voltages up to 250V.
Isolation: It provides galvanic isolation between high-voltage AC mains and low-voltage microcontrollers, protecting the latter from electrical surges.
Output: The module typically outputs an analog signal proportional to the RMS voltage.
Adjustment: It includes an onboard multi-turn potentiometer to calibrate the output amplitude and offset (typically VCC/2). 2. How to Install the Library in Proteus ZMPT101B library for Proteus a specialized simulation model
Since Proteus does not include the ZMPT101B by default, you must manually add the component and model files.
The ZMPT101B library for Proteus is a crucial third-party add-on for engineers and hobbyists looking to simulate AC voltage monitoring projects. Since the ZMPT101B sensor module is not included in the standard Proteus component library, you must manually integrate external library and model files to simulate it alongside microcontrollers like Arduino. How to Install the ZMPT101B Library in Proteus
To successfully simulate this sensor, you need both a .LIB (library) file and a .MOD (model) file.
Download the Library: Obtain the ZMPT101B Proteus library files from reputable engineering sites like Electronics Tree or trusted GitHub repositories. Add Library Files:
Navigate to your Proteus installation directory (usually C:\Program Files (x86)\Labcenter Electronics\Proteus X Professional\LIBRARY).
Paste the downloaded .LIB and .IDX files into this LIBRARY folder. Add Model Files:
Navigate to the MODELS folder in the same Proteus directory.
Paste the .MOD file here. This file is essential for the electrical behavior simulation.
Restart Proteus: Fully close and reopen Proteus to refresh the component list. Use the "Pick Device" (P) button and search for "ZMPT101B" to place the component on your schematic. Features of the ZMPT101B Module
The ZMPT101B is a high-precision voltage transformer module designed for safe AC voltage measurement.
Measurement Range: Capable of measuring AC voltages up to 250V (standard) or even 1000V with proper resistor scaling. 2) Example Proteus Circuit: ZMPT101B → Arduino ADC
Galvanic Isolation: It provides electrical isolation between the high-voltage AC side and the low-voltage DC side (microcontroller), protecting your board from surges.
Signal Conditioning: Includes an onboard LM358 operational amplifier and a potentiometer to adjust the output signal's sensitivity and DC offset.
Output: Delivers an analog voltage signal proportional to the RMS input voltage, typically centered around (e.g., 2.5V for a 5V supply) when no AC is present. Simulation and Interfacing with Arduino
In Proteus, you can interface the ZMPT101B with an Arduino Uno library to visualize waveforms and calculate RMS values.
Since the ZMPT101B is an analog sensor that outputs a voltage proportional to the AC voltage it measures, there isn’t a "one-click" installable library in Proteus like you would find for an LCD or an I2C sensor. Instead, you simulate it using existing Proteus components to mimic its behavior.
Here is a helpful review and guide on how to effectively simulate the ZMPT101B (AC Voltage Sensor) in Proteus.
2) Example Proteus Circuit: ZMPT101B → Arduino ADC
Circuit blocks:
- Input: Proteus AC source set to 230 V RMS, 50 Hz (or 120 V/60 Hz as applicable).
- Transformer model: secondary AC source with amplitude scaled to expected module secondary (e.g., 100:1 → secondary ~2.3 V RMS).
- Conditioning: full-wave coupling to op-amp buffer, then RC filter.
- Offset: resistor divider to create Vref = 2.5 V, AC-coupling capacitor to ride on mid-rail.
- Output to Arduino analog input.
- Ground references: ensure analog ground is tied correctly; transformer isolation modeled by not connecting primary ground.
Proteus setup tips:
- Use a “DC Power” supply for the module’s Vcc (e.g., 5 V) and for the Arduino.
- Place an oscilloscope probe at the module output to check amplitude and offset.
- Simulate with the Arduino VSM module and upload compiled Arduino firmware to test ADC reads in simulation.
Arduino Firmware Logic:
The ZMPT101B outputs a waveform from 0V to 5V (2.5V offset). To calculate RMS voltage:
- Sample the ADC at high speed (e.g., 1 kHz for 50 Hz).
- Subtract the 2.5V offset (512 ADC value for 10-bit ADC).
- Square each sample.
- Take the mean of squares.
- Take the square root → This gives the RMS of the ADC reading.
- Multiply by a calibration factor (derived from transformer ratio).
Example code snippet:
float readACVoltage(int pin)
const int samples = 500;
float sumSq = 0;
for (int i = 0; i < samples; i++)
int adc = analogRead(pin); // 0-1023
float voltage = (adc / 1023.0) * 5.0; // 0-5V
float offsetRemoved = voltage - 2.5; // -2.5 to +2.5
sumSq += offsetRemoved * offsetRemoved;
delayMicroseconds(400); // ~1kHz sampling
float rmsADC = sqrt(sumSq / samples);
float realRMS = rmsADC * 73.0; // Calibration factor (your value)
return realRMS;
Error 3: ZMPT101B output is constant 2.5V even with AC input
- Cause: The AC source is not referenced properly, or the frequency is outside model range (e.g., 0.1 Hz).
- Fix: Ensure VSINE frequency is 50 or 60 Hz. Also check that
AC_IN2is not floating.