So my AC-AC adapter arrived. I’m not getting the values I’m expecting so I’m goofing something up. I’m going to share a whole bunch of information and if you spot anything wrong, feel free to tell me I’m an idiot so I can fix it
Here’s the AC-AC adapter datasheet. I’ve extracted the specs I think are needed:
https://www.jameco.com/Jameco/Products/ProdDS/112336.pdf
I measured it with my scope:
With 117.4V input, it outputs 10.2 V RMS whether unloaded or connected to my measuring circuit. My measuring circuit looks like this:
link to circuit: http://tinyurl.com/yufs6emu
I’ve worked out my voltage calibration constant like so:
Voltage Divider:
Rd = (9960 + 997) ÷ 997 = 10.98996990972919,
VRef = 3.3 V,
CMax = -2048 to 2048 (12 bit ADS1015 that supports negative voltages and has a PGA. Voltage from ADC = ADC Value * (gain / 2047.0) - in this case the gain value is 4.096V
AC-AC Adapter:
Rt = 120 ÷ 10.2 = 11.76470588235294
voltage calibration constant = Rt × RD
10.98996990972919 x 11.76470588235294 = 129.2937636438728
Using 129.2937 for VCAL and 1.7 for PHASECAL I’m calling calcVI to measure 60 crossings with a 2000ms timeout.
typical output:
realPower: -736.009722, apparentPower: 731.292915, powerFactor: -1.006450, Vrms: 102.244487, Irms: 7.295094 samples: 1425, time: 570
I’m basically ignoring everything except for Vrms and Irms because (and correct me if I’m wrong) until I get those two values aligned with reality, there’s no point in looking at the other values. My Irms is very close to my test loads and I’m happy with it’s values. Vrms is low however. If I measure the voltage on the input side of the AC-AC adapter I see 117.4V but I only see ~102 reported in my code.
If I arbitrarily adjust the voltage calibration constant to 149.2 I see a voltage value more in line with what I see at the outlet, however I also see a power factor > 1 which I learned in this thread cannot be greater than 1.
realPower: 866.146270, apparentPower: 860.367767, powerFactor: 1.006716, Vrms: 117.071806, Irms: 7.349060 samples: 1402, time: 598
In an effort to confirm that I’m sampling properly, I decided to data log one of my calcVI calls. This is the data collected over 1/2 second of sampling.
and the raw data in CSV:
and here’s my datalog with the current readings charted as well if that’s useful info:
and a different scale for the current since it’s a 0.333V CT.
Thanks for taking your time to read my blog I appreciate it!
edit: Been wondering if PHASECAL may be messing with my values. I’m going to experiment with different values. Based on my timings, the time between reading the AC ADC and the CT ADC is 170us and each loop sample takes approx 360us.