Do I want a counter?

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
joey7f
Posts: 12
Joined: Fri Dec 03, 2004 1:01 am
Contact:

Do I want a counter?

Post by joey7f »

Hi everyone,<p>I have done a bit of googling and have not had my question satisfied.<p>I want to use a 555 timer to build a binary clock without microprocessors. I think counters work like this, when it receives a high input, the pin representing "1" goes high. The next cycle makes pin 2 go high, so on and so on.<p>Is that correct?<p>I figure that once the unit has been exceeded (eg, the minute value goes past 59) the next value is fet to the input of the next counter.<p>Not sure if that is right or not, or if that is how they work even.<p>Any help would be appreciated :) <p>--Joey
User avatar
Chris Smith
Posts: 4325
Joined: Tue Dec 04, 2001 1:01 am
Location: Bieber Ca.

Re: Do I want a counter?

Post by Chris Smith »

The 555 can form a poor version of the clock cycle, but then you need to add in decade counters and more gates to form the basis of the hour, minute, and second functions. <p>Then you need to add in a led segment driver circuit [and more] to form the numbers on a display. <p>Most clocks use a stable crystal running at high frequency, then use a divide by counter to split it up into seconds, etc., and hen go from there. <p>They may use 30,000 cycles to equal just one second, but the error rate is far more accurate over the long haul.
joey7f
Posts: 12
Joined: Fri Dec 03, 2004 1:01 am
Contact:

Re: Do I want a counter?

Post by joey7f »

http://www.thinkgeek.com/cubegoodies/lights/59e0/<p>The binary clock I want to build is like this, so I don't need a seven segment display.<p>The crystal is an interesting idea. What is the best way to build a squarewave oscillator that is controlled in by a crystal? The first thing I thought of is a colpitts oscillator where you hang the crystal off the base of the transitor. Then bias the transistor low so you clip the bottom and then you can use an opamp (single sourced) to clip the top.<p>I am sure there is a better way of doing this though :) <p>In fact does it even need to be a squarewave? <p>--Joey
User avatar
Chris Smith
Posts: 4325
Joined: Tue Dec 04, 2001 1:01 am
Location: Bieber Ca.

Re: Do I want a counter?

Post by Chris Smith »

Shaping circuits [invertors, gates, and TTLs] and shaping IC chips [complete] can make a clean square wave out of any input. <p>The crystal oscillator is used because of the accuracy in large numbers. <p>In one day there are 86,400 seconds. If your accuracy is down to within one thousandth of a second or Division, your clock will be off by almost 1 and a half minutes [86.4 sec] each day. <p>On the other hand if you use a crystal running at 50,000 cps and your accuracy is 1000th of a division then your accuracy has been improved by a factor of 50, or only 1.7 seconds off each day.
rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: Do I want a counter?

Post by rshayes »

The easiest crystal to obtain would probably be the ones made for wrist watches. These are pretty standard at 32,768 Hz. This looks like an odd frequency, but it just happens to be 2 to the 15th power. Dividing this frequency with 15 cascaded divide by 2 stages will give 1 Hz. When using integrated circuits, the stages may be grouped together. Three stages that divide by 16 followed by a stage that divides by 7 is one posssibility.<p>After you have a 1 Hz signal, the clock you want would divide by 10. This counts the seconds from 1 to 10 and triggers the next stage every 10 seconds. The next stage divides by 6, and triggers the following stage once each minute. The next stage divides by 10, indicating 1 to 10 minutes. The next stage counts 6 periods of 10 minutes each to get 1 hour. And so forth.<p>Most integrated circuit counters consist of 4 binary stages. This can count as high as 16 before repeating. The best example is probably the 74161 type of counter. The same logic function has benn implemented in many series of logic circuits. The 74HC161 would probably be the easiest to get. The Fairchild web site (www.fairchildsemi.com) has the data sheet for this device.<p>Division ratios other than 16 are obtained by detecting the highest count count desired and then resetting the counter. To divide by 6, you count 0 (000), 1 (001), 2 (010), 3 (011), 4 (100), and 5 (101). Logic gates are used to detect the 5 (101) state. When this state occurs, the counter is loaded with 0 (000). At the same time, the next stage counts up by 1.<p>The outputs of the counters will probably need one transistor and one or two resistors each to drive an LED.
User avatar
Edd
Posts: 885
Joined: Sun Jan 27, 2002 1:01 am
Location: Dallas Tx
Contact:

