Timer Circuit with 555 and 4060b

Wendy

Joined Mar 24, 2008
23,798
Some math to put it into perspective. You want an oscillator that is off 8 hours and on 29 seconds. The 29 seconds is easy, the 8 hours not so much.

So 8 hours = 28,800 seconds.

A 4060 is a 14 bit counter, with some of the bits missing on the leads, 2^14 = 16384 counts. If we use a 2 second time base it will count to 32767 seconds and recycle.

14,400 decimal = 11100001000000 (the Window's calculator is very handy for this function).

This means we need a 4 input AND gate on the ÷64 (Q7), ÷2048(Q12), ÷4096(Q13), and ÷8192(Q14) pins.

A quick look at the Fairchild data sheet shows this is doable. I prefer Fairchild's to TI's, it is clearer and has better application notes.

http://www.fairchildsemi.com/ds/CD/CD4060BC.pdf

The pinout even favors the diode connections.

A simple RC counter will take qty 1 4060, and qty 1 555.

A crystal base will take an additional 4060 and a divide by 4 circuit (the stock 4060 with a 32768 crystal comes out with 2Hz).

I'll design a circuit for a 0.5 Hz (2 second) time base.
 
Last edited:

Wendy

Joined Mar 24, 2008
23,798
OK, here is how I would do it with a RC circuit...



I've never used a 4060 like this, so I'm not positive about the RC oscillator. It is straight out of the TI data sheet however (I used both).

Use a tantalum capacitor for best stability. Any medium power switching transistor will work, such as a 2N2222A.

If you need more accuracy on the 29 seconds you can put a variable resistor in series with R6, and drop R6 down a little.

You can tweak the time by measuring D1 flash, it will take 128 seconds exactly for the LED to flash if adjusted correctly. I added it as an afterthought.

I'll be back with the .5 Hz crystal source later.
 

Attachments

Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
Any RC-based timer just won't be very accurate over long periods of time.

Even uncompensated crystal oscillators used as a clock will "drift" up to a couple of minutes per day. If they are temperature compensated, you can get the drift down to a few seconds a day.

I haven't seen specifications of just how accurate this is required to be; but with 29 seconds mentioned, that sounds like some degree of precision is required.

Using a microcontroller would certainly be the lowest parts-count solution. If extreme accuracy is not required, you could get within 1% of the timing constraints just using the internal oscillator of something like an 8-pin DIP PIC12F629 or PIC12F675 uC, one of which comes with the $35 PICkit 1. Even this small uC would be overkill for the project, but the start-up costs would be lower than many other possibilities.

Roman Black has some interesting (and related) projects and routines on his website:
http://www.romanblack.com/
There's a $1 OCXO (oven controlled crystal oscillator) if you need a pretty accurate timebase:
http://www.romanblack.com/xoven.htm
A zero-error 1-second timer:
http://www.romanblack.com/one_sec.htm
Combine the two with a cheap PIC, add a routine to count up the seconds and toggle the I/O pin high and low.
Control the low side of the relay using a logic-level MOSFET, like an IRLD014 or IRLD024. You'll need a diode across the relay coil to protect against reverse-EMF when the MOSFET turns off.

You could even use another pin to flash an LED at 1-second intervals to tell if it's alive or not.
 

Wendy

Joined Mar 24, 2008
23,798
Calibration is going to be an issue no matter what circuit is used. The OP has mentioned he is new to this kind of stuff.

It isn't that hard to make a oven for a crystal oscillator, but it might be overkill. Basically a simple resistor in a enclosure with a temperature regulator and temperature probe next to the crystal. Without precision measurement though, it is a waste.
 

Wendy

Joined Mar 24, 2008
23,798
OK, here is how I would do the crystal circuit. I simplified the NAND gate, you can use or loose it as you choose.



The RC oscillator can be done on a protoboard, but the crystal circuit is a bit trickier. I've thought of trying something similar using the dead bug breadboarding technique. It can be hard to get it to oscillate if you're not careful.
 

Attachments

Last edited:

Audioguru

Joined Dec 20, 2007
11,248
OK, here is how I would do it with a RC circuit...

Use a tantalum capacitor for best stability.
No.
The timing capacitor in a classic Cmos oscillator (like the one in a CD4060) has AC across it so a polarized tantalum capacitor should never be used.
A film capacitor has excellent stability but a high value is be huge.
 

rogs

Joined Aug 28, 2009
279
Even uncompensated crystal oscillators used as a clock will "drift" up to a couple of minutes per day. If they are temperature compensated, you can get the drift down to a few seconds a day.
I might have been lucky then!
I built a counter/timer to resurrect an old 'Sychronome' master clock that hasn't run by itself for over 20 years. (Short video of the project here, if you're interested: http://www.vimeo.com/1084861)

Using a 74hc4060, fitted with a 4194304Hz crystal, and divided down further using a couple of 74hc4040s and a few NANDs (much like Bill is suggesting for this project) I have been able to get an accuracy of better than two seconds a day, without any temperature compensation, for a period of over two years now.
The clock is in a lawn bowls pavilion, where the all round temperature varies quite a lot -especially in the winter, when it's locked up for several months.

So unless I've been unusually lucky, I reckon you should be able to get reasonable accuracy (within a couple of seconds a day) without having to fit any temperature compensation to a crystal oscillator.

Of course, it depends what you mean by 'reasonable accuracy' naturally! :)
 

