<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Phase 2 Interactive &#187; breadboard</title>
	<atom:link href="http://www.phase2online.com/tag/breadboard/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phase2online.com</link>
	<description>Oklahoma City Custom Application Development and Web Design</description>
	<lastBuildDate>Fri, 09 Dec 2011 17:41:51 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Welcome to Arduino!</title>
		<link>http://www.phase2online.com/technology/welcome-to-arduino/</link>
		<comments>http://www.phase2online.com/technology/welcome-to-arduino/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 03:38:10 +0000</pubDate>
		<dc:creator>Colbey Chittenden</dc:creator>
				<category><![CDATA[Fungineering]]></category>
		<category><![CDATA[Hardware & Robotics]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[P2 Culture]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[breadboard]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[resistor]]></category>

		<guid isPermaLink="false">http://www.phase2blog.com/?p=129</guid>
		<description><![CDATA[What is an Arduino? An Arduino is an all in one programmable microcontroller that allows you to start off very quickly in the world of microcontrollers. It is an Open Source hardware controller and there are many flavors out there, each catering to many different needs.
Arduino has an Integrated Development Environment based on the same [...]]]></description>
			<content:encoded><![CDATA[<p>What is an <a href="http://arduino.cc">Arduino</a>? An Arduino is an all in one programmable microcontroller that allows you to start off very quickly in the world of microcontrollers. It is an Open Source hardware controller and there are many flavors out there, each catering to many different needs.<span id="more-129"></span></p>
<p>Arduino has an Integrated Development Environment based on the same environment used in <a href="http://www.processing.org/">Processing</a>. Arduino can be programmed in the IDE using a language like AVR C that is based on the same language used for <a href="http://www.wiring.org.co/">Wiring</a>. Today I will show you how to get started on the basic “hello world&#8221; of microcontrollers. A page provided by the people who make Arduino’s explains more about what it is and can be found <a href="http://www.arduino.cc/en/Guide/Introduction">here</a>.</p>
<p>To get started you will need a few things:</p>
<ul>
<li>An Arduino board (or most any one of the many clones out there which I will discuss later)</li>
<li>A compatible computer and OS (OSX Linux and Windows are supported)</li>
<li>The IDE (downloaded from <a href="http://arduino.cc/en/Main/Software/">Arduino.cc</a>)</li>
<li>An LED (not all clones have a built in LED on pin 13)</li>
<li>An appropriate resistor for your LED (resistor values can be calculated <a href="http://led.linear1.org/1led.wiz">here</a> more info below)</li>
<li>A breadboard and some patch cables</li>
</ul>
<p>Arduino is an open source hardware device which means that it is freely available for people to get the schematics of it and create their own flavor. For this blog, I am using a seeeduino which is an arduino made by <a href="http://www.seeedstudio.com">SeeedStudio</a> and has a few advantages over the traditional arduino, like extra analog I/O and more surface mount parts which makes for a lower profile. Arduino clones are usually designed for a specific purpose, like the Roboduino which has everything setup so you can plug in PWM cables for motor controls, or the Stickduino which is about the size of a pack of gum but has all the same power as a traditional arduino. Usually, all of these clones can use the IDE for development but sometimes the method of connecting the arduino may be different.</p>
<p>It is the special purpose clones that might not have an LED built in on pin 13 and for this you would need an external LED and resistor to follow along, but if you have one of the many clones that are the same form-factor as the original arduino, you should have an integrated LED somewhere on the board.</p>
<p>If you do not want to use another LED and you have one built into the arduino then you do not need to have a separate LED and resistor or breadboard and patch cables. If you have an LED built in and have a separate LED, resistor, breadboard and patch cables, then you can blink each one individually or at the same time using the same way that I will cover below. Having a breadboard and patches handy is also great for prototyping or just playing and is good to have around anyway. Most places that sell arduino’s will have breadboards, and some will have the male to male patch cables that make it easy to plug and play into the arduino and breadboard. A breadboard is basically like a Printed Circuit Board that you don’t have to solder anything with. It has a bunch of 0.1&#8243; holes that are wired like a typical prototype PCB.</p>
<p>Once you have everything you need, it’s easy to get started. First let’s make sure you have the correct resistor for your LED. Visit <a href="http://led.linear1.org/1led.wiz">led.linear1.org</a> and let’s put in some numbers.</p>
<p><img class="alignnone size-full wp-image-133" src="http://www.phase2online.com/wp-content/uploads/2009/05/ledcalc.png" alt="ledcalc" width="500" height="330" /></p>
<p>What I have is an LED that has a forward voltage of 1.7v and an output of 20ma so I plug these values into the calculator and it get back a 180ohm resistor. If you happen to have 180ohm resistors laying around, you can use those. The rule is a plus or minus 10% is still ok, And if you go with higher ohms it will just mean less power gets to the LED. So in my case, I have a 220 ohm resistor sitting here so I will use that since it is higher than what is recommended and will not burn out the LED but still allow enough power to get to the LED to light it up.</p>
<p>Now we need to setup everything. If you are using the integrated LED then you are ready to go and can skip to the code section. For the external LED you will need to plug some things into your breadboard. First, let’s plug in the LED. I have mine put against the middle rail so I have plenty of access to the power and ground rails if i need to use them. And so I can put things in front of it, namely things that will come off the breadboard and connect to the arduino itself.</p>
<p><img src="http://www.phase2blog.com/wp-content/uploads/2009/06/ledbreadboard-300x225.jpg" alt="ledbreadboard" width="300" height="225" class="alignnone size-medium wp-image-145" /></p>
<p>Next I will plug in my resistor to two spots on the breadboard, but one of those spots will be one of the lanes that a leg of the LED is plugged into. This is so we can make sure the power goes through the resistor at some point on its way through the LED. You can select either leg of the LED to connect the resistor, just so it is on one and only one of the legs. Otherwise we will not actually be limiting power.</p>
<p><img src="http://www.phase2blog.com/wp-content/uploads/2009/06/ledresistorbreadboard-300x225.jpg" alt="ledresistorbreadboard" width="300" height="225" class="alignnone size-medium wp-image-142" /></p>
<p>Now we will plug in our power and ground into our breadboard. We will need to know which leg of the LED is the anode (+ or power) and which is the cathode (- or ground). The anode is usually the longer leg of the LED, also on some round LED&#8217;s the cathode side is flat on the body. For my setup, I will be putting the resistor on the cathode, for no specific reason. Now I will plug the supply wire into the lane the anode is on and I will plug in the ground wire to the lane the resistor is plugged into and the LED is NOT plugged into.</p>
<p><img src="http://www.phase2blog.com/wp-content/uploads/2009/06/breadboardwithwires-300x225.jpg" alt="breadboardwithwires" width="300" height="225" class="alignnone size-medium wp-image-143" /></p>
<p>Now we can plug in the wires to the arduino. I will use the GND pin just past pin 13 on the right side of the Arduino and plug in the supply line to the digital pin 3 marked with a PWM on it. The integrated LED is usually connected to pin 13 and we will utilize that when we get to coding.</p>
<p><img src="http://www.phase2blog.com/wp-content/uploads/2009/06/completesetup-300x225.jpg" alt="completesetup" width="300" height="225" class="alignnone size-medium wp-image-144" /></p>
<p>Next go to your computer and open the arduino IDE. I am using version 0015 which is current as of this writing. In the IDE, navigate to File &gt; Sketchbook &gt; Examples &gt; Digital and select Blink. This will open up the blink “sketch&#8221; so we can upload it to our arduino. In the arduino IDE, a “sketch&#8221; is what we call the program that will be uploaded to the arduino. Next plug your USB cable into the arduino and then the computer so it can be found by the IDE. Once we have it found, we will need to setup the IDE to connect to it. Click Tools &gt; Board and select the arduino you are using. Diecimila should be good if you do not know or have a standard arduino. Next click again on Tools &gt; Serial Port and select the serial port that is created by the software on the arduino. If you do not know then you can unplug the arduino and click on Tools &gt; Serial Port and see what is there, then plug it back in and click on Tools &gt; Arduino and select the new one that shows up. Once everything is setup, your IDE should look something like this:</p>
<p><img class="alignnone size-full wp-image-131" src="http://www.phase2online.com/wp-content/uploads/2009/05/arduinoide.png" alt="arduinoide" width="500" height="716" /></p>
<p>With the arduino plugged in and the IDE ready to go, we can upload the sketch. This is done by clicking the “Upload to I/O board&#8221; button <img class="alignnone size-full wp-image-132" src="http://www.phase2online.com/wp-content/uploads/2009/05/arduinoupload.png" alt="arduinoupload" width="28" height="31" /> or going to File &gt; Upload to I/O Board or you can use the keyboard shortcut, which differs based on your operating system. What this will do is compile the sketch and then upload the compiled version to the arduino. Once there, you should see the LED on your arduino blink. But, if you do not have an LED integrated, your board might just look like it does when it is not plugged in. To solve this, we will change a little bit of the code.</p>
<p>First lets talk a little bit about what the code does:</p>
<p>int ledPin = 13;</p>
<p>this just sets up a variable to make it easier for us to know later in the code, which pin is the LED pin.</p>
<p>pinMode(ledPin, OUTPUT);</p>
<p>This is how we tell the arduino that we are going to be writing to “ledPin&#8221; rather than reading from it.</p>
<p>digitalWrite(ledPin, HIGH);</p>
<p>This is how we actually write to the “ledPin&#8221; and control the LED. Note that this line is used twice, once it sets HIGH and once LOW. Basically it is saying HIGH sends power (5v) to the pin or you can think of it as turns it on. Sending LOW sets the power to 0v, or turns it off. HIGH and LOW are reserved words for the IDE and do not have to be defined.</p>
<p>delay(1000);</p>
<p>this tells the arduino that it needs to wait 1000 milliseconds, or 1 second, before going on.</p>
<p>Now we need to add code to make our external LED turn on. Lets first define a pin so we don’t have to use just the number later in the code. Under the “int ledPin = 13;&#8221; line lets add a new int and call it something useful like redLedPin and set it to our pin number, which should be 3. It will be the pin number you plugged the supply wire into. Next, we need to set our pin to output, so under the current pinMode call, lets add one that sets our new redLedPin to output. Now we are ready to make the LED turn on and off however we want. I am going to make my redLedPin turn on when the other LED is off. So now my code looks like this:</p>
<p><img class="alignnone size-full wp-image-134" src="http://www.phase2online.com/wp-content/uploads/2009/05/newcode.png" alt="newcode" width="498" height="296" /></p>
<p>We can upload our code to the arduino and test it out. On my setup, I have pin 13 turning off when pin 3 turns on, and pin 13 turns on when pin 3 turns off. That is just the beginning. Now you can add all sorts of stuff to your code, or to your breadboard and have all sorts of fun. Some examples may be adding a button to make the LED’s turn on, or adding a potentiometer to adjust the fading of the LED. But the possibilities go on and on and on. Comment or email if you have questions.</p>
<p><img src="http://www.phase2blog.com/wp-content/uploads/2009/06/arduinoled-300x225.jpg" alt="arduinoled" width="250" height="187" class="alignnone size-medium wp-image-153" /><img src="http://www.phase2blog.com/wp-content/uploads/2009/06/externalled-300x225.jpg" alt="externalled" width="250" height="187" class="alignnone size-medium wp-image-154" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phase2online.com/technology/welcome-to-arduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