Re: Do I want a counter?

Post by Edd »

This may save you some time building one up. As it is of simple design as well as using the AC line freq as its clock reference. This will be satisfactory in the long run, as the power companies make corrective incremental corrections to that frequency.
With the electronics solved, then the mechanical/display design aspect is just up to your taste.<p>http://ourworld.compuserve.com/homepage ... /clock.htm<p>73’s de Edd
[email protected] .........(Interstellar~~~~Warp~~~Speed)
[email protected].........(Firewalled-Spam*Cookies*Crumbs)
;) ;)<p>[ December 04, 2004: Message edited by: Edd Whatley ]</p>
User avatar
jwax
Posts: 2234
Joined: Mon Feb 09, 2004 1:01 am
Location: NY
Contact:

Re: Do I want a counter?

Post by jwax »

How's about a "Digital Sundial"?
http://www.digitalsundial.com/product.html
(Batteries not included-not needed) :D
WA2RBA
k7elp60
Posts: 226
Joined: Wed Dec 05, 2001 1:01 am
Location: Ivins, UT
Contact:

Re: Do I want a counter?

Post by k7elp60 »

With a good film capacitor and a CMOS version of the 555 a stable 100Hz oscillator can be produced.
Divide by 100 and you get the square wave and a stable 1 hz signal for the clock oscillator.<p>I have built many 555 oscillators in the several hundred's of Hz(as high as 800Hz) that have been extremely stable. Frequency only varied 1 or 2 hz at 800Hz. The key is a good quality of film capacitor.
User avatar
Chris Smith
Posts: 4325
Joined: Tue Dec 04, 2001 1:01 am
Location: Bieber Ca.

Re: Do I want a counter?

Post by Chris Smith »

A 555 can never be that accurate for a long term clock. The 555 is capable of 100,000 cycles per second, and as slow as one cycle per 400 hours, but not that accurate when you consider how many seconds there are in a day, week, month or year. <p>Trying to set it to a given frequency requires a frequency counter to read it and trying keep it to within even one ten thousandth of a division accuracy would require a temperature controlled environment for the chip, and still it would be off by days per year. <p>Using a 555 WILL guarantee a inaccuracy each day, every day, by enough to make a difference.<p> 31,536,000 [31 billion] seconds per year at 1 /10,000 of a cycle off will be out by over two days per year. [52.5 hours]<p>Even frequency counters don’t guarantees this kind of accuracy unless they are the expensive types.
rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: Do I want a counter?

Post by rshayes »

Its not quite that bad. (365 x 24 x 60 x 60 = 31,536,000) A one cycle error at 32,768 Hz would result in an error of 962 seconds or 16 minutes in a year. A 10 second gate on the counter would allow adjustment to 1.6 minutes per year. Unless the counter has a good reference, it may not be that accurate.<p>A 555 is not really all that stable. Metal film resistors may have temperature coefficients under 100 ppm/C (parts per million per degree centigrade). A 1 degree temperature change would result in an error of 3100 seconds per year (or about 52 minutes). Special alloys (such as maganin)and fabrication techniques (annealing and ageing)can reduce the temperature coefficient of a resistor to the range of 10 ppm. NIST probably does a little better than this in their standard resistors, but they also use temperature regulated environments as well. The capacitor is probably worse. The 555 is also sensitive to noise on the power supply, and this will cause an additional error. Overall, a 555 might be accurate to a few hours per year with a great deal of care.
dyarker
Posts: 1917
Joined: Fri Aug 22, 2003 1:01 am
Location: Izmir, Turkiye; from Rochester, NY
Contact:

Re: Do I want a counter?

Post by dyarker »

