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.
 
I have recently moved into a new (rather ancient) house and had a few trips of my Residual Current breaker. I dug out my old Socket tester which tell me the three pins are correct. But then the Red warning light tells me my socket(s) fail the loop test. I never had this before but my last house had an overhead supply with no Earth from the company. The tester said "get this checked" and the man said the (high but not ridiculous) earth resistance was acceptable. I stuck a new copper earth...
Thread 'Electromagnet magnetic field issue'
Hi Guys We are a bunch a mechanical engineers trying to build a simple electromagnet. Our design is based on a very similar magnet. However, our version is about 10 times less magnetic and we are wondering why. Our coil has exactly same length, same number of layers and turns. What is possibly wrong? PIN and bracket are made of iron and are in electrical contact, exactly like the reference design. Any help will be appreciated. Thanks. edit: even same wire diameter and coil was wounded by a...
Thread 'Beauty of old electrical and measuring things, etc.'
Even as a kid, I saw beauty in old devices. That made me want to understand how they worked. I had lots of old things that I keep and now reviving. Old things need to work to see the beauty. Here's what I've done so far. Two views of the gadgets shelves and my small work space: Here's a close up look at the meters, gauges and other measuring things: This is what I think of as surface-mount electrical components and wiring. The components are very old and shows how...
Back
Top