Arduino for kids young and old

172 30 0
Arduino for kids young and old

Đ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

Copyright From legal to ISBN Arduino® for Kids Young and Old ©2014 Daniel W Milligan All content is copyright 2014, Daniel Milligan All rights reserved No part of this publication or the files that it is comprised of shall be legally produced, reproduced, or transmitted by any form or any means without the express permission of the publisher Published by Daniel Milligan 2014, all photo's and images are copyright Milligan Photography unless otherwise noted Limit of Liability and Disclaimer of Warranty: The publisher has made every effort in preparing this book to ensure that the content is accurate however the information provided herein is provided "as is" and without warranty Daniel Milligan et al makes no representation or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose and shall in no event be liable for any loss of profit or any other commercial damage, including but not limited to special, incidental, consequential, or other damages Trademarks: This book identifies product names and services known or suspected to be trademarks, registered trademarks, or service marks of their respective holders They are used throughout this book in an editorial fashion only While great care has been taken to appropriately identify these items, there is potential that some may have not been identified as such and Daniel Milligan cannot vouch for the accuracy of this information Use of a term in this book should not be regarded as affecting the validity of any trademark, registered trademark, or service mark Daniel Milligan is not associated with any product or vendor mentioned in this book other then being the primary of Milligan Photography First edition 2014 ISBN-10: 0985855630 ISBN-13: 978-0-9858556-3-5 Thanks go out to all of my friends and family, and especially my wife Sylvine for all of the support and love through the years The resources linked to at the end of this eBook were valid as of the time of the writing of this eBook and include links to various tools helpful to those getting started with open source hardware and hobby programming / engineering Introduction Getting started with Ardunio® First I am going to make some assumptions both knowingly and unknowingly I work with a lot of this technology on a regular basis and may inadvertently leave something out It's not that I don't feel it's important or needed but more that I might not think it needs explaining or requires additional detail With that, if you should have any questions please not hesitate to email me at Email Dan This book is intended for those wanting to start working with open source hardware and software in order to build their own creations using tools and components readily available While I will point you to specific links to learn more about various software and/or hardware modules, I am not going to get into too much of programming skills 101 or hardware design 101 My assumption is that you either have some knowledge in this area or are willing to go and learn it as you go I will try to cover everything in enough detail that you won't have to dig too far to get additional information however it will vary depending on the individual As the title of the book states, this book is focused on developing with the Arduino® platform While a number of the examples and overall concepts will be applicable to a number of micro-controllers, I will be focusing on the Arduino® family of modules and specifically those built around the Atmel® AVR family of devices The following are some basic terms I will be using that you should be aware of An experimental design (software/hardware) used to prove a theory or realize an idea An open source hardware/software solution used for prototyping Arduino® An add on card i.e expander board to be used in conjunction with an Shield Arduino® This may also be called a daughter board Direct Current which is what most prototyping boards utilize DC Alternating Current which is the standard current coming into a house and AC delivered to each outlet within the house * A high level programming language and environment originally designed by Java™ Sun® Computer and now owned by Oracle® C A high level programming language designed at Bell Labs[ ] An Arduino® term for describing the code to be executed on the Arduino® Sketch Universal Serial Bus - standard connection for peripherals such as mice, USB keyboards, card readers, etc Light Emitting Diode LED A software application which generates executable code from a source file Compiler such as a sketch A data type found in a sketch which can be assigned a value Variables can Variable be of different types to represent different data types such as integers, characters, and floating point numbers A value that can represent both positive and negative numbers Signed value Unsigned value A value that can only represent positive numbers A value passed into a method during program execution Parameter A value returned by a method once it has finished processing Return Value A software construct utilized in high level programming languages such as Object Java™ and C++ Baud, Baud Rate The speed at which a communication device operates at Prototype * As I am based in the United States, a typical AC current coming into each house would be in the 120V range while in Europe, the typical value would be in the 240V range [ ] While most items purchased operate via 120V's AC, in actuality they operate on a DC voltage and have transformers inside or as part of the power cord to convert from AC to DC Having the right tool is always beneficial when working on any kind of project The same is true when working with both software and hardware Before you get started you will want to make sure you have the following items: a functioning computer (Macintosh® OSX, Windows® based PC, or Linux®) an available USB host port The port should be of the type A which will look something like this: a clean area to work in and spread out a bit internet access to look up information the Java Runtime Environment which can be downloaded: here the Arduino® development environment which can be downloaded: here ** an Arduino® kit such as this one from MakerSHED *** a breadboard for prototyping circuits *** jumper wires for connecting the various parts of your circuits together and to the Arduino® A +5v power supply able to deliver Amps of current such as: 5v 2A Supply and a comfortable chair ** Electronic components are very susceptible to static electricity This means that any static electricity that builds up on yourself could damage the component, like the micro-controller, when you touch it and transfer that energy from yourself to the component In some cases, this damage cannot be detected and the component will work most of the time but not always Consider it like a crack in a bowl It may be fine most of the time however once in a while, some liquid may spill And then if it happens to be hot, you will get burned *** If you happen to purchase the Arduino® kit as specified above then there will be a breadboard and jumpers included with it The following list are some additional items which are not required however I regularly use during development a soldering iron for building circuits a solder sucker for removing the excess solder applied with the soldering iron solid strand wire in the 22 gauge (AWG) area of thickness wire strippers wire cutters small pliers a multimeter for measuring the voltage at a given point and checking continuity within a circuit Finally a list of some items that you will probably not need however knowing they exist is always good a logic analyzer for debugging protocol issues such as those that might come up when using serial peripheral interfaces (SPI) among other things an oscilloscope for debugging issues related to communication signals or Pulse Width Modulation (PWM) output Most if these items are available at your local Radio Shack , Fry's , or whichever local Shields Bringing it to 11 Shields bring new capabilities to your Arduino® platform Shields allow you to add on functionality to your base micro-controller to additional great things While most of the functionality that a shield brings can be built by yourself, having it canned and straight out of the box with the potential of working code is a definite bonus Some of the shields I have used include the Ethernet and Bluetooth® communication modules So what does a shield look like? For the most part they are very similar to what an Arduino® UNO looks like From a top down view such as above, it might even look like and Arduino® UNO The main reason for this is that most shields, if not all, are designed to be compatible with the largest number of Arduino® and clone boards that are out there Typically the shield will expose the same digital and analog pins that an Arduino® board would have available In addition to those pins it is typical to have a reset button available on the shield to allow easy access to resetting the board given that the shield will most likely cover the reset button on the main board In some cases, the standard LED's may also be present While this is really cool, you will have to be careful when using a shield as some of the pins that would normally be available to you might not be if the shield itself is using it For instance, the Ethernet shield shown above has the typical Arduino® UNO pin layout however if you look closely you will notice that pins ten (10) and four (4) are not labeled the same Because both the Ethernet chip and the SD card slot use SPI for communications, these two pins are utilized by the default sketches to use these two pins as chip selects You will still have access to the pins however you will want to ensure that you don't use them as it might interfere with the operation of the Ethernet module or the SD card Beyond this it is as simple as including the proper libraries in your sketch, attaching the shield, and start programming One thing to note is that the shield should never be installed or removed while there is power applied to the main board or the shield Even if it is just connected to the computer via an USB cable The installation or removal of the shield could damage the main board or the shield itself if power is currently active on either one Ethernet The Ethernet Shield is designed to allow easy connectivity to your local network for communication purposes This brings up a number of possibilities such as remote monitoring, remote control, data collection, etc This shield also includes a micro SD card slot for data storage which can also be beneficial for offline storage of data which can be uploaded later on once an internet connection is made One of the main uses for this shield is to be able to communicate with the Arduino® over your local network and not require an LCD or other means to observer what is happening with the controller It is also possible to reprogram you controller over the network connection which can be useful when the controller is installed in a location that isn't readily accessible Bluetooth® The Bluetooth® shield brings wireless technology to your micro-controller This allows communication with your PC or other device which supports the Bluetooth® serial port profile (SPP) The shield I have used is the following: BT Shield which only supports the serial profile Other modules such as the Maker Shed BLE Shield supports Bluetooth® LE and may support other profiles such as the advanced audio distribution profile (A2DP) or hands free profile (HFP) My experience so far has been limited to the one shield using the serial profile for communications to control a motor connected to my Arduino® in addition to the OBDII connecter we looked at previously in the Communications chapter The possibilities are quite extensive such as controlling a robot using your smartphone or other Bluetooth® enabled device General In addition to pre-built shields, there are many kits on the market from a variety of sources which allow you to build your own shields to interface with whatever you have lying around These prototyping shields are a great way to quickly build up a circuit to interface with external devices and prove out a design before developing a PCB and ordering populated boards Most of the prototyping shields I have used come with a number of components to get the basics in place such as the pin InSystem Programming, ISP, header and the stacking headers so additional shields can be placed above the prototyping shield or below it as needed Summary In general, if there is a task you need to accomplish, there is probably a shield out there ready to go to it From communications, to motor controls, to sensor reading, there are shields that will accomplish what you need When that doesn't work, the prototyping kits that are available are a nice and easy way to build up an interface circuit to try out your idea before developing a PCB In addition to the shields that are out there, most of them come with sample code that you can use in your own projects as is or as a starting point for something bigger and better The possibilities are really endless Sketches setup and loop The sketches that have been utilized in this book are available for download from my website For each sketch, I have provided the chapter from which it came and a link to where you can download it from Sketch Chapter Location Skeleton Sketch Arduino Platform Download Temperature Reading (LM335) Input Download Temperature Comparison (LM335) Input Download Temperature Trigger (LM335) Program Interrupted Download Rotary Encoder Program Interrupted Download Fan Tachometer Program Interrupted Download PWM Output - LEDs Output Download PWM Output - Fans Output Download PWM Output - Servo's Output Download Power On LED Output Download Power Indicator I/O Expansion Download Bluetooth Serial Communications Communications Download SPI Communications Communications Download I2C Communications Communications Download References Additional information The following is a table of references found throughout the book Number Title Description Link Bell Labs Describes what Bell Labs is and its Here history AC/DC Power Background history of why 120V's Here was chosen for the United States Creative Commons License Attribution-ShareAlike 3.0 Here Arduino® Main site for the Arduino® platform Here C/C++ Comments Comment rules Here Serial Ports Information regarding standard serial port communications Here LM335 Temperature Sensor Device data sheet Here NTE7225 Temperature Sensor Device data sheet Here LM311 Voltage Comparator Device data sheet Here 10 NTE943M Voltage Comparator Device data sheet Here 11 SN74LS595 Shift Register Device Data Sheet Here 12 Segment Display Device Data Sheet Here 13 AVR Downloader/UploaDEr Open source AVR device programmer Here 14 Base 16 Definition Here 15 EEPROM Definition Here 16 Seeed Studio Bluetooth® Shield Device Information Here 17 Generic OBDII Adapter Device Information Here 18 Microchip 10K SPI Digital Potentiometer (MCP4261) Device Information Here 19 20 SH1106 LCD Controller Chip Device Information SH1106 LCD Arduino® Library Code library Here Here Here Vendors On-line Merchants The following is a table of on-line merchants with whom I have dealt successfully with Vendor Description Link Adafruit Industries Various prototyping tools and components Here Sparkfun Electronics Various prototyping tools and components Here Mouser Electronics Numerous components and tools Here Newark Numerous components and tools Here OshPark PCB manufacturing that is economical Do note that the turn Here around time can vary depending on project size Amazon Various third party vendors with economical parts Here eBay™ Various third party vendors with economical parts Here Sain Smart Various prototyping parts and tools Here Seeed Studio Various prototyping parts and tools Here D W Milligan From Programming to Photography Born and raised in Maine, the author grew up in the great outdoors The winter’s were long and the summer’s were brief however there was usually time for a good day of fishing The author currently lives outside of Charlottesville, VA with his wife and children He is a Software Architect with a keen interest in landscape photography and computers Equipment used in this book is as follows: Macintosh Macbook Pro, iPad 3rd generation for previewing, coffee and other caffeinated drinks as required Photo credit - Colin Conrad 10 11 12 13 14 15 Copyright Introduction Setup Arduino Platform Input Output Interrupts Storage Communications I/O Expansion Shields Sketches Reference Vendors About ... regularly use during development a soldering iron for building circuits a solder sucker for removing the excess solder applied with the soldering iron solid strand wire in the 22 gauge (AWG) area...Copyright From legal to ISBN Arduino for Kids Young and Old ©2014 Daniel W Milligan All content is copyright 2014, Daniel Milligan All rights... Macintosh OSX® platform than it will unzip the package for you If you are on a Windows® platform than the Explorer application will be able to unzip it for you For the Linux® platform, when you download

Ngày đăng: 16/12/2019, 15:39

Từ khóa liên quan

Mục lục

  • Copyright

  • Introduction

  • Setup

  • Arduino Platform

  • Inputs

  • Output

  • Interrupts

  • Communications

  • Storage

  • I/O Expansion

  • Shields

  • Sketches

  • Reference

  • Vendors

  • About

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan