Make: Electronics, Charles Platt [list of ebook readers .txt] 📗
- Author: Charles Platt
Book online «Make: Electronics, Charles Platt [list of ebook readers .txt] 📗». Author Charles Platt
Counters have control pins such as “clock disable,” which tells the counter to ignore its input pulses and freeze the display, “enable display,” which enables the output from the chip, and “reset,” which resets the count to zero.
The 4026 requires a positive input to activate each control pin. When the pins are grounded, their features are suppressed.
To make the 4026 count and display its running total you must ground the “clock disable” and “reset” pins (to suppress their function) and apply positive voltage to the “enable display” pin (to activate the output). See Figure 4-36 to see these pins identified.
Assuming that you succeed in getting your counter to drive the numeric display, you’re ready to add two more counters, which will control the remaining two numerals. The first counter will count in ones, the second in tens, and the third in hundreds.
In Figure 4-37, I’ve continued to use arrows and numbers to tell you which pins of the counters should be connected to which pins of the numeric display. Otherwise, the schematic would be a confusing tangle of wires crossing each other.
At this point, you can give up in dismay at the number of connections—but really, using a breadboard, it shouldn’t take you more than half an hour to complete this phase of the project. I suggest you give it a try, because there’s
something magical about seeing a display count from 000 through 999 “all by itself,” and I chose this project because it also has a lot of instructional value.
Figure 4-37. This test circuit, laid out as you would be likely to place it on a breadboard, allows you to trigger a counter manually to verify that the display increments from 000 upward to 999.
Component values:
All resistors are 1K.
S1, S2, S3: SPST tactile switches, normally open
IC1, IC2, IC3: 4026 decade counter chips
IC4: Kingbright 3-digit common-cathode display
C1: 100 µF (minimum) smoothing capacitor
Wire the output pins on IC1, IC2, and IC3 to the pins on IC4, according to the numbers preceded by arrows. The actual wires have been omitted for clarity. Check for the pinouts of IC4.
S1 is attached to the “clock disable” pin of IC1, so that when you hold down this button, it should stop that counter from counting. Because IC1 controls IC2, and IC2 controls IC3, if you freeze IC1, the other two will have to wait for it to resume. Therefore you won’t need to make use of their “clock disable” features.
S2 is connected to the “reset” pins of all three counters, so that when you hold down this button, it should set them all to zero.
S3 sends positive pulses manually to the “clock input” pin of the first counter.
S1, S2, and S3 are all wired in parallel with 1K resistors connected to the negative side of the power supply. The idea is that when the buttons are not being pressed, the “pull-down” resistors keep the pins near ground (zero) voltage. When you press one of the buttons, it connects positive voltage directly to the chip, and easily overwhelms the negative voltage. This way, the pins remain either in a definitely positive or definitely negative state. If you disconnect one of these pull-down resistors you are likely to see the numeric display “flutter” erratically. (The numeric display chip has some unconnected pins, but this won’t cause any problem, because it is a passive chip that is just a collection of LED segments.)
Always connect input pins of a CMOS chip so that they are either positive or negative. See the “No Floating Pins” warning on the next page.
I suggest that you connect all the wires shown in the schematic first. Then cut lengths of 22-gauge wire to join the remaining pins of the sockets from IC1, IC2, and IC3 to IC4.
Switch on the power and press S2. You’ll see three zeros in your numeric display.
Each time you press S3, the count should advance by 1. If you press S2, the count should reset to three zeros. If you hold down S1 while you press S3 repeatedly, the counters should remain frozen, ignoring the pulses from S3.
Fundamentals
Switch bounce
When you hit S3, I think you’ll find that the count sometimes increases by more than 1. This does not mean that there’s something wrong with your circuit or your components; you are just observing a phenomenon known as “switch bounce.”
On a microscopic level, the contacts inside a pushbutton switch do not close smoothly, firmly, and decisively. They vibrate for a few microseconds before settling; the counter chip detects this vibration as a series of pulses, not just one.
Various circuits are available to “debounce” a switch. The simplest option is to put a small capacitor in parallel with the switch, to absorb the fluctuations; but this is less than ideal. I’ll come back to the topic of debouncing later in the book. Switch bounce is not a concern in this circuit, because we’re about to get rid of S3 and substitute a 555 timer that generates nice clean bounceless pulses.
Pulse Generation
A 555 timer is ideal for driving a counter chip. You’ve already seen how to wire a 555 to create a stream of pulses that made noise through a loudspeaker. I’m reproducing the same circuit in Figure 4-38 in simplified form, using the positive and negative supply configuration in the current project. Also I’m showing the connection between pins 2 and 6 in the way that you’re most likely to make it, via a wire that loops over the top of the chip.
For the current experiment, I’m suggesting initial component values that will generate only four pulses per second. Any faster than that, and
Comments (0)