Arduino Inventor's Kit Arduino Inventor's Guide

1y ago
26 Views
3 Downloads
8.08 MB
36 Pages
Last View : 16d ago
Last Download : 3m ago
Upload by : Mollie Blount
Transcription

AIKarduino inventor’s kitArduinoInventor’sGuide

A Few WordsABOUT THIS KITThe overall goal of this kit is fun. Beyond this, the aim is to getyou comfortable using a wide range of electronic componentsthrough small, simple and easy circuits. The focus is to get eachcircuit working then giving you the tools to figure out why. If youencounter any problems, want to ask a question, or would like toknow more about any part, extra help is only an e-mail away help@oomlout.com.ABOUT OPEN SOURCE HARDWAREAll of the projects at SparkFun and .:oomlout:. are open source. What does this mean? It meanseverything involved in making this kit, be it this guide, 3D models, or code is available for freedownload. But it goes further, you're also free to reproduce and modify any of this material, thendistribute 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 yourdevelopments in a similar manner. Why? We grew up learning and playing with open sourcesoftware and the experience was good fun, we think it would be lovely if a similar experience waspossible with physical things.More details on the Creative Commons CC (By - Share Alike) License can be found athttp://ardx.org/CCLIABOUT .: OOMLOUT :.We’re a plucky little design company focusing on producing“delightfully fun open source products”To check out what we are up tohttp://www.oomlout.comABOUT SPARKFUNSparkFun is an energetic young company seeking to make electronics fun, accessible,and approachable to everyone - from kids in elementary school to PhD-toting engineers.http://www.sparkfun.com/ABOUT PROBLEMSWe strive to deliver the highest level of quality in each and every thing we produce. If you ever find anambiguous instruction, a missing piece, or would just like to ask a question, we’ll try our best to help out.help@oomlout.com(we like hearing about problems it helps us improve future versions)Thanks For Choosing .:oomlout:.and SparkFun

.: WHERE TO FIND EVERYTHING :.TBCNtable of contentsBefore We Start{ASEM}Assembling the Pieces02{INST}Installing the Software03{PROG}A Small Programming Primer04{ELEC}A Small Electronics Primer06The 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 - (LM335A Temperature Sensor)26{CIRC11}Larger Loads - (Relays)28{CIRCRGB} Colorful Light - (RGB LED)3001

01 ASEMassembling thepiecesArduino Holderx102.: PUTTING IT TOGETHER :.Breadboardx1.: For an introduction to what an Arduino is, visit :.: http://ardx.org/INTR :.Arduinox1

.: INSTALLING THE IDE :.02 INSTThis is the program used to write code for the Arduino. It mayseem a little daunting at first but once you have it installed andstart playing around, its secrets will reveal themselves.installing(software and hardware)Step 1: Download the softwareGo tohttp://arduino.cc/en/Main/Softwaredownload the software for your operating systemWindows XPMac OSXStep 2: Unzip the SoftwareStep 2: Open The .dmgUnziparduino-00r-win.zip (rr- version #)rOpen (mount)arduino-00rr-mac.dmg (rr- version #)Recommended Pathc:\Program Files\Step 3: Copy The ApplicationStep 3: Shortcut IconOpenc:\program files\arduino-00rr\ (rr- version #)Right ClickArduino.exe(send to Desktop (create shortcut))Step 4: Plug In Your ArduinoPlug your Arduino in:Using the included USB cable, plug your Arduinoboard into a free USB port.Wait for a box to pop upGo to"Arduino" (in the devices section of finder)Move"Arduino" Application to the"Applications" folderStep 4: Install DriversGo to"Arduino" deviceDouble Click & InstallrFTDI Drivers for Intel Macs (rrr).pkg(FTDI Drivers for PPC Macs (rrrr).pkgRestartStep 5: Add new HardwareSkip searching the internet(click the next box when prompted to do so)Step 5: Plug In Your ArduinoInstall from a specific locationPlug your Arduino in:(click “Install from a list or specific location (Advanced)")Using the included USB cable, plug your Arduinoboard into a free USB port.Choose the Locationc:\program files\arduino-00rr\drivers\FTDI USB Drivers\FinishedFinished.: NOTE: :.: Encountering problems? :.: Would like more details? Using Linux? :.: http://ardx.org/LINU :.03

