Hi,
I'm trying to power a 12 V LED strip (6 LEDs) with 2N2222 transistor connected to my Pi's GPIO pin.
The problem I've ran into is when I power the transistor's base the LED lights very dimmly.
The strip itself connected directly to power supply uses about 50 mA.
What can be the source of my problem?
- Gert van Loo
- Posts: 2487
- Joined: Tue Aug 02, 2011 7:27 am
Re: 2N2222 driven LED strip
The voltage across an LED various from type to type and colour to colour.
If your LED has a voltage drop of 2.2V you need at least a 6*2.2= 13.2Volt supply.
White LEDs can requires 3V so you can only use three in series.
And you need a bit of spare voltage across you transistor CE.
Use less LED's (e.g. 5) and always use a series resistor to limit the current.
If your LED has a voltage drop of 2.2V you need at least a 6*2.2= 13.2Volt supply.
White LEDs can requires 3V so you can only use three in series.
And you need a bit of spare voltage across you transistor CE.
Use less LED's (e.g. 5) and always use a series resistor to limit the current.
Re: 2N2222 driven LED strip
The 10kΩ resistor limits the base-emitter current to below 0.27mA. The gain of the transistor is probably not high enough to conduct 50mA collector-emitter in that condition, even if sufficient voltage is available.
A 1kΩ base resistor would be a better starting value.
A 1kΩ base resistor would be a better starting value.
Re: 2N2222 driven LED strip
Thanks for a fast answer.
So I took out one LED, and even went down to three. The result was still the same.
With no other things coming up to my mind I tried to change the PSU to PC one and it worked, the LEDs are nice and bright, but now they're ON all the time even if the GPIO is in the LOW state. I also tried to change the base resistor to 1.5 kΩ .
What should I try next?
So I took out one LED, and even went down to three. The result was still the same.
With no other things coming up to my mind I tried to change the PSU to PC one and it worked, the LEDs are nice and bright, but now they're ON all the time even if the GPIO is in the LOW state. I also tried to change the base resistor to 1.5 kΩ .
What should I try next?
-
- Posts: 4487
- Joined: Thu Dec 27, 2012 4:05 am
- Location: Québec, Canada
Re: 2N2222 driven LED strip
Since it is a led strip you made yourself, looks like it, what is the model of the led ?
Is it a 20ma normal led or a 5 Watts type ?
This is very important because we need to know the characteristic of the led.
How much current that the led needs?
A 1K resistor will give you a current of (3.3V -.07)/1K = 1.6 ma at the base which will be around 200ma(minimum) to the collector. But the HFE start to drop drastically after 200ma.
The simple answer is that we need more info about your leds, how many of them and how many strip?
Is it a 20ma normal led or a 5 Watts type ?
This is very important because we need to know the characteristic of the led.
How much current that the led needs?
A 1K resistor will give you a current of (3.3V -.07)/1K = 1.6 ma at the base which will be around 200ma(minimum) to the collector. But the HFE start to drop drastically after 200ma.
The simple answer is that we need more info about your leds, how many of them and how many strip?
Re: 2N2222 driven LED strip
So I've got two types of LEDs i want to run. They both behave in similiar way.
The first are the previously described some no-name chinese red LEDs, but i've also have some of these yellow ones.
Unfortunately datasheet is in Polish. http://www.powerled.pl/pliki/Powerled_L ... _karta.pdf
According to this PDF my yellow ones take 130 mA per 12 LEDs. But the strip can be dvided in three parts of 4. And that's the quantity I want to start with.
The first are the previously described some no-name chinese red LEDs, but i've also have some of these yellow ones.
Unfortunately datasheet is in Polish. http://www.powerled.pl/pliki/Powerled_L ... _karta.pdf
According to this PDF my yellow ones take 130 mA per 12 LEDs. But the strip can be dvided in three parts of 4. And that's the quantity I want to start with.
-
- Posts: 4487
- Joined: Thu Dec 27, 2012 4:05 am
- Location: Québec, Canada
Re: 2N2222 driven LED strip
This is the english version
http://www.powerled.pl/pliki/Powerled_LC_ENGLISH.pdf
If you use only 1/3 of the strip then the current should be
43 ma . A 1K , even a 1.5K resistor between the GPIO and the transistor base should work.
Use a voltmeter and check the voltage between the collector and the emitter when the transistor is ON.
It should be around 0.3V
Also check what is the voltage across the led power lead.
We need a picture and your voltage result.
http://www.powerled.pl/pliki/Powerled_LC_ENGLISH.pdf
If you use only 1/3 of the strip then the current should be
43 ma . A 1K , even a 1.5K resistor between the GPIO and the transistor base should work.
Use a voltmeter and check the voltage between the collector and the emitter when the transistor is ON.
It should be around 0.3V
Also check what is the voltage across the led power lead.
We need a picture and your voltage result.
- Gert van Loo
- Posts: 2487
- Joined: Tue Aug 02, 2011 7:27 am
Re: 2N2222 driven LED strip
If you have not use a series resistor your transistor might have blown up.
Re: 2N2222 driven LED strip
Is it possible to use a series parallel circuit of the LEDs, Two LEDs in series with a 380R resister,
giving 20ma each led ( X 3 ) Them parallel the three rows of series LEDs This will give a total
current of 60ma through the 2n2222. ( 12v - 4.4 =7.6 / 0.02 = 380r
Drive the 2n2222 in to saturation to use as a switch ( 3.3v - 0.6v = 2.7v / 0.01 = 270r
giving 20ma each led ( X 3 ) Them parallel the three rows of series LEDs This will give a total
current of 60ma through the 2n2222. ( 12v - 4.4 =7.6 / 0.02 = 380r
Drive the 2n2222 in to saturation to use as a switch ( 3.3v - 0.6v = 2.7v / 0.01 = 270r
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong
Some Times Right Some Times Wrong
- Gert van Loo
- Posts: 2487
- Joined: Tue Aug 02, 2011 7:27 am
Re: 2N2222 driven LED strip
I have looked at your page and I appreciate the effort yo put int it BUT!theenggprojects wrote: ↑Wed Dec 06, 2017 7:24 pmHi,
If you are planning to work on 2n2222, then you must have a look at Introduction to 2n2222. I have shared detailed overview of how it works and have also shared its working Proteus Simulation.
Thanks.
The way you use the transistor is not the way I would recommend. I would go even further and say it is wrong.
You put the load in the emitter which requires your base voltage to be above the load.
The best way to use an NPN transistor is to put the load at the collector side which makes the load voltage
independent of the driving voltage. You must then add a resistor in the base.
Also you are driving a motor but you do NOT have a flyback diode. That can damage your circuit!
It is for that reason that I post here. Do NOT use that circuit. It may damage your PI!
Also statements as ". It is the most commonly used Negative-Positive-Negative (NPN) Bipolar Junction Transistor (BJT) available"
shows to me a worrying lack of experience.