Tutorial 1 and Step 5 on Resistors for Intel® Galileo Boards
Seeing numbers on a screen can get a bit boring. Let's take it a step further and map the microphone data to an LED.
As discussed earlier, the amount of current flowing through a circuit is important to understand. We will use a resistor to limit the flow of current within your circuit to ensure that the LED doesn't get more electricity than it needs to operate.
When taking a closer look at an LED, you'll notice that it only has two points with different lengths, referred to as anode (positive) and cathode (negative). Electricity flows through the anode (long leg, positive charge), into the LED to light it, then back down to the cathode (short leg, negative charge), where it's grounded.
Calculating resistor values
This is Ohm's Law:
(Operating voltage - forward voltage) / current (in amperes) = resistor value
It's used to calculate resistance in a circuit and is represented in “Ohms” using the O symbol.
- Operating voltage: the amount of voltage provided by the power supply (5 volts)
- Forward voltage: the amount of voltage needed to power the LED (or sensor) you are using (2 volts)
- Current: the amount of current needed to operate the LED (or sensor)
- Resistance: The amount of resistance needed to regulate current within a circuit
Our LED uses a current of 20mA (milliamps) to be powered enough to not burn out. An amp (ampere) is a unit of measurement used for electric current.
As the specification for basic LEDs states, and like most common LEDs, it has a typical forward voltage of 2.0 V and a rated forward current of 20mA.
20mA = 0.02 amps
TIP: When calculating current where documentation describes the value in milliamps, divide it by 1000 to use it for Ohm's Law. |
Like most Arduinos, the Intel® Galileo Board is powered by 5 V (operating voltage). Because an LED only needs 2 V (forward voltage) to be powered, we can get the difference between them and fill in the values to the formula:
(Operating voltage - forward voltage) / current = resistor value
(5 V - 2 V) / 0.02 amps = ?
3 / 0.02 = 150
We need a 150 ohm resistor or greater to complete this circuit.
Choosing the right resistor
In order for our LED to have the right amount of current flowing to them, we need increase the resistance so that less current flows.
It will take 150 ohms or greater to allow for the proper flow of current to occur when the circuit is powered. Since writing the values on a resistor is quite difficult, engineers have created a color code chart that corresponds to resistor values. This makes it easy to select the right resistor.
TIP: The back of the resistor pack we're using has a chart that indicates the colors used for each resistor value. If you're using a different resistor (like a 5 or 6 band), your colors will vary. For later band resistors, please refer to the manufacturer specification. |
Each digit in the resistance value corresponds to a different color. We're using a 4-band color code for our resistors.
Since we don't have a resistor for exactly 150 ohms in the resistor pack we're using, we'll use a 220 ohm resistor, which uses the following color code:
- 2 Red
- 2 Red
- 0 Brown
TIP: The third band can be tricky to understand. Since our value is 220 on a 4 band resistor, we use the following formula: We see in our 4-band resistor chart (in the back of the resistor package) that 10 = brown, giving us a band of Red, Red, Brown. |