introduction Welcome to Arduino Project Handbook Volume 2 If you haven’t read the first volume don’t worry each project in this book is completely independent and designed to gently introduce you to the world of building with Arduino We’ll cover some of the important aspects of getting started with Arduino here and in the next chapter so if you’ve read Volume 1 you can either skim through as a refresher or skip ahead to dive straight into the new projects This book uses the Arduino Uno a small inexpensive computer that can be programmed to control endless devices and creations You’ll soon use the Arduino to control a whole host of projects like a musical keyboard temperature-controlled fan digital thermometer fingerprint entry system and many others The Arduino board is composed of two main elements the hardware or microcontroller which is the brain of the board and the software that you’ll use to send your program to the microcontroller The software called the Arduino integrated development environment IDE is available free for download and I’ll show you how to use it to set up a simple project in the primer About this book What inspired me to write this book The internet is bursting with tutorials videos and articles covering the Arduino and potential projects but many lack detailed visuals or the code required to build these projects This book is intended to help you build simple proj ects that will inspire you to create your own inventions as you apply the skills and techniques that you’ll learn Each project includes a description of what it will do the items you’ll need pictures of the setup simple step-by-step instructions with tables for quick connection references a circuit diagram see Figure 1 and the necessary code so you don’t have to worry about learning to program before you begin The early projects provide simple explanations of what’s happening in the code to help you understand the process of programming enough to make your own modifications if you want to If you don’t want to type that much code out the sketches are available to download at https www nostarch com arduinohandbook2 x introduction NOTE In this book you’ll create your projects on a bread board This is the best way to learn about how circuits work because the connec tions are not permanent if you make a mistake you can just unplug the wire or component and try again
FigurE 1 The circuit diagrams in this book were created with Fritzing http www fritzing org a free open source program TablE 1 The cost indication used in this book At the beginning of each project I include an indication of the cost of the components required in addition to the Arduino Uno see Table 1 and an estimated time for the build At the end I pro vide a troubleshooting section specific to that project iNdic aTOr cOsT 1 9 10 19 20 29 30 I’ve written this book to teach you how to create your own gad gets By giving you the technical know-how I allow you to focus on the creative design element The idea is that learning the function of circuits can open up your imagination to ways of using those circuits practically Although I don’t delve deeply into electronics theory or programming the projects in this book progress steadily in compex ity and will give you a good starting point This book gives you practical information so you can for example reference the pin connections and replicate them when needed in a different project You can also combine projects to make more com plicated and interesting gadgets A lot of Arduino books focus on the programming element and that’s great for a certain kind of learning but I think there’s also a place for plug-and-play electronics By fol lowing the steps in the projects you’ll learn as you go I’ve written the book that I was looking for but couldn’t find when I started out with the Arduino I hope you’ll enjoy reading and working through this book as much as I enjoyed writing it xi introduction
orgAnizAtion of this book I recommend you try out some of the earlier projects first as you’ll find information there that’s useful for the more complicated builds but if you see a project you like and feel confident enough to take it on you can skip to it The parts of the book are organized as follows Primer Getting Started Learn all about the Arduino Uno and how to use a breadboard and then test your board with a simple program and get a crash course in soldering Part i leds Here you’ll start out by learning how to control simple light-emitting diodes LEDs with variable resistors and then combine components to build a light-activated LED a scrolling text display a flashing multicolored compass and more Part ii Sound In this part you’ll use a piezo a device that emits sound to make tunes with a musical keyboard and create a simple audio visualizer that makes LEDs dance to your music Part iii motors These projects use various types of motors to bring your creations to life You’ll build an analog dial that gauges light levels learn how a stepper motor works and build a temperature controlled fan to keep you cool Part iV lcds The LCD screen is useful in lots of projects for display ing messages and results In these projects you’ll learn how to set up a serial LCD screen and then build a defusable bomb game an ultrasonic range finder a mobile Pong game and even an alcohol breathalyzer Part V Security Protect your space with a motion sensor that trig gers an ultrasonic soaker water pistol and a security system that uses a fingerprint scanner to keep unauthorized persons out In this final part you’ll combine the Arduino Part Vi Smart machines with motors and sensors to create an intelligent robot control lights using Bluetooth technology and even build a GPS speedometer to track your movements At the end of the book I provide some helpful reference informa tion including a review of some of the more common program errors and how to fix them information on the components used in this book and where to buy them and a reference table for the pins on the Arduino Uno xii introduction