[time-nuts] Building a mains frequency monitor

Attila Kinali attila at kinali.ch
Sun Apr 10 18:19:28 EDT 2016


On Sun, 10 Apr 2016 12:03:51 -0700
jimlux <jimlux at earthlink.net> wrote:

> On 4/9/16 10:20 PM, Bill Hawkins wrote:
> > The schematic is too simple. There is noise on the power line from
> > switching things on and off, leakage from dimmers and switching power
> > supplies, and the occasional animal that gets across the HV distribution
> > line, not to mention lightning, induced or direct.
> >
> > A simple capacitor will reduce high frequency stuff. The purist will
> > invest in an L and C that resonates at 60 Hz.
> 
> Or a series of R/C stages: you don't care about loss.
>
> > Alternatively, use a
> > synchronous motor driving a load with sufficient inertia in combination
> > with a slotted disk and photo pickup. Perhaps an old record turntable
> > will do - but not one with a regulated DC motor.
> 
> A clever idea because of the mechanical low pass filtering, but probably 
> impractical..
> 
> A record turntable with a synchronous motor?  That's going to be ancient 
> and hard to find in this age of digital music players. 

Why all these complicated filtering systems? As Jim wrote, we live in
a digital world. One can easily sample the 60Hz with an ADC, 200sps is more
than enough, the resolution doesn't need to be good either, 8bit would be sufficient. Do some filtering in the digital domain with some narrow band
FIR or IIR filter. No need to worry about temperature stability or whether
there will be any spikes. Time stamping is also easy as the zero crossing
"detection" is just a simple bit of math.

All this can be done in a 16bit uC.. or use one of the many cortex-M0/M3 out
there... or if you want to use floats for simplicity, use an M4.


If you want to go all out and do a luxury solution, how about sampling
at 100ksps (something which most modern 32bit uC support with their
internal ADC), so a simple 200Hz or so RC filter would be enough to get
rid of all harmonics, spikes and other stuff that would cause aliasing.
Filter in the digital domain, decimate, filter again, decimate, filter
until you're down at a couple of Hz of bandwidth. Then mix the signal
down to DC with an 60Hz generated from an NCO and detect the phase.
Send phase value to PC using USB or ethernet interface.



			Attila kinali

-- 
Reading can seriously damage your ignorance.
		-- unknown


More information about the time-nuts mailing list