Paste them into the folder of your Proteus installation directory.
Connect the AC live and neutral terminals to the high-voltage input pins of the ZMPT101B model. 2. Low-Voltage DC Side VCC: Connect to a +5V DC source generator. GND: Connect to the schematic ground terminal.
Upload the compiled .HEX file of the following code into your Proteus Arduino block: zmpt101b proteus library
When using custom simulation libraries, you may encounter minor setup glitches. Here is how to fix them quickly:
The ZMPT101B module is designed to safely step down high-voltage AC (up to 250V) into a low-voltage analog signal that a microcontroller can safely read via its Analog-to-Digital Converter (ADC). Key Specifications: 0 to 250V AC Output Signal: Analog sine wave (centered around Supply Voltage ( VCCcap V sub cap C cap C end-sub ): 5V DC typical Paste them into the folder of your Proteus
C:\ProgramData\Labcenter Electronics\Proteus 8 Professional\Data\LIBRARY
Because Labcenter Electronics does not include this sensor out-of-the-box, third-party developers have created custom library blocks. These blocks use standard .IDX and .LIB files to render the component visual model and its simulation properties. Steps to Find and Download Low-Voltage DC Side VCC: Connect to a +5V
const int sensorPin = A0; // ZMPT101B OUT connected to A0 const float vCC = 5.0; // ADC reference voltage const float calibrationFactor = 42.5; // Adjust to match input RMS in simulation void setup() Serial.begin(9600); void loop() unsigned long startTime = millis(); float maxCurrent = 0; float minCurrent = 1023; float sampleVoltage = 0; float sumOfSquares = 0; long sampleCount = 0; // Sample the AC wave for 20 milliseconds (one full 50Hz cycle) while (millis() - startTime < 20) int rawValue = analogRead(sensorPin); // Convert raw ADC to voltage centered around VCC/2 offset float voltage = ((rawValue * vCC) / 1023.0) - (vCC / 2.0); sumOfSquares += sq(voltage); sampleCount++; // Calculate Mean Square and Root Mean Square (RMS) float meanSquare = sumOfSquares / sampleCount; float rmsVoltageOutput = sqrt(meanSquare); // Scale the output to reflect the actual primary AC Mains voltage float finalACVoltage = rmsVoltageOutput * calibrationFactor; Serial.print("Simulated AC RMS Voltage: "); Serial.print(finalACVoltage); Serial.println(" V"); delay(1000); Use code with caution. Troubleshooting Common Simulation Issues