Hello All,
I have a 3V logic MCU and an LED with a typical forward voltage of 2.2V. I would like to use a GPIO pin of the MCU in conjunction with a transistor and a 9V source to enable digital control of the LED (either on or off depending on the low/high state of the GPIO). The reason for this is that the LED will probably be replaced with one which has a forward voltage of 4.9V in the very near future. But, for the sake of the work now, assume Vf = 2.2V for the LED.
I have added an attachment showing the circuit. It is the stuff on the right hand side of course.
I am doing something wrong with the below. Please read and let me know if you see it!
I want to produce a 10mA drive current to power the LED so I find Rc as:
Rc = (Vs - Vforward)/Ic => (9V - 2.2V)/(10*10^-3) = 680 ohms
I am using a 2N4104 transistor with Hfe = 1400 @ Vce = 5V and Ic = 1mA. A curve is not displayed to show any other points.
I find the value of my base resistor as
Rb = (Vmcu*Hfe)/(5*Ic) => (3V*1400)/(5*10*10^-3) = 84kohms
To test this I am using a prototyping board and a second power supply with grounds connected. The LED does turn on at Vb = 0.6V and the drive current, as monitored with a multimeter in line with the LED, does increase with increasing Vb. However, with Vb = 3V, the current in the collector, Ic, is only 7.1mA.
I checked the voltage drop across the LED and it is 2.3V. I checked Vce and it is 1.6V. Clearly I was forgetting to tabulate Vce into the earlier equation, but it has been a long time since I took an electronics course and I cannot recall nor find online how to take that into account correctly. What I would really like to do is to be able to say "okay, given this BJT and supply and microcontroller voltage, you can use these 1 or 2 quick formulae to find what resistors you need in the base and collectors to produce a given drive current for the LED." i can't think of how I can do that, though. Can someone point me in the right direction?
Thanks so much in advance.
I have a 3V logic MCU and an LED with a typical forward voltage of 2.2V. I would like to use a GPIO pin of the MCU in conjunction with a transistor and a 9V source to enable digital control of the LED (either on or off depending on the low/high state of the GPIO). The reason for this is that the LED will probably be replaced with one which has a forward voltage of 4.9V in the very near future. But, for the sake of the work now, assume Vf = 2.2V for the LED.
I have added an attachment showing the circuit. It is the stuff on the right hand side of course.
I am doing something wrong with the below. Please read and let me know if you see it!
I want to produce a 10mA drive current to power the LED so I find Rc as:
Rc = (Vs - Vforward)/Ic => (9V - 2.2V)/(10*10^-3) = 680 ohms
I am using a 2N4104 transistor with Hfe = 1400 @ Vce = 5V and Ic = 1mA. A curve is not displayed to show any other points.
I find the value of my base resistor as
Rb = (Vmcu*Hfe)/(5*Ic) => (3V*1400)/(5*10*10^-3) = 84kohms
To test this I am using a prototyping board and a second power supply with grounds connected. The LED does turn on at Vb = 0.6V and the drive current, as monitored with a multimeter in line with the LED, does increase with increasing Vb. However, with Vb = 3V, the current in the collector, Ic, is only 7.1mA.
I checked the voltage drop across the LED and it is 2.3V. I checked Vce and it is 1.6V. Clearly I was forgetting to tabulate Vce into the earlier equation, but it has been a long time since I took an electronics course and I cannot recall nor find online how to take that into account correctly. What I would really like to do is to be able to say "okay, given this BJT and supply and microcontroller voltage, you can use these 1 or 2 quick formulae to find what resistors you need in the base and collectors to produce a given drive current for the LED." i can't think of how I can do that, though. Can someone point me in the right direction?
Thanks so much in advance.
Attachments
Last edited: