Arduino Workshop: A hands-on introduction with 65 projects
John Boxall
Published by No Starch Press
For the two people who have always believed in me: my mother and my dearest Kathleen
Acknowledgments
First of all, a huge thank you to the Arduino team: Massimo Banzi, David Cuartielles, Tom Igoe, Gianluca Martino, and David Mellis. Without your vision, thought, and hard work, none of this would have been possible.
Many thanks to my technical reviewer Marc Alexander for his contributions, expertise, suggestions, support, thoughts, and long conversations, and for having the tenacity to follow through with such a large project.
I also want to thank the following organizations for their images and encouragement: adafruit industries, Agilent Technologies, Gravitech, Freetronics, Oomlout, Seeed Studio, Sharp Corporation, and SparkFun. Furthermore, a big thanks to Freetronics for the use of their excellent hardware products. And thank you to all those who have contributed their time making Arduino libraries, which makes life much easier for everyone.
Kudos and thanks to the Fritzing team for their wonderful open source circuit schematic design tool, which Ive used throughout this book.
And a thank you to the following people (in no particular order) from whom Ive received encouragement, inspiration and support: Iraphne Childs, Limor Fried, Jonathan Oxer, Philip Lindsay, Nicole Kilah, Ken Shirriff, Nathan Kennedy, David Jones, and Nathan Seidle.
Finally, thank you to everyone at No Starch Press, including Sondra Silverhawk for suggesting the book; Serena Yang for her dedicated editing, endless patience, and suggestions; and Bill Pollock for his support and guidance and for convincing me that sometimes there is a better way to explain something.
Chapter 1. Getting Started
Have you ever looked at some gadget and wondered how it really worked? Maybe it was a remote control boat, the system that controls an elevator, a vending machine, or an electronic toy? Or have you wanted to create your own robot or electronic signals for a model railroad, or perhaps youd like to capture and analyze weather data over time? Where and how do you start?
The Arduino board (shown in ) can help you find some of the answers to the mysteries of electronics in a hands-on way. The original creation of Massimo Banzi and David Cuartielles, the Arduino system offers an inexpensive way to build interactive projects, such as remote-controlled robots, GPS tracking systems, and electronic games.
The Arduino project has grown exponentially since its introduction in 2005. Its now a thriving industry, supported by a community of people united with the common bond of creating something new. Youll find both individuals and groups, ranging from interest groups and clubs to local hackerspaces and educational institutions, all interested in toying with the Arduino.
Figure 1-1. The Arduino board
To get a sense of the variety of Arduino projects in the wild, you can simply search the Internet. Youll find a list of groups offering introductory programs and courses with like-minded, creative people.
The Possibilities Are Endless
A quick scan through this book will show you that you can use the Arduino to do something as simple as blinking a small light, or even something more complicated, such as interacting with a cellular phoneand many different things in between.
For example, have a look at Philip Lindsays device, shown in . It can receive text messages from cellular phones and display them on a large sign for use in dance halls. This device uses an Arduino board and a cellular phone shield to receive text messages from other phones (similar to Project 65). The text message is sent to a pair of large, inexpensive dotmatrix displays for everyone to see.
Figure 1-2. SMS (short message service) text marquee
You can purchase large display boards that are easy to interface with an Arduino, so you dont have to make your own display from scratch. (For more information, visit http://www.labradoc.com/i/follower/p/project-sms-text-scroller .)
How about creating a unique marriage proposal? Tyler Cooper wanted an original way to propose to his girlfriend, so he built what he calls a reverse geocache boxa small box that contained an engagement ring, as shown in .)
Figure 1-3. Marriage proposal via Arduino
Heres another example. Kurt Schulz was interested in monitoring the battery charge level of his moped. However, after realizing how simple it is to work with Arduino, his project morphed into what he calls the Scooterputer: a complete moped management system. The Scooterputer can measure the battery voltage, plus it can display the speed, distance traveled, tilt angle, temperature, time, date, GPS position, and more. It also contains a cellular phone shield that can be controlled remotely, allowing remote tracking of the moped and engine shutdown in case its stolen. The entire system can be controlled with a small touchscreen, shown in .)
Figure 1-4. The Scooterputer display (courtesy of Kurt Schulz)
Then theres John Sarik, who enjoys the popular Sudoku math puzzles; he also likes working with Nixie numeric display tubes. With those two drivers in mind, John created a huge 81-digit Sudoku game computer! The user can play a full 9-by-9 game, with the Arduino in control of the digits and checking for valid entries. Although this project might be considered a more advanced type, it is certainly achievable and the electronics are not complex. The device is quite large and looks great mounted on a wall, as shown in .)
The team at Oomlout even used the Arduino to create a TwypeWriter. They fitted an Arduino board with an Ethernet shield interface connected to the Internet, which searches Twitter for particular keywords. When a keyword is found, the tweet is sent to an electric typewriter for printing. The Arduino board is connected to the typewriters keyboard circuit, which allows it to emulate a real person typing, as shown in .)
These are only a few random examples of what is possible using an Arduino. You can create your own projects without much difficultyand after youve worked through this book, they are certainly not out of your reach.
Figure 1-5. Nixie tube Sudoku
Figure 1-6. The TwypeWriter
Strength in Numbers
The Arduino platform increases in popularity every day. If youre more of a social learner and enjoy class-oriented situations, search the Web for Cult of Arduino to see what people are making and to find Arduino-related groups. Members of Arduino groups introduce the world of Arduino from an artists perspective. Many group members work to create a small Arduino-compatible board at the same time. These groups can be a lot of fun, introduce you to interesting people, and let you share your Arduino knowledge with others.