Make Electronics

(nextflipdebug2) #1

Experiment 18: Reaction Timer


174 Chapter 4


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.
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 nega-
tive 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 nega-
tive. 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 re-
peatedly, 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 set-
tling; 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.

1 2 3 4 5 6 7 8

13

16
15
14
13
17

12
11
10
9 1 2 3 4 5 6 7 8
16
15
14
13
12
11
10
9 1 2 3 4 5 6 7 8
16
15
14
13
12
11
10
9 1 2 3 4 5 6 7 8 9

10
11
12
13
14

28
27
26
25
24
23
22
21
20
19
18
17
16
15

IC1

IC2

IC3

IC4

S1

S3

R1

R2

R4

R5

R6

R3

S2
C1

23
22

27
28

12

15
10
16
11

8
20
21
7

4
1
2

24
25

6

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 num-
bers preceded by arrows. The actual wires
have been omitted for clarity. Check for
the pinouts of IC4.

Free download pdf