Hi plecc,

Recently, chriswms had design an 8-hours delay (4 hours ON and 4 hours OFF). Look here, it will help you:

http://pcbheaven.com/forum/index.php?topic=745.0. He wanted to have accuracy so he used a crystal oscillator.

I would not suggest to use a crystal oscillator even if you need A LOT of divisions. Let me give you an example:

**The 7 days are: 60*60*24*7 = 604800 seconds. **You make an 1Hz (approximately) oscillator with the 555 timer. The output of the 555 (pin 3) goes to the first 4060 binary counter. The Q14 of this counter, will be low for 2

^{13} seconds, and high for 2

^{13} seconds, this means 8192 seconds low and 8192 seconds high. You want 604800 seconds low and then high. So, you put another 4060 to further divide this signal. From this second 4060 divider, you will use the output #6. From this output, you get 524288 seconds low and 524288 seconds high. The 524288 are 6 days, 1 hour and 360minutes (and some seconds).

**Now you need an oscilloscope**. You

**NEED** to accurately set the clock from the 555 timer. If you set the oscillator at 1.15356 Hz, you will finally get the exact 7 days low/7 days high signal at the output.

For your calculations, you can convert the input frequency to seconds of delay using the formula: SEC = HZ x 2

^{19}. Eg, 1.15356 x 2

^{19} = 604797.66528 seconds, (that you really need).

You can calculate the error (if the oscillator is not exactly 1.15Hz) using the same formula. If for example the oscillator is 1.2Hz (instead of 1.15): SEC= 629145.6 seconds, and that is 7 days and 6 hour.... You understand how difficult is to set. If yo can tolerate such an error, then this is a nice solution.

** ------- OR --------**You can have instead of the lazy 555 inaccurate timer, a crystal oscillator. The post i gave you before has some nice 2Hz timers using 32768 crystal and 4060 divider/counter (

http://www.reuk.co.uk/Making-Very-Accurate-Timers.htm). This is a very VERY accurate 1Hz, as the crystal needs of no calibration and oscilloscopes like the 555. What you do then, is to connect this 2Hz signal to the circuit i described you above. Be carefull, as now you need to get the output from the second 4060 from the

**output #7** (and not #6 as before). The output will be low for 6 days, 1 hour and 360minutes (and some seconds) (as i described you before), but this will be ALWAYS the same, ALWAYS every this interval. This is something that the 555 cannot achieve.

You may ask me now "ok, why not using another crystal that will give me the appropriate frequency for 7 days?".

I am not sure of which crystals are sold. The 32768Hz crystal is a standard number and exists because it can be divided by powers of 2 and result into an integer. You need to do a research yourself to find something more appropriate