6.Experiments
.pdf7.6. LED SEQUENCER |
333 |
7.6LED sequencer
PARTS AND MATERIALS
²4017 decade counter/divider (Radio Shack catalog # 276-2417)
²555 timer IC (Radio Shack catalog # 276-1723)
²Ten-segment bargraph LED (Radio Shack catalog # 276-081)
²One SPST switch
²One 6 volt battery
²10 k- resistor
²1 M- resistor
²0.1 ¹F capacitor (Radio Shack catalog # 272-135 or equivalent)
²Coupling capacitor, 0.047 to 0.001 ¹F
²Ten 470 - resistors
²Audio detector with headphones
Caution! The 4017 IC is CMOS, and therefore sensitive to static electricity!
Any single-pole, single-throw switch is adequate. A household light switch will work ¯ne, and is readily available at any hardware store.
The audio detector will be used to assess signal frequency. If you have access to an oscilloscope, the audio detector is unnecessary.
CROSS-REFERENCES
Lessons In Electric Circuits, Volume 4, chapter 3: "Logic Gates"
Lessons In Electric Circuits, Volume 4, chapter 4: "Switches"
Lessons In Electric Circuits, Volume 4, chapter 11: "Counters"
LEARNING OBJECTIVES
²Use of a 555 timer circuit to produce "clock" pulses (astable multivibrator)
²Use of a 4017 decade counter/divider circuit to produce a sequence of pulses
²Use of a 4017 decade counter/divider circuit for frequency division
²Using a frequency divider and timepiece (watch) to measure frequency
²Purpose of a "pulldown" resistor
²Learn the e®ects of switch contact "bounce" on digital circuits
²Use of a 555 timer circuit to "debounce" a mechanical switch (monostable multivibrator)
334 |
CHAPTER 7. DIGITAL INTEGRATED CIRCUITS |
SCHEMATIC DIAGRAM
Clk ClkEn Rst Carry
1 MΩ |
Vcc |
RST |
VDD |
4017 |
Gnd |
|
555 |
||||
|
|
|
|
||
|
Disch |
Out |
|
0 1 2 3 4 5 6 7 8 9 |
|
6 V |
Thresh |
|
|
|
|
|
Trig |
Ctrl |
Ten-segment |
|
|
|
|
|
|
||
0.1 μF |
|
|
LED bargraph |
|
|
|
Gnd |
470 Ω each |
|
|
|
|
|
|
|
|
|
ILLUSTRATION |
|
- |
|
+ |
4017 |
555 |
INSTRUCTIONS
The model 4017 integrated circuit is a CMOS counter with ten output terminals. One of these ten terminals will be in a "high" state at any given time, with all others being "low," giving a "one- of-ten" output sequence. If low-to-high voltage pulses are applied to the "clock" (Clk) terminal of the 4017, it will increment its count, forcing the next output into a "high" state.
With a 555 timer connected as an astable multivibrator (oscillator) of low frequency, the 4017 will cycle through its ten-count sequence, lighting up each LED, one at a time, and "recycling" back to the ¯rst LED. The result is a visually pleasing sequence of °ashing lights. Feel free to experiment with resistor and capacitor values on the 555 timer to create di®erent °ash rates.
Try disconnecting the jumper wire leading from the 4017's "Clock" terminal (pin #14) to the 555's "Output" terminal (pin #3) where it connects to the 555 timer chip, and hold its end in your hand. If there is su±cient 60 Hz power-line "noise" around you, the 4017 will detect it as a fast clock signal, causing the LEDs to blink very rapidly.
Two terminals on the 4017 chip, "Reset" and "Clock Enable," are maintained in a "low" state by means of a connection to the negative side of the battery (ground). This is necessary if the chip is to count freely. If the "Reset" terminal is made "high," the 4017's output will be reset back to 0 (pin #3 "high," all other output pins "low"). If the "Clock Enable" is made "high," the chip will stop responding to the clock signal and pause in its counting sequence.
7.6. LED SEQUENCER |
335 |
If the 4017's "Reset" terminal is connected to one of its ten output terminals, its counting sequence will be cut short, or truncated. You may experiment with this by disconnecting the "Reset" terminal from ground, then connecting a long jumper wire to the "Reset" terminal for easy connection to the outputs at the ten-segment LED bargraph. Notice how many (or how few) LEDs light up with the "Reset" connected to any one of the outputs:
|
touch end of long jumper wire |
|
to an LED terminal |
|
disconnect |
- |
|
+ |
4017 |
555 |
Counters such as the 4017 may be used as digital frequency dividers, to take a clock signal and produce a pulse occurring at some integer factor of the clock frequency. For example, if the clock signal from the 555 timer is 200 Hz, and the 4017 is con¯gured for a full-count sequence (the "Reset" terminal connected to ground, giving a full, ten-step count), a signal with a period ten times as long (20 Hz) will be present at any of the 4017's output terminals. In other words, each output terminal will cycle once for every ten cycles of the clock signal: a frequency ten times as slow.
To experiment with this principle, connect your audio detector between output 0 (pin #3) of the 4017 and ground, through a very small capacitor (0.047 ¹F to 0.001 ¹F). The capacitor is used for "coupling" AC signals only, to that you may audibly detect pulses without placing a DC (resistive) load on the counter chip output. With the 4017 "Reset" terminal grounded, you will have a fullcount sequence, and you will hear a "click" in the headphones every time the "0" LED lights up, corresponding to 1/10 of the 555's actual output frequency:
340 |
CHAPTER 7. DIGITAL INTEGRATED CIRCUITS |
these "bounces" are interpreted as distinct clock signals, and the count incremented accordingly. One way to combat this problem is to use a timing circuit to produce a single pulse for any number
of input pulse signals received within a short amount of time. The circuit is called a monostable multivibrator, and any technique eliminating the false pulses caused by switch contact "bounce" is called debouncing.
The 555 timer circuit is capable of functioning as a debouncer, if the "Trigger" input is connected to the switch as such:
Using the 555 timer to "debounce" the switch
Clk ClkEn Rst Carry
1 MΩ |
Vcc |
RST |
VDD |
4017 |
Gnd |
|
555 |
||||
|
|
|
|
||
|
Disch |
Out |
|
0 1 2 3 4 5 6 7 8 9 |
|
6 V |
Thresh |
|
|
|
|
|
Trig |
Ctrl |
|
|
|
|
|
|
|
|
|
0.1 μF |
|
Gnd |
|
|
|
|
|
|
10 kΩ |
|
|
- |
|
+ |
4017 |
555 |
Please note that since we are using the 555 once again to provide a clock signal to the 4017, we must re-connect pin #3 of the 555 chip to pin #14 of the 4017 chip! Also, if you have altered the values of the resistor or capacitor in the 555 timer circuit, you should return to the original 1 M- and 0.1 ¹F components.
Actuate the switch again and note the counting behavior of the 4017. There should be no more "skipped" counts as there were before, because the 555 timer outputs a single, crisp pulse for every on-to-o® actuation (notice the inversion of operation here!) of the switch. It is important that the timing of the 555 circuit be appropriate: the time to charge the capacitor should be longer than the
7.6. LED SEQUENCER |
341 |
"settling" period of the switch (the time required for the contacts to stop bouncing), but not so long that the timer would "miss" a rapid sequence of switch actuations, if they were to occur.
342 |
CHAPTER 7. DIGITAL INTEGRATED CIRCUITS |
7.7Simple combination lock
PARTS AND MATERIALS
²4001 quad NOR gate (Radio Shack catalog # 276-2401)
²4070 quad XOR gate (Radio Shack catalog # 900-6906)
²Two, eight-position DIP switches (Radio Shack catalog # 275-1301)
²Two light-emitting diodes (Radio Shack catalog # 276-026 or equivalent)
²Four 1N914 "switching" diodes (Radio Shack catalog # 276-1122)
²Ten 10 k- resistors
²Two 470 - resistors
²Pushbutton switch, normally open (Radio Shack catalog # 275-1556)
²Two 6 volt batteries
Caution! Both the 4001 and 4070 ICs are CMOS, and therefore sensitive to static electricity! This experiment may be built using only one 8-position DIP switch, but the concept is easier to understand if two switch assemblies are used. The idea is, one switch acts to hold the correct code for unlocking the lock, while the other switch serves as a data entry point for the person trying to open the lock. In real life, of course, the switch assembly with the "key" code set on it must be hidden from the sight of the person opening the lock, which means it must be physically located elsewhere from where the data entry switch assembly is. This requires two switch assemblies. However, if you understand this concept clearly, you may build a working circuit with only one 8-position switch,
using the left four switches for data entry and the right four switches to hold the "key" code. For extra e®ect, choose di®erent colors of LED: green for "Go" and red for "No go."
CROSS-REFERENCES
Lessons In Electric Circuits, Volume 4, chapter 3: "Logic Gates"
LEARNING OBJECTIVES
²Using XOR gates as bit comparators
²How to build simple gate functions with diodes and a pullup/down resistor
²Using NOR gates as controlled inverters
SCHEMATIC DIAGRAM
