Hardware Reference
In-Depth Information
DIGGING INTO THE CIRCUIT
In the circuit in Figure 5-4, a resistor is used. An LED is a delicate component
that can only cope with a small amount of current, usually no more than about
20mA (that's 0.02 of an amp, which is quite small). If an LED is connected
directly to a battery, too much current will flow around the circuit and it will
damage the LED. To prevent this from happening, a resistor is added that limits
the flow of current around the circuit. The value of the resistor is indicated by
the coloured bands on its body.
If a higher battery voltage is used, you will have to use a higher value of resis-
tance to limit the amount of current that flows in the circuit. I have calculated
the resistor values in this project for you, but there are plenty of websites that
will help you recalculate the resistor value for different battery voltages, such as
www.ohmslawcalculator.com/led_resistor_calculator.php .
A current is the rate at which electrical energy flows past a point in a circuit.
It is the electrical equivalent of the flow rate of water in pipes. Current is
measured in amperes (A), often abbreviated to Amps. Smaller currents are
measured in milliamperes (mA). There are some interesting theories about the
direction that current actually flows in a circuit, which you can read about here:
www.allaboutcircuits.com/vol_1/chpt_1/7.html
CHALLENGE
See if you can build the circuit in FigureĀ 5-4 with your electronic components, so
that when you press the button the LED lights up. You will need a small battery
pack with two AA or AAA batteries. Make sure that you put the LED in the cir-
cuit the right way. If the LED does not light, check your wiring very carefully, and
make sure that you have the LED in the circuit the right way.
Connecting Electronics to
Your.Computer
Soon you are going to connect an LED to your computer and control it from a Python
program. When you are controlling electronic components from your computer, your
computer needs a way to connect and control those circuits, and for that you need
some general purpose input outputs (GPIOs) .
 
Search WWH ::




Custom Search