1. Trang chủ
  2. » Công Nghệ Thông Tin

practical arduino

445 3,2K 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 445
Dung lượng 9,67 MB

Nội dung

T his book was written to demonstrate a variety of Arduino techniques in a practical context, giving you an opportunity to learn how the theory and reference material already available online applies to real-world projects. If you’ve come as far as picking up a whole book about Arduino, you’re ready for something more substantial than assembly instructions. You don’t want a simple series of steps to follow: you want to understand not just how to assemble something, but why it was designed that way in the first place. That’s what this book will give you: you won’t just be a color-by-numbers painter; you’ll learn to be a true hardware craftsman and artist, able to conceptualize, design, and assemble your own creations. We want you to take these projects as inspiration and examples of applying a variety of handy techniques and then adapt them to suit your own requirements, coming up with inspiration and new ideas that put ours to shame. And we hope that you’ll then share your creations with us and with the world, inspiring others in turn. By following through the projects in this book, you will gain a number of insights into the flexibility of Arduino as a platform for taking software and hardware and linking them to the physical world around us. Jonathan Oxer Hugh Blemings Practical Arduino Cool Projects for Open Source Hardware Oxer Blemings TECHNOLOGY IN ACTION ™ this print for content only—size & color not accurate trim size = 7.5" x 9.25" spine = 0.859" 448 page count CYAN MAGENTA YELLOW BLACK PANTONE 123 C Practical Arduino www.apress.com US $39.99 Shelve in Hardware User level: Beginning–Advanced ISBN 978-1-4302-2477-8 9 781430 224778 5 3 9 9 9 Practical Arduino Cool Projects for Open Source Hardware SOURCE CODE ONLINE LEARN IN-DEPTH ARDUINO TECHNIQUES USING REAL-WORLD PROJECTS Also available: www.it-ebooks.info www.it-ebooks.info Practical Arduino Cool Projects for Open Source Hardware    Jonathan Oxer Hugh Blemings www.it-ebooks.info Practical Arduino: Cool Projects for Open Source Hardware Copyright © 2009 by Jonath an Oxer and Hugh Blemings All rights reserved. No part of this work may be r eproduced 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-13 (pbk): 978-1-4302-2477-8 ISBN-13 (electronic): 978-1-4302-2478-5 Printed and bound in the United Sta tes of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Cover picture of Arduino Duemilanove used with permission of SparkFun Electronics. President and Publisher: Paul Manning Lead Editor: Michelle Lowman Technical Reviewers: Nathan Seidle, Andy Gelme, Thomas Sprinkmeier, Trent Lloyd, Scott Penros e, Marc Alexander, Philip Lindsay Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gen nick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Coordinating Editor: Jim Markham Copy Editor: Vanessa Moore Compositor: Bytheway Publishing Services Indexer: Julie Grady Artist: April Milne Cover Designer: Kurt Krames Distributed to the book tra de worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer- sbm.com, or visit http://www.springeronline.com. For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600, Berk eley, CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail info@a press.com, or visit http://www.apress.com. Apress and friends of ED books may be purchased in b ulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at http://www.apress.com/info/bulksales. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress 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 this work. The source code for this book is available to readers at htt p://www.apress.com. www.it-ebooks.info For everyone who looks at the everyday objects around them and sees the potential of what they could become. ii www.it-ebooks.info Contents at a Glance  Contents at a Glance iv  Contents v  About the Authors xvi  About the Technical Reviewers xvii  Acknowledgments xix  Introduction xx  Chapter 1: Introduction 1  Chapter 2: Appliance Remote Control 17  Chapter 3: Time-Lapse Camera Controller 37  Chapter 4: Virtual USB Keyboard 51  Chapter 5: PS/2 Keyboard or Mouse Input 63  Chapter 6: Security/Automation Sensors 81  Chapter 7: Online Thermometer 101  Chapter 8: Touch Control Panel 121  Chapter 9: Speech Synthesizer 139  Chapter 10: Water Flow Gauge 163  Chapter 11: Oscilloscope/Logic Analyzer 185  Chapter 12: Water Tank Depth Sensor 209  Chapter 13: Weather Station Receiver 239  Chapter 14: RFID Access Control System 269  Chapter 15: Vehicle Telemetry Platform 295  Chapter 16: Resources 383  Index 405 iv www.it-ebooks.info Contents  Contents at a Glance iv  Contents v  About the Authors xvi  About the Technical Reviewers xvii  Acknowledgments xix  Introduction xx  Chapter 1: Introduction 1 Fundamentals 1 Sharing Your Work 1 Practical Electronics for Software Developers 1 Current, Voltage, and Power 2 Mains Is Nasty 2 Reading Schematics 3 Resistance and Resistors 6 Ohm’s Law and Current Limiting 7 Choosing Wire 8 Diodes 8 Power Supplies 9 USB Power 9 Batteries 10 Wall Warts/Plugpacks 11 v www.it-ebooks.info  CONTENTS Capacitance and Capacitors 11 Fundamentals 11 Capacitor Types 12 Power Supply Bypass 13 ESD Precautions 13 Tools 13 Parts 14 Further Reading 15  Chapter 2: Appliance Remote Control 17 Parts Required 17 Instructions 19 Test and Investigate Appliance Remote 19 Assemble Reed Relay Shield 21 Connect Reed Relay Shield to Remote Control 25 Create Reed Relay Control Program 27 ApplianceRemoteControl 27 ApplianceRemoteControlCompact 30 Test Reed Relay Shield and Sketch 32 Variations 34 Wireless Link 34 Automatic Trigger 34 Socket Connections 35  Chapter 3: Time-Lapse Camera Controller 37 Parts Required 37 Instructions 39 Assemble Prototyping Shield 39 Connect Camera Shutter Release 39 Remote Shutter Release Connector 40 vi www.it-ebooks.info  CONTENTS Infrared Remote Control 42 Modify Camera 43 Configure Camera 44 Calculate Photo Interval 44 Configure and Load Sketch 44 Check Memory Capacity 48 Set Up Your Shoot 48 Process the Images 48 Linux 48 Windows 48 Macintosh 49 Variations 49  Chapter 4: Virtual USB Keyboard 51 Parts Required 51 Instructions 53 Populate Prototyping Shield 53 Prepare the UsbKeyboard Library 56 Compile and Upload Sketch 57 Variations 61 Chording Keyboard 61  Chapter 5: PS/2 Keyboard or Mouse Input 63 Parts Required 63 Instructions 64 PS/2 Connections 65 Recycled 6-Pin Mini-DIN Sockets 66 6-Pin Mini-DIN Panel Sockets 67 PS/2 Extension Cable 69 Keyboard Software 73 vii www.it-ebooks.info  CONTENTS Mouse Software 76 Variations 79 Barcode Reader for a Stock Control System 79 Resources 80  Chapter 6: Security/Automation Sensors 81 Parts Required 82 Instructions 84 Security Sensor Basics 84 Assemble Four-Channel Alarm Sensor Shield 87 Install End-of-Line Resistors on Sensor 92 Load Test Program 95 PIR Placement 98 Variations 98 Visual Display Written in Processing 98 Home Security System 99 Multiple Buttons on One Input 99  Chapter 7: Online Thermometer 101 Parts Required 101 Instructions 103 Mount PCB Plugs on Shield 103 Connect Data Lines 105 Assemble Sensors 106 Load Program 108 Variations 119  Chapter 8: Touch Control Panel 121 Parts Required 122 Instructions 123 How Resistive Touch Screens Work 123 viii www.it-ebooks.info [...]... as you progress to designing and debugging your own projects Thus we have consciously left material out of Practical Arduino We do not, for example, cover how to set up basic software tools such as the Arduino IDE This is for two reasons—firstly because it is described very well on the http:/ /arduino. cc web site itself, and secondly because anything that we provide in written form here will be out... For that reason, wherever possible we’ve licensed Practical Arduino code under the GNU General Public License (GPL) Similarly for hardware details, even if it’s a simple schematic on a web page, it never hurts to be explicit about if/how it can be reused Practical Electronics for Software Developers One of the beauties of designing projects around Arduino is that much of the low-level electronic detail... background information that the projects require, but it could save your life! Sharing Your Work One of the key aspects of the success of Arduino has been the community that has sprung up around it due to the open nature of the Arduino software and hardware The software used on Arduino is entirely open source and the hardware design information (schematics, PCB layouts, etc.) have been made available under... phone calls helped me understand far more about Arduino Thanks also go out to the technical reviewers who provided us the benefit of their expertise and years of experience: Andy Gelme, Marc Alexander, Nathan Seidle, Trent Lloyd, Scott Penrose, Thomas Sprinkmeier, and Philip Lindsay Of course, thanks go to the core Arduino team whose vision conjured the whole Arduino ecosystem into existence: Massimo Banzi,... way of second chances • Don’t be discouraged If you’re just using regular low-voltage Arduino applications, it’s pretty hard to hurt yourself! Reading Schematics A schematic or circuit diagram is a diagram that describes the interconnections in an electrical or electronic device In the projects presented in Practical Arduino, we’ve taken the approach of providing both a photograph and/or line drawing... powering your Arduino project Low-power Arduino projects can be powered from either the host PCs USB port or batteries Projects that make use of devices with higher power demands—solenoids, servos, motors, lots of LEDs and the like—are best powered off a mainspowered supply (transformer or plugpack/wallwart) or larger capacity battery This section discusses some of the options available to the Arduino experimenter... yield some ready-made packs that have built-in charge/discharge controllers We provide links to some examples on the Practical Arduino web site Wall Warts/Plugpacks Wall warts (or plugpacks as they tend to be called in Australia) are an ideal way of powering all but the most power-hungry Arduino projects Most plugpacks output a DC voltage, and this voltage can be regulated or unregulated (more on this... 1 INTRODUCTION There are many different capacitor chemistries/construction methods Wherever we make use of capacitors in Practical Arduino projects, we’ll call out what types are suitable Power Supply Bypass Cutting a rather long and complex story short, digital circuits like the Arduino have quite low constant current requirements, but relatively higher peak or transient current when internal circuits...CONTENTS Basic Touch Screen Connection Test 126 Arduino TouchScreen Library 128 Controlling a “Processing” Program 128 Construct Hardware for Home Automation Control Panel 131 Calibrate Hot Zones 134 Mount Arduino 137 Chapter 9: Speech Synthesizer 139 Parts Required ... means it is easy to adapt both the software and the hardware to your needs, and then contribute what you do back into the Arduino project as a whole The authors are unashamed proponents of this model and would encourage you to consider making your own work available back to the Arduino community in a similar way For software source code, please provide explicit copyright and/or licensing information . BLACK PANTONE 123 C Practical Arduino www.apress.com US $39.99 Shelve in Hardware User level: Beginning–Advanced ISBN 978-1-4302-2477-8 9 781430 224778 5 3 9 9 9 Practical Arduino Cool Projects. into the flexibility of Arduino as a platform for taking software and hardware and linking them to the physical world around us. Jonathan Oxer Hugh Blemings Practical Arduino Cool Projects for. Hardware SOURCE CODE ONLINE LEARN IN-DEPTH ARDUINO TECHNIQUES USING REAL-WORLD PROJECTS Also available: www.it-ebooks.info www.it-ebooks.info Practical Arduino Cool Projects for Open Source

Ngày đăng: 05/05/2014, 15:57

Xem thêm

TỪ KHÓA LIÊN QUAN