Concur that 555s don't make good long term real time clock sources. 1Hz error at 800Hz is quite an achievement, but is 108 seconds error per day.
(1/800) * 60 * 60 * 24 = 108<p>Seconds in 1 Day = 60 * 60 * 24 = 86400
108 / 86400 = 0.00125 = 0.125% while a 100 parts per million (PPM) crystal is 0.01% max error. 50PPM crystals are common, and the oscillator can be trimed much closer.<p>The simplist oscilator for digital circuits is two CMOS inverters in series, with one crystal lead connected to the input of the first inverter, the other crystal lead to the output of the second inverter, a low picoFarad capacitor to common on one crystal lead, and a low picoFarad trimmer capacitor to common on the other crystal lead.
-------------------------------------------
Some counter ICs toggle on the rising edge of the input, some toggle on the falling edge.<p>4 flip-flops per IC is common. Some ICs divide by 16 (4 divide by 2s), but decade counters (divide by 10) are also available. With a NAND gate IC, a counter IC can be set to count to smaller numbers.<p>Divide oscillator to 1HZ
decade counter for seconds
reset on 6 counter for tens of seconds
decade counter for minutes
reset on 6 counter for tens of minutes
decade counter for hours
counter for tens of hours
gates reset hours and tens of hours counters on 12 or 24 depending on format you want. One flip-flop keeps track of AM/PM for 12 hour format.<p>The outputs of the counters go to BCD-to-7 segment ICs, which drive the display.
-------------------------------------------<p>So, you are basically right in your guess at how it works.<p>Good luck with the project!<p>=================================================
added: I was typing at the same time as stephen. The 108 seconds I mentioned above is "base accuracy". I agree, temperature drift and noise will make the error worse.<p>[ December 04, 2004: Message edited by: Dale Y ]</p>
Dale Y
Dean Huster
Posts: 1263
Joined: Wed Dec 05, 2001 1:01 am
Location: Harviell, MO (Poplar Bluff area)
Contact:

Re: Do I want a counter?

Post by Dean Huster »

If you're just starting out in the clock-building area, a 24-hour clock is the easiest to work out since you reset things to zero. A 12-hour clock is a royal pain since you have to all the units-of-hours run through a full decade, then when the count reaches 12, you have to parallel-load 01 (for 1 am or 1 pm) rather than reset to zero. It can be tricky, but is a wonderful way to learn to design with counters.<p>Dean
Dean Huster, Electronics Curmudgeon
Contributing Editor emeritus, "Q & A", of the former "Poptronics" magazine (formerly "Popular Electronics" and "Electronics Now" magazines).

R.I.P.
joey7f
Posts: 12
Joined: Fri Dec 03, 2004 1:01 am
Contact:

Re: Do I want a counter?

Post by joey7f »

Thanks for all of your input everyone!<p>I am thinking of making this my electronic project for next semester then upgrading it in my senior design by syncing it remotely via an ntp server. That would be cool!<p>--Joey
User avatar
dacflyer
Posts: 4748
Joined: Fri Feb 08, 2002 1:01 am
Location: USA / North Carolina / Fayetteville
Contact:

Re: Do I want a counter?

Post by dacflyer »

joey...i am in the middle of building a big clock also...simelar to the big ben clock of last year..
except mine will be a non-processor type.. mine uses only 4017 ic's , i am making a 217 led clock..ya i know thats a lot of leds..lol
anyway for the most accurate and easiest time reference that is as stable as line freq is i sampled the 60Hz i used a 4017 ic..2 actually..
for a count to 60 1st IC counts to 10 then use the carry out to the clock in of the other IC to a count of 6 (10x6=60) then the carry out is your 1Hz.. or if your not in the USA then you just adjust for the 50Hz.. 10x5=50 easy enough?<p>BTW i got one of them binary clocks also.. i had gotten the blue led one... was nice and all.. but was hard to read from a distance...so what did i do? HACKED IT ! i changed the hours and minuite leds..
i seperated the hrs / min / sec so they are easier to read.. was a pain the the A** to swap out them micro micro leds too...bout went blind.
but i got it...<p>i am working on same clock that bill bowden has on his site.. but i am using my 4017 for the time base.. i seem to like it better...let me know what you think... others give comments too ;)
Mike6158
Posts: 409
Joined: Fri Nov 12, 2004 1:01 am
Location: Weimar, Texas
Contact:

Re: Do I want a counter?

Post by Mike6158 »

This... is a cool clock :D <p>Propeller Clock
"If the nucleus of a sodium atom were the size of a golf ball, the outermost electrons would lie 2 miles away. Atoms, like galaxies, are cathedrals of cavernous space. Matter is energy."
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 85 guests