23
An Arduino is an open-source microcontroller development board. In plain English, you can use the Arduino to read sensors and control things like motors and lights. This allows you to upload programs to this board which can then interact with things in the real world. With this, you can make devices which respond and react to the world at large. For instance, you can read a humidity sensor connected to a potted plant and turn on an automatic watering system if it gets too dry. Or, you can make a stand-alone chat server which is plugged into your internet router. Or, you can have it tweet every time your cat passes through a pet door. Or, you can have it start a pot of coffee when your alarm goes off in the morning. Basically, if there is something that is in any way controlled by electricity, the Arduino can interface with it in some manner. And even if it is not controlled by electricity, you can probably still use things which are (like motors and electromagnets), to interface with it. The possibilities of the Arduino are almost limitless. As such, there is no way that one single tutorial can cover everything you might ever need to know. That said, I've done my best to give a basic overview of the fundamental skills and knowledge (/files/deriv/F2K/5L77/H05NHB4C/F2K5L77H05NHB4C.LARGE.jpg) About This Instructable License: 202,023 views 879 favorites (/member/randofo/) randofo (/member/randofo/) Randy Sarafan loves you! (http://www.randysarafan.com) Follow My name is Randy and I am always making new things. I'm also the author of the books 'Simple Bots,' and '62 Projects to Make with a Dead Computer'. Subscribing to me = fun and excitement! 5650 Bio: (/id/Glowing-Color-Changing- Guitar) (/id/Car-Horn-Prank-Box) (/id/Overdrive-Pedal) More by randofo (/) let's make share what you make > (/about/submit.jsp) (/) Explore (/tag/type-id/) Create (/about/submit.jsp) Contests (/contest/) Community (/community/) Login (/you/)

Intro to arduino

Embed Size (px)

Citation preview

Page 1: Intro to arduino

An Arduino is an open-source microcontroller development board. In plain English,

you can use the Arduino to read sensors and control things like motors and lights.

This allows you to upload programs to this board which can then interact with things

in the real world. With this, you can make devices which respond and react to the

world at large.

For instance, you can read a humidity sensor connected to a potted plant and turn

on an automatic watering system if it gets too dry. Or, you can make a stand-alone

chat server which is plugged into your internet router. Or, you can have it tweet

every time your cat passes through a pet door. Or, you can have it start a pot of

coffee when your alarm goes off in the morning.

Basically, if there is something that is in any way controlled by electricity, the

Arduino can interface with it in some manner. And even if it is not controlled by

electricity, you can probably still use things which are (like motors and

electromagnets), to interface with it.

The possibilities of the Arduino are almost limitless. As such, there is no way that

one single tutorial can cover everything you might ever need to know. That said,

I've done my best to give a basic overview of the fundamental skills and knowledge

(/files/deriv/F2K/5L77/H05NHB4C/F2K5L77H05NHB4C.LARGE.jpg)

About This Instructable

License:202,023 views

879 favorites

(/member/randofo/)

randofo

(/member/randofo/)

