AC spanning meet module 230Vac
Productomschrijving
AC spanning meet module 230Vac
Netspanning meet module te gebruiken met b.v. een Arduino.
Type: ZMTP101B
Via deze link kunt u een voorbeeld filmpje zien.
Sketch
double sensorValue1 = 0; | |
double sensorValue2 = 0; | |
int crosscount = 0; | |
int climb_flag = 0; | |
int val[100]; | |
int max_v = 0; | |
double VmaxD = 0; | |
double VeffD = 0; | |
double Veff = 0; | |
voidsetup() { | |
Serial.begin(9600); | |
} | |
voidloop() { | |
for ( int i = 0; i < 100; i++ ) { | |
sensorValue1 = analogRead(A0); | |
if (analogRead(A0) > 511) { | |
val[i] = sensorValue1; | |
} | |
else { | |
val[i] = 0; | |
} | |
delay(1); | |
} | |
max_v = 0; | |
for ( int i = 0; i < 100; i++ ) | |
{ | |
if ( val[i] > max_v ) | |
{ | |
max_v = val[i]; | |
} | |
val[i] = 0; | |
} | |
if (max_v != 0) { | |
VmaxD = max_v; | |
VeffD = VmaxD / sqrt(2); | |
Veff = (((VeffD - 420.76) / -90.24) * -210.2) + 210.2; | |
} | |
else { | |
Veff = 0; | |
} | |
Serial.print("Voltage: "); | |
Serial.println(Veff); | |
VmaxD = 0; | |
delay(100); | |
} |
Productspecificaties
- Artikelnummer
- GO81