KulZAus
Posts: 3
Joined: Sat Sep 12, 2015 6:58 am

2N2222 driven LED strip

Sat Sep 12, 2015 7:50 am

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.
scheme.jpg
Circuit
scheme.jpg (16.45 KiB) Viewed 3023 times
What can be the source of my problem?

User avatar
Gert van Loo
Posts: 2482
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: 2N2222 driven LED strip

Sat Sep 12, 2015 8:42 am

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.

User avatar
jojopi
Posts: 3078
Joined: Tue Oct 11, 2011 8:38 pm

Re: 2N2222 driven LED strip

Sat Sep 12, 2015 9:05 am

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.

KulZAus
Posts: 3
Joined: Sat Sep 12, 2015 6:58 am

Re: 2N2222 driven LED strip

Sat Sep 12, 2015 9:16 am

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?

danjperron
Posts: 3383
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: 2N2222 driven LED strip

Sat Sep 12, 2015 12:24 pm

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?

KulZAus
Posts: 3
Joined: Sat Sep 12, 2015 6:58 am

Re: 2N2222 driven LED strip

Mon Sep 14, 2015 3:11 pm

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.

danjperron
Posts: 3383
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: 2N2222 driven LED strip

Mon Sep 14, 2015 5:18 pm

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.

User avatar
Gert van Loo
Posts: 2482
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: 2N2222 driven LED strip

Tue Sep 15, 2015 12:07 pm

If you have not use a series resistor your transistor might have blown up.

boyoh
Posts: 1300
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: 2N2222 driven LED strip

Wed Sep 16, 2015 4:19 pm

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
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

User avatar
Gert van Loo
Posts: 2482
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: 2N2222 driven LED strip

Wed Dec 06, 2017 11:15 pm

theenggprojects wrote:
Wed Dec 06, 2017 7:24 pm
Hi,

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.
I have looked at your page and I appreciate the effort yo put int it BUT!
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.

theenggprojects
Posts: 9
Joined: Thu Nov 19, 2015 2:13 am
Contact: Website

Re: 2N2222 driven LED strip

Sun Dec 10, 2017 3:27 pm

Hi,

You are absolutely right.This circuit is just a demo to show guys about the working of this transistor. If you are working on some project then you have to design its proper circuit. Thanks for mentioning that. :)

Have a good day.

Return to “Troubleshooting”