O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Arduino Inventor's Guide

Book Description

The Arduino microcontroller makes it easy to learn about electronics, but it can be hard to know where to start. The 10 projects in this book will teach you to build, code, and invent with the super-smart Arduino and a handful of parts.

First, you'll master the basics with a primer that explains how a circuit works, how to read a wiring schematic, and how to build and test projects with a solderless breadboard. Then you'll learn how to make your hardware move, buzz, flash, and interact with the world using motors, LEDs, sensors, and more as you build these 10 projects:

  • The classic first Arduino project: blinking an LED
  • A miniature traffic light
  • An LED screen that displays animated patterns and shapes
  • A fast-paced button-smashing game to test your reflexes
  • A light-sensitive, color-changing night-light
  • A challenging ball-balancing game
  • A temperature-sensing mini greenhouse with an automated fan and vent
  • A motorized robot that you can control
  • A racing timer for toy cars
  • A tiny electric piano that you can actually play!
With each project, you'll learn real coding skills so you can tell your inventions what to do, like how to store temperature readings with variables, start a timer or spin a motor with functions, and make decisions using loops. You'll even find tips and tricks to put your own twist on each gadget and take things further.

Table of Contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. About Sparkfun Electronics
  5. About the Authors
  6. About the Technical Reviewer
  7. A Note from Brian
  8. A Note from Derek
  9. Contents
  10. Contents in Detail
  11. Introduction
    1. What is this Book About?
    2. Why Arduino?
    3. How is this Book Different from Others?
    4. Materials
    5. Required Tools
    6. Required Computer
    7. What’s in this Book?
    8. Online Resources
    9. Spread the Word: Sharing Your Work
  12. Electronics Primer
    1. Electricity, Conductivity, and Basic Terms
      1. What Is Electricity?
      2. Types of Electricity
      3. What Is a Circuit?
      4. Ohm’s Law
      5. Visualizing Electricity as Water in a Pipe
    2. Schematics, Circuit Blueprints, and Wiring Diagrams
    3. Prototyping Circuits
    4. Discrete Components vs. Breakout Boards
    5. Analog vs. Digital
    6. What Is A Microcontroller?
  13. Project 1: Getting Started with Arduino
    1. Materials to Gather
    2. About the Arduino
      1. An Accessible Hardware Platform
      2. About the SparkFun RedBoard
    3. Installing the Arduino IDE and Drivers
      1. Installing on Windows
      2. Installing on OS X
      3. Installing on Linux
    4. A Brief IDE Tour
    5. Changing the Default Preferences
    6. Test Drive: Plugging in the Arduino for the First Time
      1. Choosing Your Board in the IDE
      2. Selecting the Communication Port
    7. An Arduino “Hello, World!”
    8. Basic Arduino Troubleshooting
    9. Anatomy of an Arduino Sketch
      1. Key Sketch Elements
      2. The setup() Function
      3. The loop() Function
      4. Your First Piece of Hardware
    10. Going Further
      1. Hack
      2. Modify
    11. Saving Your Sketch
  14. Project 2: A Stoplight for Your House
    1. Materials to Gather
      1. Electronic Parts
      2. Other Materials and Tools
    2. New Component: The Resistor
    3. Build the Stoplight Prototype
      1. Connect the Red LED to the Breadboard
      2. Add Power to the Breadboard
      3. Add the Yellow and Green LEDs
    4. Program the Stoplight
      1. Confirm Your IDE Settings
      2. Create Placeholders for Pin Numbers
      3. Write the setup() Function
      4. Write the loop() Function
      5. Upload the Sketch
      6. Make the Stoplight Portable
    5. Build the Stoplight Enclosure
      1. Cardboard Construction
      2. Make the Stoplight Lenses
      3. Make the Shades
      4. Mount the LEDs and Arduino
    6. Going Further
      1. Hack
      2. Modify
  15. Project 3: The Nine-Pixel Animation Machine
    1. Materials to Gather
      1. Electronic Parts
      2. Other Materials and Tools
    2. Build the Nine-Pixel Animation Machine Prototype
    3. Program the Nine-Pixel Animation Machine
      1. What Are Custom Functions?
      2. Design Your Artwork
      3. The Test Sketch
    4. Build the Nine-Pixel Animation Machine Enclosure
      1. Cardboard Construction
      2. Connect the Electronics
    5. Create an Led Animation
      1. Plan the Animation Sequence
      2. Write Custom Functions
      3. Tweak Your loop() Function
    6. Going Further
      1. Hack
      2. Modify
  16. Project 4: Reaction Timer
    1. Materials to Gather
      1. Electronic Parts
      2. Other Materials and Tools
    2. New Component: The Push Button
      1. How Push Buttons Work
      2. Using Resistors with Push Buttons
    3. Build the Reaction Timer Prototype
    4. Program the Reaction Timer
      1. Write the setup() Function
      2. Write the loop() Function
      3. Test the Reaction Timer Sketch
      4. Play Again?
      5. Add a Game Element
      6. Upload the Complete Code for the Reaction Timer
    5. Build the Reaction Timer Enclosure
      1. Cut Out the Cardboard
      2. Assemble the Electronics
      3. Spice Up Your Game Enclosure
    6. Going Further
      1. Hack
      2. Modify
  17. Project 5: A Color-Mixing Night-Light
    1. Materials to Gather
      1. Electronic Parts
      2. Other Materials and Tools
    2. New Components
      1. The RGB LED
      2. The Photoresistor
    3. Build the Night-Light Prototype
      1. Wire the Voltage Divider
      2. Wire the RGB LED
    4. Test the Night-Light with Basic Color Mixing
    5. Program the Night-Light
      1. Prepare to Check the Light Level
      2. Control the Night-Light Based on the Light Level
      3. Prevent False Alarms
      4. Recalibrate the Night-Light
    6. Create More Colors with Analogwrite()
      1. Create Analog Signals with PWM
      2. Mix Colors with analogWrite()
      3. Find RGB Values with Color Picker
      4. The Custom-Color Night-Light Code
    7. Build the Night-Light Enclosure
      1. Cardstock Construction
      2. Put the Electronics Inside
      3. Let It Glow!
    8. Going Further
      1. Hack
      2. Modify
  18. Project 6: Balance Beam
    1. Materials to Gather
      1. Electronic Parts
      2. Other Materials and Tools
    2. New Components
      1. The Potentiometer
      2. The Servo Motor
    3. Build the Balance Beam Prototype
    4. Program the Balance Beam
      1. Test the Servo
      2. Complete the Balance Beam Sketch
    5. Build the Balance Beam
      1. Cut Out the Parts
      2. Build the Beam
      3. Build the Base and Attach the Servo
      4. Final Assembly
    6. Going Further
      1. Hack
      2. Modify
  19. Project 7: Tiny Desktop Greenhouse
    1. Materials to Gather
      1. Electronic Parts
      2. Other Materials and Tools
    2. New Components
      1. TMP36 Temperature Sensor
      2. Standard Hobby Motor
      3. NPN Transistor
    3. Taking a Systems Approach
    4. Build the Temperature Monitor
      1. Measure Temperature with the TMP36
      2. Connect the Temperature Sensor
      3. Program the Temperature Sensor
    5. Build the Servo Motor Autovent
    6. Program the Autovent
    7. Build the Fan Motor
      1. Program the Fan Motor
      2. Isolate the Motor Effect
    8. Build the Tiny Desktop Greenhouse Enclosure
      1. Add the Autovent Window Servo
      2. Create the Paper Clip Linkage
      3. Add the Roof
      4. Build the Fan-Motor Box
      5. Connect It Up
    9. Going Further
      1. Hack
      2. Modify
  20. Project 8: Drawbot, The Robotic Artist
    1. Materials to Gather
      1. Electronic Parts
      2. Other Materials and Tools
    2. New Components
      1. The H-Bridge Motor Driver Integrated Circuit
      2. Geared Hobby Motor
    3. Build the Drawbot Prototype
    4. Program the Drawbot
      1. Create a Custom Function
      2. Clean Up the Code
    5. Wire the Second Motor
    6. Drive Both Motors
    7. Build the Drawbot Chassis
      1. Test and Troubleshoot
      2. Turn and Make Patterns: A Robot Square Dance
    8. Going Further
      1. Hack
      2. Modify
      3. Bonus
  21. Project 9: Drag Race Timer
    1. Materials to Gather
      1. Electronic Parts
      2. Other Materials and Tools
    2. New Component: The 16 × 2 Character LCD
    3. Drag Race Timer Operation
    4. Build the LCD Circuit
      1. Power the LCD
      2. Control the Contrast
      3. Connect the Data and Control Wiring
      4. Test the LCD
    5. Add the Rest of the Electronics
    6. Program the Drag Race Timer
    7. A Quick Test
    8. Build the Drag Race Track
      1. Build the Starting Tower
      2. Assemble the Starting Gate
      3. Build Your Own Track
      4. Add the Photoresistor
      5. Test and Troubleshoot
    9. Going Further
      1. Hack
      2. Modify
  22. Project 10: Tiny Electric Piano
    1. Materials to Gather
      1. Electronic Parts
      2. Other Materials and Tools
    2. New Components
      1. The SoftPot Membrane Potentiometer
      2. The Piezo Buzzer
    3. Build the Circuit
    4. Program the Tiny Electric Piano
      1. Test the Buzzer
      2. Create Specific Notes
      3. Generate Sound with the SoftPot
      4. Play a Song
    5. Build the Piano
    6. Going Further
      1. Hack
      2. Modify
      3. Bonus Project: Binary Trumpet
  23. Appendix: More Electronics Know-How
    1. Measuring Electricity with a Multimeter
      1. Parts of a Multimeter
      2. Measuring Continuity
      3. Measuring Resistance
      4. Measuring Voltage
      5. Measuring Current
    2. How to Solder
      1. Heating the Iron
      2. Perfecting Your Soldering Technique
      3. Cleaning the Iron
      4. Soldering Tips
    3. Additional Soldering Tools
      1. Third Hand
      2. Flux Pen
      3. Solder Wick
      4. Solder Vacuum
    4. Resistors and Bands
  24. Afterword
    1. Additional Resources
    2. Acknowledgments
  25. Resources