Calculating Values for PN2222A LED Circuit

In summary, the OP is trying to figure out how to use a PN2222 transistor with an Arduino Uno to drive an LED, but is having difficulty understanding the math involved. They have determined that they will be using a 1/2W resistor and that the transistor will need to be driven at saturation in order to function properly.
  • #1
Yoyo G
4
0
I'm going to be adding an IR LED to my Arduino Uno and I'm trying to wrap my head around the math used to figure out the exact resistor values needed to use a PN2222A transistor to drive the LED.I know my LED has a voltage drop of 1.35V and I want to run it at 100mA and that I'll be supplying it with 5V from the Arduino. What I don't understand is the math for how to figure out the exact voltage drop of the transistor between the collector and emitter. And I'm also trying to figure out the math used to calculate the required milliamps that have to flow through the base of the transistor in order to fully turn it on (but not waste extra electricity).I know that there is quite a lot of lee way in which resistors to use and the circuit will still work, but I'm hoping to figure out the math so that I can get as close as possible to using the exactly perfect resistor values.
 
Engineering news on Phys.org
  • #2
You don't need to calculate it exactly. Since the transistor is being used as a switch you can start by assuming that it's all the way on (or off). We call this saturation.

The collector to emitter voltage will be about 0.4V (VCE(sat)) on the data sheet. This plus the 1.35V across the LED will leave 3.25V across the resistor in series with the LED. For 0.1A flowing through the LED that means you'll use a 33Ω, 1/2W resistor.

The base current must be more than enough to support the 0.1A collector current. So we need to guess at the minimum current gain in this configuration this is called β or hFE. For this transistor we can assume β>50 (from the data sheet), which means you need at least 2mA of base current. The base emitter voltage (VBE) will be about 0.7V. So if you are driving the base from 5V when on, you'll have 4.3V across the base resistor. So 4.3V/2mA = 2.15KΩ, but I would round that off to 2KΩ.

This is a better datasheet: https://www.mouser.com/datasheet/2/302/nxp_pn2222a-1189038.pdf
 
  • #3
Use common emitter connected to ground.
Saturation voltage Vce(sat) of 2N2222 will be about 100 mV. Check that on datasheet.
LED requires 1.35 V at 100 mA. (That makes it an IR LED).
5 V supply.
5V - 1.35V - 0.1V = 3.55 volts across resistor.
3.55 V / 100 mA = 35.5 ohms which is the limit resistor. Use 33R.
W = 3.55V * 0.1A = 0.355 watt; so use 0.5 watt.
If 2N2222 current gain, beta = 100. Check the minimum beta.
Then base current must be 100 mA / 100 = 1 mA.
If logic high from port is 4.75 V and Vbe = 0.65 V; Check that on datasheet.
Then resistor drop is 4.75 - 0.65 = 4.1 volt at 1 mA..
Base resistor must be 4.1 / 1 mA = 4k1 so use 3k9 or 3k3.
 
  • #4
@DaveE we are in the same ballpark.
@Yoyo G
This is a situation where you could halve the power consumption by placing two LEDs in series and allowing them 50 mA. Total light output is then the same, but less heat comes from the LED current limit resistor. The design process is the same but two series LEDs total voltage is 2.7 V.
 
  • Like
Likes DaveE
  • #5
Baluncore said:
@DaveE we are in the same ballpark.
@Yoyo G
This is a situation where you could halve the power consumption by placing two LEDs in series and allowing them 50 mA. Total light output is then the same, but less heat comes from the LED current limit resistor. The design process is the same but two series LEDs total voltage is 2.7 V.
Yes. This can be a pretty sloppy design and still work well. For example, my datasheet says β(sat)>50, but in the real world of one-off hobby designs, it probably is 100. I suppose it's really a question of how far into saturation you drive it. VCE(sat) = 0.4V and β(sat)>50 aren't that realistic in combination. If it comes out of saturation β will rise. I always tend toward the more conservative just because of the companies/markets I worked for.

It's the 1/2W resistor that people will screw up, IMO.
 
  • Like
Likes Baluncore
  • #6
Yoyo G said:
I'm going to be adding an IR LED to my Arduino Uno and I'm trying to wrap my head around the math used to figure out the exact resistor values needed to use a PN2222A transistor to drive the LED.
This OP has a history of only posting one post per thread and not answering follow-up questions asked of them, but I'll try anyway.

@Yoyo G -- What speed / frequency are you going to be turning this IR LED on and off? If it's only a few kHz, then the PN2222 should work with the previous circuit advice. If it's 1MHz or above, you will need a different circuit to drive it.
 

1. How do I calculate the value for the resistor in a PN2222A LED circuit?

To calculate the value for the resistor in a PN2222A LED circuit, you will need to know the forward voltage of the LED, the supply voltage, and the desired LED current. The formula for calculating the resistor value is R = (Vsupply - VLED) / ILED, where R is the resistor value in ohms, Vsupply is the supply voltage, VLED is the forward voltage of the LED, and ILED is the desired LED current in amps.

2. What is the maximum LED current that can be used in a PN2222A LED circuit?

The maximum LED current that can be used in a PN2222A LED circuit is 600mA. This is the absolute maximum rating for the PN2222A transistor, and exceeding this current can damage the transistor.

3. Can I use a different transistor in a PN2222A LED circuit?

Yes, you can use a different transistor in a PN2222A LED circuit as long as it has similar specifications. It should have a similar maximum current rating and voltage rating, and be able to handle the desired LED current. It is important to consult the datasheet of the transistor to ensure compatibility.

4. How do I determine the power dissipation of the PN2222A transistor in a LED circuit?

The power dissipation of the PN2222A transistor can be determined by multiplying the collector current (in amps) by the collector-emitter voltage drop (in volts). This will give you the power dissipation in watts. It is important to make sure that the power dissipation does not exceed the maximum rating for the transistor, which is 625mW for the PN2222A.

5. Can I use a higher supply voltage in a PN2222A LED circuit?

Yes, you can use a higher supply voltage in a PN2222A LED circuit, but you will need to adjust the value of the resistor accordingly. The resistor value can be calculated using the same formula as mentioned in question 1, but with the new supply voltage and LED forward voltage. It is important to make sure that the power dissipation of the transistor does not exceed its maximum rating.

Similar threads

Replies
10
Views
1K
  • Electrical Engineering
Replies
12
Views
720
  • Electrical Engineering
Replies
5
Views
2K
Replies
68
Views
4K
Replies
10
Views
1K
  • Electrical Engineering
2
Replies
41
Views
4K
  • Electrical Engineering
Replies
26
Views
2K
Replies
38
Views
3K
Replies
5
Views
2K
  • Electrical Engineering
Replies
3
Views
1K
Back
Top