LED Circuit and Blinking LED

advertisement
LED Circuit and
Blinking LED
An LED, or light emitting diode, is an easy first step into the world of engineering. This simple device, now used for household lights because of its low use of energy, just needs power to get it working but can also be coded to blink, fade, or turn on and off with the use of sensors and buttons. You could start as simple as using a coin cell battery and placing it between the two leads and pressing down to make a connection. However, this requires you to hold everything in place and doesn’t scale to working with the Arduino. So for the first lesson we will use the Arduino as the battery and then continue on to using the Arduino to code the LED to blink. To do this, we will also need to use a resistor, which helps us regulate the flow of electricity to the LED so that we don’t burn out the LED. Step 1: Identify the pieces 1.
2.
3.
4.
5.
Arduino Breadboard Resistor LED (notice that one of the wires of the LED is slightly longer than the Red & Black Wire (please note that while we use red to represent positive and black to represent negative, the wires themselves do not have that charge, it is only to make it easier for us to understand where they should go. We could have used any color wire or used all of 1 color, but color-­‐coding helps us keep everything in order.) Step 2: Draw the circuit A schematic is a plan for building a circuit much like a blueprint is a plan for building a house. Start with a battery (a circle, with a positive side and a negative side, and a wire coming out of each end), then the resistor (a wire, the squiggly part in the middle, and another wire), then the LED (which has a positive side and a negative side and light emitting from it, hence the name light emitting diode)” Step 3: Make the circuit: 1. Connect the Arduino to your computer using the USB cable, making sure the power comes on on the Arduino (if not you will need to power up the computer first) 2. Connect the red wire from Vin on the Arduino to the red row of the breadboard 3. Connect the black wire from Gnd on the Arduino to the black row of the breadboard 4. Connect the resistor from the red row to the blue row of the breadboard 5. Connect the LED, placing the long wire in the blue row and short wire in the black row Congratulations! You have just made an LED light up! Now let’s move on to making that LED blink. Authored By: Vanessa Myers 1/21/2016 Step 4: Upload “Blink” code 1. Open the Arduino program on your computer (see downloading Arduino info sheet) 2. Select correct port by going to Tools -­‐> Port -­‐> Select Com# with (Arduino Uno) next to it, if there are 2, select the larger one 3. Open the Blink example code by going to File -­‐> Examples -­‐> Basics -­‐> Blink 4. Upload the code (arrow button in the top left corner) 5. Move the red wire from Vin to pin 13 Step 5: Change blink code 1. Scroll down to “void loop” and change both delays in the blink code to 100 to see the light blink faster. 2. Make the delay smaller and smaller until the blink is no longer visible. Authored By: Vanessa Myers 1/21/2016 
Download