Dec 10 2009
Shop Timer : Part 4
After some experimentation with push buttons and toggle switches it became apparent that mechanical switches are way too electrically noisy to accurately control the CD4026 logic lines. Not horrible, but enough to frustrate me, and I don’t need to get more frustrated in the shop.
So I went looking for either a button debouncer of some sort (using a Schmitt trigger) or a toggle / latch or something. I looked at flip-flops, but didn’t want to mess with them. I knew there had to be an easier way. And, once again, the humble 555/556 timer comes to the rescue.
The 555/556 have been written about endlessly, so I won’t go into much detail. The key is that they can be wired up to clean single-shot pulses (needed for my “Reset” button) and can also be wired to act like a toggle — press one button and the output is “high”, press another button and the output is “low” — this is exactly what I need for the “Run/Stop” buttons.
Normally you’d need one 555 for the “Reset” functionality and another 555 for the “Run/Stop” toggle. I have a bunch of 556′s on hand — and they are basically two 555s on one chip — so I have exactly what I need (and a lower chip count).
Here is the circuit I used for the Toggle (“Run/Stop”) part of the button interface. Note that this is for a 555, if you use a 556 be sure to use the correct pins (set A)!
When “trigger” is pressed, the output is HIGH. This means that my CD4026 would go into Clock Inhibit mode, meaning that the display will “pause”. Then “reset” is pressed, the output is LOW, meaning that the CD4026 will be non-Clock Inhibited — so the display would “run”. Note that the “output” goes to the Clock Inhibit pin (#2) on CD4026 #1 — you only need to Inhibit the first chip in the chain. (I learned this yesterday.)
Here is the circuit I used for the single-shot “Reset” functionality. Again, if using a 556, use the correct pins (set B).
When you press “trigger” you get a single output pulse. The length of the pulse is dictated by the R1 and C1 combination. In my circuit I used an R1 of 3.3K Ohms (actual measured value: 3170 Ohms) and a C1 of 100 uF. This gives an approximate on-time of 0.34 seconds.
I did not include the “reset” button in mine, since I didn’t need it. However, I did keep the 10K pullup resistor on the reset line. The 10K on the trigger line is also a pullup. This means that when the button isn’t pressed the trigger line is held “high” (positive / Vs). When the button is pressed, the trigger line goes “low” (negative / ground).
Also, I didn’t add the cap on the control line. You’d put one there if you have interference. If I have room on the board I’ll probably solder it in, to be safe.
Both of those excellent diagrams come from a great source for basic electronics, The Electronics Club. They do an excellent job of explaining in simple language how the circuits work, and I’ve yet to find a problem with any of their work. Plus, I love their schematics.
The Electronics Club : 555/556 Sample Circuits
Now that I had my schematics I was ready to wire. Here is the finished result:
The chip in the center is the 556 timer (two 555 timers on one chip). The two 10K resistors on the lower left are the pull-ups for the Bistable toggle. The 10K resistor to the far lower right is the pull-up for the Reset line.
The resistor to the right of the chip (timer B) is a 3.3 K Ohm and the capacitor is 100 uF. This is the R/C combo used to determine the length of the single-shot pulse. It will be about 0.3 seconds in duration.
The capacitor at the top is a 100 uF across the power supply lines. This is a “smoothing capacitor” and recommended for 555 circuits. I learned that you sometimes get weird power supply behavior when the 555 is changing its output state (going low to high). I saw some of this with my CD4026s — they would increment a bit extra on ticks — but only intermittently. The 100 uF cap helps even out the supply problems. There is one on this board, and another on the display controller (which has a 555 as the timer / tick generator).
The three buttons (Start, Stop, and Reset) will be connected to the Molex connectors toward the bottom. When the buttons are pressed they will pull the appropriate lines down to ground. “Start” pulls the “A” reset line to ground. “Stop” pulls the “A” trigger line to ground. These two make up the start/stop toggle of the display. The “Reset” pulls the B trigger line to ground. (“A” refers to timer A on the 556. “B” is timer B on the other side of the chip.)
Finally, there are two other Molex connectors toward the top. On the left is a two pin for the power supply input. On the right is a four pin. This is what will connect the button controller board to the display controller board. You only need 4 wires for this: Red (power), Black (ground), and then Blue (reset) and Yellow (Clock Inhibit). The colors are arbitrary, but consistent through the design.
Power and Ground are obvious.
Reset is normally held Low, until the “Reset” button is pressed, at which point the monostable will fire a single shot High down the line and then return to Low.
When the “Start” button is pressed the Clock Inhibit line will be held Low. Shen the “Stop” button is pressed the Clock Inhibit line will be held High. This is a toggle.
I tested up everything last night and it worked pretty well. Today I need to wire up the three pushbuttons and put them in a case.
I’m pleased that I ended up with the three push button design. It’s very clean and I’ll be able to use my favorite button — the jumbo arcade buttons! Besides being big and cool, they also have the added benefit of being able to take a lot of abuse. This is critical for the shop work. (I was afraid that the sawdust would clog some of the smaller toggle switches I was considering.)
One Response to “Shop Timer : Part 4”




This is a great series. I’m learning quite a bit reading this. Good stuff – keep it coming!