Download +5 volts How to measure the LEDs Forward Voltage (Vf) How to

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Radio transmitter design wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Audio power wikipedia , lookup

Decibel wikipedia , lookup

Josephson voltage standard wikipedia , lookup

Transistor–transistor logic wikipedia , lookup

Valve RF amplifier wikipedia , lookup

Schmitt trigger wikipedia , lookup

Operational amplifier wikipedia , lookup

TRIAC wikipedia , lookup

PS Audio wikipedia , lookup

Multimeter wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

CMOS wikipedia , lookup

Ohm's law wikipedia , lookup

Current source wikipedia , lookup

Voltage regulator wikipedia , lookup

Power electronics wikipedia , lookup

Surge protector wikipedia , lookup

Power MOSFET wikipedia , lookup

Current mirror wikipedia , lookup

Rectiverter wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Charlieplexing wikipedia , lookup

Opto-isolator wikipedia , lookup

Transcript
Using an NPN transistor to drive multiple LEDs from a PIC microcontroller output
http://picprojects.org.uk
Supply voltage
V
V is the power supply voltage
Vf is the LED forward voltage
If is the LED forward current
Rled =
V - Vf
If
Vf
V
V is the power supply voltage
Vf is the LED forward voltage
n is the number of LEDs in series
If is the LED forward current
V
V
Rled = V - ( n x Vf )
If
Vf
Vf
Vf
To PIC 1K
To PIC 1K
Driving a single LED
To PIC 1K
Connecting multiple LEDs in series
The configuration above can be used when
the number of LEDs in series would be
greater than the supply voltage. Try to work
with a margin of 1 volt or greater between the
supply and the total LED forward voltage.
The supply voltage should be a regulated DC source.
When connecting multiple LEDs in series, the number of LEDs must be such that the sum
of their forward voltages is less than the supply voltage otherwise they can’t operate.
How to calculate the value for the LED current limiting resistor
Supply voltage
V is the power supply voltage
Rled is the current limit resistor value
V
Rled =
(V - Vf )
If
Vf is the LED forward voltage
If is the LED forward current
These parameters should be taken from the datasheet for the
specific LED being used. If this isn’t available you will need to
measure the forward voltage (see below)
You can’t measure the forward current so if you don’t know it you
should work with a value of 15mA
To PIC
1K
Example
(10 volts – 2 volts ) = 533 ohms
0.015amps
Resistors come in standard values, pick the nearest higher standard
value to the one calculated – in this example it would be 560 ohms
How to calculate the power rating for the LED current limiting resistor
The larger the difference between the power supply voltage and the LED forward voltage, the more
power the LED current limiting resistor has to dissipate. The resistor used must have a power rating
greater than the power it will have to dissipate. This is calculated as shown here
Pwatts = If x If x R
Example (0.015 amps x 0.015 amps x 560 ohms = 0.126 watts
How to measure the LEDs Forward Voltage (Vf)
If you don’t have the datasheet for the LEDs you plan to use, or just
want to check the actual forward voltage you can measure it using
the test circuit shown here. Make sure the LED is illuminated and
then measure the voltage across the LED with a voltmeter.
The forward voltage for a standard red, yellow and green 5mm LEDs
will be around 1.8 Volts to 2.2 Volts. For high brightness LEDs it will
typically be 3 volts to 4 volts.
+5 volts
150R
1999
Vdc A
Vac
RΩ
Using an NPN transistor to drive multiple LEDs from a PIC microcontroller output
http://picprojects.org.uk
Transistors
Since standard 3mm, 5mm, 8mm and 10mm LEDs only require around 15mA to operate,
we can use a small NPN transistor to drive them.
Some transistors that are suitable for use in LED driving applications are listed below.
The Ic (collector current) max value is an absolute maximum and operation at or near to
this value should be avoided. For the full specification of each transistor consult the
manufacturers datasheet for the specific device.
Device
2N2222A
2N3053
2N3704
2N3705
2N3904
2N4401
BC107
BC108
BC109
BC182
BC183L
BC184
BC237
BC238B
BC337
BC546
BC548
BC549
ZTX457
Ic max (mA)
800
700
600
600
200
600
200
200
200
100
100
100
100
100
500
100
100
100
500
V
Current here is
LED string1 If
To PIC
1K
V
Current here is
LED string2 If
Current here is:
LED string1 If + LED string2 If
Where one transistor is used to drive LEDs in
the arrangement shown, the transistor will be
passing the sum of the current in all the
parallel strings of LEDs
High Power LEDS
This document has described how to drive multiple high brightness, low power LEDs.
High power LEDs, such as those manufactured by Cree, Luxeon etc work in the same way as
small LEDs and the calculations for current limit resistor and forward voltages can still be used.
However, the power dissipated is much greater which in turn requires power transistors or better
still N channel MOSFETs along with high wattage resistors. Managing the heat and the physical
size of components can be an issue.
Ideally rather than using the passive current limiting described in this document some type of
active current regulator should be employed. This is beyond the scope of this document.
Examples
http://picprojects.org.uk
12 Volts
LED parameters
Vf = 3.2 volts
If = 20mA
R
Calculate value for R
12 volts – ( 3 x 3.2 volts)
20mA
=
2.4
0.02
= 120 ohms
Calculate power rating for R
20mA x 20mA x 120 ohms = 0.048 watts
To PIC
In this case we can use a standard 120 ohm
resistor with a power rating of at least 0.125 watt
1K
5 Volts
LED parameters
R
Vf = 2.1 volts
If = 15mA
R
Calculate value for R
5 volts – ( 2 x 2.1 volts)
15mA
=
0.8
0.015
= 53.3 ohms
53.3 ohms isn’t a standard value so we’ll use 56 ohms
Current through
transistor is
2 x 15mA = 30mA
Calculate power rating for R
To PIC
15mA x 15mA x 56 ohms = 0.126 watts
1K
Use a resistor with a power rating of at least 0.25 watt
9 Volts
LED parameters
R
Vf = 1.8 volts
If = 35mA
Calculate value for R
9 volts – 1.8 volts
35mA
=
7.2
0.035
= 205 ohms
205 ohms isn’t a standard value so we’ll use 220 ohms
Calculate power rating for R
To PIC
1K
35mA x 35mA x 220 ohms = 0.269 watts
Use a resistor with a power rating of at least 0.5 watts