Read The Arduino Inventor's Guide Online
Authors: Unknown
LEARN ELECTRONICS BY MAKING 10 AWESOME PROJECTS
BRIAN HUANG
DEREK RUNBERG
SAN FRANCISCO
THE ARDUINO INVENTOR’S GUIDE.
Copyright © 2017 by SparkFun Electronics.
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher.
ISBN-10: 1-59327-652-4
ISBN-13: 978-1-59327-652-2
Publisher: William Pollock
Production Editors: Alison Law and Riley Hoffman
Cover Illustration: Brian Cook
Interior Design: Beth Middleworth
Photographer: Juan Peña
Illustrations: Pete Holm
Developmental Editors: Jennifer Griffith-Delgado and Liz Chadwick
Technical Reviewer: Daniel Hienzsch
Copyeditor: Rachel Monaghan
Compositors: Susan Glinert Stevens and Riley Hoffman
Proofreader: Lisa Devoto Farrell
The following image is reproduced with permission:
Figure 8-1
© Richard Hall.
Circuit diagrams and schematics were created using Fritzing (
http://fritzing.org/
).
For information on distribution, translations, or bulk sales, please contact No Starch Press, Inc. directly:
No Starch Press, Inc.
245 8th Street, San Francisco, CA 94103
phone: 1.415.863.9900;
[email protected]
www.nostarch.com
Library of Congress Cataloging-in-Publication Data
Names: Huang, Brian, author. | Runberg, Derek, author.
Title: The Arduino inventor's guide: learn electronics by making 10 awesome
projects / Brian Huang and Derek Runberg.
Description: San Francisco : No Starch Press, Inc., [2017]
Identifiers: LCCN 2017005801 (print) | LCCN 2017023025 (ebook) | ISBN
9781593278397 (epub) | ISBN 159327839X (epub) | ISBN 9781593278403 (mobi)
| ISBN 1593278403 (mobi) | ISBN 9781593276522 (pbk.) | ISBN 1593276524
(pbk.)
Subjects: LCSH: Arduino (Programmable controller) | Electronics--Amateurs'
manuals.
Classification: LCC TJ223.P76 (ebook) | LCC TJ223.P76 R86 2017 (print) | DDC
006.2/2--dc23
LC record available at
https://lccn.loc.gov/2017005801
No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other product and company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The information in this book is distributed on an “As Is” basis, without warranty. While every precaution has been taken in the preparation of this work, neither the authors nor No Starch Press, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it.
TO LINDSAY DIAMOND, FOR YOUR AMAZING LEADERSHIP AND GUIDANCE; TO THE ENTIRE TEAM AT SPARKFUN; AND TO ALL THE FUTURE TINKERERS AND INVENTORS WE INSPIRE!
SparkFun is an online retailer that produces and sells the widgets and parts that end up in a lot of maker projects, prototypes, and even the International Space Station. Nathan Seidle started the company after blowing a circuit board in 2003, while he was an undergraduate at the University of Colorado Boulder. At the time, circuit boards were really hard to get; you had to fax your credit card to another country and hope that you got your hardware in six to eight weeks. Nathan felt he could do better, and he did. SparkFun. com was born, and it now sells over 3,000 different parts of all shapes and sizes for your digital electronic needs. From a basic Arduino to GPS modules, you can find them and all of the documentation you need to get up and running at SparkFun.
SparkFun’s Department of Education develops curricula and runs professional development programs for educators of all kinds. The department is at the forefront of a number of computer science and maker initiatives that are making headway in the classroom. You can learn more about SparkFun and the Department of Education at
https://www.sparkfun.com/
and
http://www.sparkfuneducation.com/
.
Brian Huang and Derek Runberg were both teachers at one point. Brian was a high school physics teacher with an affinity for robots, and Derek was a middle school technology teacher obsessed with pushing the limits of middle school students. They’ve taken very different paths to get where they are now, including how they learned programming and electronics, their teaching philosophies, and their viewpoints on how students learn, so they are a bit of an odd couple. They hope that this book will serve you well as you set off on your adventure into the world of inventing.
Daniel Hienzsch is the founder of Rheingold Heavy, which delivers educational content and materials to electronics enthusiasts and students. He previously worked in IT for 20 years, including 10 years as the IT director for an investment bank. Dan is passionate about education, and Rheingold Heavy is his effort to provide the maker community with materials he wished he had when he was first getting started in electronics and technology. He is also a certified scuba instructor.
Although I am a formally trained engineer (I went to school to study electrical engineering), my education focused a lot on theory, simulations, and modeling, and I was never taught how to solder, machine, or really build things. After graduating from college, I worked as an engineer during the week, and found myself volunteering at the Science Museum of Minnesota on the weekends. It was at the museum where I discovered my love of teaching. I was given the opportunity to inspire children to be curious, ask questions, and wonder about the world. My experiences in the museum set me on a course to change careers, pursue a master’s in education, and become a high school physics teacher.
Derek and I complement each other’s experience and background. This book is a culmination of both of our experiences in teaching and in learning how best to use Arduino in the classroom. As Derek puts it, the Arduino is simply another material that we use in our projects. The faculty and students at NYU’s Integrated Telecommunications Program (ITP) have long known this. The way you interact with electronics changes immediately when you enclose or cover them. Even something as simple as using a ping-pong ball to diffuse an LED immediately affects your interaction with the project. The way the light diffuses and blends through materials teases your emotions in a way that you wouldn’t get with just an LED in a breadboard.
We’ve put a lot of thought into how to make learning electronics and programming accessible for anyone. We hope that these projects will help to unleash your inner inventor!
Unlike Brian, I have no formal background in electronics or computer programming; I am completely self-taught. I learned Arduino so that I could give my students access to a technology they could control and build with. I was a middle school technology teacher asked to dream up a shop class for the 21st century. Electronics was part of that vision, and over a three-year process, Arduino (and, later, the Processing language) took center stage in my classroom. I learned electronics and programming so that I could teach it in my class.
Many of these projects come directly from my classroom experience teaching Arduino. My students learned computer science and electronics out of necessity, in order to develop their ideas rather than have a teacher telling them “because you need to.” I hope that my contribution to this book honors my students and puts electronics and programming into a format that sparks your imagination.
Project 1: Getting Started with Arduino
Project 2: A Stoplight for Your House
Project 3: The Nine-Pixel Animation Machine
Project 5: A Color-Mixing Night-Light
Project 7: Tiny Desktop Greenhouse
Project 8: Drawbot, The Robotic Artist
Project 10: Tiny Electric Piano
How is This Book Different from Others?
Spread the Word: Sharing Your Work
Electricity, Conductivity, and Basic Terms
Visualizing Electricity as Water in a Pipe
Schematics, Circuit Blueprints, and Wiring Diagrams
Discrete Components vs. Breakout Boards
Project 1
Getting Started with Arduino
An Accessible Hardware Platform
Installing the Arduino IDE and Drivers
Changing the Default Preferences
Test Drive: Plugging in the Arduino for the First Time
Choosing Your Board in the IDE
Selecting the Communication Port
Project 2
A Stoplight for Your House
Connect the Red LED to the Breadboard
Create Placeholders for Pin Numbers
Project 3
The Nine-Pixel Animation Machine
Build the Nine-Pixel Animation Machine Prototype
Program the Nine-Pixel Animation Machine
Build the Nine-Pixel Animation Machine Enclosure
New Component: The Push Button
Using Resistors with Push Buttons
Build the Reaction Timer Prototype
Test the Reaction Timer Sketch
Upload the Complete Code for the Reaction Timer
Build the Reaction Timer Enclosure
Project 5
A Color-Mixing Night-Light
Build the Night-Light Prototype
Test the Night-Light with Basic Color Mixing
Prepare to Check the Light Level
Control the Night-Light Based on the Light Level
Create More Colors with Analogwrite()
Create Analog Signals with PWM
Find RGB Values with Color Picker
The Custom-Color Night-Light Code
Build the Night-Light Enclosure
Build the Balance Beam Prototype
Complete the Balance Beam Sketch
Build the Base and Attach the Servo
Project 7
Tiny Desktop Greenhouse
Measure Temperature with the TMP36
Connect the Temperature Sensor
Program the Temperature Sensor
Build the Servo Motor Autovent
Build the Tiny Desktop Greenhouse Enclosure
Project 8
Drawbot, The Robotic Artist
The H-Bridge Motor Driver Integrated Circuit
Turn and Make Patterns: A Robot Square Dance
New Component: The 16 × 2 Character LCD
Connect the Data and Control Wiring
Add the Rest of the Electronics
The SoftPot Membrane Potentiometer
Program the Tiny Electric Piano
Generate Sound with the SoftPot
Appendix
More Electronics Know-How
Measuring Electricity with a Multimeter