Wendy

Joined Mar 24, 2008
23,798
With any oscillator there is an element of luck, tolerances are a statistical process. Ideally it would be perfect, but since it is made by man...
 

Wendy

Joined Mar 24, 2008
23,798
chriswms17 via PM said:
Thanks for your help. I am in the process of waiting for the rest of my parts to build the schematic you drew up for me which I appreciate. But I did run into one problem so far. Shouldn't the output from the gate supply everything on the 555 except the pin 8 power and the grounds? I have everything except the gate and flip flops and was playing around with it and when hooked up the way you drew it the led from pin 3 of 555 stays on constantly, but when switched around to using the output from the 4060 for everything but the power and ground it works. just need the rest of my parts and some tinkering for adjustments sake.
I don't know which schematic you are using at this point. So, which is it?

The 555 schematic is correct, as is. If you want it to work use it as drawn. If you want to know more about 555 monostables see my 555 Monostable article.

The input pin on the 555 should be a high normally. It sounds like you have a low.

On the first schematic, which I assume you are using at this point, the diode AND gate will be low at R4, 0.6V to be exact. The output of the transistor Q1 at R5 should be a high, 12VDC. This condition is an absolute must.

Any pin not shown connected to anything is meant not to be connected to anything.

 
Last edited:

Thread Starter

chriswms17

Joined Jan 18, 2010
22
Actually I am using the other drawing but don't have the flip flops or gate. Im just tinkering with how it works til I get them. If I hook it up the way you drew it in the second drawing with the crystal, the led off pin 3 of the 555 will stay on constantly (never go off). If I use the 12v power supply for pin 8 only, the grounds as drawn, but use my output from 4060 for my reset, trigger, and 6 and 7 in line with correct cap. and res. I get my correct timing. Any way you can explain why that way works correctly please? Because you are right as far as how you drew the 555 according to almost every site I looked up using the 555 (which is alot by the way :) ) except one which is what made me rewire it and actually made it work right.
 

Wendy

Joined Mar 24, 2008
23,798
The second drawing has a NAND gate, same as the first. The only difference is how the NAND is made. You can not eliminate it, it is required and basic to how the 555 works. What chip did you use for it (or are planning on using)? The inverter part is needed, since the 555 requires a high on the input pin 2. When pin 2 goes low the 555 starts timing.

This was explained in detail in the 555 monostable article. Reread the section on the signal conditioner.

If the LED is not blinking the RC Oscillator is not working. The LED is a good diagnostic for that too.

R1 couples the RC oscillator to the input of the counter.
 

Thread Starter

chriswms17

Joined Jan 18, 2010
22
I understand what you are saying and yes it is stated as that all over the net. But when I hooked the 555 up using the vcc how you drew it (and the way it is drew on almost every page on the net) using the output of the 4060 as the trigger only,,, the pin 3 led stayed on constantly. When I changed it to the way I redrew it below it works??????