03 PROGprogrammingprimer.: A Small Programming Primer:.ARDUINO PROGRAMMING IN BRIEFThe Arduino is programmed in the C language. This is a quick little primer targeted at peoplewho have a little bit of programing experience and just need a briefing on the idiosyncracies of Cand the Arduino IDE. If you find the concepts a bit daunting, don't worry, you can start goingthrough the circuits and pick up most of it along the way. For a more in-depth intro theArduino.cc website is a great resource.STRUCTUREEach Arduino program(often called a sketch) hastwo required functions(also called routines).void setup(){}void loop(){}All the code between the twocurly brackets will be run oncewhen your Arduino programfirst runs.This function is run after setuphas finished. After it has runonce it will be run again, andagain, until power is removed.// (single line comment)It is often useful to write notesto yourself as you go alongabout what each line of codedoes. To do this type two backslashes and everything until theend of the line will be ignored byyour program./* */(multi line comment)If you have a lot to say you canspan several lines as acomment. Everything betweenthese two symbols will beignored in your program.SYNTAXOne of the slightlyfrustrating elements of C isits formatting requirements(this also makes it verypowerful). If you rememberthe following you should bealright.{ } (curly brackets)Used to define when a blockof code starts and ends (usedin functions as well as loops).; (semicolon)Each line of code must beended with a semicolon (amissing semicolon is oftenthe reason for a programrefusing to compile).int (integer)The main workhorse, stores anumber in 2 bytes (16 bits).Has no decimal places and willstore a value between -32,768and 32,767.long (long)Used when an integer is notlarge enough. Takes 4 bytes (32bits) of RAM and has a rangebetween -2,147,483,648 and2,147,483,647.float (float)Used for floating point math(decimals). Takes 4 bytes (32bits) of RAM and has a rangebetween -3.4028235E 38and 3.4028235E 38.char (character)Stores one character using theASCII code (ie 'A' 65). Usesone byte (8 bits) of RAM. TheArduino handles strings as anarray of char’s.VARIABLESA program is nothing morethan instructions to movenumbers around in anintelligent way. Variables areused to do the moving.boolean (boolean)A simple True or Falsevariable. Usefulbecause it onlyuses one bit ofRAM.04

.:For a full programming reference visit:.http://ardx.org/PROG03 PROGprogrammingprimerMATH OPERATORSOperators used formanipulating numbers.(they work like simplemath). (assignment) makes something equal to something else (eg. x 10 * 2 (x now equals 20))% (modulo) gives the remainder when one number is divided byanother (ex. 12 % 10 (gives 2)) (addition)(subtraction)* (multiplication)/ (division)COMPARISON OPERATORSOperators used forlogical comparison. ! (equal to) (eg. 12 10 is FALSE or 12 12 is TRUE)(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 isFALSE)CONTROL STRUCTUREPrograms are reliant oncontrolling what runsnext, here are the basiccontrol elements (thereare many more online).if(condition){ }else if( condition ){ }else { }This will execute the code betweenthe curly brackets if the conditionis true, and if not it will test theelse if condition if that is alsofalse the else code will execute.for(int i 0; i #repeats; i ){}Used when you would like torepeat a chunk of code a numberof times (can count up i ordown i-- or use any variable)DIGITALpinMode(pin, mode);digitalWrite(pin, value);int digitalRead(pin);Used to set a pin's mode, pinis the pin number you wouldlike to address 0-19 (analog 05 are 14-19). The mode caneither be INPUT or OUTPUT.Once a pin is set as an OUTPUT,it can be set either HIGH (pulledto 5 volts) or LOW (pulled toground).Once a pin is set as an INPUTyou can use this to returnwhether it is HIGH (pulled to 5 volts) or LOW (pulled toground).int analogWrite(pin,value);int analogRead(pin);ANALOGThe Arduino is a digitalmachine but it has the abilityto operate in the analogrealm (through tricks).Here's how to deal withthings that aren't digital.Some of the Arduino's pins supportpulse width modulation (3, 5, 6, 9, 10,11). This turns the pin on and off veryquickly making it act like an analogoutput. The value is any numberbetween 0 (0% duty cycle 0v) and255 (100% duty cycle 5 volts).When the analog input pins are setto input you can read their voltage.A value between 0 (for 0volts) and 1024 (for5 volts) will bereturned05

