An Overly-Complicated Logic Chip Clock

Clock

When a normal alarm clock just won’t do, the only option is to build your own, entirely out of discrete logic chips. [jvok] built this alarm clock for last year’s 7400 Logic Competition. In a desire to go against the grain a little bit, [jvok] decided to use 4000-series logic chips. It was allowed under the rules, and the result is a wonderful example of what can be done without a microcontroller.

Most clock projects we’ve seen use a single button to increase each digit. [jvok] wanted to do something unique, so he is able to set his clock with a ‘mode’ button that allows him to independently set the hours, minutes, and seconds. He’s only ever seen this method of setting a clock’s time used with microcontroller-based projects, and translating even that simple code into pure circuitry is quite impressive.

This clock also includes an alarm function, set by a bunch of DIP switches in binary coded decimal. It’s a great piece of work, and deserving of much more attention than it received during the Open Logic Competition.

27 thoughts on “An Overly-Complicated Logic Chip Clock

  1. I was thinking about doing a clock like this, but with bare transistors.Now, the modes and alarm functions though? Kudos.

      1. The funny thing about it, is that i already thought about using relays, but gave it up when i calculated how many would be necessary. Would be pretty, but insanely noisy.

  2. “and translating even that simple code into pure circuitry is quite impressive.”

    Well- not really. A digital clock is a bunch of counters strung together with carry overs. That’s simple enough to understand. You set the clock by strobing the counter either by a clock generator, or manually.

    The mode selector is a simple state machine – another counter itself – whose output selects the counter you you want to advance. The guy is using a 4019 multiplexer to switch the signals between manual mode and clock mode. That’s clever, I would have used a bunch of AND gates.

    1. To replace the 4019 multiplexer, you could have the three counters wired in series for the time, the fourth counter for the state machine, and a single 3x AND chip to select which counter gets the clock signal.

      The AND gates each get one input from the clock source, and the other input from the state counter, and the output goes to the counters. Whichever gate gets the logic high from the state machine counter, injects the clock pulse to the appropriate counter.

      The state machine has four states, three of which simply select the seconds/minutes/hours counters but do not enable the clock, leaving the user to press a button to make the clock pulses. The fourth selects the seconds counter and starts the clock.

      The rest of the circuit could be implemented quite similiarily.

      1. In a grey past I built myself a darkroom process timer. You know, develop for x minutes, rinse, fix for y minutes, etc. With colour processes, everything is done in drums or in total darkness, with no way to check progress as you would be able to when doing B/W under appropriate safe light.

        It allowed up to 128 processes to be stored, each with up to16 process steps. For each step it would indicate the agitation regime (continuous, or 2/3/4/6 times per minute), whether it was a rinsing step or a true process step, with its step number, and it would start beeping 10 seconds before the end of each step.

        The contraption occupied three 10x16cm Europrints, with about 80 4xxx logic gates in all. It had a keypad for entering values, several shift registers, binary and BCD counters, and some kind of state machine. Storage was two 2k*8 static CMOS RAM chips, with a 4.5V battery for data retention.

        This was before even home computers like the Acorn BBC and the C64 became popular, so while I knew that it might be done with a microprocessor, some RAM and ROM, there was no way I could have developed the software and burned the ROM without getting (extensive) help. Discrete logic was something I could handle: you could buy it, go home and spend a few evenings (and nights) with a soldering iron, and build something working.

        1. State machines are discrete logic way of programming. In a pinch, you can create a diode-resistor ROM on a piece of perfboard, and loop its output back to its input through a latch that holds the previous value.

          Each stored word refers to another stored word, which refers to another stored word, so a sequence can be made with loops and conditionals. E.g. if you make one of the address lines a button or a toggle switch, you get two possible address spaces the sequence can jump to depending on the switch position.

  3. On the contrary, for a clock made from discrete logic chips, this design is not over-complicated at all.

    Furthermore, one could easily argue that this solution is far less complicated than using a micro-controller which requires ten times as many gates (or more!) and a PC with a full software development environment for the firmware.

      1. Also, there’s the mile or so of wire you get to use (and look at) this way, and the volume of time it takes to build one this way. And the breadboards. Oh so many breadboards.

  4. nice! Anybody have a circuit for a “false sunrise” I can attach to my alarm clock?
    (gradually increasing brightness with LED’s or incandescent)

    1. That would be pretty simple: use the alarm logic output to slowly charge a capacitor (use a constant current source instead of a resistor if you want the voltage to increase linearly over time), and use that voltage, buffered, to drive a voltage-controlled dimmer.

      Another option would be to use the alarm logic out to start a slow oscillator that clocks a binary counter. Use the counter outputs to drive an R/2R ladder network (a D/A converter), and use its output to drive the dimmer mentioned above. Use the MSD to stop the counter, otherwise it would at some point roll over to zero and turn off the light. You can also use the MSD to drive a buzzer, a gong or (suitably interfaced) a pneumatic cylinder that kicks you out of bed, depending on the amount of persuasion you need to actually get up.

      A snooze button would discharge the capacitor, or reset the counter.

  5. It’d be interesting to see old Medium Scale Integration catalogues, for stuff like this, before everything was done with microcontrollers.

    Tho that said, LED radio-alarms haven’t changed at all in operation for at least 20 years, probably twice that. It would make sense to use the same chips, I wonder if they do?

    1. Aahh! Apparently a gentlemen from Shenzhen can help me! Not gonna email the bastard though. Last time I was foolish enough to ask a question of Alibaba, my reply was sent by the keyword-scanning routines of 5 dozen companies offering to sell in bulk the item I was asking a simple question about.

      My question, of course, was never answered.

  6. One should note that the 4027 Shown in his schematic should actually be a 4026. A dual J/K flip flop wont work to well to drive the LED displays like he has them connected there… Far be it for me to question, but it seems to me that you would need a lot more circuitry to drive the said LED displays using an actual 4027, and it would probably be connected differently…Just saying…

  7. When I was an undergrad comp sci student one of our homework assignments was to build a 7-segment-display clock just like this one using only logic chips (and I think a 555). Do they still teach comp sci majors about the 74-series logic chips or am I dating myself?

    1. While we aren’t doing that level of complexity, our Electronics Systems Technology class is working with this sort of logic and building counters. I’m quite tempted to work out a 7400-based clock just because I can. Hmm… *opens multisim*

      Don’t know that it’s worth the time though, I can’t get any more extra credit. :p

    2. Can’t speak for over the pond, but for reference, when I did my BSc in Comp Sci in the UK 5 years ago, we did not do any electronics.

      Probably because it’s not relevent to modern taught computer science where you’re spending time focusing on computational theory and related topics eg, languages, compilers, data structures, calculating program complexity and/or estimated excution times, state machines+turing machines etc…

      1. I think it’s very relevant for a Comp Sci student to understand a bit about the topics that are overlapping his own field of expertise. When I did my Comp Sci, I did all the topics you mentioned, plus chip design and digital logic, but also calculus, signals and systems, general physics, statistics, and linear algebra. Even though this is not all core Comp Sci, most of these topics have proved very useful in my later career. As an engineer, you don’t work in a vacuum. If you work on a project that also involves electronics, it’s very useful to have at least an understanding of what the electronics engineer is doing, and vice versa.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s