hello,
I am new to Arduino, and have not programmed since high school. I have spent the past week working on how to get this sensor to work. The "active output single phase ac sensor" is pretty common on ebay and removes the need to make your own board to monitor voltage, unfortunately there is little information on this. The only post that pointed me in right direction is here
http://forum.arduino.cc/index.php?topic=357095.0
Unfortunately a little more information would have saved me time, so I am sharing it here.
Starting with Emonlib EmonLib/EmonLib.h at master · openenergymonitor/EmonLib · GitHub
the challenge is finding the information on how to calibrate the system for a sensor that is not made by openenergymonitor.
so here is the sketch that I used to understand the calibration, and timing. I set the potentiometer in the middle because it didn't seem to make much of a difference.
I used a voltmeter to watch the real voltage from the outlet, and increased the calibration number till my computer was reading close to what my voltmeter did.
emon1.voltage(A0, 600, 1.7); // Voltage: input pin, calibration, phase_shift
I found that if I used a multiplier in the loop, ie: x= emon1.Vms * 2; I would get funny results for different voltages. (I need to read from 0 - 400v ac) So use the calibration.
for my project I need speed more than accuracy, I found that when using the settings in the github example my loop would take 200ms,
emon1.calcVI(20,2000); // Calculate all. No.of half wavelengths (crossings), time-out
so I wrote this sketch to see the accuracy between 2 and 20 crossings, found the accuracy to be 3v with 2 crossings, and 2v with 20. The time difference is 180ms. I also found my project hanging when the voltage went to zero... then I noticed the 2000ms timeout.
still working on this, and will update as I learn more
Voltage_sensor.ino (1.34 KB)