04 ELECelectronicsprimer.: A Small Electronics Primer:.ELECTRONICS IN BRIEFNo previous electronic experience is required to have fun with this kit. Here are a few detailsabout each component to make identifying, and perhaps understanding them, a bit easier. Ifat any point you are worried about how a component is used or why it's not working theinternet offers a treasure trove of advice, or we can be contacted at help@oomlout.comCOMPONENT DETAILSLEDWhat it Does:No. of Leads:2 (one longer, this one connects to positive)Things to watch out for:- Will only work in one direction- Requires a current limiting resistorMore Details:http://ardx.org/LED(Light Emitting Diode)Emits light when a small current ispassed through it. (only in one direction)Identifying:Looks like a mini light bulb.DiodeWhat it Does:The electronic equivalent of a one wayvalve. Allowing current to flow in onedirection but not the other.Identifying:Usually a cylinder with wires extending fromeither end. (and an off center line indicating polarity)No. of Leads:2Things to watch out for:- Will only work in one directionWhat it Does:Restricts the amount of current that canflow through a circuit.Identifying:Cylinder with wires extending from eitherend. The value is displayed using a colorcoding system (for details see next page)No. of Leads:2Things to watch out for:- Easy to grab the wrong value (doubleWhat it Does:Uses a small current to switch or amplify amuch larger current.Identifying:Comes in many different packages but youcan read the part number off the package.No. of Leads:3 (Base, Collector, Emitter)Things to watch out for:- Plugging in the right way round (also aResistorsTransistor(P2N2222AG in this kit and find a datasheet online)Hobby ServoDC Motor06What it Does:Takes a timed pulse and converts it intoan angular position of the output shaft.Identifying:A plastic box with 3 wires coming out oneside and a shaft with a plastic horn outthe top.What it Does:Spins when a current is passed through it.Identifying:This one is easy, it looks like a motor.Usually a cylinder with a shaft coming outof one end.(current willflow if end with the line is connected to ground)More Details:http://ardx.org/DIODcheck the colors before using)More Details:http://ardx.org/RESIcurrent limiting resistor is often needed on the base pin)More Details:http://ardx.org/TRANNo. of Leads:3Things to watch out for:- The plug is not polarized so make sureit is plugged in the right way.More Details:http://ardx.org/SERVNo. of Leads:2Things to watch out for:- Using a transistor or relay that is ratedfor the size of motor you're using.More Details:http://ardx.org/MOTO

