Close and reopen the software to refresh the component database.
While incredibly useful, you must understand the simulation’s boundaries:
. Installation involves adding .LIB, .IDX, and model files to the Proteus library directory, allowing users to visualize waveforms and calibrate the module using Arduino ElectroPeak zmpt101b proteus library
Connect the Analog Output ( OUT or A0 ) pin of the ZMPT101B to the A0 analog input pin of the Arduino Uno. 3. Monitoring the Waveforms
Configure the Alternator properties: Amplitude = 311V (for 220V RMS) and Frequency = 50Hz or 60Hz . VCC Pin: Connect to a +5V DC power rail generator. GND Pin: Connect to the circuit ground terminal. Close and reopen the software to refresh the
Simulating the ZMPT101B in Proteus: Step-by-Step Circuit Design
#include // Optional: Use a filter library for easier RMS calculation const int sensorPin = A0; float testFrequency = 50.0; float windowLength = 40.0 / testFrequency; // Time window for sampling int rawValue = 0; float intercept = -0.04; // Calibration intercept float slope = 0.0405; // Calibration slope (adjust in simulation) float current_Volts; unsigned long prevMillis = 0; void setup() Serial.begin(9600); pinMode(sensorPin, INPUT); void loop() RunningStatistics inputStats; inputStats.setWindowSecs(windowLength); while((millis() - prevMillis) < 1000) // Sample for 1 second rawValue = analogRead(sensorPin); inputStats.input(rawValue); prevMillis = millis(); float rmsInput = inputStats.sigma(); current_Volts = (rmsInput * slope) + intercept; // Convert to AC RMS Volts Serial.print("Voltage RMS: "); Serial.println(current_Volts); Use code with caution. Troubleshooting Simulation Errors 1. "Simulation is not running in real-time" GND Pin: Connect to the circuit ground terminal
: Connect the AC voltage source (e.g., 220V AC) to the module's input pins. Output Side : The module has pins for
Many websites offer this library, but caution is advised. Stick to reputable engineering forums (like The Engineering Projects, ElectronicWings, or GitHub).
void loop() sum = 0; // Sample 1000 points for accurate RMS for (int i = 0; i < 1000; i++) float sample = analogRead(sensorPin) * (5.0 / 1023.0); float vMains = (sample - offset) / sensitivity; sum += sq(vMains); delayMicroseconds(100); // Simulate 10kHz sampling
Run the simulation. You will likely see an inaccurate voltage (e.g., 210V instead of 230V). To calibrate: