ebook img

Learn Electronics with Arduino PDF

386 Pages·2017·50.22 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Learn Electronics with Arduino

Make: Learn ElEctronics with arduino An Illustrated Beginner’s guIde to PhysIcAl ComputIng Jody Culkin and Eric Hagan Copyright © 2017 Jody Culkin and Eric Hagan. All rights reserved. Printed in the United States of America. Published by Maker Media, Inc., 1700 Montgomery Street, Suite 240, San Francisco, CA 94111 Maker Media books may be purchased for educational, business, or sales promo- tional use. Online editions are also available for most titles (safaribooksonline.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or [email protected]. Publisher and Editor: Roger Stewart Copy Editor: Elizabeth Welch, Happenstance Type-O-Rama Proofreader: Scout Festa, Happenstance Type-O-Rama Interior Designer, Compositor, and Cover Designer: Maureen Forys, Happenstance Type-O-Rama Indexer: Valerie Perry, Happenstance Type-O-Rama August 2017: First Edition Revision History for the First Edition 28-08-2017 First Release See oreilly.com/catalog/errata.csp?isbn=9781680453744 for release details. Make:, Maker Shed, and Maker Faire are registered trademarks of Maker Media, Inc. The Maker Media logo is a trademark of Maker Media, Inc. An Illustrated Begin- ner’s Guide to Physical Computing and related trade dress are trademarks of Maker Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and Maker Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While the publisher and the author have used good faith efforts to ensure that the information and instruc- tions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights. 9-781-68045-374-4 Safari® Books Online Safari Books Online is an on-demand digital library that delivers expert content in both book and video form from the world’s leading authors in technology and business. Technology professionals, software developers, web designers, and busi- ness and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training. Safari Books Online offers a range of plans and pricing for enterprise, government, education, and individuals. Members have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like O’Reilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and hun- dreds more. For more information about Safari Books Online, please visit us online. How to Contact Us Please address comments and questions to the publisher: Maker Media 1700 Montgomery St. Suite 240 San Francisco, CA 94111 You can send comments and questions to us by email at [email protected]. Maker Media unites, inspires, informs, and entertains a growing community of resourceful people who undertake amazing projects in their backyards, basements, and garages. Maker Media celebrates your right to tweak, hack, and bend any Tech- nology to your will. The Maker Media audience continues to be a growing culture and community that believes in bettering ourselves, our environment, our educational system—our entire world. This is much more than an audience, it’s a worldwide movement that Maker Media is leading. We call it the Maker Movement. To learn more about Make: visit us at makezine.com. You can learn more about the company at the following websites: Maker Media: makermedia.com Maker Faire: makerfaire.com Maker Shed: makershed.com dedication Dedicated to all of our students, past, present, and future. Their curiosity drives them and inspires us. iv contEnts Acknowledgments vii Back to Debugging Our Circuit 69 Summary 71 About the Authors viii 4 Programming the Arduino 73 Preface ix Arduino, Circuits, and Code: 1 Introduction to Arduino 1 Bringing Everything Together 74 Physical Computing 3 What’s an IDE? 75 Prototyping 3 Downloading the Arduino IDE: What Will I Need and Where Getting Started 78 Can I Get It? 4 The Sketch: The Basic Unit of Parts and Tools 5 Arduino Programming 90 Resources 12 Debugging: What to Do if the Summary 13 LED Isn’t Blinking 96 LEA4_Blink Sketch: An Overview 98 2 Your Arduino 15 setup() and loop(): The Guts of Parts of an Arduino 16 Your Code 101 Plug Your Arduino into Your Looking at loop(): What Happens Computer 20 Over and Over 109 Components and Tools 26 A Schematic of the Arduino 115 Summary 30 Building the Basic Circuit 118 SOS Signal Light: Creating More 3 Meet the Circuit 31 Complex Timing 125 The Circuit: Building Block of Summary 135 Electronics 32 5 Electricity and Metering 137 The Schematic 37 Using a Breadboard 42 Understanding Electricity 138 Building a Circuit 48 Build the Circuit Step by Step 140 A Look at the Battery 52 Electricity: An Overview 144 Power for Our Circuit: Electricity 55 Understanding Electricity: Debugging the Circuit 57 The Water Tank Analogy 148 The Multimeter 60 Voltage: The Potential 149 Using the Multimeter 65 Current: The Flow 159 v Resistance: Restricting the Flow 167 Serial Communication 269 Voltage, Current, Resistance: Adding the Speaker 278 Review 173 Adding the Photoresistor 282 How Do Voltage, Current, and Summary 288 Resistance Interact? Ohm’s Law 177 8 Servo Motors 289 Components in Parallel and Series 180 Summary 192 Waving the Flags 291 Servos Up Close 292 6 Switches, LEDs, and More 193 Building the Servo Circuit Interactivity! 194 Step by Step 295 Digital Inputs and Outputs LEA8_Sweep Overview 301 Overview 195 What’s a for Loop? 304 Digital Input: Add a Button 197 Operators 309 Looking at the Sketch: Variables 206 The for Loop in the Sketch 312 Digital Input Refresher 213 Add Interactivity: Looking at the Sketch: Conditional Turn the Flag 314 Statements 215 LEA8_Knob Explained 317 Add a Speaker and Adjust Two Flags Waving: Add a the Code 220 Second Servo Motor 320 Add Two More Buttons and LEA8_2_servos, First Look 322 Adjust the Code 227 Summary 332 Reviewing Electronic and Code 9 Building Your Projects 333 Concepts 236 Summary 239 Project Management 334 A Few Helpful Components 338 7 Analog Values 241 Types of Projects 342 There’s More to Life than On Other Versions of the Arduino and Off! 241 Board 345 Potentiometer Circuit, Step Document Your Project and by Step 246 Share It! 348 The LEA7_AnalogInOutSerial Summary 350 Sketch 254 A Appendix: Reading Analog Input: Values from the Resistor Codes 351 Potentiometer 259 Analog Values as Output: PWM 266 Identifying Resistors by Color Bands 351 vi acknowLedgments This book wouldn’t have been possible without the help of many people, more than we can mention here. We’d like to thank our tech editor, Anna Pinkas, for her tireless and thorough review of this text. An earlier version of this book also benefited from tech editing by Michael Colombo and Sharon Cichelli. Roger Stewart, our publisher and editor, has been supportive and helpful throughout the process of getting this book into print. Our production team from Happen- stance Type-O-Rama has been a delight to work with, particularly Liz Welch and Maureen Forys. We met at the Interactive Telecom- munications Program at New York University, and we will always be grateful to Tom Igoe for suggesting we work together on a project there. In fact, we’d like to thank all of the faculty and staff at ITP, especially Dan O’Sullivan and Marianne Petit. Eric would like to thank his wife Marie for her endless support, without which this book would not be possible. He would also like to thank his parents, David and Tracey, who have always had so much faith in his work. Jody would like to thank her husband Calvin Reid, who seems to think she can do anything and has done whatever he can to make that possible. And she would like to acknowledge the memory of her parents, Florence and Hosmer Culkin, who would be startled but proud that she has co-authored a book on technology. vii about thE authors Jody Culkin is an artist and teacher. She has shown her sculptures, photographs, and installations at museums and galleries through- out this country and internationally. She illustrated How to Use a Breadboard, written by Sean Ragan, for Maker Media (2017). Her comic Arduino! has been translated into 12 languages. She has received grants and awards from the National Science Foundation, the New York State Council on the Arts, and many other organiza- tions. She is currently a professor at City University of New York's Borough of Manhattan Community College in the Media Arts and Technology Department. She has a BA from Harvard University in visual studies and an MPS from NYU's Interactive Telecommunica- tions Program. Eric Hagan is an interactive and kinetic artist and professor based out of Astoria, New York. He has written articles for publications, including Make: magazine and Popular Science. He has also worked on several art installation projects around New York City, includ- ing the annual holiday windows on 5th Avenue and Kara Walker’s A Subtlety. He is currently an assistant professor at SUNY Old Westbury in the Visual Arts Department. He has a BA from Duke University in philosophy and an MPS from NYU's Interactive Tele- communications Program. Eric enjoys showing projects at the annual New York City World Maker Faire. viii

Description:
Jody would like to thank her husband Calvin Reid, who seems to think she We haven't covered everything that the Arduino can do, but we have set
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.