
www.picaxe.com/products/axe171
AXE171 PICAXE-14 Audio Kit © Revolution Education Ltd 2015 v1.1
May be copied for educational use.
10
4.1 Switching the LEDs on and off
4.1.0 What is an LED?
A Light Emitting Diode (LED) is an electronic component that
gives out light when current passes through it. An LED is a special
type of diode. A diode is a component that only allows current to
flow in one direction.
Therefore when using a diode, it must always be connected the
correct way around.
The positive (anode) leg of an LED is longer than the negative (cathode) leg (shown by the bar on the
symbol). The negative leg also has a flat edge on the plastic casing of the LED.
4.1.1 What are LEDs used for?
LEDs are mainly used as indicator lights. Red and green LEDs are commonly used on electronic
appliances like televisions to show if they are switched on or in 'standby' mode. LEDs are available in
many different colours, including red, yellow, green and blue. Special 'ultrabright' LEDs are used in
safety warning devices such as the 'flashing lights' used on bicycles. Infra-red LEDs produce infra-red
light that cannot be seen by the human eye but can be used in devices such as video remote-
controls.
4.1.2 Using LEDs.
LEDs only require a small amount of current to work, which makes them
much more efficient than bulbs (this means, for instance, that if powered
by batteries the LEDs will light for a much longer time than a bulb would).
If too much current is passed through an LED it will be damaged, and so
LEDs are normally used together with a 'series' resistor that protects the
LED from too much current.
The value of the resistor required depends on the battery voltage used. For a 4.5V battery pack a
330R resistor can be used, and for a 3V battery pack a 120R resistor is appropriate.
4.1.3 Connecting the LED to a PICAXE microcontroller
Because the LED only requires a small amount of current to operate, it can be directly connected
between the microcontroller output pin and 0V (with the series protection resistor).