04 ELECelectronicsprimerCOMPONENT DETAILS (CONT.)Piezo ElementWhat it Does:A pulse of current will cause it to click. Astream of pulses will cause it to emit atone.Identifying:In this kit it comes in a little black barrel,but sometimes they are just a gold disc.No. of Leads:2Things to watch out for:- Difficult to misuse.More Details:http://ardx.org/PIEZIC (Integrated Circuit)What it Does:Packages any range of complicatedelectronics inside an easy to use package.Identifying:The part ID is written on the outside of thepackage. (this sometimes requires a lot oflight or a magnifying glass to read).PushbuttonWhat it Does:Completes a circuit when it is pressed.Identifying:A little square with leads out the bottomand a button on the top.No. of Leads:2 - 100s (in this kit there is one with 3 (TMP36) andone with 16 (74HC595)Things to watch out for:- Proper orientation.(look for marks showing pin 1)More Details:http://ardx.org/ICICNo. of Leads:4Things to watch out for:- these are almost square so can beinserted 90 degrees off angle.More Details:http://ardx.org/BUTTPotentiometerWhat it Does:Produces a variable resistance dependanton the angular position of the shaft.Identifying:They can be packaged in many differentform factors, look for a dial to identify.No. of Leads:3Things to watch out for:- Accidentally buying logarithmic scale.More Details:http://ardx.org/POTEPhoto ResistorWhat it Does:Produces a variable resistance dependanton the amount of incident light.Identifying:Usually a little disk with a clear top and acurvy line underneath.RESISTOR COLOR CODEExamples:green-blue-brown - 560 ohmsred-red-red - 2 200 ohms (2.2k)brown-black-orange - 10 000 ohms ePurpleGreyWhitefirst digitsecond digit# of zerostolerance20% - none10% - silver5% - goldNo. of Leads:2Things to watch out for:- Remember it needs to be in a voltagedivider before it provides a useful input.More Details:http://ardx.org/PHOTLEAD CLIPPINGSome components in this kit come with very long wireleads. To make them more compatible with a breadboarda couple of changes are required.LEDs:Clip the leads so the long lead is 10mm (3/8”) long andthe short one is 7mm (9/32”).Resistors:Bend the leads down so they are 90 degrees to thecylinder. Then snip them so they are 6mm(1/4”) long.Other Components:Other components may need clipping.Use your discretion when doing so.07

CIRC-01.:Getting Started:.:(Blinking LED):.WHAT WE’RE DOING:LEDs (light emitting diodes) are used in all sorts of clever thingswhich is why we have included them in this kit. We will start offwith something very simple, turning one on and off, repeatedly,producing a pleasant blinking effect. To get started, grab the partslisted below, pin the layout sheet to your breadboard and then plugeverything in. Once the circuit is assembled you'll need to upload the program. To do this plug theArduino board into your USB port. Then select the proper port in Tools Serial Port (thecomm port of your Arduino). Next upload the program by going to File Upload to I/OBoard (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/TRBLTHE CIRCUIT:Parts:CIRC-01Breadboard Sheetx1330 Ohm ResistorOrange-Orange-Brownx1SchematicArduinopin 13longer lead LED(light emitting und) (-)The Internet.:download:.breadboard layout sheethttp://ardx.org/BBLS01S.:view:.assembly videohttp://ardx.org/VIDE01082 Pin Headerx45mm Yellow LEDx1Wire

CODECIRC-01(no need to type everything in just click)File Examples Digital Blink(example from the great arduino.cc site, check it out for other ideas)/* Blink* Turns on an LED on for one second, then off for one second,* repeatedly.* Created 1 June 2005 By David Cuartielles* http://arduino.cc/en/Tutorial/Blink* based on an orginal by H. Barragan for the Wiring i/o board*/int ledPin 13;// LED connected to digital pin 13// The setup() method runs once, when the sketch startsvoid setup(){// initialize the digital pin as an output:pinMode(ledPin, OUTPUT);}// the loop() method runs over and over again,// as long as the Arduino has powervoid loop(){digitalWrite(ledPin, HIGH);// set the LED ondelay(1000);// wait for a seconddigitalWrite(ledPin, LOW);// set the LED offdelay(1000);// wait for a second}NOT WORKING?(3 things to try)LED Not Lighting Up?LEDs will only work in oneProgram Not UploadingThis happens sometimes,Still No Success?the most likely cause is aA broken circuit is no fun, senddirection. Try taking it out andtwisting it 180 degrees.(no need to worry, installing itconfused serial port, youbackwards does no permanentcan change this inharm).tools serial port us an e-mail and we will getback to you as soon as we can.help@oomlout.comMAKING IT BETTERChanging the pin:The LED is connected to pin 13 but we can use any ofControl the brightness:Along with digital (on/off) control the Arduino can controlthe Arduino’s pins. To change it take the wire pluggedsome pins in an analog (brightness) fashion. (more details oninto pin 13 and move it to a pin of your choice (from 0-this in later circuits). To play around with it.13) (you can also use analog 0-5, analog 0 is 14.)Change the LED to pin 9: (also change the wire)ledPin 13; - int ledPin 9;Then in the code change the line:int ledPin 13; - int ledPin newpin;Replace the code inside the { }'s of loop() with this:analogWrite(ledPin, new number);Then upload the sketch: (ctrl-u)Change the blink time:Unhappy with one second on one second off?(new number) any number between 0 and 255.0 off, 255 on, in between different brightnessIn the code change the lines:digitalWrite(ledPin, HIGH);delay(time on); //(seconds * 1000)digitalWrite(ledPin, LOW);delay(time off); //(seconds * 1000)Fading:We will use another included example program. To open go toFile Examples Analog FadingThen upload to your board and watch as the LED fades in andthen out.MORE, MORE, MORE:More details, where to buy more parts, where to ask more questions:http://ardx.org/CIRC0109

