Data Sheet

18
Lesson 2 LED Flowing Lights
Overview
In this lesson, you will master how to use eight large red LEDs with an UNO or MEGA2560
board without using up 8 output pins.
Components required
Name Qty Name Qty
UNO R3 or MEGA 2560 1 220Ω Resistor 8
LED 8 DuPont Wire 17
74HC595 IC 1 Breadboard 1
Component Introduction
The 74HC595 is an 8-stage serial shift register with a storage register
and 3-state outputs. Each of which can either be a 1 or a 0. The shift
register and storage register have separate clocks. To set each of
these values on or off, we feed in the data using the pin 'Data' and 'Clock' of the chip.
The clock pin is used to receive eight pulses. At each pulse, if the pin "data" is high, then a 1
gets pushed into the shift register; otherwise, a 0.
When all eight pulses have been received, enabling the pin of "Latch" copies those eight values
to the latch register. This is necessary; otherwise, the wrong LEDs would flicker as the data is
being loaded into the shift register.
The chip also has an output enable pin (OE), which is used to enable or disable the outputs
all at once. You could attach this to a PWM-capable pin of UNO and use 'analog Write' to
1 0 1 1 0 0 1 1
Data
Clock
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
Data Clock Latch
pin14 pin11 pin12
pin15
pin1
pin2
pin3
pin4
pin5
pin6
pin7
Outputs