Calculating Values for PN2222A LED Circuit

  • Thread starter Thread starter Yoyo G
  • Start date Start date
  • Tags Tags
    Circuit Led
AI Thread Summary
To drive an IR LED with a PN2222A transistor using an Arduino Uno, the collector-emitter voltage drop (VCE(sat)) is approximately 0.4V, leaving 3.25V across the series resistor when powered by 5V. For a desired LED current of 100mA, a 33Ω resistor is recommended, with a power rating of at least 0.5W. The base current should be around 2mA to ensure the transistor is fully saturated, leading to a base resistor value of about 2KΩ. It is suggested to consider using two LEDs in series to reduce power consumption while maintaining light output. Overall, careful calculations are essential for optimal resistor values, but slight variations can still yield functional results.
Yoyo G
Messages
4
Reaction score
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
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
 
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.
 
@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.
 
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.
 
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.
 
Thread 'Weird near-field phenomenon I get in my EM simulation'
I recently made a basic simulation of wire antennas and I am not sure if the near field in my simulation is modeled correctly. One of the things that worry me is the fact that sometimes I see in my simulation "movements" in the near field that seems to be faster than the speed of wave propagation I defined (the speed of light in the simulation). Specifically I see "nodes" of low amplitude in the E field that are quickly "emitted" from the antenna and then slow down as they approach the far...
Hello dear reader, a brief introduction: Some 4 years ago someone started developing health related issues, apparently due to exposure to RF & ELF related frequencies and/or fields (Magnetic). This is currently becoming known as EHS. (Electromagnetic hypersensitivity is a claimed sensitivity to electromagnetic fields, to which adverse symptoms are attributed.) She experiences a deep burning sensation throughout her entire body, leaving her in pain and exhausted after a pulse has occurred...
Back
Top