I’m not willing to hook my Mac up to 220V through USB, whether through the DSO-2090 USB scope I have, or any other way – even if it’s tied to a galvanically isolated setup such as the recent current measuring setups. One mistake and it’d go up in smoke – I’d rather focus all my attention on keeping myself safe while fooling around with this AC mains stuff.
It took some hacking on the original sketch to get a system which more or less syncs to the power-line frequency (well, just the internal clock, but that turns out to be good enough). Here’s what it shows with the input floating:
Definitely usable. The three different super-imposed waves are most likely an artifact of the scanning, which takes place every 60 ms. One huge improvement for this type of repetitive readout is “digital phosphor”, like the professional DSO’s do: leaving multiple traces on the screen to intensify the readout. Single traces on a GLCD like this one end up with very little contrast, due to the lag of liquid crystals. What I do now, is leave pixels on for 10 scans before clearing the display. It’s not quite digital phosphor (where each scan fades independently), but it’s pretty effective as you can see. And this setup is a tad cheaper than that Agilent 3000X MSO I dream of…
Here’s a readout with this setup tied to the 0.1 Ω shunt in the AC mains line, with the power off:
That’s three pixels of noise, roughly, i.e. some 10 mV.
With a 60 W light bulb turned on, we get this:
Not bad at all! It looks like with a bit of smoothing and averaging, one could turn this into an ON / OFF signal.
Alas, the sensivity does leave to be desired. With a 25 W light bulb:
That’s barely above the noise threshold. It might be difficult to obtain a reliable detection from this, let alone at lower power levels. The 1W power brick showed almost no signal, for example.
Note that with North-America’s 110V, the readout would be twice as sensitive, since it’s measuring current.
Still, these results look promising. Here is the <cough> DSO with digital phosphor </cough> sketch I used:
This code can be found as “glcdScope50” example in GLCDlib on GitHub.
Fun stuff. Just look how simple it is to gain new insight: a few chips, a few lines of code – that’s all it takes!