Just curious as to an explanation of why this defies what everyone is saying.
 

Attachments

Wendy

Joined Mar 24, 2008
23,798
Then you have a basic wiring error. Pin 3 will be low if A) pin 2 is high (+Vcc), B) pin 6 and 7 are tied together with a resistor going to Vcc, C) Pin 5 is either floating or has a capacitor attached (nothing else, it will measure 1/3 of Vcc). In addition Pin 4 and 8 must be Vcc (though this will kill the timer, but not bring Pin 3 high) and Pin 1 is ground.

You might have a bad 555, but they tend to be pretty rugged chips. I've blown them in under a second with a wiring error.

What do you have connected to pin 3? If there is something disconnect it, and see where the pin voltage goes.

You should see the following voltage on the following pins...

1. 0V
2. Vcc
3. 0V
4. Vcc
5. 1/3 Vcc
6. 0V
7. 0V
8. Vcc

Are you using a protoboard to wire this up?
 

Thread Starter

chriswms17

Joined Jan 18, 2010
22
I am using a breadboard.

The reason I dont understand why I have a wiring problem is because the way I have it wired it works whereas the way you originally drew it, it doesn't work the way I need it to.. By no means am I stating you are wrong as you have WAY more knowledge than I.

The way I have the test circuit wired is that pin 8 of 555 is hooked up to 12vdc. When pin 14 of the second 4060 goes high the 555 will reset the timer (pin 4 of 555) it will also trigger the timer to start (pin 2 of 555) as well as control the voltage for timing using resistor, pin 6, pin 7, and capacitor.

As you can see in your revised drawing I posted above, pin 14 of the second 4060 goes high for approx 1 min 4 seconds. So that means there is a high signal to the 555 timer for that long allowing my 555 to time my 29 seconds.

This way works so I don't understand how I have a wiring error???? As this is how I assumed it was supposed to work. my total time off needed is 8 hours which will give me 4 hours high and 4 hours low. When it goes high again after the 8 hours has passed, the 555 gets a high signal and starts timing my 29 seconds.
 

Wendy

Joined Mar 24, 2008
23,798
At this point I don't know how you have it wired. I can only guess. But the output of the 555 will be a low if you connect it as drawn. The exception is while it is timing. Did you compare the voltages I gave you to your circuit? What did you measure? I'm working in a vacuum here.

When you say breadboard I assume you are soldering it in? I prefer protoboard, then solder, it lets you experiment more and build confidence. However, the crystal section can't use protoboard, so it is a personal call.

Since I'm not sure of the RC oscillator I'm going to verify its operation. I know you are going to use the crystal version, but the RC oscillator lets you check out the rest of the design.

The two designs are basically identical except for time base used.

Your reference to pin 14 of the 4060, you aren't using it to feed the 555 by chance? I've said it several times, the input to the 555 must have an inverter (as drawn by the transistor Q1) or a inverting gate. Pin 2 of the 555 must be high, this is not optional. If pin 2 of the 555 is low then pin 3 will lock up in a high state, and the 555 can not do its job.
 

Thread Starter

chriswms17

Joined Jan 18, 2010
22
I have it hooked up on a solderless plug in board. No solder. I have it hooked up exactly as it is drawn in the above drawing. I was using pin 14 as a test point. Pin 2 of 555 does go high when pin 14 goes high but only stays high for my timing of 29 secs while pin 14 stays high for about 1 min.

I have the crystal oscillator hooked up on the plug in board. The test point (pin 9) is correct and the output from the different pins on the 4060 I tested in Hz are correct so I know it is installed on the board correctly.

I will take measurements as to the 555 voltage this afternoon and post back.
 

Wendy

Joined Mar 24, 2008
23,798
I keep saying this. Pin 2 should not go high. It should be high. You are driving the input backwards. It won't damage anything, but it won't work.

Pin 2 is high. Pin 2 stays high. Pin 2 only goes low to start the timer, then it goes back high again.

Put the transistor inverter Q1 between Pin 14 of the 4060 and pin 2 of the 555.
 
Top