15,99 €
The quick, easy way to leap into the fascinating world of physical computing
This is no ordinary circuit board. Arduino allows anyone, whether you're an artist, designer, programmer or hobbyist, to learn about and play with electronics. Through this book you learn how to build a variety of circuits that can sense or control things in the real world. Maybe you'll prototype your own product or create a piece of interactive artwork? This book equips you with everything you'll need to build your own Arduino project, but what you make is up to you! If you're ready to bring your ideas into the real world or are curious about the possibilities, this book is for you.
It's hardware, it's software, it's fun! Start building the next cool gizmo with Arduino and Arduino For Dummies.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 542
Veröffentlichungsjahr: 2013
Arduino® For Dummies®
Published byJohn Wiley & Sons, LtdThe AtriumSouthern GateChichesterWest SussexPO19 8SQEngland
Email (for orders and customer service enquires): [email protected]
Visit our home page on www.wiley.com
Copyright © 2013 John Wiley & Sons, Ltd, Chichester, West Sussex, England
All rights reserved. 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 under the terms of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licensing Agency Ltd., Saffron House, 6-10 Kirby Street, London EC1N 8TS, UK, without the permission in writing of the Publisher. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ, England, or emailed to [email protected], or faxed to (44) 1243 770620.
Trademarks: Wiley, For Dummies, the Dummies Man logo, A Reference for the Rest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates in the United States and other countries, and may not be used without written permission. Arduino is a registered trademark of Arduino LLC. Arduino drawings and circuit diagrams used throughout the book are based on the Fritzing Arduino drawings. All other trademarks are the property of their respective owners. John Wiley & Sons, Ltd. is not associated with any product or vendor mentioned in this book.
Limit of Liability/Disclaimer of Warranty: The publisher, the author, and anyone else in preparing this work 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 legal, accounting, or other professional 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 organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations 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, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002.
For technical support, please visit www.wiley.com/techsupport.
Wiley also publishes its books in a variety of electronic formats and by print-on-demand. Some content that appears in standard print versions of this book may not be available in other formats. For more information about Wiley products, visit us at www.wiley.com.
British Library Cataloguing in Publication Data: A catalogue record for this book is available from the British Library.
ISBN 978-1-118-44637-9 (paperback); ISBN 978-1-118-44643-0 (ebook); 978-1-118-44644-7 (ebook); 978-1-118-44642-3 (ebook)
Printed and bound in Great Britain by TJ International, Padstow, Cornwall
10 9 8 7 6 5 4 3 2 1
About the Author
John Nussey is a creative technologist based in London. His work involves using technology in new and interesting ways and covers many areas, including physical computing, creative coding, interaction design, and product prototyping.
During his career, he has worked on many varied projects with clients such as ARUP, the BBC, the Museum of Science and Industry, the National Maritime Museum, Nokia, and the Southbank Centre.
He is a proud advocate of the Arduino prototyping platform and has taught the craft of interaction design and prototyping to people of all ages, competencies, and abilities at a variety of establishments, including Goldsmiths College, the Bartlett School of Architecture, the Royal College of Art, and OneDotZero.
Dedication
To Avril, the love of my life (and only person I trust with a soldering iron), for providing encouragement when I was writing and distraction when I wished I wasn’t; to Roanne and Oliver for our stimulating literary chats; to Craig for helping me bridge the trans-Atlantic gap; to all the guys and girls at Kin for still feigning interest and asking “How’s the books going?” after 6 months; and to Alexandra for all the guidance that led me to such an enjoyable and inspiring career.
Author’s Acknowledgments
John would like to thank the folks at Wiley, especially Craig Smith for always being upbeat and his gentle reminders, and Susan Christophersen for her hard work and support throughout.
Many thanks to Andy Huntington for his excellent technical editing and occasional humorous comments that helped me through the long nights.
A big thanks to all my friends, family, and loved ones for their encouragement and enthusiasm. I love making things, and I hope that this book inspires you to make things of your own and find the same enjoyment I have.
Publisher’s Acknowledgments
We’re proud of this book; please send us your comments at http://dummies.custhelp.com. For other comments, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002.
Some of the people who helped bring this book to market include the following:
Acquisitions, Editorial
Project and Copy Editor: Susan Christophersen
Executive Commissioning Editor: Craig Smith
Development Editors: Susan Christophersen, Susannah Gardner
Technical Editor: Andy Huntington
Editorial Manager: Jodi Jensen
Senior Project Editor: Sara Shlaer
Editorial Assistant: Leslie Saxman
Cover Photo: © John Nussey
Cartoons: Rich Tennant (www.the5thwave.com)
Marketing
Associate Marketing Director: Louise Breinholt
Marketing Manager: Lorna Mein
Senior Marketing Executive: Kate Parrett
Composition Services
Senior Project Coordinator: Kristie Rees
Layout and Graphics: Carrie A. Cesavice, Melanee Habig, Joyce Haughey, Andrea Hornberger, Christin Swinford
Proofreader: Wordsmith Editorial
Indexer: Potomac Indexing, LLC
UK Tech Publishing
Michelle Leete, VP Consumer and Technology Publishing Director
Martin Tribe, Associate Director–Book Content Management
Chris Webb, Associate Publisher
Publishing and Editorial for Technology Dummies
Richard Swadley, Vice President and Executive Group Publisher
Andy Cummings, Vice President and Publisher
Mary Bednarek, Executive Acquisitions Director
Mary C. Corder, Editorial Director
Publishing for Consumer Dummies
Kathleen Nebenhaus, Vice President and Executive Publisher
Composition Services
Debbie Stailey, Director of Composition Services
Visit www.dummies.com/cheatsheet/arduino to view this book's cheat sheet.
Table of Contents
Introduction
About This Book
Foolish Assumptions
How This Book Is Organized
Part I: Getting to Know Arduino
Part II: Getting Physical with Arduino
Part III: Building on the Basics
Part IV: Unlocking Your Arduino’s Potential
Part V: Sussing Out Software
Part VI: The Part of Tens
Icons Used in This Book
Where to Go from Here
Part I: Getting to Know Arduino
Chapter 1: What Is Arduino and Where Did It Come From?
Where Did Arduino Come From?
Learning by Doing
Patching
Hacking
Circuit bending
Electronics
Inputs
Outputs
Open Source
Chapter 2: Finding Your Board and Your Way Around It
Getting to Know the Arduino Uno R3
The Brains: ATmega328 microcontroller chip
Header sockets
Digital pins
Analog in pins
What about analog out?
Power pins
USB socket
External power jack
Reset button
Discovering Other Arduino Boards
Official Arduino boards
Contributed (Approved) Arduinos
Shopping for Arduino
Official Arduino Store
Distributors in the United Kingdom
Distributors in the United States
Amazon
Electronics distributors
Kitted Out: Starting with a Beginner’s Kit
Preparing a Workspace
Chapter 3: Downloading and Installing Arduino
Installing Arduino
Installing Arduino for Windows
Installing Arduino for Mac OS X
Installing Arduino for Linux
Surveying the Arduino Environment
Chapter 4: Blinking an LED
Working with Your First Arduino Sketch
Finding the Blink Sketch
Identifying your board
Configuring the software
Uploading the sketch
Congratulate yourself!
What just happened?
Looking Closer at the Sketch
Comments
Declarations
Variables
Functions
Setup
Loop
Blinking Brighter
Tweaking the Sketch
Part II: Getting Physical with Arduino
Chapter 5: Tools of the Trade
Finding the Right Tools for the Job
Breadboard
Jump wires
Needle-nose pliers
Multimeter
Using the Multimeter to Measure Voltage, Current, and Resistance
Measuring voltage (in volts) in a circuit
Measuring current (in amps) in a circuit
Measuring resistance (in ohms) of a resistor
Measuring resistance (in ohms) of a variable resistor
Checking the continuity (in bleeps) of your circuit
Chapter 6: A Primer on Electricity and Circuitry
Understanding Electricity
Using Equations to Build Your Circuits
Ohm’s Law
Calculating power
Joule’s Law
Working with Circuit Diagrams
A simple circuit diagram
Using a circuit diagram with an Arduino
Color Coding
Datasheets
Resistor Color Charts
Chapter 7: Basic Sketches: Inputs, Outputs, and Communication
Uploading a Sketch
Using Pulse Width Modulation (PWM)
The LED Fade Sketch
Understanding the fade sketch
Tweaking the fade sketch
The Button Sketch
Understanding the Button sketch
Tweaking the Button sketch
The AnalogInput Sketch
Understanding the AnalogInput sketch
Tweaking the AnalogInput sketch
Talking Serial
The DigitalReadSerial Sketch
Understanding the DigitalReadSerial sketch
The AnalogInOutSerial Sketch
Understanding the AnalogInOutSerial sketch
Chapter 8: More Basic Sketches: Motion and Sound
Working with Electric Motors
Discovering Diodes
Spinning a DC Motor
The Motor sketch
Understanding the Motor sketch
Changing the Speed of Your Motor
The MotorSpeed sketch
Understanding the MotorSpeed sketch
Controlling the Speed of Your Motor
The MotorControl sketch
Understanding the MotorControl Sketch
Tweaking the MotorControl sketch
Getting to Know Servo Motors
Creating Sweeping Movements
The Sweep sketch
Understanding the Sweep sketch
Controlling Your Servo
The Knob sketch
Understanding the Knob sketch
Making Noises
Piezo buzzer
The toneMelody sketch
Understanding the sketch
Making an Instrument
The PitchFollower sketch
Understanding the sketch
Part III: Building on the Basics
Chapter 9: Learning by Example
Skube
How it works
Further reading
Chorus
How it works
Further reading
Push Snowboarding
How it works
Further reading
Baker Tweet
How it works
Further reading
The National Maritime Museum’s Compass Lounge and Compass Card
How it works
Further reading
The Good Night Lamp
How it works
Further reading
Little Printer
How it works
Further reading
Flap to Freedom
How it works
Further reading
Chapter 10: Soldering On
Understanding Soldering
Gathering What You Need for Soldering
Creating a workspace
Choosing a soldering iron
Solder
Third hand (helping hand)
Adhesive putty
Wire cutters
Wire strippers
Needle-nosed pliers
Multimeter
Solder sucker
Solder wick
Equipment wire
Staying Safe while Soldering
Handling your soldering iron
Keeping your eyes protected
Working in a ventilated environment
Cleaning your iron
Don’t eat the solder!
Assembling a Shield
Laying out all the pieces of the circuit
Assembly
Header pins
Acquiring Your Soldering Technique
Building Your Circuit
Knowing your circuit
Laying out your circuit
Preparing your wire
Soldering your circuit
Cleaning up
Testing your shield
Packaging Your Project
Enclosures
Wiring
Securing the board and other elements
Chapter 11: Getting Clever with Code
Blinking Better
Setting up the BlinkWithoutDelay sketch
Understanding the BlinkWithoutDelay sketch
Taking the Bounce Out of Your Button
Setting up the Debounce sketch
Understanding the Debounce sketch
Making a Better Button
Setting up the StateChangeDetection sketch
Understanding the StateChangeDetection sketch
Smoothing Your Sensors
Setting up the Smoothing sketch
Understanding the Smoothing sketch
Calibrating Your Inputs
Setting up the Calibration sketch
Understanding the Calibration sketch
Chapter 12: Common Sense with Common Sensors
Making Buttons Easier
Implementing the DigitalInputPullup sketch
Understanding the DigitalInputPullup sketch
Exploring Piezo Sensors
Implementing the Knock sketch
Understanding the Knock sketch
Utilizing Pressure, Force, and Load Sensors
Implementing the toneKeyboard sketch
Understanding the toneKeyboard sketch
Sensing with Style
Implementing the CapPinSketch sketch
Understanding the CapPinSketch sketch
Tripping Along with Lasers
Implementing the AnalogInOutSerial sketch
Understanding the AnalogInOutSerial sketch
Detecting Movement
Implementing the DigitalReadSerial sketch
Understanding the DigitalReadSerial sketch
Measuring Distance
Implementing the MaxSonar sketch
Understanding the MaxSonar sketch
Testing, Testing . . . Can Anybody Hear This?
Implementing the AnalogInOutSerial sketch
Understanding the AnalogInOutSerial sketch
Part IV: Unlocking Your Arduino’s Potential
Chapter 13: Becoming a Specialist with Shields and Libraries
Looking at Shields
Considering combinations
Reviewing the field
Staying current
Browsing the Libraries
Reviewing the standard libraries
Installing additional libraries
Obtaining contributed libraries
Chapter 14: Sensing More Inputs and Controlling More Outputs
Controlling Multiple LEDs
Implementing the AnalogWriteMega sketch
Understanding the AnalogWriteMega Sketch
Tweaking the AnalogWriteMega sketch
Controlling Lots of LEDs by Shifting Out
Implementing the shiftOutCode, Hello World sketch
Understanding the shiftOutCode, Hello World sketch
Tweaking the shiftOutCode, Hello World sketch
Doing more with the same circuit
Chapter 15: Multiplying Your Outputs with I2C
What Is I2C?
Assembling the I2C PWM/Servo Driver
Using the I2C PWM/Servo Driver
Understanding the I2C PWM/Servo Driver Sketch
Buying Servo Motors
Other Uses for I2C
Part V: Sussing Out Software
Chapter 16: Getting to Know Processing
Looking Under the Hood
Installing Processing
Taking a look at Processing
Trying Your First Processing Sketch
Drawing shapes
Changing color and opacity
Playing with interaction
Chapter 17: Processing the Physical World
Making a Virtual Button
Setting up the Arduino code
Setting up the Processing code
Understanding the Processing PhysicalPixel sketch
Understanding the Arduino Physical Pixel sketch
Drawing a Graph
Setting up the Arduino code
Setting up the Processing code
Understanding the Arduino Graph sketch
Understanding the Processing Graph sketch
Sending Multiple Signals
Setting up the Arduino code
Setting up the Processing code
Understanding the Arduino SerialCallResponse sketch
Understanding the Processing SerialCallResponse sketch
Part VI: The Part of Tens
Chapter 18: Ten Places to Learn More about Arduino
Arduino Blog
Hack a Day
SparkFun
MAKE
Adafruit
Bildr
Instructables
YouTube
Hackerspaces
Forum
Friends, Colleagues, and Workshops
Chapter 19: Ten Great Shops to Know
Shops in the United Kingdom
SK Pang
Technobots
Proto-PIC
Oomlout
RoboSavvy
Active Robots
Shops around the World
Adafruit (U.S.)
Arduino Store (Italy)
Seeed Studio (China)
SparkFun (U.S.)
Chapter 20: Ten Places to Find Parts and Components
RS Components (World)
Farnell (World)
Rapid (World)
Digi-Key (World)
eBay (World)
Maplin (U.K.)
RadioShack (U.S.)
Ultraleds (U.K.)
EnvironmentalLights.com (U.S.)
Skip/Dumpster Diving (World)
Foreword
The moment a For Dummies book comes out, it’s definitely a milestone in the history of a product.
Programming embedded computers used to be a very difficult task, reserved only to experienced engineers willing to master the obscure assembly language. In recent years, however, many platforms have tried to make this task simpler and more accessible to everyday people. Arduino is one of the latest attempts at making technology less scary and more creative.
With John, this book’s author, we watched this creative tool being adopted by designers and artists in London, making its way into many memorable projects. Now Arduino has escaped the lab of Arts & Design and spread like a virus, becoming the tool of choice for all kinds of people who have great ideas they want to realize.
I’m really glad that John decided to write this book, because he’s an early user of the Arduino platform from back in the days when it was still quite experimental. Having taught Arduino classes for many years, he has the ability to introduce the subject to all audiences.
Any newcomer to Arduino will, with the right tools and teaching — such as those found in this book — show true genius in no time.
Massimo Banzi
Introduction
Arduino is a tool, a community, and a way of thinking that is affecting how we use and understand technology. It has rekindled a love and understanding for electronics for many people, including myself, who felt that electronics was something that they had left behind at school.
Arduino is tiny circuit board that has huge potential. It can be used to blink a Morse-code signal using a single LED or to control every light in a building, depending on how far you take it. Its capabilities are limited only by your imagination.
Arduino is also providing a new, practical approach to technical education, lowering the entry level for those wanting to use electronics to complete small projects and, I hope, encouraging you to read further to take on big ones.
A huge and ever-growing community of Arduin-ists has emerged — users and developers who learn from each other and contribute to the open source philosophy by sharing the details of their projects. Arduin-ists and their supporters with their open source attitude are responsible for the huge popularity of Arduino.
Arduino is more than just a “bit of kit”; it’s a tool. A piece of technology that makes understanding and using today’s technology easier.
So if the prospect of understanding the limitless possibilities of technology doesn’t sound interesting to you, please put this book down and back away.
Otherwise, read on!
About This Book
This is a technical book, but it’s not for technical people only. Arduino is designed to be usable by anyone, whether they’re technical, creative, crafty, or just curious. All you need is an open mind or a problem to fix and you’ll soon find ways that using Arduino can benefit you.
Arduino has rekindled my love of electronics and opened many avenues for my career. I wrote this book to share that experience. When I first went to an Arduino workshop, I had no experience in programming and could only vaguely remember which end of a soldering iron to hold (don’t worry, I cover soldering, too). Now the mainstay of my work involves building interactive installations, prototyping products, and generally finding new ways to play with technology using Arduino.
I think it is an excellent platform that lowers the entry level into electronics and coding, allowing people who may not have had the attention span or interest at school to dive straight into the areas that interest them and explore them from there.
Foolish Assumptions
This book assumes nothing about your technical knowledge. Arduino is an easy-to-use platform for learning about electronics and programming. It is for people from all walks of life, whether you’re a designer, an artist, or a hobbyist.
It can also be a great platform for people who are already technical. Maybe you’ve done a bit of coding but want to bring your projects into the physical world in some way, or maybe you’ve worked with electronics and want to see what Arduino can bring to the table.
But whoever you are, you’ll find that Arduino has great potential. It’s really up to you to decide what to make of it.
This book starts on the most basic level to get you started with using and understanding Arduino. At times throughout the book, I may refer to a number of very technical things that will, like anything, take time to understand. I guide you through all the basics and then on to more advanced activities.
Much of what is in this book is based on my learning and teaching experiences. I learned all about Arduino from scratch, but have always found that the best way to learn is in practice, by making your own projects. The key is to learn the basics that I cover in this book and then build on that knowledge by thinking about how you can apply it to solve problems, create things, or just entertain yourself.
How This Book Is Organized
Arduino For Dummies is organized in a way that allows you to jump around the book as you like. If you’ve dabbled in Arduino before, you might want to skip to the later chapters, or if you’ve forgotten some of the basics, consider starting at the beginning.
Part I: Getting to Know Arduino
In Part I, I introduce you to Arduino, outlining a variety of other practices and circumstances that created a need for Arduino and that have influenced its development. Then I look at Arduino in more detail, both as a physical board and software environment, and I walk you through uploading your first sketch.
Part II: Getting Physical with Arduino
In this part, you find out how to do some basic prototyping using breadboards and other components to give your Arduino more reach into the physical world. Using just a few simple components, you can explore a variety of applications for Arduino and form a base on which you can build your own projects. The chapters in this part cover a variety of inputs and outputs, including light, motion, and sound that you can build on and combine to form your own projects.
Part III: Building on the Basics
After you have covered the basics, you’ll be itching to do more. In Part III, I tell you about some real-world projects and how they work. You find out how to solder your own circuit board to get your project out into the world for others to see. You also learn how to choose the correct sensor for the job and how to use code to fine-tune or change the behavior of your circuits.
Part IV: Unlocking Your Arduino’s Potential
This part pushes the possibilities of your Arduino project further. You learn about using shields to add specific functionality to your Arduino, using hardware and techniques to allow you project to grow, and hacking existing hardware. You also find out how to communicate with Processing, Arduino’s sister project, to combine open source hardware with software.
Part V: Sussing Out Software
If you work through the book to this part, you should have a good understanding of how you can use electronics and hardware in your own projects. In this part, you learn how to combine this knowledge of the physical world with the digital world of software. I introduce you to a few open source programming environments and then more specifically to Processing, which is a digital sketchbook that you can use for a huge variety of applications to enhance your Arduino project.
Part VI: The Part of Tens
The Part of Tens is a For Dummies standard that breaks down useful information into groups of ten bite-sized chunks. This part covers where to learn more about Arduino, where to shop for Arduino-specific parts, and where to shop for electronics in general.
Icons Used in This Book
Arduino For Dummies uses icons to highlight important points for you. Keep an eye out for these:
This icon highlights a bit of helpful information. That info may be a technique to help you complete a project more easily or the answer to common problems.
Arduinos aren’t dangerous on their own; indeed, they’re made to be extremely safe and easy to use. But if they are used in a circuit without proper planning as well as care and attention, they can damage your circuit, your computer, and yourself. When you see a Warning icon, please take special note.
There are often points that must be considered before proceeding with a task. I use Remember icons to remind you of such points.
Some information is more technical than others and is not for the faint hearted. The joy of Arduino is that you don’t need to fully understand the technical details immediately. You can skip anything that’s marked with this icon if it’s more complicated than you want to deal with at the moment; you can always return to it when you’re ready.
Where to Go from Here
If you’re uncertain about where to start, I suggest the beginning. By the end of Chapter 2, you’ll have acquired a simple understanding of Arduino and will know where you can get a kit to continue learning.
If you’ve used Arduino before, you may want to jump straight to Chapter 4 to cover the basics again, or head straight to the area that interests you.
Part I
Getting to Know Arduino
In this part . . .
So what is an Arduino, anyway? In the chapters ahead, you find out all about this little blue circuit board, how it came into being, and what it can be used for. After a brief introduction, I talk you through all the things you need to get started with Arduino and where to get them. Next, you learn how to wield the awesome power of an LED, blinking it on command with a few simple lines of code.
Chapter 1
What Is Arduino and Where Did It Come From?
In This Chapter
Discovering Arduino
Learning where Arduino came from and why it’s so important
Introducing the basic principles
Arduino is made up of both hardware and software.
The Arduino board is a printed circuit board (PCB) that is specifically designed to use a microcontroller chip as well as other input and outputs. It also has many other electronic components that are needed for the microcontroller to function or to extend its capabilities.
Microcontrollers are small computers contained within a single, integrated circuit or computer chip, and they are an excellent way to program and control electronics. Many devices, referred to as microcontroller boards, have a microcontroller chip and other useful connectors and components that allow a user to attach inputs and outputs. Some examples of devices with microcontroller boards are the Wiring board, the PIC, and the Basic Stamp.
You write code in the Arduino software to tell the microcontroller what to do. For example, by writing a line of code, you can tell an LED to blink on and off. If you connect a pushbutton and add another line of code, you can tell the LED to turn on only when the button is pressed. Next, you may want to tell the LED to blink only when the pushbutton is held down. In this way, you can quickly build a behavior for a system that would be difficult to achieve without a microcontroller.
Similarly to a conventional computer, an Arduino can perform a multitude of functions, but it’s not much use on its own. It requires other inputs or outputs to make it useful. These inputs and outputs allow a computer to sense objects in the world and to affect the world.
Before you move forward, it might help you to understand a bit of the history of Arduino.
Where Did Arduino Come From?
Arduino started its life in Italy, at Interaction Design Institute Ivera (IDII), a graduate school for interaction design. This is a specific school of design education that focuses on how people interact with digital products, systems, and environments and how they in turn influence us.
The term interaction design was coined by Bill Verplank and Bill Moggridge in the mid-1980s. The sketch in Figure 1-1 by Verplank illustrates the basic premise of interaction design. This diagram is an excellent illustration of how the process of interaction works: If you do something, you feel a change, and from that you can know something about the world.
Although it is a general principle, interaction design more commonly refers to how we interact with conventional computers by using peripherals, such as mice, keyboards, and touchscreens, to navigate a digital environment that is graphically displayed on a screen.
Courtesy of Bill Verplank
Figure 1-1: The principle of interaction design, illustrated by Bill Verplank.
There is another avenue, referred to as physical computing, which is about extending the range of these computer programs, software, or systems. Through electronics, computers can sense more about the world and have a physical impact on the world themselves.
Both of these areas — interaction design and physical computing — require prototypes to fully understand and explore the interactions, which presented a hurdle for nontechnical design students.
In 2001, a project called Processing that was started by Casey Reas and Benjamin Fry aimed to get nonprogrammers into programming by making it quick and easy to produce onscreen visualizations and graphics. The project gave the user a digital sketchbook on which to try ideas and experiment with a very small investment of time. This project in turn inspired a similar project for experimenting in the physical world.
Building on the same principles as Processing, in 2003 Hernando Barragán started developing a microcontroller board called Wiring. This board was the predecessor to Arduino.
In common with the Processing project, the Wiring project also aimed to involve artists, designers, and other nontechnical people, but Wiring was designed to get people into electronics rather than programming. The Wiring board (shown in Figure 1-2) was less expensive than some other microcontrollers, such as the PIC and the Basic Stamp, but it was still a sizable investment for students to make.
Figure 1-2: An early Wiring board.
In 2005, the Arduino project began in response to the need for affordable and easy-to-use devices for Interaction Design students to use in their projects. It is said that Massimo Banzi and David Cuartielles named the project after Arduin of Ivera, an Italian king, but I’ve heard from reliable sources that it also happens to be the name of the local pub near the university, which may have been of more significance to the project.
The Arduino project drew from many of the experiences of both Wiring and Processing. For example, an obvious influence from Processing is the graphic user interface (GUI) that is used in the Arduino software. This GUI was initially “borrowed” from Processing, and even though it still looks similar, it has since been refined to be more specific to Arduino. I cover the Arduino interface in more depth in Chapter 4.
Arduino also kept the naming convention from Processing, naming its programs sketches. In the same way that Processing gives people a digital sketchbook to create and test programs quickly, Arduino gives people a way to sketch out their hardware ideas as well. Throughout this book, I show many sketches that allow your Arduino to perform a huge variety of tasks. By using and editing the example sketches in this book, you can quickly build up your understanding of how they work and will be writing your own in no time. Each sketch is followed with a line-by-line explanation of how it works to ensure that no stone is left unturned.
The Arduino board, shown in Figure 1-3, was made to be more robust and forgiving than Wiring or other earlier microcontrollers. It was not uncommon for students and professions, especially those from a design or arts background, to break their microcontroller within minutes of using it, simply by getting the wires the wrong way around. This fragility was a huge problem, not only financially but also for the success of the boards outside technical circles.
It is also possible to change the microcontroller chip on an Arduino, so if it is damaged, you can just replace the chip rather than the whole board.
Another important difference between Arduino and other microcontroller boards is the cost. In 2006, another popular microcontroller, the Basic Stamp, cost nearly four times as much (http://blog.makezine.com/2006/09/25/arduino-the-basic-stamp-k/) as an Arduino, and even today, a Wiring board still costs nearly double the price of an Arduino.
In one of my first Arduino workshops, I was told that the price was intended to be affordable for students. The price of a nice meal and a glass of wine at that time was about 30 euros, so if you had a project deadline, you could choose to skip a nice meal that week and make your project instead.
The range of Arduino boards on the market is a lot bigger than it was back in 2006. In Chapter 2, you learn about just a few of the most useful Arduino and Arduino-compatible boards and how they differ to provide you with a variety of solutions for your own projects. Also, in Chapter 13 you learn all about a special type of circuit board called a shield, which can add useful, and in some cases phenomenal, features to your Arduino, turning it into a GPS receiver, a Geiger counter, or even a mobile phone, to name just a few.
Figure 1-3: The original Arduino Serial board.
Learning by Doing
People have used technology in many ways to achieve their own goals without needing to delve into the details of electronics. Following are just a few related schools of thought that have allowed people to play with electronics.
Patching
Patching isn’t just a town in West Sussex; it is also a technique for experimenting with systems. The earliest popular example of patching is in phone switchboards. For an operator to put you through to another line they had to physically attach a cable. This was also a popular technique for synthesizing music, such as with the Moog synthesizer.
When an electronic instrument generates a sound, it is really generating a voltage. Different collections of components in the instrument manipulate that voltage before it is outputted as an audible sound. The Moog synthesizer works by changing the path that that voltage takes, sending it through a number of different components to apply different effects.
Because so many combinations are possible, for the musician the experience is largely based on trial and error. But the simple interface means that this process is extremely quick and requires very little preparation to get going.
Hacking
Hacking is popular term and is commonly used to refer to subversive people on the Internet. More generally, though, it refers to exploring systems and making full use of them or repurposing them to suit your needs.
Hacking in this sense is possible in hardware as well as software. A great example of hardware hacking is a keyboard hack. Say that you want to use a big, red button to move through a slideshow. Most software has keyboard shortcuts, and most PDF viewers move to the next page when the user presses the spacebar. If you know this, then you ideally want a keyboard with only a spacebar.
Keyboards have been refined so much that inside a standard keyboard is a small circuit board, a bit smaller than a credit card (see Figure 1-4). On it are lots of contacts that are connected when you press different keys. If you can find the correct combination, you can connect a couple of wires to the contacts and the other ends to a pushbutton. Now every time you hit that button, you send a space to your computer.
This technique is great for sidestepping the intricacies of hardware and getting the results you want. In the bonus chapter (www.dummies.com/go/arduinofd), you learn more about the joy of hacking and how you can weave hacked pieces of hardware into your Arduino project to control remote devices, cameras, and even computers with ease.
Figure 1-4: The insides of a keyboard, ready to be hacked.
Circuit bending
Circuit bending flies in the face of traditional education and is all about spontaneous experimentation. Children’s toys are the staple diet of circuit benders, but really any electronic device has the potential to be experimented with.
By opening a toy or device and revealing the circuitry, you can alter the path of the current to affect its behavior. Although this technique is similar to patching, it’s a lot more unpredictable. However, after you find the combinations, you can also add or replace components, such as resistors or switches, to give the user more control over the instrument.
Most commonly, circuit bending is about sound, and the finished instrument becomes a rudimentary synthesizer or drum machine. Two of the most popular devices are the Speak & Spell (see Figure 1-5) and the Nintendo GameBoy. Musicians such as the Modified Toy Orchestra (modifiedtoyorchestra.com ), in their own words, "explore the hidden potential and surplus value latent inside redundant technology." So think twice before putting your old toys on eBay!
Courtesy of Modified Toy Orchestra
Figure 1-5: A Modified Toy Orchestra Speak & Spell after circuit bending.
Electronics
Although there are many ways to work around technology, eventually you’ll want more of everything: more precision, more complexity, and more control.
If you learned about electronics at school, you were most likely taught how to build circuits using specific components. These circuits are based solely on the chemical properties of the components and need to be calculated in detail to make sure that the correct amount of current is going to the correct components.
These are the kind of circuits you find as kits at Radio Shack (or Maplin, in the United Kingdom) that do a specific job, such as an egg timer or a security buzzer that goes off when you open a cookie jar. These are very good at their specific job, but they can’t do much else.
This is where microcontrollers come in. Microcontrollers are tiny computers, and if used in conjunction with analog circuitry, can give that circuitry a more advanced behavior. They can also be reprogrammed to perform different functions as needed. Your Arduino is actually designed around one of these microcontrollers and helps you get the most out of it. In Chapter 2, you look closely at an Arduino Uno to see exactly how it is designed and what it is capable of.
The microcontroller is the brains of a system, but it needs data to either sense things about or affect things in its environment. It uses inputs and outputs to do so.
Inputs
Inputs are senses for your Arduino. They tell it what is going on in the world. At its most basic, an input could be a switch, such as a light switch in your home. At the other end of the spectrum, it could be a gyroscope, telling the Arduino the exact direction it’s facing in three dimensions. You learn all about basic inputs in Chapter 7, and more about the variety of sensors and when to use them in Chapter 12.
Outputs
Outputs allow your Arduino to affect the real world in some way. An output could be very subtle and discreet, such as in the same way that a mobile phone vibrates, or it could be a huge visual display on the side of a building that can be seen for miles around. The first sketch in the book walks you through “blinking” an LED (see Chapter 4). From there you can go on to motor control (Chapter 8) and even controlling huge numbers of outputs (see Chapters 14 and 15) to discover a variety of outputs for your Arduino project.
Open Source
Open source software, in particular Processing, has had a huge influence on the development of Arduino. In the world of computer software, open source is a philosophy involving sharing the details of a program and encouraging others to use, remix, and redistribute them, as they like.
Just as the Processing software is open source, so are Arduino software and hardware. This means that the Arduino software and hardware are both released freely to be adapted as needed. Possibly because of this openness on the part of the Arduino team, you find the same open source community spirit in the Arduino forums.
On the official Arduino forums (www.arduino.cc/forum/) and many other ones around the world, people have shared their code, projects, and questions for an informal peer review. This sharing allows all sorts of people, including experienced engineers, talented developers, practiced designers, and innovative artists, to lend their expertise to complete novices in some or all of these areas. It also provides a means to gauge people's areas of interest, which then occasionally filters into the official release of Arduino software or board design with new refinements or additions. The Arduino website has an area known as the Playground (www.playground.arduino.cc) where people are free to upload their code for the community to use, share, and edit.
This kind of philosophy has encouraged the relatively small community to pool knowledge on forums, blogs, and websites, thereby creating a vast resource for new Arduin-ists to tap into.
There is also a strange paradox that despite the open source nature of Arduino, a huge loyalty to Arduino as a brand exists — so much so that there is an Arduino naming convention of adding -duino or -ino to the name of boards and accessories (much to the disgust of Italian members of the Arduino team)!
Chapter 2
Finding Your Board and Your Way Around It
In This Chapter
Looking closer at the Arduino Uno R3
Discovering other Arduino boards
Knowing where to shop for Arduinos
Finding the right Arduino kit to get started
Setting up a workspace
In Chapter 1, I describe Arduino in general terms, but now it’s time to look a little closer. The name Arduino encompasses a host of concepts. It can refer to an Arduino board, the physical hardware, the Arduino environment — that is, a piece of software that runs on your computer — and, finally, Arduino as a subject in its own right, as in this book: how the hardware and software can be combined with related craft and electronics knowledge to create a toolkit for any situation.
This chapter is relatively short and provides an overview of what you need to get started with Arduino. You may be eager to dive in, so you may want to quickly scan through this chapter, stopping at any areas of uncertainty and referring back to it later as needed.
In this chapter, you learn about the components used on the Arduino Uno R3 board, which is the stating point for most Arduin-ists. Beyond that, you learn about the other available Arduino boards, how they differ, and what uses they have. The chapter lists a few suppliers that can equip you with all the parts you need and examines some of the starter kits that are ideal for beginners and for accompanying this book. When you have the kit, all you need is a workspace and then you’re ready to start.
Getting to Know the Arduino Uno R3
No one definitive Arduino board exists; many types of Arduino boards are available, each with its own design to suit various applications. Deciding what board to use can be a daunting prospect because the number of boards is increasing, each with new and exciting prospects. However, one board can be considered the backbone of the Arduino hardware; this is the one that almost all people start with and that is suitable for most applications. It’s the Arduino Uno.
The most recent main board to date is the Arduino Uno R3 (released in 2011). Think of it as the plain-vanilla of Arduino boards. It’s a good and reliable workhorse that is suitable for a variety of projects. If you’re just starting out, this is the board for you (see Figures 2-1 and 2-2).
Uno is Italian for the number one, named for the release of version 1.0 of the Arduino software. Predecessors to this had a variety of names, such as Serial, NG, Diecimila (10,000 in Italian, to mark that 10,000 boards have been sold) and Duemilanove (2009 in Italian, the release date of the board), so the Uno has ushered in some much needed order to the naming of the boards. R3 relates to the revision of the features on the board, which includes updates, refinements, and fixes. In this case, it is the third revision.
Figure 2-1: The front of an Arduino Uno R3.
Figure 2-2: The back of an Arduino Uno R3.
The board has many small components, described throughout much of this chapter.
The Brains: ATmega328 microcontroller chip
You can think of the microcontroller chip itself as the “brains” of the board. The chip used in the Arduino Uno is the ATmega328, made by Atmel. It’s the large, black component in the center of the board. This chip is known as an integrated circuit, or IC. It’s actually not alone but rather sits in a socket. If you were to remove it, it would look like the one shown in Figure 2-3.
This same chip can come in different forms, referred to as packages. The one in a regular Arduino Uno R3 is in a plated-through hole, or PTH, package, named because of the way it makes contact with the board. Another variation you may find is the Arduino Uno R3 SMD, where SMD stands for surface mount device, mounted on the surface of the board rather than in holes that go through it. This is a much smaller chip but is not replaceable, as the PTH chip is. Apart from that, as long as the name of the chip is the same, the chips function exactly the same and differ only in looks. You see another example of this kind of chip in Chapter 14 when you learn about the Arduino Mega 2560.
Figure 2-3: An ATmega328 microcontroller all by itself.
Header sockets
The microcontroller socket connects all the legs of the ATmega328 microcontroller chip to other sockets, referred to as header sockets, which have been arranged around the board and labeled for ease of use. They are the black sockets that go around the edge of the Arduino board. These are divided up into three main groups: digital pins, analog input pins, and power pins.
All these pins transfer a voltage, which can either be sent as output or received as an input. Why are these pins important? They allow additional circuitry to be connected to the board quickly and easily when prototyping with a breadboard (described in Chapter 7) and allow additional boards, called shields, to be designed that will fit neatly on top of your Arduino board (see Chapter 13 for more on shields).
This same process of sending and receiving electrical signals is going on inside modern computers, but because they are so advanced and refined compared to a humble Arduino, it is difficult to directly link a computer that is accustomed to digital signals (0s and 1s) to an electronic circuit that deals with a range of voltages (in the ATmega328’s case 0v to 5v).
The Arduino (see the sketch in Figure 2-4) is so special because it is able to interpret these electric signals and convert them to digital signals that your computer can understand — and vice versa. It also allows you to write a program using software on a conventional computer that is converted or compiled using the Arduino Software (IDE) to electrical signals that your circuit can understand.
By bridging this gap, it is possible to use the benefits of a conventional computer — ease of use, user-friendly interfaces, and code that is easy for humans to understand — to control a wide range of electronic circuits and even give them complex behaviors with relative ease.
Figure 2-4: An Arduino Uno with all the important parts labeled.
Digital pins
You use the digital pins, which run across the top of the board in Figure 2-1 (shown previously), to send and receive digital signals. Digital implies that they have two states: off or on. In electrical terms, this would mean a value of 0 or 5 volts, but no values in between.
Analog in pins
You use the analog in pins, which can be seen in the bottom left of the board in Figure 2-1, to receive an analog value. An analog value is taken from a range of values. In this case, the range is the same 0 to 5V as with the digital pins, but the value can be at any point — 0.1, 0.2, 0.3, and so on.
What about analog out?
The very shrewd ones among you may have noticed that there seem to be no analog out pins. In fact, there are, but they’re hidden among the digital pins marked as PWM using the “~” symbol. PWM stands for Pulse Width Modulation, which is a technique you can use to give the impression of an analog output using digital pins. I explain how PWM works in Chapter 7. The ~ symbol appears next to digital pins 3, 5, 6, 9, 10, and 11, showing that you have 6 pins that are capable of PWM.
Power pins
You use the power pins to distribute power to inputs and outputs wherever it’s needed.
Vin, which stands for voltage in, can be used to source a voltage (V) equal to the one that is supplied by the external supply jack (for example, 12V). You can also use this pin to supply power to the Arduino from another source.
GND marks the ground pins, which are essential to complete circuits. There is also a third ground by pin 13. All these pins are linked and share the same (called common) ground.
You can use 5V to supply a 5 volt power supply to components or circuits.
And finally, you can use 3.3V to supply a 3.3 volt power supply to components or circuits.
USB socket
To tell the microcontroller on the Arduino board what to do, you need to send a program to it. On the Uno, you send programs primarily by a USB connection. The large, metallic socket is a USB port for a USB A-B cable. This cable is similar to the one used on your home printer or scanner, so you may find a few around the house that can serve as handy spares. The Arduino uses the USB both for power and to transfer data. Using a USB cable is perfect for low-power applications and when data is being sent to or received from a computer.
External power jack
Next to the USB socket is another socket; this one is for power. This socket allows you to power your Arduino from an external power supply. The supply could be from an AC-to-DC adaptor (similar to those used on other consumer electronics), a battery, or even a solar panel.
The connector needed is a 2.1 mm center positive plug. Center positive simply means that the plug has an outside and an inside that fit the socket and that, in this case, the inside of the plug must be positive. You should be able to find this plug among the standard connectors that come with most power supplies; otherwise, you can buy the connector yourself and attach it to bare wires.
If you connect a power supply that is the opposite (center negative), it is known as having a “reverse polarity.” There are components on the Arduino Uno R3 to resist your attempts to send voltage the wrong way around the board, but those components can melt in the progress of saving your board, depending on how much power you are sending and how long it takes you to notice the burning smell! If you reverse the polarity when using the Vin, 5V, or 3.3V pins, you bypass this protection and almost instantly destroy several parts of your board and the ATmega 328 chip.
The recommended voltage for the Uno R3 board is 7-12V. If you supply too little power, your board might not function correctly. Or if you provide too much power you can cause your board to overheat and potentially damage it.
LEDs
The components described in this section are tiny. The Uno board has four light-emitting diodes (LEDs), labeled L, RX, TX, and ON. An LED is a component that produces light when electrical current flows through it.
LEDs come in a variety of shapes and sizes and are found in almost every modern piece of consumer electronics, from your bike lights to your TV to your washing machine. They’re almost unavoidable. They are the future, and you see a lot more of them in numerous examples throughout the book.
These four LEDs are all used to indicate activity on the board, as follows:
ON is green and signifies that your Arduino is powered.
RX and TX tell you that data is being received or transmitted by the board.
L is a very special LED that’s connected to digital pin 13. This is great for testing to see whether your board is functioning as you want.
If your Arduino is plugged in but you don’t see any lights, you should double-check that:
Your USB cable is plugged in
Your USB port is working — try another device in the port
Your cable is okay — try another cable, if possible
If none of these steps makes the LED illuminate, something is probably wrong with your Arduino. Your first destination should be the Arduino troubleshooting page at http://arduino.cc/en/Guide/troubleshooting. If you still have no luck, request a replacement Arduino from where you purchased the device.
Reset button
The Uno board also has a button next to the USB socket. This is the reset button. It resets the program on the Arduino or stops it completely when held down for a time. Connecting a wire between GND and the reset pin, which is located next to the 3.3V, achieves the same results.
The board has many other components, all of which perform important jobs, but the ones described in this section are the key ones for you to know for now.
Discovering Other Arduino Boards
The preceding section describes the standard USB Arduino board, but you should be aware that many others exist, all designed with different needs in mind. Some offer more functionality, and others are designed to be more minimal, but generally they follow a design that is similar to that of the Arduino Uno R3. For this reason, all examples in this book are based on the Uno R3 (with a brief mention of the Arduino Mega 2560 in Chapter 14). Previous revisions of the Uno should work without any changes, but if you are using an older or more specialized board, be sure to follow instructions that are specific to it. This section gives you a brief rundown of other available boards.
Official Arduino boards
Although Arduino is open source, it is also a trademarked brand, so to guarantee the quality and consistency of its products, new boards must be properly approved by the Arduino team before they are officially recognized and can bear the name Arduino. You can recognize official boards first by the name — Arduino Pro, Fio, or Lilypad, for example. Other nonofficial boards often include “Arduino compatible” or “for Arduino” in the name. The other way to recognize an official Arduino, made by the Arduino team, is by the branding (in the most recent versions): they are turquoise and display the infinity symbol somewhere on the board, along with a link to Arduino.cc. Some other companies also have their boards accepted as official boards, so you may find other company names printed on them, such as Adafruit Industries and Sparkfun.
You can find more details on the naming guidelines at http://arduino.cc/en/Main/FAQ#naming.
Because the schematics for the Arduino board are open source, there is a lot of variation in unofficial Arduino boards, which people have made for their own needs. These are usually based on the same microcontroller chips because the official Arduinos and are compatible with the Arduino software, but they require extra consideration and reading to be sure that they will work as expected. The Seeeduino (by Seeed Studio), for example, is based on the Arduino Duemilanove and is 100 percent compatible but adds various extra connections, switches, and sockets, which may be of more use to you in certain situations than an official Arduino board might be.
Official boards are the safe option for beginners to choose because the majority of Arduino examples online are based around these boards. Because of this official boards are more widely used and because of that, any errors or ‘bugs’ in the board design are likely to be remedied with the next revision or at least well documented.
Arduino Leonardo
The Leonardo is one of the newest boards in the official Arduino range. It has the same footprint (shape of circuit board), but the microcontroller used is different, giving it the benefit of being recognized as a keyboard or mouse by a computer. I provide more detail about the difference of this board to the Uno and how to use it in the bonus chapter at www.dummies.com/go/arduinofd.
Arduino Mega 2560 R3
As the name suggests, the Mega 2560 is a bigger board than the Uno. It is for people who want more: more inputs, more outputs, and more processing power! The Mega has 54 digital pins and 16 analog pins compared to the Uno’s measly 15 digital and 6 analog pins. This board is introduced further in Chapter 14.
Arduino Mega ADK
The Arduino Mega ADK is essentially the same board as the Mega 2560 but is designed to interface with Android phones. This means that you can share data between your Android mobile or tablet and an Arduino to broaden the range of either.
Arduino Nano 3.0
The Arduino Nano is a condensed Arduino that measures just 0.70" x 1.70". This size is perfect for making your project smaller. The Nano has all the power of an Arduino UNO, using the same ATmega328 microcontroller, but is a fraction of the size. It is also handily fits into a breadboard, making it ideal for prototyping as well.
Arduino Mini R5
Despite what the names suggest, the Arduino Mini is smaller than the Nano. This board also uses the same ATmega328 microcontroller chip but is condensed further, removing all header pins and the Mini-USB connector of the Nano. This board is great if space is at a premium, but it does require great care when connecting because an incorrect connection can easily destroy the board.
Arduino Ethernet
This Arduino has the same footprint as the Uno but is specifically for communicating with the Internet. Rather than access the abundant amounts of data available to you through a computer, you can tell your Arduino Ethernet to access it directly. A web browser on your computer is really just interpreting text that is telling it what to display on your screen: aligning, formatting, and displaying images, for example. If the correct commands are known, the Arduino Ethernet can access this text directly and it can be used for other purposes. A favorite purpose is accessing Twitter so that you can perhaps display Tweets on an LCD display or have a bell ring every time you’re mentioned. Some basic examples are included in the Arduino software, but beyond that, you will require a more advanced knowledge of web development to use this board.
Arduino BT
The Arduino BT allows your Arduino to talk with Bluetooth devices in the surrounding area. This is great for interfacing with mobile phones, tablets, or anything with Bluetooth!
Contributed (Approved) Arduinos
Many of the Arduino boards are now standardised and designed by the Arduino team, but some have been contributed by other companies, such as Adafruit Industries and SparkFun, over the years and are recognised as official boards. I list a few of the best ones here.
Arduino LilyPad
The Arduino LilyPad was made for projects in which technology is combined with textiles to aid in the development of e-textiles or wearable electronics projects. The LilyPad and its accompanying breakout boards (printed circuit board that make it easy to integrate various components without the need to build your own boards) can be sewn together using conductive thread instead of conventional wire. This board was designed and developed by Leah Buechley of MIT (http://web.media.mit.edu/~leah/) and SparkFun Electronics. If you're interested in e-textiles or wearable electronics, check out the excellent tutorial on Sparkfun's site to introduce the latest version of the board and the ProtoSnap kit here: http://www.sparkfun.com/tutorials/308.
Arduino Fio
The Fio (whose full name is the Arduino Funnel I/O) was designed by Shigeru Kobayashi with wireless applications in mind. It is based on the design of the LilyPad but includes a mini USB port, a lithium battery connector, and space for an XBee wireless module.
Arduino Pro
The Arduino Pro is a minimal and super skinny Arduino, by SparkFun Electronics, based on the same microcontroller as those used in the Uno R3. It comes without any of the normal headers or sockets but has all the same capabilities of an Uno. It’s ideal when height is at a short supply and also has a battery socket which allows you to easily make your project portable.
Arduino Pro Mini
