Home Chapter 7 Identifying an LED general
Identifying an LED general

In this exercise, you will be using Ohm’s law to identify the proper parts for the project and to calculate the size of resistor you will need. You will then place the parts in the breadboard on the Board of Education and program them to turn on an off in sequence, using the commands of HIGH, LOW and PAUSE.

An LED has two terminals, one called the anode and the other the cathode. The longer lead is the anode, but the best way to test them is to carefully look for the flat mark at the bottom of the LED. On some LEDs, it is difficult to see the flat area or it may not be apparent, so you must use all clues.



side and top view of an LED


Because the LED is a semiconductor and we know that it is sensitive to too much current, we need to know what the absolute maximum ratings are on this part before we hook it up to the circuit.

We also need to know what the absolute maximum ratings are for the microprocessor, and we will address this in Chapter 8 in more detail.

The LEDs we are using do not want to see any more than 20 mA or .02 amps maximum, so you will need to a use a resistor to limit the current.


You must never exceed the absolute maximum ratings on any parts, or you risk the parts and maybe your Basic Stamp.


Here you will get to use Ohm’s law to calculate what the proper resistor would need to be in order to have the LED glow brightly and safely.

Ohm’s Law should be repeated for each and every part that you interface to your microcontroller because the controller has delicate components.

  1. Use Ohm’s law to calculate the resistor you need, because your LED can take no more than 20 mA. 20 mA is the same as .020 amps. The voltage of 5 volts is a given coming from your Basic Stamp.
  2. Ohm’s Law is V = I x R, where R is the resistance (measured in ohms), V is the voltage (volts), and I is current (amps). We have 5 volts and want to solve for R or resistance, so 5v = .020A x R or 5/. 020 = R or 250 ohms.
  3. However because we are concerned with the ability to drive many LEDs at one time for this lesson we are wise to use a 470 Ohm Resistor. This will allow us to turn on many LEDs on and off using the total of 50 ma we can source (provide) from the Basic Stamp. Remember when driving more than one LED you need a resistor for each LED and line out from the Basic Stamp.
  4. It is okay to use a larger value but not a smaller value. Using the larger value will only mean the LED will glow a little less brightly, but the circuit and flashing will still work. A smaller value will allow too much current and possibly damage your Basic Stamp so use your mulitmeter to confirm the resistor values. 
  5. Identify the part using the color codes, which should be yellow, violet, and brown.
  6. Set your multimeter to the Ohm’s setting. As instructed in Chapter 3, use your meter to measure the resistor and confirm that you have the correct resistor for this circuit.