Copyright 2015 by McGraw-Hill Education. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher.
ISBN: 978-0-07-179810-5
MHID: 0-07-179810-2
The material in this eBook also appears in the print version of this title: ISBN: 978-0-07-179067-3, MHID: 0-07-179067-5.
eBook conversion by codeMantra
Version 1.0
All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps.
McGraw-Hill Education eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. To contact a representative please visit the Contact Us page at www.mhprofessional.com.
Information contained in this work has been obtained by McGraw-Hill Education from sources believed to be reliable. However, neither McGraw-Hill Education nor its authors guarantee the accuracy or completeness of any information published herein, and neither McGraw-Hill Education nor its authors shall be responsible for any errors, omissions, or damages arising out of use of this information. This work is published with the understanding that McGraw-Hill Education and its authors are supplying information but are not attempting to render engineering or other professional services. If such services are required, the assistance of an appropriate professional should be sought.
TERMS OF USE
This is a copyrighted work and McGraw-Hill Education and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill Educations prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms.
THE WORK IS PROVIDED AS IS. McGRAW-HILL EDUCATION AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill Education and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill Education nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill Education has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill Education and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise.
To my son Matthew
About the Author
Dr. Simon Monk (Preston, UK) has a degree in cybernetics and computer science and a Ph.D. in software engineering. He spent several years as an academic before he returned to industry, co-founding the mobile software company Momote Ltd. He has been an active electronics hobbyist since his early teens and is a full-time writer on hobby electronics and open-source hardware. Dr. Monk is the author of numerous electronics books, specializing in open-source hardware platforms, especially Arduino and Raspberry Pi. He is also co-author with Paul Scherz of Practical Electronics for Inventors, Third Edition.
You can follow him on Twitter, where he is @simonmonk2.
Contents
Acknowledgments
I am very grateful to my son Stephen, the musician of the family, for his help with the Sound and Music section of the book.
Introduction
T his book contains 36 Arduino projects. Some are easy to make, whereas others require some expertise with a soldering iron. You do not need a strong grounding in electronics engineering to build these projects. Although you will find some theoretical explanations, this is primarily a book that shows you in detail how to make the Arduino projects that it contains.
Some experience with a soldering iron will be helpful. The only tools you will need are screwdrivers, pliers, snips, and a soldering set.
Arduino
Arduino has become the most popular open-source hardware for building your own microcontroller projects. There are many reasons for this:
Low cost ($25 or less)
Cross-platform (you can use it with PC, Mac, or Linux)
Simple to program
Ready-made plug-in shields that add hardware such as Ethernet, liquid-crystal display (LCD) screens, and so on
Active and helpful community
Arduino Boards
Probably the two most common Arduino boards in use are the Arduino Uno and the Arduino Leonardo ().
FIGURE I-1 Arduino Uno.
FIGURE I-2 Arduino Leonardo.
There are pros and cons for each board. The Leonardo is a little cheaper and can do some tricks, such as impersonating a USB keyboard or mouse, that the Uno is not capable of. However, the Leonardo is a newer device, and there are some computability problems with older shields and libraries. However, most of the projects in this book will work with the Leonardo. In fact, a few of the projects in this book will only work with the Leonardo because they use the USB keyboard impersonation feature. Refer to the start of each project to check for compatibility or otherwise with different Arduino boards.
The Arduino Uno is a more common board. It is more expensive, but it does have a removable processor chip, which gives the advantage that should you accidentally short an output pin and destroy the processor chip, you can buy a new one for a few dollars. If you do that to a Leonardo, you will need to buy a new Leonardo.
If you get advanced in your Arduino project making, you can take a programmed processor from an Arduino Uno and build it onto a custom printed circuit board (PCB) or stripboard and then replace the processor chip with a new one for the next project. Again, this is not possible with the Leonardo.
Next page