This book was written by Michael Margolis and Brian Jepson with Nick Weldin to help you explore the amazing things you can do with Arduino.
Arduino is a family of microcontrollers (tiny computers) and a software creation environment that makes it easy for you to create programs (called sketches) that can interact with the physical world. Things you make with Arduino can sense and respond to touch, sound, position, heat, and light. This type of technology, often referred to as physical computing, is used in all kinds of things from smartphones to automobile electronics systems. Arduino makes it possible for anyone with an interesteven people with no programming or electronics experienceto use this rich and complex technology .
Who This Book Is For
This book is aimed at readers interested in using computer technology to interact with the environment. It is for people who want to quickly find the solution to hardware and software problems. The recipes provide the information you need to accomplish a broad range of tasks. It also has details to help you customize solutions to meet your specific needs. There is insufficient space in this book to cover general theoretical background, so links to external references are provided throughout the book. See for some general references for those with no programming or electronics experience.
If you have no programming experienceperhaps you have a great idea for an interactive project but dont have the skills to develop itthis book will help you learn how to write code that works, using examples that cover over 200 common tasks. Absolute beginners may want to consult a beginners book such as Getting Started with Arduino (Make Community), by Massimo Banzi and Michael Shiloh.
If you have some programming experience but are new to Arduino, the book will help you become productive quickly by demonstrating how to implement specific Arduino capabilities for your project.
People already using Arduino should find the content helpful for quickly learning new techniques, which are explained using practical examples. This will help you to embark on more complex projects by showing you how to solve problems and use capabilities that may be new to you.
Experienced C/C++ programmers will find examples of how to use the low-level AVR resources (interrupts, timers, I2C, Ethernet, etc.) to build applications using the Arduino environment.
How This Book Is Organized
The book contains information that covers the broad range of Arduinos capabilities, from basic concepts and common tasks to advanced technology. Each technique is explained in a recipe that shows you how to implement a specific capability. You do not need to read the content in sequence. Where a recipe uses a technique covered in another recipe, the content in the other recipe is referenced rather than repeating details in multiple places.
Introduces the Arduino environment and provides help on getting the Arduino development environment and hardware installed and working. This chapter introduces some of the most popular new boards. The next couple of chapters introduce Arduino software development.Covers essential software concepts and tasks.Shows how to make use of the most common mathematical functions.Describes how to get Arduino to connect and communicate with your computer and other devices. Serial is the most common method for Arduino input and output, and this capability is used in many of the recipes throughout the book.Introduces a range of basic techniques for reading digital and analog signals.Builds on concepts in the preceding chapter with recipes that explain how to use devices that enable Arduino to sense touch, sound, position, heat, and light.Covers controlling light. Recipes cover switching on one or many LEDs and controlling brightness and color. This chapter explains how you can drive bar graphs and numeric LED displays, as well as create patterns and animations with LED arrays. In addition, the chapter provides a general introduction to digital and analog output for those who are new to this.Explains how you can make things move by controlling motors with Arduino. A wide range of motor types is covered: solenoids, servo motors, DC motors, and stepper motors.Shows how to generate sound with Arduino via output devices such as a speaker. It covers playing simple tones and melodies and playing WAV files and MIDI.Describes techniques that can be used to interact with almost any device that uses some form of remote controller, including TV, audio equipment, cameras, garage doors, appliances, and toys. It builds on techniques used in previous chapters for connecting Arduino to devices and modules .Covers interfacing text and graphical LCD displays. The chapter shows how you can connect these devices to display text, scroll or highlight words, and create special symbols and characters.Covers built-in Arduino time-related functions and introduces many additional techniques for handling time delays, time measurement, and real-world times and dates.Covers the Inter-Integrated Circuit (I2C) and Serial Peripheral Interface (SPI) standards. These standards provide simple ways for digital information to be transferred between sensors and Arduino. This chapter shows how to use I2C and SPI to connect to common devices. It also shows how to connect two or more Arduino boards, using I2C for multiboard applications.Covers wireless communication with XBee, Bluetooth, and other wireless modules. This chapter provides examples ranging from simple wireless serial port replacements to mesh networks connecting multiple boards to multiple sensors .Describes the many ways you can use Arduino with the internet. It has examples that demonstrate how to build and use web clients and servers and shows how to use the most common internet communication protocols with Arduino. This chapter also includes recipes that will help you connect Arduino to the Internet of Things.Arduino software libraries are a standard way of adding functionality to the Arduino environment. This chapter explains how to use and modify software libraries. It also provides guidance on how to create your own libraries.Covers advanced programming techniques, and the topics here are more technical than the other recipes in this book because they cover things that are usually concealed by the friendly Arduino wrapper. The techniques in this chapter can be used to make a sketch more efficientthey can help improve performance and reduce the code size of your sketches.Shows how to access and use hardware functions that are not fully exposed through the documented Arduino language. It covers low-level usage of the hardware input/output registers, timers, and interrupts.Provides an overview of the components used throughout the book.Explains how to use schematic diagrams and datasheets.Provides a brief introduction to using a breadboard, connecting and using external power supplies and batteries, and using capacitors for decoupling.Provides tips on fixing compile and runtime problems.Covers problems with electronic circuits.Provides tables indicating functionality provided by the pins on standard Arduino boards.Provides tables showing ASCII characters .