Hardware Reference
In-Depth Information
Voltage refers to the amount of pressure that the electricity is under. As an
analogy, if you had a hose connected to a wimpy little water pump, water
might dribble out of the other end of the hose. If you connected a more pow-
erful water pump (that is, increased the voltage), the water would be under
more pressure and would shoot out of the hose.
Current , on the other hand, is the amount of electrical energy (the number
of electrons) that flows through a given point in the circuit in a period of time.
Using the water analogy, attaching a larger hose to the pump would allow
more gallons per second to flow past a particular point. Electrical current is
measured in amperes (amps). A typical red LED might consume 20 milliamps
(mA), or 0.02 amps. It's important to note, however, that Galileo's digital
output pins will only provide about 10mA of current.
LED Polarity
Earlier, you identified the anode and cathode of the LED and connected the
anode to pin 13 through a resistor. The cathode of the LED connected to the
ground side of the circuit. If you got this reversed, the LED would not light up
and you wouldn't have a complete circuit. This is simply a side effect of the
way an LED works.
In fact, all diodes (even the ones that don't light up), by definition, oppose
the flow of electricity in only one direction. This comes in handy for some
circuits where you need to protect sensitive components from a possible
condition in which the flow of electricity reverses.
A component that must be connected in a certain orientation in relation to
the flow of electrical current is considered to be polarized or have polarity .
Resistors with LEDs
Another property of an LED is that it has a typical voltage and current at which
it's meant to operate. Differences in color, size, and manufacturer can have
an effect on these properties. If the LED is given too much voltage or is al-
lowed to pull more current than it needs, it will be damaged or burn out.
The purpose of a resistor is to resist the flow of electrical current. Using the
water hose analogy, it would be like stepping your foot down on the hose. By
adding a little bit of resistance to your LED circuit, you can ensure that the
LED is provided with the proper voltage and current.
Unlike LEDs, resistors do not have polarity, so the orientation of this com-
ponent in relation to the flow of electrical current doesn't matter.
That's enough discussion of electrical matters for now. Let's get back into
the code.
Search WWH ::




Custom Search