Copyright 2019 by Rockridge Press, Emeryville, California
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the Publisher. Requests to the Publisher for permission should be addressed to the Permissions Department, Rockridge Press, 6005 Shellmound Street, Suite 175, Emeryville, CA 94608.
Limit of Liability/Disclaimer of Warranty: The Publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the Publisher is not engaged in rendering medical, legal, or other professional advice or services. If professional assistance is required, the services of a competent professional person should be sought. Neither the Publisher nor the author shall be liable for damages arising herefrom. The fact that an individual, organization, or website is referred to in this work as a citation and/or potential source of further information does not mean that the author or the Publisher endorses the information the individual, organization, or website may provide or recommendations they/it may make. Further, readers should be aware that Internet websites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the United States at (866) 744-2665, or outside the United States at (510) 253-0500.
Rockridge Press publishes its books in a variety of electronic and print formats. Some content that appears in print may not be available in electronic books, and vice versa.
TRADEMARKS: Rockridge Press and the Rockridge Press logo are trademarks or registered trademarks of Callisto Media Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. Rockridge Press is not associated with any product or vendor mentioned in this book.
Interior and Designer: Michael Cook
Photo Art Director: Michael Hardgrove
Editor: David Lytle
Production Editor: Kurt Shulenberger
Photography: 2019 Kenneth Hawthorn
ISBN: Print 978-1-64152-599-2 | eBook 978-1-64152-600-5
R0
FOR APRIL
CONTENTS
You are not currently flying around in your flying suit because, well, you have not yet built a flying suit. Over the last few years artists, tinkerers, students, and inventors have seen more of their visions come to life because of the inexpensive microcontroller known as Arduino. A microcontroller is a very simple computer that runs a program that can control things such as lights or motors. With this tiny device, an artist can create a light installation with millions of colors that react to the people looking at the installation. It allows a robotic kitten to judge the distance to an obstacle. It will provide opportunities to those who feel compelled to attach small jet engines to a wearable wing to actually fly. This book is a journey through several Arduino projects that will enable you to build a skill set to tackle your own dream projects. I wrote this book so you can build a machine that will make you smile.
The projects in this book are designed to be completed in order. There is nothing stopping you from building any project within this book as a stand-alone project, but the order of projects was carefully thought out to build the readers confidence across the broad spectrum of devices that can be used with Arduino.
The way to understand Arduino is to look at the circuit board as an if this happens, then do that machine. If an input happens, then an output occurs. Typically, Arduino is looking at some kind of input event (such as a switch being pressed or a countdown reaching zero) and using the input event as a programmed trigger for an output event (such as a motor turning on or an LED illuminating).
MATERIALS USED IN CHAPTER 1:
Arduino Uno R3Board
USB Type 2.0 Printer Cable
Laptop Computer
Listed above are the materials that will be used in this chapter. The first thing that you will notice when shopping online for an Arduino is the variety of circuit boards that appear in the search. This is because the folks who invented Arduino (www.arduino.cc ) made the incredibly generous decision to freely release their schematics and design data as open-source hardware and software. As a result, everyone is making his or her own version of the microcontroller and incorporating the name Arduino due to the origin of the design. This results in a plethora of options and styles being available.
Figure 1.1
Pictured above is an ultrasonic distance sensor (left) that can act as an input device for the Arduino and a servo motor (right) that can act as an output device.
START WITH THE OLD-SCHOOL CHIP
To add to the confusion in choosing your first board, there are several variants of Arduino designs. Technically, we are looking for the variant named an Arduino Uno. Other variants are called the Arduino Leonardo, YUN, and Mega, to name just a few of the 20 most commonly found. The Uno was the first design released and is by far the most commonly used model. Below are two copies of the Uno that I have used with success in my classroom over the past five years. The most reliable boards, other than an authentic Arduino ($20), come from Elegoo and SunFounder and cost approximately $5 to $7. If you are an Amazon user, I would suggest typing in Arduino Uno R3 and choosing any starter kit that is rated four stars or higher. The only caveat I can add is to look at the picture and make sure that the microchip on the board looks similar to the one in . This is because some manufacturers are using microchips that emulate the functionality of the original chip, which sometimes require the installation of a separate software driver on your computer.
Figure 1.2
Pictured above are two different types of Arduino Uno boards. Both should function identically, but the version containing the tiny emulator may require extra steps to install a software driver on some laptops in order for the board to work correctly. When in doubt, look for the big, bulky microchip.
GETTING STARTED
We will begin our adventure by becoming familiar with the basics of using an Arduino. A company called Autodesk has developed a wonderful tool that will allow us to explore the basic functionality of an Arduino with an online simulator. This is a great way to establish a basic understanding regarding the steps necessary to write code for your Arduino and to simulate a successful circuit. Next, we will explore setting up your laptop to assist with building that same circuit while using the physical Arduino board. To get started, navigate to www.Tinkercad.com .