ebook img

arduino experimentation kit Experimenter’s Kit for Arduino PDF

36 Pages·2012·2.08 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview arduino experimentation kit Experimenter’s Kit for Arduino

ARDX arduino experimentation kit Experimenter’s Kit for Arduino A R D X Open-Source Arduino Instruction Guide Document Revision: May 11, 2012 A Few Words ABOUT THIS KIT The overall goal of this kit is fun. Beyond this, the aim is to get you comfortable using a wide range of electronic components through small, simple and easy circuits. The focus is to get each circuit working then giving you the tools to figure out why. If you encounter any problems, want to ask a question, or would like to know more about any part, extra help is only an e-mail away [email protected]. ABOUT OPEN SOURCE HARDWARE All of .:oomlout:.'s projects are open source. What does this mean? It means everything involved in making this kit, be it this guide, 3D models, or code is available for free download. But it goes further, you're also free to reproduce and modify any of this material, then distribute it for yourself. The catch? Quite simple, it is released under a Creative Commons (By - Share Alike) license. This means you must credit .:oomlout:. in your design and share your developments in a similar manner. Why? We grew up learning and playing with open source software and the experience was good fun, we think it would be lovely if a similar experience was possible with physical things. More details on the Creative Commons CC (By - Share Alike) License can be found at http://ardx.org/CCLI ABOUT .: OOMLOUT :. We’re a plucky little design company focusing on producing “delightfully fun open source products” To check out what we are up to http://www.oomlout.com ABOUT SOLARBOTICS We started out doing BEAM robot kits over 15 years ago (really!), and now we also supply clever electronic bits & kits http://www.solarbotics.com/ ABOUT PROBLEMS We strive to deliver the highest level of quality in each and every thing we produce. If you ever find an ambiguous instruction, a missing piece, or would just like to ask a question, we’ll try our best to help out. [email protected] / [email protected] (we like hearing about problems it helps us improve future versions) Thanks For Choosing .:oomlout:. (and Solarbotics) TBCN .: WHERE TO FIND EVERYTHING :. table of contents Before We Start {ASEM} Assembling the Pieces 02 {INST} Installing the Software 03 {PROG} A Small Programming Primer 04 {ELEC} A Small Electronics Primer 06 The Circuits {CIRC01} Getting Started - (Blinking LED) 08 {CIRC02} 8 LED Fun - (Multiple LEDs) 10 {CIRC03} Spin Motor Spin - (Transistor and Motor) 12 {CIRC04} A Single Servo - (Servos) 14 {CIRC05} 8 More LEDs - (74HC595 Shift Register) 16 {CIRC06} Music - (Piezo Elements) 18 {CIRC07} Button Pressing - (Pushbuttons) 20 {CIRC08} Twisting - (Potentiometers) 22 {CIRC09} Light - (Photo Resistors) 24 {CIRC10} Temperature - (TMP36 Temperature Sensor) 26 {CIRC11} Larger Loads - (Relays) 28 {CIRC12} Colorful Lights - (RGB LEDs) 30 01 01 ASEM .: PUTTING IT TOGETHER :. assembling the pieces Arduino Holder Breadboard Arduino x1 x1 x1 #4 x 1/16” 4-40 x 3/8” bolt 4-40 nut Spacer x3 x3 x3 Use at least 2 bolt / spacer / nut assemblies to secure the Arduino .: For an introduction to what an Arduino is, visit :. 02 .: http://ardx.org/INTR :. .: INSTALLING THE IDE :. 0022 IINNSSTT This is the program used to write code for the Arduino. It may iinnssttaalllliinngg seem a little daunting at first but once you have it installed and ((ssooffttwwaarree aanndd hhaarrddwwaarree)) start playing around, its secrets will reveal themselves. Step 1: Download the software Go to http://arduino.cc/en/Main/Software download the software for your operating system Windows XP Mac OSX Step 2: Unzip the Software Step 2: Open The .dmg Unzip Open (mount) arduino-00-win.zip (- version #) arduino-00-mac.dmg (- version #) Recommended Path c:\Program Files\ Step 3: Shortcut Icon Step 3: Copy The Application Open c:\program files\arduino-00\ (- version #) Go to Right Click "Arduino" (in the devices section of finder) Arduino.exe (send to>Desktop (create shortcut)) Move "Arduino" Application to the "Applications" folder Step 4: Plug In Your Arduino Plug your Arduino in: Using the included USB cable, plug your Arduino board into a free USB port. Wait for a box to pop up Step 4: Install Drivers .:Duemilanove Boards Only:. Step 5: Add new Hardware Go to "Arduino" device Skip searching the internet Double Click & Install (click the next box when prompted to do so) FTDI Drivers for Intel Macs (__).pkg Install from a specific location (click “Install from a list or specific location (Advanced)") (FTDI Drivers for PPC Macs (__).pkg Choose the Location Restart Duemilanove Board c:\program files\arduino-00\drivers\FTDI USB Drivers\ Uno Board c:\program files\arduino-00\drivers\ Finished Step 5: Plug In Your Arduino Vista, Seven Plug your Arduino in: Step 5: Add new Hardware Using the included USB cable, plug your Arduino board into a free USB port. Run Device Manager Finished Start > Run > devmgmt.msc Choose the Arduino Other Devices > Arduino Uno (Uno) .: NOTE: :. Update Driver .: Encountering problems? :. click “Update Driver” .: Would like more details? Using Linux? :. Select Driver .: http://ardx.org/LINU :. click “Browse My Computer for Driver Software” c:\program files\arduino-00\drivers\ Finished 03 03 PROG .: A Small Programming Primer:. programming primer ARDUINO PROGRAMMING IN BRIEF The Arduino is programmed in the C language. This is a quick little primer targeted at people who have a little bit of programing experience and just need a briefing on the idiosyncracies of C and the Arduino IDE. If you find the concepts a bit daunting, don't worry, you can start going through the circuits and pick up most of it along the way. For a more in-depth intro, the Arduino.cc website is a great resource. STRUCTURE Each Arduino program void setup(){ } void loop(){ } (often called a sketch) has All the code between the two This function is run after setup two required functions curly brackets will be run once has finished. After it has run when your Arduino program once it will be run again, and (also called routines). first runs. again, until power is removed. SYNTAX One of the slightly // (single line comment) /* */(multi line comment) frustrating elements of C is It is often useful to write notes If you have a lot to say you can its formatting requirements to yourself as you go along span several lines as a (this also makes it very about what each line of code comment. Everything between powerful). If you remember does. To do this type two these two symbols will be forward slashes and everything ignored in your program. the following you should be until the end of the line will be alright. ignored by your program. ; (semicolon) Each line of code must be { } (curly brackets) ended with a semicolon (a Used to define when a block missing semicolon is often of code starts and ends (used the reason for a program in functions as well as loops). refusing to compile). VARIABLES int (integer) long (long) A program is nothing more The main workhorse, stores a Used when an integer is not than instructions to move number in 2 bytes (16 bits). large enough. Takes 4 bytes (32 numbers around in an Has no decimal places and will bits) of RAM and has a range intelligent way. Variables are store a value between -32,768 between -2,147,483,648 and used to do the moving. and 32,767. 2,147,483,647. boolean (boolean) float (float) char (character) A simple True or False Used for floating point math Stores one character using the variable. Useful (decimals). Takes 4 bytes (32 ASCII code (ie 'A' = 65). Uses because it only bits) of RAM and has a range one byte (8 bits) of RAM. The Arduino handles strings as an uses one bit of between -3.4028235E+38 array of char’s. RAM. and 3.4028235E+38. 04 03 PROG .:For a full programming reference visit:. http://ardx.org/PROG programming primer MATHS OPERATORS = (assignment) makes something equal to something else (eg. x Operators used for = 10 * 2 (x now equals 20)) manipulating numbers. % (modulo) gives the remainder when one number is divided by (they work like simple another (ex. 12 % 10 (gives 2)) + (addition) maths). - (subtraction) * (multiplication) / (division) COMPARISON OPERATORS Operators used for == (equal to) (eg. 12 == 10 is FALSE or 12 == 12 is TRUE) logical comparison. != (not equal to) (eg. 12 != 10 is TRUE or 12 != 12 is FALSE) < (less than) (eg. 12 < 10 is FALSE or 12 < 12 is FALSE or 12 < 14 is TRUE) > (greater than) (eg. 12 > 10 is TRUE or 12 > 12 is FALSE or 12 > 14 is FALSE) CONTROL STRUCTURE if(condition){ } for(int i = 0; i < Programs are reliant on else if( condition ){ } #repeats; i++){ } else { } controlling what runs Used when you would like to This will execute the code between next, here are the basic repeat a chunk of code a number the curly brackets if the condition of times (can count up i++ or control elements (there is true, and if not it will test the down i-- or use any variable) are many more online). else if condition if that is also false the else code will execute. DIGITAL pinMode(pin, mode); digitalWrite(pin, value); int digitalRead(pin); Used to set a pin's mode, pin Once a pin is set as an OUTPUT, Once a pin is set as an INPUT is the pin number you would it can be set either HIGH (pulled you can use this to return like to address 0-19 (analog 0- to +5 volts) or LOW (pulled to whether it is HIGH (pulled to 5 are 14-19). The mode can ground). +5 volts) or LOW (pulled to ground). either be INPUT or OUTPUT. ANALOG int analogWrite(pin, int analogRead(pin); The Arduino is a digital value); machine but it has the ability Some of the Arduino's pins support When the analog input pins are set to operate in the analog pulse width modulation (3, 5, 6, 9, 10, to input you can read their voltage. 11). This turns the pin on and off very A value between 0 (for 0 realm (through tricks). quickly making it act like an analog volts) and 1024 (for Here's how to deal with output. The value is any number 5 volts) will be things that aren't digital. between 0 (0% duty cycle ~0v) and returned. 255 (100% duty cycle ~5 volts). 05 04 ELEC .: A Small Electronics Primer:. electronics primer ELECTRONICS IN BRIEF No previous electronic experience is required to have fun with this kit. Here are a few details about each component to make identifying, and perhaps understanding them, a bit easier. If at any point you are worried about how a component is used or why it's not working the internet offers a treasure trove of advice, or we can be contacted at [email protected] COMPONENT DETAILS LED What it Does: No. of Leads: (Light Emitting Diode) Emits light when a small current is 2 (one longer, this one connects to positive) passed through it. (only in one direction) Things to watch out for: Identifying: - Will only work in one direction Looks like a mini light bulb. - Requires a current limiting resistor More Details: http://ardx.org/LED Diode What it Does: No. of Leads: The electronic equivalent of a one way 2 valve. Allowing current to flow in one Things to watch out for: direction but not the other. - Will only work in one direction (current will Identifying: flow if end with the line is connected to ground) More Details: Usually a cylinder with wires extending from http://ardx.org/DIOD either end. (and an off center line indicating polarity) Resistors What it Does: No. of Leads: Restricts the amount of current that can 2 flow through a circuit. Things to watch out for: Identifying: - Easy to grab the wrong value (double Cylinder with wires extending from either check the colors before using) end. The value is displayed using a color More Details: coding system (for details see next page) http://ardx.org/RESI Transistor What it Does: No. of Leads: Uses a small current to switch or amplify a 3 (Base, Collector, Emitter) much larger current. Things to watch out for: Identifying: - Plugging in the right way round (also a Comes in many different packages but you current limiting resistor is often needed on the base pin) More Details: can read the part number off the package. http://ardx.org/TRAN (P2N2222AG in this kit and find a datasheet online) Hobby Servo What it Does: No. of Leads: Takes a timed pulse and converts it into 3 an angular position of the output shaft. Things to watch out for: Identifying: - The plug is not polarized so make sure A plastic box with 3 wires coming out one it is plugged in the right way. side and a shaft with a plastic horn out More Details: the top. http://ardx.org/SERV DC Motor What it Does: No. of Leads: Spins when a current is passed through it. 2 Identifying: Things to watch out for: This one is easy, it looks like a motor. - Using a transistor or relay that is rated Usually a cylinder with a shaft coming out for the size of motor you're using. of one end. More Details: http://ardx.org/MOTO 06 04 ELEC electronics COMPONENT DETAILS (CONT.) primer Piezo Element What it Does: A pulse of current will cause it to click. A No. of Leads: stream of pulses will cause it to emit a 2 tone. Things to watch out for: Identifying: - Difficult to misuse. In this kit it comes in a little black barrel, More Details: but sometimes they are just a gold disc. http://ardx.org/PIEZ IC (Integrated Circuit) What it Does: No. of Leads: Packages any range of complicated 2 - 100s (in this kit there is one with 3 (TMP36) and electronics inside an easy to use package. one with 16 (74HC595) Identifying: Things to watch out for: The part ID is written on the outside of the - Proper orientation. (look for marks showing pin 1) package. (this sometimes requires a lot of More Details: light or a magnifying glass to read). http://ardx.org/ICIC Pushbutton What it Does: No. of Leads: Completes a circuit when it is pressed. 4 Identifying: Things to watch out for: A little square with leads out the bottom - these are almost square so can be and a button on the top. inserted 90 degrees off angle. More Details: http://ardx.org/BUTT Potentiometer What it Does: No. of Leads: Produces a variable resistance dependant 3 on the angular position of the shaft. Things to watch out for: Identifying: - Accidentally buying logarithmic scale. They can be packaged in many different More Details: form factors, look for a dial to identify. http://ardx.org/POTE Photo Resistor What it Does: No. of Leads: Produces a variable resistance dependant 2 on the amount of incident light. Things to watch out for: Identifying: - Remember it needs to be in a voltage Usually a little disk with a clear top and a divider before it provides a useful input. curvy line underneath. More Details: http://ardx.org/PHOT RESISTOR COLOR CODE first digit LEAD CLIPPING second digit Examples: Some components in this kit come with very long wire green-blue-brown - 560 ohms # of zeros leads. To make them more compatible with a breadboard red-red-red - 2 200 ohms (2.2k) tolerance a couple of changes are required. brown-black-orange - 10 000 ohms (10k) LEDs: Clip the leads so the long lead is ~10mm (3/8”) long and the short one is ~7mm (9/32”). Resistors: Bend the leads down so they are 90 degrees to the 0 - Black 5 - Green 20% - none cylinder. Then snip them so they are ~6mm 1 - Brown 6 - Blue 10% - silver (1/4”) long. Other Components: 2 - Red 7 - Purple 5% - gold Other components may need clipping. 3 - Orange 8 - Grey Use your discretion when doing so. 4 - Yellow 9 - White 07 .:Getting Started:. CIRC-01 .:(Blinking LED):. WHAT WE’RE DOING: LEDs (light emitting diodes) are used in all sorts of clever things which is why we have included them in this kit. We will start off with something very simple, turning one on and off, repeatedly, producing a pleasant blinking effect. To get started, grab the parts listed below, pin the layout sheet to your breadboard and then plug everything in. Once the circuit is assembled you'll need to upload the program. To do this plug the Arduino board into your USB port. Then select the proper port in Tools > Serial Port > (the comm port of your Arduino). Next upload the program by going to File > Upload to I/O Board (ctrl+U). Finally, bask in the glory and possibility that controlling lights offers. If you are having trouble uploading, a full trouble shooting guide can be found here: http://ardx.org/TRBL THE CIRCUIT: Parts: CIRC-01 2 Pin Header 10mm LED Breadboard Sheet x4 x1 Wire x1 560 Ohm Resistor Green-Blue-Brown x1 Schematic Arduino pin 13 longer lead + LED (light emitting diode) resistor (560ohm) (green-blue-brown) gnd (ground) (-) The Internet .:download:. breadboard layout sheet http://ardx.org/BBLS01 .:view:. assembly video http://ardx.org/VIDE01 08

Description:
ARDX arduino experimentation kit Open-Source Arduino Instruction Guide ARDX Document Revision: May 11, 2012 Experimenter’s Kit for Arduino
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.