This packet shows how to control a single external LED with an Arduino board.

The code for this packet is similar to the code for blinking the on-board LED. However,
the circuit is different.

Introduction to LEDs

LEDs come in many different types; for this packet, we’ll focus on monochrome LEDs, the most
common of which can produce light in red or green or yellow or blue.

Monochome LEDs have 2 leads; one is longer than the other. The longer lead is the “anode” or
positive lead. The shorter lead is the “cathode” or negative lead. When you get a new LED, both
leads are straight and it is easy to see which one is longer. Once an LED has been used, the
longer lead is often bent so that the two leads have the same top-to-bottom height, which is
convenient for connecting in breadboards. The bent lead will is still the anode, it’s just
harder to recognize.

(New LED: leads are still straight) (Used LED: longer lead has been bent)

Introduction to resistors

A resistor can come in any one of many values from 1Ω to several MΩ. The value of any particular
resistor can (in principle) be red from the colors of the bands printed on it.
(However, it is difficult to remember the color code.) A 220Ω resistor has a these bands:

Resistors have 2 leads but no polarity so it doesn’t matter which side you connect to a component.

Connecting components directly 🙁

One way to connect the components is to:

In order to have a good electrical contact between the LED and the resistor, you’ll
need to solder the LED to the resistor. This is time-consuming, requires extra equipment,
and makes it difficult for you to re-use the LED (or the resistor) in another circuit.

Connecting components via a breadboard 🙂

The solution is to use a “breadboard” which allows you to make temporary connections simply
by plugging components in to the “right” holes. The real electrical connections are made inside
the breadboard.

A “full-sized” breadboard

To use the breadboard effectively, be aware of its basic layout:

Two rows of “GND” connections Two rows of “Power” connections
A single field in a breadboard
The great divide
The great divide and the mini-divide