Timer for 1 hour duration every 23 hours?

Thread Starter

bio88

Joined Feb 17, 2011
34
Trying to design an inexpensive way to have a music file play for 1 hour at 12 noon every day.

I'm thinking about using a timer circuit similar to one of these: LED String Timer.

Timers used for LED Xmas light strings go for 6 hours every 18 hours. To get the music file to play the timer circuit should close and hold a normally open switch contact for 1 hours duration every 23 hours. So obviously I need to replicate the circuit to adjust this timing.

Any idea what kind of timer circuit is being used?

How could you use that output voltage from the timer to close a switch contact? I'm thinking relay but that would use too much current.

Any help appreciated -
 

GopherT

Joined Nov 23, 2012
8,009
Could you give us an idea of how accurate you need The 24 hours and the 1 hour.

What do you need to switch your music generator on? Or do you need a plan for the music too?

Battery, walwort, AC transformer power?
 

t06afre

Joined May 11, 2009
5,934
They sell electronic timers quite cheap. Depending on your budget one of those may be the cheapest option. As it may be hard to beat mass production in this case. If you still want to build one. We will of course help you
 

KMoffett

Joined Dec 19, 2007
2,918
Google: wall plug timer
Electromechanical ones generally have on/off intervals of 15 minutes. Digital ones are one minute. Connect a 120VAC coil relay and switch whatever you need to.

Ken
 

Thread Starter

bio88

Joined Feb 17, 2011
34
Thanks for the feedback! Actually I am using one of these to play the sound file. The large button on the front is a momentary switch. Whatever timer circuit I use needs to be able to complete that momentary switch. That right there has me scratching my head.

On the timers - I've tried the plug in type and daily mechanical type as well. They are awesome but not practical to fit into a project box and run on AA batteries.

The timer needs to be reasonably accurate to the time of day. It can drift a bit but not by more than say, 15 minutes over a week. I know it is not a 555 timer but what then?
 

crutschow

Joined Mar 14, 2008
34,452
If you wanted to use discrete parts to build a low power timer you could use a CD4060 14-bit counter/oscillator to get a 2Hz output using a 32,768Hz watch crystal. You could then use additional counters to divide that by 120 to get an hour count, and divide that further by 24 to get a day count. The 24 hour count is then used to gate the 1 hour counter every 24 hours.
 

AnalogKid

Joined Aug 1, 2013
11,044
Or you could divide the 2 Hz by 7200 to get the hour count...:)

Nothing does very long duration timers like a uC, but there is all of that software gunk to deal with. If you're better with perf board than with C++, then I vote for the crystal and counter approach. If your application is ok with extending an on time of either 51 or 68 minutes, then this gets pretty easy. This project lends itself to very simple decoding because a) it is an up-counter; and b) we care only about the first instance of the numbers we are decoding.

To count a 32 KHz crystal down to a 24-hour day takes a 32 bits count string. To decode the on and off times you want, you need access to only the last 10 bits of the counter. The counter can be done with only two chips, a 4521 (24 bit counter) followed by an additional 8 bit counter such as part of a 4020.

In this 32-bit string, bit 15 is toggling at a 1 second period. Moving up from there, bit 27 is 2048 seconds or 34 minutes, and bit 26 is 17 minutes. Decoding these two bits with an AND gate gets you a stop time of 51 minutes. Or, you can use bit 28 by itself for a stop time of 68 minutes 16 seconds. For real accuracy, decode bits 27, 26, and 25 for an on time of 59.5 minutes.

The other decoder is the start time. If you think of the last 10 bits of the counter as a single counter of zero to 1023, you need to decode a value of 675. This is because there are 86,400 seconds in a day, and 675 is the remainder after the largest binary divisor (128). Using an AND gate, you need to decode the 1's only. To decode 675, the ones are at 512, 128, 32, 2, and 1. This can be done with a single 8-in or a dual 4-in AND gate.

Besides the long counter and the decoders, you need one flip-flop and an output stage, or driver, or whatever it takes to do the task, plus a reset button that combines with the 675 decoder to reset all counters and the output FF.

Pressing the reset button (at 12 noon) resets all counters, sets the FF, and starts the music. At either 51 or 59.5 or 68 minutes, the FF is reset and the music is off. Over the next 23 hours the FF is reset many times, but never is set in between so the music stays off. The 675 decoder resets the long counters to zero, sets the FF, and the music comes on again.

A simple RC filter between the 675 gate output and the various reset inputs prevents meta-stable states from accidently resetting things too early, and gives you a place to put the reset button to synchronize everything to 12 noon.

So this looks like 2 counter chips plus 2 or 3 gate chips. All of this is intentionally vague, just the outline of the plan rather than a complete schematic. Let us know if you need more.

ak
 

Nykolas

Joined Aug 27, 2013
115
I used a 4060, anded 2 outputs to get my delayed-time on and an inverter to do the reset (my app was to turn on a fan in a windowless bathroom for 5 mins every 5 hours). Google "repeat timer". E
 

wayneh

Joined Sep 9, 2010
17,498
The timer needs to be reasonably accurate to the time of day. It can drift a bit but not by more than say, 15 minutes over a week.
Just hack a cheap electronic watch. I've seen internet instructions for this. You may need help using the watch signal to control a transistor, but that's the easy part. A repurposed cellphone would work also, but maybe too big for your enclosure. Don't try to get on a plane with this! ;)
 

tcmtech

Joined Nov 4, 2013
2,867
On the timers - I've tried the plug in type and daily mechanical type as well. They are awesome but not practical to fit into a project box and run on AA batteries.
Just buy one of those digital wall timers and strip it down. They run the display off their own internal 3 volt watch battery and are typically nothing more than a dedicated Digital clock with a three wire (+, -, out) connector that goes to the main AC power control board.

Pretty easy to hack one of those and turn it into a timer for a whole other projects and working voltage capability.:)
 

Thread Starter

bio88

Joined Feb 17, 2011
34
I've already hacked a wall timer to do just that - but it was for the prototype.

Appreciate all the info on the circuits - good stuff. I gotta think it can be done cheaply since they do it with those $10 LED lights strings and LED candles that come on for 6 hours and off for 18.

I'm trying to learn as much as possible before putting this out for quote. I need hundreds of these timer/player combos and soon. Thanks for the help!
 

KMoffett

Joined Dec 19, 2007
2,918
Use an 8-pin microcontroller like a PIC, if you are not too critical on the accuracy (creep) of the 24 hour cycling. Or add an 8-pin real-time-clock (RTC) chip for very accurate timing. This requires programming, but is small and very versatile.

Ken
 
Top