CIRC-02.:8 LED Fun:.:Multiple LED’s:.WHAT WE’RE DOING:We have caused one LED to blink, now it's time to up thestakes. Lets connect eight. We'll also have an opportunity tostretch the Arduino a bit by creating various lightingsequences. This circuit is also a nice setup to experiment withwriting your own programs and getting a feel for how the Arduino works.Along with controlling the LEDs we start looking into a few simple programming methods tokeep your programs small.for() loops - used when you want to run a piece of code several times.arrays[] - used to make managing variables easier (it's a group of variables).THE CIRCUIT:Parts:CIRC-02Breadboard Sheetx1330 Ohm ResistorOrange-Orange-Brownx8Schematicpin 2 pin 3 pin 4 pin 5LEDresistor330ohmgndpin 6 pin 7 pin 8 pin 9LEDresistor330ohmgndThe Internet.:download:.breadboard layout sheethttp://ardx.org/BBLS02S.:view:.assembly videohttp://ardx.org/VIDE02102 Pin Headerx45mm Yellow LEDx8Wire

CODECIRC-02(no need to type everything in just click)Download the Code from ( http://ardx.org/CODE02 )(and then copy the text and paste it into an empty Arduino Sketch)//LED Pin Variablesint ledPins[] {2,3,4,5,6,7,8,9};//An array to hold the//pin each LED is connected to//i.e. LED #0 is connected to pin 2void setup(){for(int i 0; i 8; i ){//this is a loop and will repeat eight timespinMode(ledPins[i],OUTPUT);//we use this to set LED pins to output}}void loop()// run over and over again{oneAfterAnotherNoLoop();//this will turn on each LED one by//one then turn each oneoff//oneAfterAnotherLoop();//this does the same as onAfterAnotherNoLoop//but with much less typing//oneOnAtATime();//inAndOut();}* will then turn them offvoid oneAfterAnotherNoLoop(){int delayTime 100;//the time (in milliseconds) to pause//between LEDsdigitalWrite(ledPins[0], HIGH); //Turns on LED #0//(connected to pin 2)delay(delayTime);//waits delayTime milliseconds.digitalWrite(ledPins[7], HIGH); //Turns on LED #7//(connected to pin 9)delay(delayTime);//waits delayTime milliseconds//Turns Each LED OffdigitalWrite(ledPins[7], LOW); //Turns off LED #7delay(delayTime);//waits delayTime milliseconds.-----more code in the downloadable version------/** oneAfterAnotherNoLoop() - Will light one then* delay for delayTime then light the next LED itNOT WORKING?(3 things to try)Starting AfreshSome LEDs Fail to LightOperating out of sequenceIt is easy to insert an LEDbackwards. Check the LEDsthat aren't working and ensurethey the right way around.With eight wires it's easy to crossa couple. Double check that thefirst LED is plugged into pin 2 andeach pin there after.Its easy to accidentallymisplace a wire withoutnoticing. Pulling everything outand starting with a fresh slateis often easier than trying totrack down the problem.MAKING IT BETTERSwitching to loops:In the loop() function there are 4 lines. The lastthree all start with a '//'. This means the line istreated as a comment (not run). To switch theprogram to use loops change the void loop()code ;//oneOnAtATime();//inAndOut();Upload the program, and notice that nothing haschanged. You can take a look at the twofunctions, each does the same thing, but usedifferent approaches (hint the second one uses afor loop).Extra animations:Tired of this animation? Then try the other twosample animations. Uncomment their lines and uploadthe program to your board and enjoy the new lightanimations. (delete the slashes in front of row 3 and then 4)Testing out your own animations:Jump into the included code and start changingthings. The main point is to turn an LED on usedigitalWrite(pinNumber, HIGH); then to turnit off use digitalWrite(pinNumber, LOW); .Type away, regardless of what you change you won'tbreak anything.MORE, MORE, MORE:More details, where to buy more parts, where to ask more questions:http://ardx.org/CIRC0211

CIRC-03.:Spin Motor Spin:.:Transistor & Motor:.WHAT WE’RE DOING:The Arduino's pins are great for directly controlling small electricitems like LEDs. However, when dealing with larger items (like atoy motor or washing machine), an external transistor is required. Atransistor is incredibly useful. It switches a lot of current using amuch smaller current. A transistor has 3 pins. For a negative type (NPN)transistor, you connect your load to collector and the emitter to ground. Then when a small currentflows from base to the emitter, a current will flow through the transistor and your motor will spin(this happens when we set our Arduino pin HIGH). There are literally thousands of different types oftransistors, allowing every situation to be perfectly matched. We have chosen a P2N2222AG a rathercommon general purpose transistor. The important factors in our case are that its maximum voltage(40v) and its maximum current (200 milliamp) are both high enough for our toy motor (full detailscan be found on its datasheet http://ardx.org/2222).(The 1N4001 diode is acting as a flyback diode for details on why its there visit: http://ardx.org/4001)THE CIRCUIT:Parts:CIRC-03Breadboard Sheetx12 Pin Headerx4TransistorP2N2222AG (TO92)x1Toy Motorx1Diode(1N4001)x110k Ohm ResistorBrown-Black-Orangex1SchematicArduinopin 9WireThe transistor will haveP2N2222AG printed on it(some variations will havedifferent pin orP2N2222AGEmitterDiodeMotorgnd(ground) (-) 5 voltsThe Internet.:download:.breadboard layout sheethttp://ardx.org/BBLS03S.:view:.assembly videohttp://ardx.org/VIDE0312.:NOTE: if your arduino is resetting you need to install the optional capacitor:.

CODECIRC-03(no need to type everything in just click)Download the Code from ( http://ardx.org/CODE03 )(then simply copy the text and paste it into an empty Arduino Sketch)int motorPin 9; //pin the motor is connected tovoid setup() //runs once{pinMode(motorPin, OUTPUT);}void loop()// run over and over ;//motorAcceleration();}/** motorOnThenOff() - turns motor on then off* (notice this code is identical to the code weused for* the blinking LED)*/void motorOnThenOff(){int onTime 2500; //on timeint offTime 1000; //off timedigitalWrite(motorPin, HIGH);// turns the motor Ondelay(onTime); // waits for onTime millisecondsdigitalWrite(motorPin, LOW);// turns the motor Offdelay(offTime);// waits for offTime milliseconds}NOT WORKING?void motorOnThenOffWithSpeed(){int onSpeed 200;// a number between//0 (stopped) and 255int onTime 2500;int offSpeed 50;// a number between//0 (stopped) and 255int offTime 1000;analogWrite(motorPin, onSpeed);// turns the motor Ondelay(onTime);// waits for onTimeanalogWrite(motorPin, offSpeed);// turns the motor Offdelay(offTime);// waits for offTime}(full speed)(full speed)millisecondsmillisecondsvoid motorAcceleration(){int delayTime 50; //time between each speed stepfor(int i 0; i 256; i ){//goes through each speed from 0 to 255analogWrite(motorPin, i);//sets the new speeddelay(delayTime);// waits for delayTime milliseconds}for(int i 255; i 0; i--){//goes through each speed from 255 to 0analogWrite(motorPin, i);//sets the new speeddelay(delayTime);//waits for delayTime milliseconds}}(3 things to try)Motor Not Spinning?If you sourced your owntransistor, double check withStill No Luck?Still Not Working?If you sourced your ownSometimes the Arduino boardmotor, double check that it willwill disconnect from thethe data sheet that the pinoutwork with 5 volts and that itcomputer. Try un-plugging andis compatible with adoes not draw too muchthen re-plugging it into yourP2N2222AGpower.USB port.(many are reversed).MAKING IT BETTERControlling speed:We played with the Arduino's ability to control thebrightness of an LED earlier now we will use the samefeature to control the speed of our motor. The Arduinodoes this using something called Pulse WidthModulation (PWM). This relies on the Arduino's ability tooperate really, really fast. Rather than directlycontrolling the voltage coming from the pin the Arduinowill switch the pin on and off very quickly. In thecomputer world this is going from 0 to 5 volts manytimes a second, but in the human world we see it as avoltage. For example if the Arduino is PWM'ing at 50%we see the light dimmed 50% because our eyes are notquick enough to see it flashing on and off. The samefeature works with transistors. Don't believe me? Try itout.In the loop() section change it to this// motorOnThenOff();motorOnThenOffWithSpeed();// motorAcceleration();Then upload the program. You can change the speeds bychanging the variables onSpeed and offSpeed.Accelerating and decelerating:Why stop at two speeds, why not accelerate and deceleratethe motor. To do this simply change the loop() code to read// motorOnThenOff();// motorOnThenOffWithSpeed();motorAcceleration();Then upload the program and watch as your motor slowlyaccelerates up to full speed then slows down again. If youwould like to change the speed of acceleration change thevariable delayTime (larger means a longer acceleration time).MORE, MORE, MORE:More details, where to buy more parts, where to ask more questions:http://ardx.org/CIRC0313

CIRC-04.:A Single Servo:.:Servos:.WHAT WE’RE DOING:Spinning a motor is good fun but when it comes to projectswhere motion control is required they tend to leave uswanting more. The answer? Hobby servos. They are massproduced, widely available and cost anything from a couple ofdollars to hundreds. Inside is a small gearbox (to make the movement more powerful) andsome electronics (to make it easier to control). A standard servo is positionable from 0 to180 degrees. Positioning is controlled through a timed pulse, between 1.25 milliseconds (0degrees) and 1.75 milliseconds (180 degrees) (1.5 milliseconds for 90 degrees). Timingvaries between manufacturer. If the pulse is sent every 25-50 milliseconds the servo will runsmoothly. One of the great features of the Arduino is it has a software library that allowsyou to control two servos (connected to pin 9 or 10) using a single line of code.THE CIRCUIT:Parts:CIRC-04Breadboard Sheetx1Mini Servox1SchematicArduinopin 9Mini Servosignal(white) 5v(red)gnd(black)gnd(ground) (-) 5 volts(5V)The Internet.:download:.breadboard layout sheethttp://ardx.org/BBLS04S.:view:.assembly videohttp://ardx.org/VIDE04142 Pin Headerx43 Pin Headerx1Wire

CODECIRC-04(no need to type everything in just click)File Examples Library-Servo Sweep(example from the great arduino.cc site check it out for other great ideas)// Sweep// by BARRAGAN http://barraganstudio.com #include Servo.h Servo myservo; // create servo object to control a servoint pos 0;// variable to store the servo positionvoid setup() {myservo.attach(9);}// attaches the servo on pin 9 to the servo objectvoid loop() {for(pos 0; pos 180; pos {myservo.write(pos);delay(15);}for(pos 180; pos 1; pos- 1){myservo.write(pos);delay(15);}}NOT WORKING?1)// goes from 0 degrees to 180 degrees// in steps of 1 degree// tell servo to go to position in variable 'pos'// waits 15ms for the servo to reach the position// goes from 180 degrees to 0 degrees// tell servo to go to position in variable 'pos'// waits 15ms for the servo to reach the position(3 things to try)Still Not WorkingServo Not Twisting?Even with colored wires it isstill shockingly easy to plug aservo in backwards. This mightbe the case.A mistake we made a time ortwo was simply forgetting toconnect the power (red andbrown wires) to 5 volts andground.Fits and StartsIf the servo begins moving thentwitches, and there's a flashinglight on your Arduino board, thepower supply you are using isnot quite up to the challenge.Using a fresh battery instead ofUSB should solve this problem.MAKING IT BETTERPotentiometer control:We have yet to experiment with inputs but if you would liketo read ahead, there is an example program File LibraryServo Knob. This uses a potentiometer (CIRC08) tocontrol the servo. You can find instructions onli

arduino-00 -win.zip Recommended Path c:\Program Files\ ( - version #) Step 3: Shortcut Icon Open c:\program files\arduino-00 Right Click Arduino.exe (send to Desktop (create shortcut)) \ ( - version #) 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 .

Related Documents:

2 Valve body KIT M100201 KIT M100204 KIT M100211 KIT M100211 KIT M100218 KIT M300222 7 Intermediate cover (double diaphragm) - - - KIT M110098 KIT M110100 KIT M110101 4 Top cover KIT M110082 KIT M110086 KIT M110092 KIT M110082 KIT M110082 KIT M110082 5 Diaphragm KIT DB 16/G KIT DB 18/G KIT DB 112/G - - - 5 Viton Diaphragm KIT DB 16V/S KIT

2-4 Parametric Modeling with Autodesk Inventor The Adjuster Design Starting Autodesk Inventor 1. Select the Autodesk Inventor option on the Start menu or select the Autodesk Inventor icon on the desktop to start Autodesk Inventor. The Autodesk Inventor main window will appear on the screen. 2. Select the Projects icon with a single click of the

SparkFun Inventor's Kit This SparkFun Inventor's Kit Experiment Guide is your map for navigating the waters of beginning embedded electronics using the Intel Curie-based Arduino 101 or Genuino 101 board. This guide contains all the information you will need to explore the 21 circuits of the SparkFun Inventor's Kit for the Arduino 101.

Arduino compatible components. Personal computer running Arduino software Arduino software is free to download and use from: www.arduino.cc Arduino board Such as: Arduino Uno Freetronics Eleven Genuino Uno or any Arduino compatible board that has a standard Arduino UNO header l

Autodesk Inventor 1. Select the Autodesk Inventor option on the Start menu or select the Autodesk Inventor icon on the desktop to start Autodesk Inventor. The Autodesk Inventor main window will appear on the screen. 2. Once the program is loaded into memory, select the New File icon with a single click of the left-mouse-button in the Launch .

to get started writing programs for Inventor is to use the Visual Basic for Applications (VBA) that comes with Inventor. Here are some important things to understand about VBA. Free and comes with Inventor The best for Inventor RAD (Rapid Application Development) The best for debugging Inventor code Old technology

Windows XP Mac OSX Step 2: Unzip the Software Unzip arduino-00 -win.zip Recommended Path c:\Program Files\ rr(rr- version #) Step 3: Shortcut Icon Open c:\program files\arduino-00 Right Click Arduino.exe (send to Desktop (create shortcut)) rr\ (rr- version #) Step 4: Plug In Your Arduino Plug your Ar

electromagnetic compatibility and product safety. 5 3. Test plan Before proceeding with any testing, the vendor needs to submit a test plan for approval by the designated Project Officer, who will assess the test plan and notify the vendor in writing as to whether the test plan has been approved or rejected. If rejected or incomplete, the Project Officer will state the reason and allow the .