Saturday, April 2, 2011

Project 1 – LED Flasher

Posted by rinson

You are now going to work your way through the first four projects. These projects all use LED lights in
various ways. You will learn about controlling outputs from the Arduino as well as simple inputs such as
button presses. On the hardware side, you will learn about LEDs, buttons, and resistors, including pull
up and pull down resistors, which are important in ensuring that input devices are read correctly. Along
the way, you will pick up the concepts of programming in the Arduino language. Let’s start with a “Hello
World” project that makes your Arduino flash an external LED

For the first project, you are going to repeat the LED blink sketch that you used during your testing stage.
This time, however, you are going to connect an LED to one of the digital pins rather than using LED13,
which is soldered to the board. You will also learn exactly how the hardware and the software for this
project works, learning a bit about electronics and coding in the Arduino language (which is a variant of
C) at the same time.

Parts Required
5mm LED
100 ohm Resistor*
Jumper Wires

Connecting Everything

First, make sure your Arduino is powered off by unplugging it from the USB cable. Now, take your
breadboard, LED, resistor, and wires and connect everything as shown in Figure 2-1.

It doesn’t matter if you use different colored wires or use different holes on the breadboard as long
as the components and wires are connected in the same order as in the picture. Be careful when
inserting components into the breadboard. If your breadboard is brand new, the grips in the holes will
be stiff. Failure to insert components carefully could result in damage.
Make sure that your LED is connected correctly with the longer leg connected to Digital Pin 10. The
long leg is the anode of the LED and must always go to the +5v supply (in this case, coming out of Digital
Pin 10); the short leg is the cathode and must go to Gnd (ground).
When you are sure that everything is connected correctly, power up your Arduino and connect the
USB cable.