Robert Monsen said:
its a PIC. The tick is the output of a small transformer (actually, the
transformer that provides power for the system) put through a 1MEG resistor.
The transformer is a 120VAC -> 12VAC 2VAC center tap transformer.
A series diode with the resistor would be nice. ;-)
The PIC has input clamp diodes to prevent overvoltage, and a bit of
hysteresis to prevent retriggering.
I assume you're talking about external clamping and not just relying on
the internal protection diodes. Sign up for the mailing list at
www.piclist.com.
The error seems to be erratic, sometimes lagging my wristwatch, sometimes
leading it. The watch is very accurate, so I don't think its that...
Some of this is normal throughout the day. Check out the link I posted,
it shows that loads on the system cause slight variation that the power
company keeps track of. They then make adjustments. I wouldn't be
surprised if at any given moment, your watch (you really should be using
something more accurate like WWV for your testing) is likely to be
several seconds or even a minute or two in disagreement. It's the long
term accuracy that's maintained, the short term accuracy sucks. ;-)
I'll run it for a few more days, and keep track of the errors in a
log.
That's a good way to do it, you need to check the long term accuracy
over several days. You also need to make sure that you are not counting
extra cycles or dropping them. You may need to "clean up" your input a
bit more by using a comparator, I suspect you're getting spikes and/or
missing cycles when surges/sags occur.
I was really hoping that somebody from the power industry would answer... I
poked around on the PGE (the northern california power company) site, but
didn't find anything useful.
Check out the link I posted, it shows what appear to be adjustments
being made by the power company. There are sudden and sharp corrections
on his graph amidst what would appear to be random variations in the
line frequency. Interestingly, they occurred at precise times of the
day on the hour or half hour. This would make sense as the grid needs
all the suppliers to work together.
Good luck and keep tinkering. ;-) Check out that guys site, he's got a
bunch of neat stuff out there. I'm biased though as I collect old
clocks myself. I think one of my next projects will be a pendulum
reinforced by a magnetic "nudge" on each swing. The pendulum will still
swing at it's natural rate, and that will be the time base for my clock.
A hall effect or optical sensor will indicate when to provide the
impulse to the pendulum. Should be fun getting it tweaked out. Not my
idea, but it sounds too good to resist for a PIC project. ;-)
michael