Hi Guys,
New to this forum, hope this is a good place to come for help with this sort of stuff.
I am a pretty involved EE hobbyist and and am designing a unit to interface with automotive electronics over a CANBUS. I am learning massive amounts as I go and really enjoying this challenge.
On the particular MCU I have chosen (PIC18F46K80) I have decided I want to have a series of warning LED's, as well as the ability to drive a standard automotive relay (in the future anyhow)
LED's I have are grouped in pairs, and draw around 25ma each at 2.2v. I am currently running each one with a 150R resistor.
Max current sourced/sunk by the PIC on some pins is 25mA, 8mA or 2mA, so by putting them into pairs (parallel) I am saving I/O pins but increasing current draw, meaning I cannot supply directly from the MCU anymore.
So I am going to use a basic NPN transistor as a switch, *which is a first for me.*
The unit I have on hand is a BC549 and has the following characteristics:
Ic (max) 100mA (suitable for the LED's)
Hfe min 420
VCEsat 200mV at IC = 100 mA; IB = 5 mA
VBEsat 900mV at IC = 100 mA; IB = 5 mA
What I am struggling to understand is how to equate the base resistor value. I have read probably 20 different web theories and still do not fully understand, and have come up with a few different values as a result.
Both the LED and the IC (connected to base) operate off the same VDD of +5v, and the pin I want to control the transistor from has a Ic max of 2mA, but I do also have a pin with Ic max 8mA also.
Can anyone point me to some clear-cut theory or help me to understand this a little better?
One website I found most helpful was http://electronicsclub.info/transistorcircuits.htm
But I am obviously missing something here.
Thanks,
Hayden
New to this forum, hope this is a good place to come for help with this sort of stuff.
I am a pretty involved EE hobbyist and and am designing a unit to interface with automotive electronics over a CANBUS. I am learning massive amounts as I go and really enjoying this challenge.
On the particular MCU I have chosen (PIC18F46K80) I have decided I want to have a series of warning LED's, as well as the ability to drive a standard automotive relay (in the future anyhow)
LED's I have are grouped in pairs, and draw around 25ma each at 2.2v. I am currently running each one with a 150R resistor.
Max current sourced/sunk by the PIC on some pins is 25mA, 8mA or 2mA, so by putting them into pairs (parallel) I am saving I/O pins but increasing current draw, meaning I cannot supply directly from the MCU anymore.
So I am going to use a basic NPN transistor as a switch, *which is a first for me.*
The unit I have on hand is a BC549 and has the following characteristics:
Ic (max) 100mA (suitable for the LED's)
Hfe min 420
VCEsat 200mV at IC = 100 mA; IB = 5 mA
VBEsat 900mV at IC = 100 mA; IB = 5 mA
What I am struggling to understand is how to equate the base resistor value. I have read probably 20 different web theories and still do not fully understand, and have come up with a few different values as a result.
Both the LED and the IC (connected to base) operate off the same VDD of +5v, and the pin I want to control the transistor from has a Ic max of 2mA, but I do also have a pin with Ic max 8mA also.
Can anyone point me to some clear-cut theory or help me to understand this a little better?
One website I found most helpful was http://electronicsclub.info/transistorcircuits.htm
But I am obviously missing something here.
Thanks,
Hayden