Randy Sarafan loves you!(http://www.randysarafan.com)

Follow

My name is Randy and I am alwaysmaking new things. I'm also the author ofthe books 'Simple Bots,' and '62 Projectsto Make with a Dead Computer'.Subscribing to me = fun and excitement!

5650

Bio:

(/id/Glowing-Color-Changing-Guitar)

(/id/Car-Horn-Prank-Box)

(/id/Overdrive-Pedal)

More by randofo

(/)

let's make

share what you make >

(/about/submit.jsp)

(/)

Explore (/tag/type-id/) Create (/about/submit.jsp) Contests (/contest/) Community (/community/)Login (/you/)

Page 2: Intro to arduino

that you need to get your Arduino up and running. If nothing more, this should

function as a springboard into further experimentation and learning.

Step 1: Different types of Arduinos

There are a number of different types of Arduinos to choose from. This is a brief

overview of some of the more common types of Arduino boards you may

encounter. For a full listing of currently support Arduino boards, check out the

Arduino hardware page (http://www.arduino.cc/en/Main/hardware).

Arduino Uno

The most common version of Arduino is the Arduino Uno. This board is what most

people are talking about when they refer to an Arduino. In the next step, there is a

more complete rundown of its features.

Arduino NG, Diecimila, and the Duemilanove (Legacy Versions)

Legacy versions of the Arduino Uno product line consist of the NG, Diecimila, and

the Duemilanove. The important thing to note about legacy boards is that they lack

particular feature of the Arduino Uno. Some key differences:

Related

See More (/tag/type-id/?q=)

(/files/deriv/FYS/03SJ/H0OJ1LNG/FYS03SJH0OJ1LNG.LARGE.jpg)

(/files/deriv/FXR/57Y8/H05NHB4J/FXR57Y8H05NHB4J.LARGE.jpg)

(/files/deriv/F2K/5L77/H05NHB4C/F2K5L77H05NHB4C.LARGE.jpg)

(/files/deriv/F9Z/VGSB/H05NSX4M/F9ZVGSBH05NSX4M.LARGE.jpg)

(/files/deriv/FG8/RZ2L/H05NSX4N/FG8RZ2LH05NSX4N.LARGE.jpg)

(/files/deriv/FDU/OYP5/H05Y7GWQ/FDUOYP5H05Y7GWQ.LARGE.jpg)

intro (/tag/type-id/category-technology/keyw ord-

intro/)

introduction (/tag/type-id/category-

technology/keyw ord-introduction/)

beginning (/tag/type-id/category-

technology/keyw ord-beginning/)

beginner (/tag/type-id/category-

technology/keyw ord-beginner/)

Arduino (/tag/type-id/category-

technology/keyw ord-arduino/)

atmega328 (/tag/type-id/category-

technology/keyw ord-atmega328/)

atmega (/tag/type-id/category-technology/keyw ord-

atmega/)

atmel (/tag/type-id/category-technology/keyw ord-

atmel/)

micro (/tag/type-id/category-technology/keyw ord-

micro/)

controller (/tag/type-id/category-

technology/keyw ord-controller/)

Tags:

Bootloading and

Mounting Arduino

Atmega328 - I made it at

TechShop

(/id/Bootloading-and-GOduino II = Arduino +

L293D Variable Speed

Motor Controller

(/id/GOduino-II-Arduino-

L293D-Variable-Speed-Lap Stopwatch with

ATmega328

Microcontroller (/id/Lap-

Stopwatch-with-

ATmega328-The Traveling Geocache!

(/id/The-Traveling-

Geocache/)

by Revolt Lab (/member/Revolt

Lab/)Bootload an ATmega328

(/id/Bootload-an-

ATmega328/)

by AndyTallack

(/member/AndyTallack/)

Page 3: Intro to arduino

The Diecimila and NG use an ATMEGA168 chips (as opposed to the morepowerful ATMEGA328),Both the Diecimila and NG have a jumper next to the USB port and requiremanual selection of either USB or battery power.The Arduino NG requires that you hold the rest button on the board for a fewseconds prior to uploading a program.

Arduino Mega 2560

The Mega is the second most commonly encountered version of the Arduino family.

The Arduino Mega is like the Arduino Uno's beefier older brother. It boasts 256 KB

of memory (8 times more than the Uno). It also had 54 input and output pins, 16 of

which are analog pins, and 14 of which can do PWM. However, all of the added

functionality comes at the cost of a slightly larger circuit board. It may make your

project more powerful, but it will also make your project larger. Check out the

official Arduino Mega 2560 page

(http://arduino.cc/en/Main/ArduinoBoardMega2560) for more details.

Arduino Mega ADK

This specialized version of the Arduino is basically an Arduino Mega that has been

specifically designed for interfacing with Android smartphones.

Arduino LilyPad

The LilyPad was designed for wearable and e-textile applications. It is intended to

be sewn to fabric and connected to other sewable components using conductive

thread. This board requires the use of a special FTDI-USB TTL serial programming

cable (http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm). For more

information, the Arduino LilyPad page (http://arduino.cc/en/Guide/ArduinoLilyPad)

is a decent starting point.

Step 2: Arduino Uno Features

Some people think of the entire Arduino board as a microcontroller, but this is

inaccurate. The Arduino board actually is a specially designed circuit board for

programming and prototyping with Atmel microcontrollers.

The nice thing about the Arduino board is that it is relatively cheap, plugs straight

(/files/deriv/FTA/8EB8/H142A66M/FTA8EB8H142A66M.LARGE.jpg)

Page 4: Intro to arduino

into a computer's USB port, and it is dead-simple to setup and use (compared to

other development boards).

Some of the key features of the Arduino Uno include:An open source design. The advantage of it being open source is that it has alarge community (http://arduino.cc/forum/) of people using and troubleshootingit. This makes it easy to find someone to help you debug your projects. An easy USB interface . The chip on the board plugs straight into your USBport and registers on your computer as a virtual serial port. This allows you tointerface with it as through it were a serial device. The benefit of this setup isthat serial communication is an extremely easy (and time-tested) protocol, andUSB makes connecting it to modern computers really convenient. Very convenient power management and built-in voltage regulation. You canconnect an external power source of up to 12v and it will regulate it to both 5vand 3.3v. It also can be powered directly off of a USB port without any externalpower. An easy-to-find, and dirt cheap, microcontroller "brain." The ATmega328 chipretails for about $2.88 on Digikey. It has countless number of nice hardwarefeatures like timers, PWM pins, external and internal interrupts, and multiplesleep modes. Check out the official datasheet(http://www.atmel.com/Images/8271s.pdf) for more details. A 16mhz clock. This makes it not the speediest microcontroller around, but fastenough for most applications.

32 KB of flash memory for storing your code. 13 digital pins and 6 analog pins. These pins allow you to connect externalhardware to your Arduino. These pins are key for extending the computingcapability of the Arduino into the real world. Simply plug your devices andsensors into the sockets that correspond to each of these pins and you aregood to go. An ICSP connector for bypassing the USB port and interfacing the Arduinodirectly as a serial device. This port is necessary to re-bootload your chip(http://www.instructables.com/id/Bootload-an-Arduino-with-a-ZIF-Socket/) if itcorrupts and can no longer talk to your computer. An on-board LED attached to digital pin 13 for fast an easy debugging of code. And last, but not least, a button to reset the program on the chip.

For a complete rundown of all the Arduino Uno has to offer, be sure to check out

the official Arduino page (http://arduino.cc/en/Main/ArduinoBoardUno).

Step 3: Arduino IDE

Page 5: Intro to arduino

Before you can start doing anything with the Arduino, you need to download and

install the Arduino IDE (http://www.arduino.cc/en/Main/software) (integrated

development environment). From this point on we will be referring to the Arduino

IDE as the Arduino Programmer.

The Arduino Programmer is based on the Processing IDE (http://processing.org/)

and uses a variation of the C and C++ programming languages.

You can find the most recent version of the Arduino Programmer on this page

(http://www.arduino.cc/en/Main/software).

Step 4: Plug it in

(/files/deriv/FHS/OMOZ/H0A2H36S/FHSOMOZH0A2H36S.LARGE.jpg)

(/files/deriv/FUZ/UHSQ/H0A001RZ/FUZUHSQH0A001RZ.LARGE.jpg)

Page 6: Intro to arduino

Connect the Arduino to your computer's USB port.

Please note that although the Arduino plugs into your computer, it is not a true USB

device. The board has a special chip that allows it to show up on your computer as

a virtual serial port when it is plugged into a USB port. This is why it is important to

plug the board in. When the board is not plugged in, the virtual serial port that the

Arduino operates upon will not be present (since all of the information about it lives

on the Arduino board).

It is also good to know that every single Arduino has a unique virtual serial port

address. This means that every time you plug in a different Arduino board into your

computer, you will need to reconfigure the serial port that is in use.

The Arduino Uno requires a male USB A to male USB B cable

(http://www.amazon.com/Black-Hi-Speed-Printer-Scanner-Lexmark/dp/tech-

data/B0030FMQ90).

Step 5: Settings

(/files/deriv/FSL/I0F3/H142PA5I/FSLI0F3H142PA5I.LARGE.jpg)

(/files/deriv/F6F/MRQJ/H1426LR2/F6FMRQJH1426LR2.LARGE.jpg)

Page 7: Intro to arduino

Before you can start doing anything in the Arduino programmer, you must set the

board-type and serial port.

To set the board, go to the following:

Tools --> Boards

Select the version of board that you are using. Since I have an Arduino Uno

plugged in, I obviously selected "Arduino Uno."

To set the serial port, go to the following:

Tools --> Serial Port

Select the serial port that looks like:

/dev/tty.usbmodem [random numbers]

Step 6: Run a sketch

Arduino programs are called sketches. The Arduino programmer comes with a ton

of example sketches preloaded. This is great because even if you have never

programmed anything in your life, you can load one of these sketches and get the

Arduino to do something.

To get the LED tied to digital pin 13 to blink on and off, let's load the blink example.

(/files/deriv/FJU/YHUA/H0C6MHGC/FJUYHUAH0C6MHGC.LARGE.jpg)

(/files/deriv/FB2/DHZX/H0A00DUB/FB2DHZXH0A00DUB.LARGE.jpg)

Page 8: Intro to arduino

The blink example can be found here:

Files --> Examples --> Basics --> Blink

The blink example basically sets pin D13 as an output and then blinks the test LED

on the Arduino board on and off every second.

Once the blink example is open, it can be installed onto the ATMEGA328 chip by

pressing the upload button, which looks like an arrow pointing to the right.

Notice that the surface mount status LED connected to pin 13 on the Arduino will

start to blink. You can change the rate of the blinking by changing the length of the

delay and pressing the upload button again.

Step 7: Serial monitor

(/files/deriv/FS6/I5IK/H0C6MHGG/FS6I5IKH0C6MHGG.LARGE.jpg)

(/files/deriv/F7G/OG5U/H142Z8QK/F7GOG5UH142Z8QK.LARGE.jpg)

(/files/deriv/FHM/9QUH/H143LPL3/FHM9QUHH143LPL3.LARGE.jpg)

Page 9: Intro to arduino

The serial monitor allows your computer to connect serially with the Arduino. This is

important because it takes data that your Arduino is receiving from sensors and

other devices and displays it in real-time on your computer. Having this ability is

invaluable to debug your code and understand what number values the chip is

actually receiving.

For instance, connect center sweep (middle pin) of a potentiometer to A0, and the

outer pins, respectively, to 5v and ground. Next upload the sketch shown below:

File --> Examples --> 1.Basics --> AnalogReadSerial

Click the button to engage the serial monitor which looks like a magnifying glass.

You can now see the numbers being read by the analog pin in the serial monitor.

When you turn the knob the numbers will increase and decrease.

The numbers will be between the range of 0 and 1023. The reason for this is that

the analog pin is converting a voltage between 0 and 5V to a discreet number.

Step 8: Digital in

The Arduino has two different types of input pins, those being analog and digital.

To begin with, lets look at the digital input pins.

Digital input pins only have two possible states, which are on or off. These two on

and off states are also referred to as:HIGH or LOW1 or 05V or 0V.

This input is commonly used to sense the presence of voltage when a switch is

opened or closed.

Digital inputs can also be used as the basis for countless digital communication

protocols. By creating a 5V (HIGH) pulse or 0V (LOW) pulse, you can create a

binary signal, the basis of all computing. This is useful for talking to digital sensors

like a PING ultrasonic sensor, or communicating with other devices.

For a simple example of a digital input in use, connect a switch from digital pin 2 to

5V, a 10K resistor** from digital pin 2 to ground, and run the following code:

(/files/deriv/FT9/0P7B/H142P82N/FT90P7BH142P82N.LARGE.jpg)

Page 10: Intro to arduino

File --> Examples --> 2.Digital --> Button

**The 10K resistor is called a pull-down resistor because it connects the digital pin

to ground when the switch is not pressed. When the switch is pressed, the

electrical connections in the switch has less resistance than the resistor, and the

electricity no longer connects to ground. Instead, electricity flows between 5V and

the digital pin. This is because electricity always chooses the path of least

resistance. To learn more about this, visit the Digital Pins

(http://arduino.cc/en/Tutorial/DigitalPins) page.

Step 9: Analog in

Aside from the digital input pins, the Arduino also boasts a number of analog input

pins.

Analog input pins take an analog signal and perform a 10-bit analog-to-digital

(ADC) conversion to turn it into a number between 0 and 1023 (4.9mV steps).

This type of input is good for reading resistive sensors. These are basically

sensors which provide resistance to the circuit. They are also good for reading a

varying voltage signal between 0 and 5V. This is useful when interfacing with

various types of analog circuitry.

If you followed the example in Step 7 for engaging the serial monitor, you have

already tried using an analog input pin.

Step 10: Digital out

(/files/deriv/FID/B5US/H1426JJG/FIDB5USH1426JJG.LARGE.jpg)

Page 11: Intro to arduino

A digital out pin can be set to be HIGH (5v) or LOW (0v). This allows you to turn

things on and off.

Aside from turning things on and off (and making LEDs blink), this form of output is

convenient for a number of applications.

Most notably, it allows you to communicate digitally. By turning the pin on and off

rapidly, you are creating binary states (0 and 1), which is recognized by countless

other electronic devices as a binary signal. By using this method, you can

communicate using a number of different protocols.

Digital communication is an advanced topic, but to get a general idea of what can

be done, check out the Interfacing With Hardware

(http://arduino.cc/playground/Main/InterfacingWithHardware) page.

If you followed the example in Step 6 for getting an LED to blink, you have already

tried using a digital output pin.

Step 11: Analog out

(/files/deriv/FGG/JIJL/H1426JNH/FGGJIJLH1426JNH.LARGE.jpg)

(/files/deriv/FC1/HJ0M/H142Z50T/FC1HJ0MH142Z50T.LARGE.jpg)

Page 12: Intro to arduino

As mentioned earlier, the Arduino has a number of built in special functions. One of

these special functions is pulse width modulation, which is the way an Arduino is

able to create an analog-like output.

Pulse width modulation - or PWM for short - works by rapidly turning the PWM pin

high (5V) and low (0V) to simulate an analog signal. For instance, if you were to

blink an LED on and off rapidly enough (about five milliseconds each), it would

seem to average the brightness and only appear to be receiving half the power.

Alternately, if it were to blink on for 1 millisecond and then blink off for 9

millisecond, the LED would appear to be 1/10 as bright and only be receiving 1/10

the voltage.

PWM is key for a number of applications including making sound, controlling the

brightness of lights, and controlling the speed of motors.

For a more in-depth explanation, check out secrets of PWM

(http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM) page.

To try out PWM yourself, connect an LED and 220 ohm resistor to digital pin 9, in

series to ground. Run the following example code:

File --> Examples --> 3.Analog --> Fading

Step 12: Write your own code

To write your own code, you will need to learn some basic programming language

syntax. In other words, you have to learn how to properly form the code for the

programmer to understand it. You can think of this kind of like understanding

grammar and punctuation. You can write an entire book without proper grammar

and punctuation, but no one will be abler to understand it, even if it is in English.

Some important things to keep in mind when writing your own code:An Arduino program is called a sketch.

All code in an Arduino sketch is processed from top to bottom.

Arduino sketches are typically broken into five parts.

(/files/deriv/FW3/MX1A/H142A629/FW3MX1AH142A629.LARGE.jpg)

Page 13: Intro to arduino

1. The sketch usually starts with a header that explains what the sketch is doing,and who wrote it.

2. Next, it usually defines global variables. Often, this is where constant namesare given to the different Arduino pins.

3. After the initial variables are set, the Arduino begins the setup routine. In thesetup function, we set initial conditions of variables when necessary, and runany preliminary code that we only want to run once. This is where serialcommunication is initiated, which is required for running the serial monitor.

4. From the setup function, we go to the loop routine. This is the main routine ofthe sketch. This is not only where your main code goes, but it will be executedover and over, so long as the sketch continues to run.

5. Below the loop routine, there is often other functions listed. These functionsare user-defined and only activated when called in the setup and loop routine.When these functions are called, the Arduino processes all of the code in thefunction from top to bottom and then goes back to the next line in the sketchwhere it left off when the function was called. Functions are good becausethey allow you to run standard routines - over and over - without having towrite the same lines of code over and over. You can simply call upon afunction multiple times, and this will free up memory on the chip because thefunction routine is only written once. It also makes code easier to read. Tolearn how to form your own functions, check out this page(http://arduino.cc/en/Reference/FunctionDeclaration).

All of that said, the only two parts of the sketch which are mandatory are theSetup and Loop routines.

Code must be written in the Arduino Language(http://arduino.cc/en/Reference/HomePage), which is roughly based on C.

Almost all statements written in the Arduino language must end with a ;

Conditionals (such as if statements (http://arduino.cc/en/Reference/If) and forloops (http://arduino.cc/en/Reference/For)) do not need a ;

Conditionals have their own rules and can be found under "Control Structures(http://arduino.cc/en/Reference/HomePage)" on the Arduino Language(http://arduino.cc/en/Reference/HomePage) page

Variables are storage compartments for numbers. You can pass values into andout of variables. Variables must be defined (stated in the code) before they canbe used and need to have a data type associated with it. To learn some of thebasic data types, review the Language Page(http://arduino.cc/en/Reference/HomePage).

Okay! So let us say we want to write code that reads a photocell connected to pin

A0, and use the reading we get from the photocell to control the brightness of an

LED connected to pin D9.

First, we want to open the BareMinimum sketch, which can be found at:

File --> Examples --> 1.Basic --> BareMinimum

The BareMinimum Sketch should look like this:

voidsetup(){

//putyoursetupcodehere,torunonce:

}

voidloop(){

//putyourmaincodehere,torunrepeatedly:

}

Next, lets put a header on the code, so other people know about what we are

making, why, and under what terms:

Page 14: Intro to arduino

/*

LEDDimmer

byGeniusArduinoProgrammer

2012

ControlsthebrightnessofanLEDonpinD9

basedonthereadingofaphotocellonpinA0

ThiscodeisinthePublicDomain

*/

voidsetup(){

//putyoursetupcodehere,torunonce:

}

voidloop(){

//putyourmaincodehere,torunrepeatedly:

}

Once that is all squared away, let us define the pin names, and establish variables:

/*

LEDDimmer

byGeniusArduinoProgrammer

2012

ControlsthebrightnessofanLEDonpinD9

basedonthereadingofaphotocellonpinA0

ThiscodeisinthePublicDomain

*/

//nameanalogpin0aconstantname

constintanalogInPin=A0;

//namedigitalpin9aconstantname

constintLEDPin=9;

//variableforreadingaphotocell

intphotocell;

voidsetup(){

//putyoursetupcodehere,torunonce:

}

voidloop(){

//putyourmaincodehere,torunrepeatedly:

}

Now that variables and pin names are set, let us write the actual code:

/*

LEDDimmer

byGeniusArduinoProgrammer

2012

ControlsthebrightnessofanLEDonpinD9

basedonthereadingofaphotocellonpinA0

ThiscodeisinthePublicDomain

*/

//nameanalogpin0aconstantname

constintanalogInPin=A0;

//namedigitalpin9aconstantname

constintLEDPin=9;

//variableforreadingaphotocell

intphotocell;

voidsetup(){

//nothinghererightnow

}

voidloop(){

//readtheanaloginpinandsetthereadingtothephotocellvariable

photocell=analogRead(analogInPin);

//controltheLEDpinusingthevaluereadbythephotocell

analogWrite(LEDPin,photocell);

//pausethecodefor1/10second

If we want to see what numbers the analog pin is actually reading from the

photocell, we will need to use the serial monitor. Let's activate the serial port and

output those numbers:

Page 15: Intro to arduino

/*

LEDDimmer

byGeniusArduinoProgrammer

2012

ControlsthebrightnessofanLEDonpinD9

basedonthereadingofaphotocellonpinA0

ThiscodeisinthePublicDomain

*/

//nameanalogpin0aconstantname

constintanalogInPin=A0;

//namedigitalpin9aconstantname

constintLEDPin=9;

//variableforreadingaphotocell

intphotocell;

voidsetup(){

Serial.begin(9600);

}

voidloop(){

//readtheanaloginpinandsetthereadingtothephotocellvariable

photocell=analogRead(analogInPin);

//printthephotocellvalueintotheserialmonitor

Serial.print("Photocell=");

Serial.println(photocell);

//controltheLEDpinusingthevaluereadbythephotocell

analogWrite(LEDPin,photocell);

//pausethecodefor1/10second

//1second=1000

delay(100);

}

For more information about formulating code, visit the Foundations Page

(http://arduino.cc/en/Tutorial/Foundations). If you need help with the Arduino

Language, then the Language Page (http://arduino.cc/en/Reference/HomePage) is

the place for you.

Also, the Example Sketch Page (http://arduino.cc/hu/Tutorial/HomePage) is a great

place to start messing around with code. Don't be afraid to change things and

experiment.

Step 13: Shields

Shields are expansion apdapter boards that plug in over top of the Arduino Uno and

gives it special functions.

Since the Arduino is open hardware, anyone who has the inclination is free to

make an Arduino shield for whatever task they wish to accomplish. On account of

this, there are countless number of Arduino shields out in the wild. You can find an

ever-growing list of Arduino shields

(http://www.arduino.cc/playground/Main/SimilarBoards) in the Arduino playground.

Keep in mind that there will be more shield in existence than you will find on listed

on that page (as always, Google is your friend).

(/files/deriv/FHL/1GFX/H0A0LBNW/FHL1GFXH0A0LBNW.LARGE.jpg)

Page 16: Intro to arduino

To give you a small sense of the capabilities of Arduino shields, check out these

tutorials on how to use three official Arduino shields:Wireless SD Shield (http://www.instructables.com/id/Arduino-Wireless-SD-Shield-Tutorial/)Ethernet Shield (http://www.instructables.com/id/Arduino-Ethernet-Shield-Tutorial/)Motor Shield (http://www.instructables.com/id/Arduino-Motor-Shield-Tutorial/)

Step 14: Building an external circuit

As your projects get more complex, you will want to build your own circuits to

interfacewith the Arduino. While you won't learn electronics overnight, the internet

is an unbelievable resource for electronic knowledge and circuit diagrams.

To get started with electronics, visit the Basic Electronics

(http://www.instructables.com/id/Basic-Electronics/) Instructable.

Step 15: Going beyond

(/files/deriv/FY7/TGWQ/H0A2836M/FY7TGWQH0A2836M.LARGE.jpg)

Intro to Arduino by randofo (/member/randofo/)

+ Collection Download (/id/Intro-to-Arduino/?download=pdf) 15 Steps Favorite (/id/Intro-to-Arduino/)

Page 17: Intro to arduino

Post Comment

1

(/member/tin701/)

3 months ago Reply (C9V9WX6HKM946Y4)

From here, the only thing left to do is make some projects. There are countless

awesome Arduino resources and tutorials online.

Be sure to check out the Official Arduino Page (http://arduino.cc/) and Forum

(http://forum.arduino.cc/). The information listed here is invaluable and very

complete. This is great resource for debugging projects.

If you need inspiration for some fun beginner projects, check out the 20

Unbelievable Arduino Projects (http://www.instructables.com/id/20-Unbelievable-

Arduino-Projects/) guide.

For a vast listing or Arduino project, the Arduino Channel

(http://www.instructables.com/tag/type-id/category-technology/channel-arduino/) is

a great place to start.

That's it. You're on your own.

Good luck and happy hacking!

1-40 of53

Next » (http://www.instructables.com/id/Intro-to-Arduino/?&sort=ACTIVE&limit=40&offset=40#DISCUSS)

tin701 (/member/tin701/) says:

Very good

profpat (/member/profpat/) says:

very good instructable!

(/files/deriv/FG8/BV6T/H0A288B0/FG8BV6TH0A288B0.LARGE.jpg)

Page 18: Intro to arduino

4

(/member/profpat/)

3 months ago Reply (CM8QW2OHKITG56G)

(/member/Raphango/)

3 months ago Reply (CTCU6F6HK1DFRS7)

(/member/Toon_ca7/)

4 months ago Reply (C49HFKDHJ5ZL1CD)

(/member/earslan1/)

6 months ago Reply (CFEDP0RHH2VMAW6)

(/member/naldobatumbakal/)

8 months ago Reply (CMM3Z2LHEXS4LID)

2

(/member/teknohawk/)

8 months ago Reply (CNBRR4THET0RRZP)

(/member/HBang/)

11 months ago Reply (C9FP9DZHAUNNGHU)

(/member/charmquark/)

11 months ago Reply (CINX482HAWBWK2P)

(/member/rustygray/)

1 year ago Reply (CENBRSNH8CVDEVV)

Raphango (/member/Raphango/) says:

Wonderfull tutorial! It has enlightened me up pretty much. I'm pretty much familiar toarduino now, and pretty much confident about not blowing up my projects. Thank you

very much!

Toon_ca7 (/member/Toon_ca7/) says:

Im looking forward to work some animatronics projects using arduino lillypads.

Was guessing if there's a way you can bring me some starying data about Arduino,

just like this you're publishing here, in a pdf format, so I can study it offline.

earslan1 (/member/earslan1/) says:

Thank you, this is very good :)

naldobatumbakal (/member/naldobatumbakal/) says:

Liked Arduino and I would like to study

them.

I have a project that needs to contrlol relays

to switch on/of 12volts. Can Arduino capable of doing multi-

switching (9 or 12 volts) around 6 to 10

switches?

I don't often open my account, would it be

better to give me a reply on my mail? at [email protected] you very

much.

teknohawk (/member/teknohawk/) says:

The Uno R3 is most likely the "best" Arduino to use. It is probably the newest,

cheapest and smartest to use for protoboarding (or what ever you need it to do). It

has a Atmel328 and is quit common, mostly used by beginners to Arduino, all the wayto Advanced electrical hobbyists. But really, most Arduino's can use a sketch meant

for " only one type of Arduino"

HBang (/member/HBang/) says:

I'm trying to make a robot arm to grab things and place it in different places. Which

Arduino should I buy? As a beginner, I am having some trouble in figuring out whichArduino to use... Thank you!:)

charmquark (/member/charmquark/) says:

Excellent guide to get up and going with arduino! Thanks a lot!

rustygray (/member/rustygray/) says:

I bought a new Uno board, and it plugs in and lights up, but the serial port command is

greyed out.

I did select the Uno as my board. I reset it, I unplugged and replugged.

I still cannot get the serial port to allow me to make a choice.

Suggestions?

Page 19: Intro to arduino

3(/member/Psychic+Master/)

11 months ago Reply (CPW9ISHHA5M7P2V)

238

(/member/randofo/)

1 year ago Reply (CXDZPK3H8CVG2BC)

(/member/rustygray/)

11 months ago Reply (CBORUZ3HA4MB964)

(/member/elfarandulero/)

1 year ago Reply (C0Z5IUKH7ZPBXO4)

238(/member/randofo/)

1 year ago Reply (C8SONJQH7UQN496)

(/member/elfarandulero/)

1 year ago Reply (CF6SDJ8H7URC19Q)

(/member/elfarandulero/)

1 year ago Reply (C7Z8PGQH7ZPBXO9)

238(/member/randofo/)

1 year ago Reply (CFRKGHYH7UQN49D)

Psychic Master (/member/Psychic+Master/) in reply to rustygray

you might need to manually

update the drivers, thats what i

had to do with my mega 2560

randofo (/member/randofo/) (author) in reply to rustygray

...exchange it for a new one?

rustygray (/member/rustygray/) in reply to randofo

i obtained a 2nd one and same

issue. I have windows 7, and

downloaded the latest software. i

will check for an update.

elfarandulero (/member/elfarandulero/) says:

First I have to be clear,what is Arduino I see that name all over the Internet?

randofo (/member/randofo/) (author) in reply to elfarandulero

From the first paragraph of myexplanation of what an Arduino is:

An Arduino is an open-source

microcontroller development board.

In plain English, you can use theArduino to read sensors and control

things like motors and lights. This

allows you to upload programs to this

board which can then interact with

things in the real world. With this, youcan make devices which respond

and react to the world at large.

elfarandulero (/member/elfarandulero/) in reply to randofo

Since I don't know anything about

microcontroller; I like Electronics Ikeep using the regular PCB for my

projects;let the wizard one work with

Arduino; I don't need Arduino at this

point

elfarandulero (/member/elfarandulero/) says:

Some people think of the entire Arduino board as a microcontroller, but this isinaccurate. The Arduino board actually is a specially designed circuit board for

programming and prototyping with Atmel microcontroller.. Then why not use a regular

PCB board? I don't know a hell about microcontroller; I don't even know what is that

and what is the use for microcontroller????/

randofo (/member/randofo/) (author) in reply to elfarandulero

Because a PCB board is a

fiberglass board with copper on it. It

does not do anything.

A microcontroller is a computer chip,which is like a mini computer that

controls things.

You attach microcontrollers (and

Page 20: Intro to arduino

16(/member/ride+on+toy+dude/)

1 year ago Reply (C4LQZUGH4AFSGZE)

238(/member/randofo/)

1 year ago Reply (CX9WBVHH4AGJHIO)

16

(/member/ride+on+toy+dude/)

1 year ago Reply (CN3JWXOH4AGJLW8)

238(/member/randofo/)

1 year ago Reply (CQML3PBH4AGJN1R)

16(/member/ride+on+toy+dude/)

1 year ago Reply (CVIFAEFH4V015O8)

238

(/member/randofo/)

1 year ago Reply (CA504RTH4ZN4RKQ)

other components) to PCB boards.

ride on toy dude (/member/ride+on+toy+dude/) says:

Hey Randofo!! I had a few questions aboutbeginning in arduino.

-What would be the best starter project for

arduino?

-Do you recommend any particular books or

ibles on this subject? -Does a computer have to have USB 2.0

ports to operate an arduino?

(Mine only has USB 1.0 ports.)

if anybody has any other advice, please

leave a comment below.

randofo (/member/randofo/) (author) in reply to ride on toy dude

I think USB 1.0 should be fine.

I recommend this one ;-)

...but you should try searching the site

for some of the Arduino guides and

eBooks. Those are pretty good. Also,

arduino.cc has a ton of useful

information. It just takes a little diggingthrough.

What do you ultimately want to make

with an Arduino? Once I have a sense

of that, I can probably recommendsome intro projects that might help

you.

ride on toy dude (/member/ride+on+toy+dude/) in reply to randofo

Also, is an led cube a beginner,

intermediate, or advanced project?

randofo (/member/randofo/) (author) in reply to ride on toy dude

An led cube is probably a beginner tointermediate project. I would start

small with a 3 x 3 x 3 LED cube. It

may not seem like much, but that is

27 LEDs to solder together, which

will take a bit of work.

ride on toy dude (/member/ride+on+toy+dude/) in reply to randofo

I have the cube soldered together!!

However I still need the resistors,

transistors, and perfboard. Good luck

at Red Bull Creation!!!

The people who won last year had ahuman sized hamster wheel that

printed dot matrix words. People in the

crowd were told to text it and it would

print the texts.

It was awesome! :):):):):)!!

randofo (/member/randofo/) (author) in reply to ride on toy dude

Good luck with the cube. We did our

best on the challenge. Now it is up to

the internet to vote for us. I guess we

Page 21: Intro to arduino

16

(/member/ride+on+toy+dude/)

1 year ago Reply (CJADPQDH51AS3RB)

238(/member/randofo/)

1 year ago Reply (CCPHRATH4ZN58CO)

16

(/member/ride+on+toy+dude/)

1 year ago Reply (CJEIBEWH4ZN59Q6)

238(/member/randofo/)

1 year ago Reply (C266HHMH51ASO91)

16

(/member/ride+on+toy+dude/)

1 year ago Reply (CBFJAKKH4AFSHCT)

(/member/Harshaeinstein/)

1 year ago Reply (CSNCHR7H4AFZFQD)

will see how it goes.

ride on toy dude (/member/ride+on+toy+dude/) in reply to randofo

I finished it!! it works really well!

Never fear with the voting. you've goteverybody on Instructables supporting

you guys!!

randofo (/member/randofo/) (author) in reply to ride on toy dude

Awesome! Nice job on your first

Arduino project. You should share itwith a Photo Instructable.

ride on toy dude (/member/ride+on+toy+dude/) in reply to randofo

I am going to try to rebuild it with ahackduino so I can keep the Arduino I

have know. I try to post it then. Howwould I build an infrared rc system with

Arduino?I had a n idea for a door that had akey fob so that I could remotely unlock

the door to my room. Or build asystem that would open up my closet

doors when I pushed a button. : )

randofo (/member/randofo/) (author) in reply to ride on toy dude

This might get you started with the IRpart of things:http://www.instructables.com/id/Clone-

a-Remote-with-Arduino/(http://www.instructables.com/id/Clone-

a-Remote-with-Arduino/)

There are bunch of projects on

Instructables for electronic door locks.You should search the site for those.

ride on toy dude (/member/ride+on+toy+dude/) in reply to randofo

I want to tart out with something like asmall led cube. I also found a really

interesting arduino starter kit online.here's a

linkhttp://www.amazon.com/Arduino-Uno-Starter---Solderless-Breadboard/dp/B0051QHPJM/ref=sr_1_2?

ie=UTF8&qid=1341878297&sr=8-2&keywords=arduino

(http://www.amazon.com/Arduino-Uno-Starter---Solderless-Breadboard/dp/B0051QHPJM/ref=sr_1_2?

ie=UTF8&qid=1341878297&sr=8-2&keywords=arduino)

Harshaeinstein (/member/Harshaeinstein/) says:

thank you very much.... i am not able to understand why there is a

16Mhz crystal(SPK 16.000) on arduino(uno)board.

please help me out.. thank you....

Page 22: Intro to arduino

238

(/member/randofo/)

1 year ago Reply (COL7UPYH4AGJHIZ)

1

(/member/ms10/)

1 year ago Reply (COQMILTH1EN6RVR)

3

(/member/waterlubber/)

1 year ago Reply (C088SDSH3KOVX46)

238

(/member/randofo/)

1 year ago Reply (CLT7F93H1ERMW62)

1

(/member/ms10/)

1 year ago Reply (C1T72MPH1ERNF5P)

(/member/Orngrimm/)

1 year ago Reply (CSXAJLKH2MYJZRV)

(/member/jimvandamme/)

1 year ago Reply (CGTM2DDH1KH9P1B)

(/member/linda555/)

1 year ago Reply (CDY720WH1EN787S)

randofo (/member/randofo/) (author) in reply to Harshaeinstein

It is on there to provide a stable clockfor the microcontroller.

ms10 (/member/ms10/) says:

awesome instructable thanks it helped me a lot

my arduino works lights up the green light but when i upload code into it at the minute

it says

"arvdude :verification error,first mismatch at byte 0x00000xc != 0x62

arvdude : verification error ; content mismatch"

i new to arduino and i just bought it 2 days ago

do you have some idea on what's going on

waterlubber (/member/waterlubber/) in reply to ms10

Oh no...sometimes, you just retry. Ifthat doesn't work, do this:

V V

V V

randofo (/member/randofo/) (author) in reply to ms10

Double check the configuration yousetup in step 5. I am not certain why

you are getting that error, but it seemslike the board or the serial port is notselected properly.

ms10 (/member/ms10/) in reply to randofo

thanks

Orngrimm (/member/Orngrimm/) says:

Cool 'ible! Nice ans painless. Will forward it to some folks who want to gain foot withArduino.

BTW: Didnt you forgot one popular Arduino?

The Arduino Nano http://arduino.cc/en/Main/ArduinoBoardNano I often use it (Or a cheaper chinese replica) for the movement of the finished projectoff to the cheaper and final resting place...

jimvandamme (/member/jimvandamme/) says:

Typo: First page, under "Arduino NG,

Diecimila, and the Duemilanove" paragraph,you meant ATMEGA328, not '368

linda555 (/member/linda555/) says:

This comes at the perfect time for me. Very clear and understandable. This is beyonda doubt the clearest, most inclusive explanation of how to get the Arduino up and

running. You have been posting a lot of very helpful Instructables.

Thanks for this one and the many others.

Page 23: Intro to arduino

6

(/member/Kryptonite/)

1 year ago Reply (CGKAS18H19RQV1Q)

(/member/jjmcgaffey/)

1 year ago Reply (C5S4LZOH1EMHVER)

Post Comment

Kryptonite (/member/Kryptonite/) says:

Step 12, the last two images appear to be the same, is this correct?

jjmcgaffey (/member/jjmcgaffey/) in reply to Kryptonite

The change is in the Setup section,

not at the bottom like all the others.Sneaky!

1-40 of53

Next » (http://www.instructables.com/id/Intro-to-Arduino/?&sort=ACTIVE&limit=40&offset=40#DISCUSS)

About Us

Who We Are (/about/)

Advertise (/advertise/)

Contact (/about/contact.jsp)

Jobs (/community/Positions-available-at-Instructables/)

Help (/community?categoryGroup=Help)

Find Us

Facebook (http://www.facebook.com/instructables)

Youtube (http://www.youtube.com/user/instructablestv)

Twitter (http://www.twitter.com/instructables)

Pinterest (http://www.pinterest.com/instructables)

Google+ (https://plus.google.com/+instructables)

Resources

For Teachers (/teachers/)

Artists in Residence (/group/air/)

Forums (/community/)

Answers (/tag/type-question/?sort=RECENT)

Mobile

Download our new apps foriOS and android!

Android

(https://play.google.com/store/apps/details?

id=com.adsk.instructables)

iOS

(https://itunes.apple.com/app/instructables/id586765571)

Go Pro Today » (/account/gopro?sourcea=footer)

We're Hiring! » (/community/Positions-available-at-Instructables/)

Join our newsletter:

Terms of service (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721) |

Privacy Policy (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079) | Legal Notices & Trademarks (http://usa.autodesk.com/legal-notices-trademarks/) |

Mobile Site (http://m.instructables.com) (http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112)

Join!

©Copyright 2013 Autodesk Inc. All rights reserved.

Englishenter email