Differences

This shows you the differences between two versions of the page.

Link to this comparison view

products:ardx:circ-11 [2012/03/14 04:59] (current)
Line 1: Line 1:
  
 +<html>
 +<div id="CIRC-head">
 +<div id="CIRC-100"><table height="100px" width="100px" valign="center"><tr><td><span class="headText"><center>CIRC<br>11</center></span></td></tr></table></div>
 +<div id="CIRC-465"><table height="100px" width="465px" valign="center"><tr><td><span class="subText"><center>.:Larger Loads:.<br>.:Relays:.</center></span></td></tr></table></div>
 +<div id="CIRC-100"><img src="http://www.ardx.org/src/circ/CIRC-11-square-100.jpg" width="100" height="100"></div>
 +</div>
 +<span class="familyName"><center>(ARDX)   .:Arduino Expermentation Kit:.   (ARDX)</center></span>
 +<div id="CIRC-whitespace"></div>
 +<div id="CIRC-body">
 +<div id="CIRC-whitespace"></div><br>
 +<div id="CIRC-whatweredoing">
 +<span class="titleText">What We're Doing</span><br>
 +<span class="regularText">This next circuit is a bit of a test. We combine what we learned about using transistors in CIRC03 to control a relay. A relay is an electrically controlled mechanical switch. Inside the little plastic box is an electromagnet that, when energized, causes a switch to trip (often with a very satisfying clicking sound). You can buy relays that vary in size from a quarter of the size of the one in this kit up to as big as a fridge, each capable of switching a certain amount of current. They are immensely fun because there is an element of the physical to them. While all the silicon we've played with to this point is fun sometimes, you may just want to wire up a hundred switches to control something magnificent. Relays give you the ability to dream it up then control it with your Arduino. Now to using today's technology to control the past. (The 1N4001 diode is acting as a flyback diode, for details on why it's there visit: <a href="http://ardx.org/4001 ">http://ardx.org/4001 </a>) </span>
 +</div><br>
 +<div id="CIRC-whitespace"></div><br>
 +<div id="CIRC-thecircuit">
 +<span class="titleText">The Circuit</span><br>
 +<div id="CIRC-thepartsSideSpacer">
 +</div>
 +        <div id="CIRC-theparts">
 +          <span class="smallTitleText">The Parts</span><br>
 +          <span class="regularText">
 +<table>
 +<tr>
 +<td>
 +<img src="http://www.oomlout.com/parts/CIRC-01-3dsheet-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +CIRC-11 <br>Breadboard Sheet <br>x1
 +</span>
 +</td>
 +<td>
 +<img src="http://www.oomlout.com/parts/DIOD-01-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +Diode<br>(1N4001) <br>x1
 +</span>
 +</td>
 +<td>
 +<img src="http://www.oomlout.com/parts/IC-2222A-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +Transistor<br>P2N2222AG (TO92) <br>x1
 +</span>
 +</td>
 +<td>
 +
 +<img src="http://www.oomlout.com/parts/RELAY-01-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +Relay<br>(SPDT) <br>x1
 +</span>
 +</td>
 +</tr>
 +
 +<tr>
 +<td>
 +<img src="http://www.oomlout.com/parts/RES-103-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +10k  Ohm Resistor<br>Brown-Black-Orange <br>x1
 +</span>
 +</td>
 +<td>
 +<img src="http://www.oomlout.com/parts/RES-561-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +560 Ohm Resistor<br>Green-Blue-Brown <br>x2
 +</span>
 +</td>
 +<td>
 +<img src="http://www.oomlout.com/parts/LED-05G-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +Green LED<br>x1
 +</span>
 +</td>
 +<td>
 +
 +<img src="http://www.oomlout.com/parts/LED-05R-60.png" width="60px" height="36px">
 +</td>
 +<td>
 +<span class="partsText">
 +Red LED<br>x1
 +</span>
 +</td>
 +</tr>
 +</table>
 +</span>
 +        </div><br>
 +        <div id="CIRC-whitespace"></div><br>
 +        <div id="CIRC-thepartsSideSpacer"></div>
 +          <div id="CIRC-circuitBox">
 +            <div id="CIRC-schematic"><center><span class="smallTitleText">Schematic</span><span class="smallTitleText"><img src="http://www.ardx.org/src/circ/ARDX-SC-11-150.png"></span></center></div>
 + <br>
 + <div id="CIRC-smallwhitespace">&nbsp;</div><br>
 +            <div id="CIRC-resources">
 + <center><span class="smallTitleText">Resources</span><br><span class="smallMediumDarkText"><b>.:download:.</b><br>breadboard layout sheet<br><b><a href="http://ardx.org/BBLS11">http://ardx.org/BBLS11</a></b><br><br><b>.:view:.</b><br>assembly video <b><br><a href="http://ardx.org/VIDE11">http://ardx.org/VIDE11</a></b></span></center>
 +            </div>
 +          </div>
 +        <div id="CIRC-circuitPicture">
 +          <center>
 +            <img src="http://www.ardx.org/src/circ/CIRC11-3dexploded-445.png" width="445">
 +          </center>
 +        </div>
 +      </div><br>
 +      <div id="CIRC-whitespace">&nbsp;</div><br>
 +<div id="CIRC-thecode">
 +        <span class="titleText">Code</span> <span class="smallDarkText">(no need to type everything in just)</span><br>
 +        <span class="mediumDarkText">File &gt; Examples &gt; 1.Basic &gt; Blink<br>(example from the great arduino.cc site, check it out for other great ideas) </span><br>
 +        <span class="code">        <prew>/*<br>
 +&nbsp;&nbsp;Blink<br>
 +&nbsp;&nbsp;Turns&nbsp;on&nbsp;an&nbsp;LED&nbsp;on&nbsp;for&nbsp;one&nbsp;second,&nbsp;then&nbsp;off&nbsp;for&nbsp;one&nbsp;second,&nbsp;repeatedly.<br>
 +&nbsp;&nbsp;The&nbsp;circuit:<br>
 +&nbsp;*&nbsp;LED&nbsp;connected&nbsp;from&nbsp;digital&nbsp;pin&nbsp;13&nbsp;to&nbsp;ground.<br>
 +&nbsp;&nbsp;*&nbsp;Note:&nbsp;On&nbsp;most&nbsp;Arduino&nbsp;boards,&nbsp;there&nbsp;is&nbsp;already&nbsp;an&nbsp;LED&nbsp;on&nbsp;the&nbsp;board<br>
 +&nbsp;connected&nbsp;to&nbsp;pin&nbsp;13,&nbsp;so&nbsp;you&nbsp;don't&nbsp;need&nbsp;any&nbsp;extra&nbsp;components&nbsp;for&nbsp;this&nbsp;example.<br>
 +&nbsp;&nbsp;<br>
 +&nbsp;Created&nbsp;1&nbsp;June&nbsp;2005<br>
 +&nbsp;By&nbsp;David&nbsp;Cuartielles<br>
 +&nbsp;http://arduino.cc/en/Tutorial/Blink<br>
 +&nbsp;based&nbsp;on&nbsp;an&nbsp;orginal&nbsp;by&nbsp;H.&nbsp;Barragan&nbsp;for&nbsp;the&nbsp;Wiring&nbsp;i/o&nbsp;board<br>
 +&nbsp;*/<br>
 +<br>
 +int&nbsp;ledPin&nbsp;=&nbsp;&nbsp;2;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Relay&nbsp;connected&nbsp;to&nbsp;digital&nbsp;pin&nbsp;2&nbsp;&nbsp;&nbsp;<&#45;&#45;&#45;&#45;&#45;Change&nbsp;this&nbsp;to&nbsp;pin&nbsp;2&nbsp;<br>
 +<br>
 +//&nbsp;The&nbsp;setup()&nbsp;method&nbsp;runs&nbsp;once,&nbsp;when&nbsp;the&nbsp;sketch&nbsp;starts<br>
 +<br>
 +void&nbsp;setup()&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
 +&nbsp;&nbsp;//&nbsp;initialize&nbsp;the&nbsp;digital&nbsp;pin&nbsp;as&nbsp;an&nbsp;output:<br>
 +&nbsp;&nbsp;pinMode(ledPin,&nbsp;OUTPUT);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
 +}<br>
 +<br>
 +//&nbsp;the&nbsp;loop()&nbsp;method&nbsp;runs&nbsp;over&nbsp;and&nbsp;over&nbsp;again,<br>
 +//&nbsp;as&nbsp;long&nbsp;as&nbsp;the&nbsp;Arduino&nbsp;has&nbsp;power<br>
 +<br>
 +void&nbsp;loop()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
 +{<br>
 +&nbsp;&nbsp;digitalWrite(ledPin,&nbsp;HIGH);&nbsp;&nbsp;&nbsp;//&nbsp;set&nbsp;the&nbsp;LED&nbsp;on<br>
 +&nbsp;&nbsp;delay(1000);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;wait&nbsp;for&nbsp;a&nbsp;second<br>
 +&nbsp;&nbsp;digitalWrite(ledPin,&nbsp;LOW);&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;set&nbsp;the&nbsp;LED&nbsp;off<br>
 +&nbsp;&nbsp;delay(1000);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;wait&nbsp;for&nbsp;a&nbsp;second<br>
 +}<br>
 +<br>
 +        </prew></span>
 +      </div>
 +      <div id="CIRC-whitespace">&nbsp;</div><br>
 +<div id="CIRC-notWorking">
 +        <span class="titleText">Not Working?</span> <span class="smallDarkText">(3 things to try)</span>
 + <br><div id="CIRC-smallwhitespace">&nbsp;</div><br>
 + <div>
 +        <div id="CIRC-thepartsSideSpacer">&nbsp;</div>
 +        <div id="CIRC-nw1"><center><span class="regularText"><b>Nothing Happens</b></span><br><span class="regularText">The example code uses pin 13 and we have the relay connected to pin 2. Make sure you made this change in the code.</span></center></div>
 +        <div id="CIRC-thepartsSideSpacer">&nbsp;</div>
 +        <div id="CIRC-nw2"><center><span class="regularText"><b>No Clicking Sound</b></span><br><span class="regularText">The transistor or coil portion of the circuit isn't quite working. Check the transistor is plugged in the right way.</span></center></div>
 +        <div id="CIRC-thepartsSideSpacer">&nbsp;</div>
 +        <div id="CIRC-nw3"><center><span class="regularText"><b>Not Quite Working</b></span><br><span class="regularText">The included relays are designed to be soldered rather than used in a breadboard. As such you may need to press it in to ensure it works (and it may pop out occasionally).</span></center></div>
 +        <div id="CIRC-thepartsSideSpacer">&nbsp;</div>
 +</div></div>
 +<div id="CIRC-whitespace">&nbsp;</div><br>
 +<div id="CIRC-makingBetter">
 +<span class="titleText">Making it Better?</span><br>&nbsp;<br>
 +<span class="regularText"><b>Watch the Back-EMF Pulse</b>  <BR>Replace the diode with an LED. You'll see it blink each time it "snubs" the coil voltage spike when it turns off.  <BR>&nbsp;  <BR><b>Controlling a Motor</b>  <BR>In CIRC-03 we controlled a motor using a transistor. However if you want to control a larger motor a relay is a good option. To do this simply remove the red LED, and connect the motor in its place (remember to bypass the 560 Ohm resistor) <BR>&nbsp;  <BR><b>Controlling Motor Direction</b>  <BR>A bit of a complicated improvement to finish. To control the direction of spin of a DC motor we must be able to reverse the direction of current flow through it. To do this manually we reverse the leads. To do it electrically we require something called an h-bridge. This can be done using a DPDT relay to control the motor's direction, wire up the following circuit. It looks complicated but can be accomplished using only a few extra wires. Give it a try. <BR><br><center><img src="<a href="http://www.ardx.org/src/circ/ARDX-EX-11-01.png"></center>">http://www.ardx.org/src/circ/ARDX-EX-11-01.png"></center></a>
 +</span></html>