Led = 700mah
I want the output to be 3v...
To limit the current, you need a resistor in series with the LED
QuoteI want the output to be 3v...This is the first problem. Since LEDs are current driven, you actually want a particular current to flow through the LED when the transistor is on. To limit the current, you need a resistor in series with the LED. You can find lots of tutorials on how to pick the series resistor for a particular LED and power supply; none of the details change significantly just because you have a transistor acting as the switch instead of just wires. For 450mA through a 3V Vf LED and 5V supply, you should have a resistor of about 5 ohms (and you should figure out how I got that...)Now, the transistor is also a current-operated device. When you put a current into the base, the transistor will allow a current of up to Ibase*gain to flow through the collector/emitter path. Just like with an LED, you need to limit the current into the base to a level that is safe for both the transistor AND the AVR pin providing the current. That means about 30mA. Using the same formulas used for LEDs, and assuming that the Base Voltage drop is .7V (typical for Silicon bipolar transistors), you should use a base transistor of about 150 ohms.Then you start to run into the practical issues that MarkT mentions. For the transistor to act as a switch and be fully ON, so that the output circuit behaves like we want, the gain of the transistor should be significantly greater than Ic/Ib(450/30, or 15.) (Significantly greater ideally means something like 5x or more, not G+5) If you look at a datasheet (I'm actually looking at a PN2222A; an actual 2n2222 is probably a rarity these days), you'll see that the typical gain is 100 to 300, so that should be fine, right? No; the gain is dependent on the collector current; reading more carefully, at Ic = 500mA, the gain might be as low as 40. Less than 3x the gain we were hoping for. Which makes it a bit ... questionable.QuoteI would go ahead and wire it up, check the LED brightness, measure the currents, and see if the transistor gets overheated. (This would probably not be risky for the Arduino, but you could also test it with just a wire from the base resistor to +5V or GND...)Hi! First of all, thank you for your explanation..We... I've searching on internet and found out some formulas and Now I'm testing one and actually I'm having the base transistor at about 4mA and the led current is about 420mA.The Brightness is grat and under its maxtimum current(700mA).The LED is handling about 420mA but the 2n2222 IS overheating. I can't even touch. I have changed the base input to to 2ma, providing about 200mA of LED current and the 2n222 keeps hot(really hot)I Have tested another 2n2222 and same overheating problem...What Could be Wrong?
I would go ahead and wire it up, check the LED brightness, measure the currents, and see if the transistor gets overheated. (This would probably not be risky for the Arduino, but you could also test it with just a wire from the base resistor to +5V or GND...)
What Could be Wrong?
QuoteWhat Could be Wrong?That's normal. The transistor does not run as a switch and dissipates about 2V * 400mA ~ 1W of heat. ( It's rated for max 500 mW, so even cooling it with a heatsink won't help )