Calulating BJT base resistance for PIC led switching?
Hi,
Hoping this is not too off topic.
I need my PIC to switch an ultrabright led.
Using a BC182L general purpose NPN transistor from futurlec
(http://www.futurlec.com/Transistors/BC182L.shtml)
and an ultrabright led from futurlec
(http://www.futurlec.com/LED/LED5YULB.shtml)
I need to use a BASE resistor for my BJT.
I'm using the ultrabright led at 2.4V 20mA with a 9V power supply, so I will be using a 330 ohms limiter resistor (9V-2.4V/0.02A)
Then I've checked the web to find clues to calculate RB for the BJT but there are parameters I don't understand.
according to
http://www.kpsec.freeuk.com/trancirc.htm
I should calculate the RB value with a pretty simple formula but when I have to find the Ic for the load, I'm stuck. How can I determine the right load resistance? Does it mean the total resistance of the current limiter for the led AND the resistance of the led? If so how can I calculate the resistance?
I did not find the value of the led resistance in the specs of the led.
Maybe using:
U=R*I -> R = 2.4V/0.02A = 120 ohms?
Then I should add the 330 ohms of the led current limiting resistor to have the Ic value using: 9V/.450Kohms = 20 mA?
If so, then the RB should be (if HFE min is 100 and PIC supply is 5V):
(5V*100)/(5*0.02A) = 5KOhms
Am I right?
Thanks for any hints...
PS: I should add some voltage drop value somewhere for the transistor?
In the same idea, I also have to switch an LM555 times but I don't know what value I should consider as the LM555 (the 'load') current and resistance...
The right values for BJT base resistor?
I have made calculations for my several uses of BC182L general purpose NPN BJT. Would you mind and have a look at these so you can tell me if I'm right or wrong. Well, this is definately off topic but as I started it here, I would like to finish it here too :p
(In fact, maybe I should use a mosfet instead of BJT to save the hassle of calculating the base resistors...)
CASE 1:
normal red led driven by pic
I need 2V, 15mA, driven by 5V from PIC
I will need 200 Ohms current limiter (5-2/0.015) between led and PIC.
CASE 2:
ultrabright led supplied by 9V battery, controled by a BJT (BC182L, HFE(min) = 80) driven by PIC (5V)
Current limiter to get 2.1V 20mA with 9V => (9-2.1/0.02) = 345 Ohms
Then for the Base current limiter I will have: 80/5 = 16 => 20/16, 5-0.7/1.25 = 3.44 KOhms resistor or less
CASE 3:
infrared led supplied by 9V battery, controled by a MOSFET (IRLD110) driven by pic (5V)
Current limiter to get 1.4V 250mA: 9-1.4/0.25 = 30.4 Ohms
CASE 4:
One Pic pin controls a BJT (BC182L) to pull to GND a pin of another PIC.
The pins of the two pic are connected via a 1K resistor, so current between pics will be 5/1000=5mA
5/16 = 0.3125, 5-0.7/0.3125 = 13.76K resistor or less to be used as base current limiter
CASE 5:
LCD backlight controled by pic (5V) via a BJT (BC182L). Backlight need 5V 70mA.
70/16 = 4.375, 5-0.7/4.375 = 0.98K or less to be used as base current limiter.
CASE 6:
A 5V, 30mA relay controled by a pic (5V) via a BJT (BC182L).
30/16 = 1.875, 5-0.7/1.875=2.29K or less to be used as a base current limiter
CASE 7:
A PIC (5V) is used to pull to GND the TRIGGER pin of a LM555 via a 1K current limiter (so we will have 5V, 5mA) and a BJT (BC182L).
5/16 = 0.3125, 5-0.7/0.3125 = 13.76K resistor or less to be used as base current limiter
I wonder if all this is fine now or what...