The clock project finished up a year ago. This is the start of a new project, which might turn into some sort of power monitor.
Here's a picture of two waveforms on an old-school scope from ~1990.
Sine wave is volts, pulse is ampsSine wave is volts, pulse is ampsSine wave is volts, pulse is ampsSine wave is volts, pulse is ampsSine wave is volts, pulse is ampsSine wave is volts, pulse is ampsSine wave is volts, pulse is ampsSine wave is volts, pulse is ampsSine wave is volts, pulse is ampsSine wave is volts, pulse is ampsSine wave is volts, pulse is amps
If the units and scales are right, the integration of volts * amps is the real power being used by the load. I did that, eye-balling it, and got 47 watts. That was a little disappointing because this is the device under test.
30W CFL bulb30W CFL bulb30W CFL bulb30W CFL bulb30W CFL bulb30W CFL bulb30W CFL bulb30W CFL bulb30W CFL bulb30W CFL bulb30W CFL bulb
If that was an incandescent bulb, the volts and amps would be very similar waveforms, neatly aligned. But most of today's electronics demand power during a fraction of a voltage cycle.
View more... The version 0 boards arrived just before the end of the year and have served their purpose. I'm expecting the version 1 boards tomorrow. Here's the version 0 board showing the voltage sine wave on a 240x320 2.8 inch display and an extra board. The bottle cap is for scale; look at the tiny capacitor in the yellow circle. The pcb vendor mounts that; I'm pretty sure I can't.
The display is mounted to the red card, which plugs in to a connector mounted to the vertical row of holes at bottom left-center.The display is mounted to the red card, which plugs in to a connector mounted to the vertical row of holes at bottom left-center.The display is mounted to the red card, which plugs in to a connector mounted to the vertical row of holes at bottom left-center.The display is mounted to the red card, which plugs in to a connector mounted to the vertical row of holes at bottom left-center.The display is mounted to the red card, which plugs in to a connector mounted to the vertical row of holes at bottom left-center.The display is mounted to the red card, which plugs in to a connector mounted to the vertical row of holes at bottom left-center.The display is mounted to the red card, which plugs in to a connector mounted to the vertical row of holes at bottom left-center.The display is mounted to the red card, which plugs in to a connector mounted to the vertical row of holes at bottom left-center.The display is mounted to the red card, which plugs in to a connector mounted to the vertical row of holes at bottom left-center.The display is mounted to the red card, which plugs in to a connector mounted to the vertical row of holes at bottom left-center.The display is mounted to the red card, which plugs in to a connector mounted to the vertical row of holes at bottom left-center.
Testing the wifi connection while waiting for the version 1 boards suggests 40K to 50K bytes per second is a sustainable data rate with everything else this computer needs to do. I want to look at both the voltage and current channels, so about 20KB/sec for each digitized wave forms. At some point I'll want to use an FFT on the data, and I started thinking about buffer sizes. FFTs really like power of 2 sizes. How much? Here's some test code:
dt = New Table( "Untitled", "invisible", New Column( "size" ), New Column( "time" ) );
dt << New Column( "factors",
character,
formula(
primes = [2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113
127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257
263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409
419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571
577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733
739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907
911 919 929 937 941 947 953 967 971 977 983 991 997 1009];
start = size;
ip = 1;
q = primes[ip];
result = "";
While( start > 1,
If( Mod( start, q ) == 0,
result = result || Char( q ) || ",";
start = start / q;//
, //
ip += 1;
q = primes[ip];
If( q * q > size, Break() );
)
);
If( start > 1,
result = result || Char( start )
);
result;
)
);
For( i = 2, i <= 2 ^ 19, i += 1,
x = 0;
x = J( i, 1, Random Uniform() );
start = HP Time();
FFT( {x} );
end = HP Time();
dt << addrows( 1 );
dt:size[N Rows( dt )] = i;
dt:time[N Rows( dt )] = (end - start) / 1e6;
If( i == 10,
dt << Graph Builder(
Size( 1709, 424 ),
Show Control Panel( 0 ),
Variables( X( :size ), Y( :time ) ),
Elements( Points( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
{Marker Size( 0 ), Marker Drawing Mode( "Normal" )}
)
)
);
Wait( .1 );
);
If( Mod( i, 100 ) == 0,
Wait( 0 )
);
);
The table looks like this:
2 is great,3 and 5 nice, maybe 7.2 is great,3 and 5 nice, maybe 7.2 is great,3 and 5 nice, maybe 7.2 is great,3 and 5 nice, maybe 7.2 is great,3 and 5 nice, maybe 7.2 is great,3 and 5 nice, maybe 7.2 is great,3 and 5 nice, maybe 7.2 is great,3 and 5 nice, maybe 7.2 is great,3 and 5 nice, maybe 7.2 is great,3 and 5 nice, maybe 7.2 is great,3 and 5 nice, maybe 7.
It makes a pretty graph:
The fast buffer sizes, near the bottom, don't have large factors.The fast buffer sizes, near the bottom, don't have large factors.The fast buffer sizes, near the bottom, don't have large factors.The fast buffer sizes, near the bottom, don't have large factors.The fast buffer sizes, near the bottom, don't have large factors.The fast buffer sizes, near the bottom, don't have large factors.The fast buffer sizes, near the bottom, don't have large factors.The fast buffer sizes, near the bottom, don't have large factors.The fast buffer sizes, near the bottom, don't have large factors.The fast buffer sizes, near the bottom, don't have large factors.The fast buffer sizes, near the bottom, don't have large factors.
What's in that odd stack of points around 9500? Select, subset, take a look...
Bigger factorsBigger factorsBigger factorsBigger factorsBigger factorsBigger factorsBigger factorsBigger factorsBigger factorsBigger factorsBigger factors
Looks like JMP will be able to make a real time dashboard if I use a 1024 or 2048 sample buffer.
Very fast.Very fast.Very fast.Very fast.Very fast.Very fast.Very fast.Very fast.Very fast.Very fast.Very fast.
Even at 60 times a second, it is under 1%. I may run the FFT on the esp32. Then, instead of sending complete waveforms, maybe just send the top N frequency bins and amplitudes. Bunch of tradeoffs to consider.
Still going. Freshly calibrated using a 160Ω dummy load, this is a nominal 13 watt CFL. The ESP32 is using wifi to create the graphs and meters in a web browser.
the wifi signal strength transmitted by the ESP32 adds noise to the digitized voltage. With it turned down like this, the sine curve looks pretty smooth. The FFT graph is overlayed...that's not the Y axis, it is the 60Hz bin for the FFT. This FFT has a linear Y axis scale.