# 4 Hz Stable Frequency generator

Whats a good circuit/design that will generate a very stable 4Hz signal (to feed into a counter) that won't drift with temp / time.

It's not so important that its exactly any particular frequency, just around 4Hz, it's just important for it to stay at that frequency ( it's to be used as a test signal )

-
Define "Very Stable". And define "won't drift with temp/time". Everything will drift, so it's mainly a matter of how much drift is acceptable. Also, over what time period does this clock need to be running? 1 hour, 1 day, 1 century? What about power requirements? Battery or AC powered? – David Kessner Apr 12 '11 at 3:47
@David, fair enough! to less than 0.01 of Hz. It will be running in the order of a week. It will be powered with a DC power supply or battery. – Keith Nicholas Apr 12 '11 at 3:53

$\dfrac{32768}{8192} = 4$

Crystals are available that oscillate at 32786 Hz and you can divide this frequency down by 8192 using CMOS IC 4060, which also contains an oscillator circuit. Images are taken from here. Stability will be better than you are asking for.

-
What's the variable capacitor in this circuit for? – BG100 Apr 12 '11 at 5:49
@BG100 It's a Pierce oscillator, so you need to match (here unknown) load capacitance of crystal with the capacitors. You don't have to use variable, though, find the correct value on breadboard or from crystal's datasheet. – Jaroslav Cmunt Apr 12 '11 at 6:23
+1 for the cheapest and simplest solution. – stevenvh Apr 12 '11 at 6:55

Standard crystal oscillator circuits have an accuracy of +/- 20ppm to 200ppm accuracy (ppm=pulses per million) depending on the crystal used. 4 Hz +/- 0.01 Hz is an accuracy of 2500ppm. So... just about any crystal oscillator circuit will give you the accuracy you need.

The problem that you'll find is that a crystal oscillator will run at much higher than 4 Hz. 32.768 KHz is about the lowest you'll find, with the upper end in the hundreds of MHz (or maybe a GHz or so). So what you'd do is use a higher clock frequency and divide it down to get the 4 Hz you desire.

Exactly how you do it all depends on what you're comfortable designing and building. You can use a metal-can type oscillator and then divide it down with simple counter chips. Or you could use a CPLD or FPGA (overkill). Or even a small microcontroller for both the crystal oscillator and the divider.

I would use the microcontroller approach. If you have never done a microcontroller approach, it is probably more difficult to do. But it's fairly flexible, low power, and small size. Although I'll be the first to admit that this approach isn't for everyone.

-
ok, so no super simple method for doing it. But I'm pretty happy at throwing a PIC at the problem to solve it. – Keith Nicholas Apr 12 '11 at 4:26
I disagree with the microcontroller. There's nothing simpler than an oscillator followed by a prescaler, see Jaroslav's answer. – stevenvh Apr 12 '11 at 6:12
@stevenvh Yes, Jaroslav's circuit is simple, but the thing is, nobody needs just a 4 Hz clock. And we don't know everything that Kieth has in plan for his project. So, while you might disagree with an MCU it might end up being the better solution given the big picture that only Keith knows. That's why in my answer I threw out three solutions: a counter chip, a CPLD/FPGA, and a MCU. – David Kessner Apr 12 '11 at 13:05
"nobody needs just a 4 Hz clock". I've got the idea he does. It sounds to me OP wants a test circuit which supplies this 4Hz signal to an existing DUT. Something like that. In that case microcontroller and especially FPGA are way overkill. You can build Jaroslav's solution in the time it takes to start your FPGA's IDE, so to speak. :-) – stevenvh Apr 12 '11 at 17:39
Steven is right, I basically just need a test signal (that we can make a fair few of and is reasonably cheap) to feed into a data logging device. – Keith Nicholas Apr 12 '11 at 21:29