ZMPT101B AC output voltage sensor

ZMPT101B AC output voltage sensor of active single-phase voltage transformer module for Arduino Mega zmpt101b 2mA


42 ₪

الناشر: ⚡ Electronic Store ⚡

القسم: Sensors

تاريخ النشر: 2025-10-10









ممنوع توصيل الخط السالب للسينسور المرتبط بالمتحكم ولا بأي شكل من الاشكال مع الخط المتعادلN للAC



Code to Plot ZMPT101B module signal:

code
نسخ
اقتباس
عرض
تنزيل
	
								
const int sensorPin = A0; int analogValue; void setup() { Serial.begin(9600); pinMode(sensorPin, INPUT); Serial.println("Plotting ZMPT101B waveform..."); } void loop() { analogValue = analogRead(sensorPin); // Convert to voltage (for 5V Arduino ADC) float voltage = (analogValue * 5.0) / 1023.0; // Print the voltage for plotting Serial.print(voltage, 2); // 2 decimal places Serial.println(" V"); // Small delay to stabilize sampling delay(500); // Adjust for smoother/faster waveform }




To get the Accurate AC Voltage readings, Arduino code written as to:

code
نسخ
اقتباس
عرض
تنزيل
	
								
// ZMPT101B AC Voltage Measurement const int sensorPin = A0; // Analog pin connected to ZMPT101B output const int sampleCount = 1000; // Number of samples for RMS calculation float calibrationFactor = 0.45; // Adjust this value to match real voltage void setup() { Serial.begin(9600); analogReference(DEFAULT); // Uses 5V as reference on Arduino Uno delay(1000); } void loop() { long sumOfSquares = 0; for (int i = 0; i < sampleCount; i++) { int raw = analogRead(sensorPin); // Read raw ADC value (0 to 1023) int centered = raw - 512; // Center around 0 (assuming VCC/2 baseline) sumOfSquares += (long)(centered * centered); delayMicroseconds(100); // Sampling delay (~10kHz sample rate) } // Calculate RMS value float mean = sumOfSquares / (float)sampleCount; float rms = sqrt(mean); // Convert to actual AC voltage using calibration factor float voltage = rms * calibrationFactor; Serial.print("AC Voltage (RMS): "); Serial.print(voltage); Serial.println(" V"); delay(1000); // Update every second }




calculating calibration factor:

calibrationFactor = 0.45 * (Multimeter Value / Serial Monitor Value) --------------------------------------------------------------------------------------- for an example: If your Arduino IDE Serial Monitor shows 30V but your multimeter shows 230V then –> New calibrationFactor = 0.45 * (230 / 30) ==> 3.45





عرض السلة (تأكيد الشراء) افراغ السلة
اتمام الشراء