This chapter covered the following concepts:
- How a shift register works
- The differences between serial and parallel data transmission
- The differences between decimal and binary data representations
- How to create animations using a shift register
- Arduino Uno
- USB A-B Cable
- Red LEDs (x8)
- Yellow LEDs (x3)
- Green LEDs (x4)
- 220Ω Resistors (x8)
- SN74HC595N Shift Register
- Sharp GP2Y0A41SK0F IR Distance Sensor with Cable
- Jumper Wires
- Arduino shiftOut() Function Reference
- 74HC595 Shift Register Datasheet (PDF)
- Sharp IR Distance Sensor Datasheet (PDF)
- Figure 7-8 is particularly hard to understand in greyscale (print copies of the book). The color version below should be much clearer, as it clearly shows the yellow, red, and green LEDs.
Color Wiring Diagrams & LED Diagram
Watch a demo of the “Light Rider” display created in the chapter:
Watch a demo of the distance-responsive light meter created in the chapter:
All code is licensed via the GNU GPL v3. Code is maintained and updated on GitHub. The download zip linked above always contains the most recent version of the code examples that have been pushed to the GitHub Code Repository.
Taking it Further
Using the new skills you learned in this chapter, paired with knowledge from previous chapters, you can experiment with some new projects:
- Daisy chain eight shift registers and make an enormous 8×8 64 LED display. You will need to use a separate 5V regulator to power the VCC pins on the shift registers, as this will consume more power than the Arduino’s built-in regulator can supply. The 5V L4940V5 linear regulator that you used in Chapter 5: “Using Transistors and Driving Motors” will work well for this.
- Make a volume unit (VU) meter that responds to an analog input from a microphone.
- Make a physical bar graph that responds to mouse movements in a processing program running on your computer.
References & Credits
- Figure 7-2: Shift Register Pin-out Credit: Image used with permission courtesy of Texas Instruments, www.ti.com. (source, PDF)