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 projects that will inspire you to create your own inventions as you apply the skills and techniques that you’ll learn.

NOTE

In this book you’ll create your projects on a breadboard. This is the best way to learn about how circuits work, because the connections are not permanent; if you make a mistake, you can just unplug the wire or component and try again.

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/.

FIGURE 1: The circuit diagrams in this book were created with Fritzing (http://www.fritzing.org/), a free, open source program.

Image

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 provide a troubleshooting section specific to that project.

TABLE 1: The cost indication used in this book

INDICATOR

COST

$

$1–$9

$$

$10–$19

$$$

$20–$29

$$$$

$30+

I’ve written this book to teach you how to create your own gadgets. 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 compexity 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 complicated 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 following 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.

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 displaying 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 triggers an ultrasonic soaker water pistol and a security system that uses a fingerprint scanner to keep unauthorized persons out.

Part VI: Smart Machines In this final part you’ll combine the Arduino 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 information, 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.159.150