NPN Transistor Help - Lighting a 5V LED Strip

I'm using the basic NPN Transistor that comes with the beginners Arduino Package.

It says:
2N
2222
A338

I have a small 3ft 5V LED Strip that I'm looking to power from an Arduino Uno.
Side Note: I'm going to do a similar setup with a 6V Solenoid as well.

I'm planning on using a 9V battery to power this setup. The LED Stirp when triggered will only be on for 20 seconds until it shuts off. This LED is simply used to illuminate a cabinet once initially opened.

I'm under the impression that this transistor can regulate the Voltage going to the LED strip acting as the "gatekeeper". Of is it simply up to the resistor being used to lower the voltage from 9V to 5V?

So Parts I think I'm going to need:
Uno (non digital output)
Transistor
Diode
Capacitor
Resister
9V Battery
5V LED Strip

I'm looking for a good diagram that draws this out for me and a little bit of direction.

Thanks in advance for any help with my setup.

If you going to use 9v to power the leds you can just power then with your arduino it already has a regulator in which will bring the voltage down depending on how many amps your led strip is rated.

I'm under the impression that this transistor can regulate the Voltage going to the LED strip acting as the "gatekeeper". Of is it simply up to the resistor being used to lower the voltage from 9V to 5V?

As for the transistor it cant regulate voltage but it does act like a switch it is there to control a larger current than your uno can handle.

I'm looking for a good diagram that draws this out for me and a little bit of direction.

If you use google a bit it will take you 2 minutes to find good diagrams etc there are a lot of tutorials available for this transistor.

Have a look at this link.

M.

Undermentioned:
If you going to use 9v to power the leds you can just power then with your arduino it already has a regulator in which will bring the voltage down depending on how many amps your led strip is rated.

Thank you for the info.
I would love to power the LED Strip with the Arduino without needing a transistor or relaty or MOS fet etc... But when I go direct to an output with this LED Strip, I'm only getting 2.7V out to the LED Strip. The Arduino appears not to be able to handle the current. Without the strip hooked up I'm reading 4.9V output. The LED's light up, but needless to say are not as bright as I want them to be.

You have to tell us what sort of LED strip you have. There are many and they have different requirements for power.

Unfortunately it doesn't show the current.

This is the strip.

I actually just got it all wired up and running.... But it appears as if this 2222 Transistor can't handle the current. Without a load I'm getting 6.2V to the Output.. (fresh batteries). Also only 4AA's.

But with the LED's hooked up I'm only getting 3.1V to the LEDs.

Any place to use a Diode or Capacitor in this setup?

My setup looks very much like this attached diagram.

  • Except the 150oHm resistor I'm using a 10oHm... (just wanted a small resistor on there... a 100oHm reduced the voltage to 2.6V)

  • I'm also using Outout 7(non digital).

Something like this fix my current problem?

What other transistor should I be looking at?

Something like this fix my current problem?

No.

That strip already contains current limiting resistors on each LED. So you need to feed it with 5V to get the current it was designed for.
Therefore you need a 5V regulator to provide 5V and then you switch that 5V with a transistor. You do not do as you have done and use a 9V power source and try and limit the current through a resistor because you have no way of calculating what that transistor should be unless you measure the current being drawn at 5V.

Thanks for the reply.

Where in line would the 5V Regulator go? In my current setup isn't the Transistor limiting the current passthrough?

Use the regulator where you have he 12V one only make it 5V. Feed the Arduino with either the 12V through the power jack or from the regulator to the 5V pin.

No the transistor just switches it does not regulate current in the configuration you have.
use capictors on that regulator.

Ok.
That actually does make sense. So regardless of voltage output from the power supply the regulator will assure no more than 5V goes to the Strip or anything else it's being used for.

So what is reducing my voltage right now at the LED Strip?
When I go straight to the batteries with the LED Strip it works fine and holds voltage. When I don't have the LED Strip hooked up I get constant 5.9 volts (going through the 10oHm resister)

The only variable would be the Transistor not allowing the current draw through it No??

You've been very helpful.

I don't understand this bit:-

When I don't have the LED Strip hooked up I get constant 5.9 volts (going through the 10oHm resister)

The diagram shows a 150R resistor not a 10R one, and if the LED strip is not wired up then the resistor is not getting any voltage to it so you should not be measuring anything at this point. I think this confusion is caused by me not knowing what "When I don't have the LED Strip hooked up" actually means in circuit terms. I hop it dose not mean that the top of the 150R resistor is directly connected to 12V.

Attached Photo in next reply

Hi Mike,
Sorry for the confusion, earlier I said that I was swapping the 150oHm used in the diagram for a 10oHm. Really just so I had a resistor in line.

DJMAudio:

  • Except the 150oHm resistor I'm using a 10oHm... (just wanted a small resistor on there... a 100oHm reduced the voltage to 2.6V)

  • I'm also using Outout 7(non digital).

I've attached a drawing of my setup.

If I test voltage after the 10oHm resistor coming off of the transistors "C" and to the + of the power source without the LED Load in the equation, I'm testing 5.2V.

When I test the voltage at the same location with the LED Load in the equation and lit, I'm only testing 3.0V.
This indicates to me that the Transistor between E & C can't pass through enough current to properly sustain the 5.2V to the LED Strip. "I believe... But I certainly may be wrong".

If I test voltage after the 10oHm resistor coming off of the transistors "C" and to the + of the power source without the LED Load in the equation, I'm testing 5.2V.

Yes that makes sense although it is an unconventional way of measuring voltage. Normally when you measure a voltage you always put one probe on the -ve or common ground and then measure the voltage at the point you want. Here by taking the measurement between the +ve which is 6V, and the collector of the transistor you will see about 5.2V. This is because you are basically measuring the voltage of the supply. This means nothing and is a total "red herring". Forget the 10R resistor it is not needed and not doing much for you.

When I test the voltage at the same location with the LED Load in the equation and lit, I'm only testing 3.0V.

So the question is what does it measure from the ground to the collector? Are you still using the TIP122? That is actually a darlington, that is two transistors in the same package. When a transistor turns on as hard as it can you are left with the saturation voltage across the emitter and collector. This saturation voltage is dependent on the collector current but can be quite high. The data sheet for the TIP122 shows this as up to 2V for a collector current of 3A and up to 4V for 5A. This saturation voltage applies to all transistors and is one reason why transistors are seldom used nowadays for currents over an amp or two.

What you need to do is to use a logic level n-channel FET. What was the base will be called the gate and you should use a 100R resistor between it and the Arduino output pin.

Now you are going to ask what sort? However this depends very much on what you can get locally. The data sheet will quote a test condition of a 5V gate voltage when stating the Ron value ( resistance between source and drain ) if it is a logic level one.

Grumpy_Mike:
Are you still using the TIP122? That is actually a darlington, that is two transistors in the same package. When a transistor turns on as hard as it can you are left with the saturation voltage across the emitter and collector. This saturation voltage is dependent on the collector current but can be quite high. The data sheet for the TIP122 shows this as up to 2V for a collector current of 3A and up to 4V for 5A. This saturation voltage applies to all transistors and is one reason why transistors are seldom used nowadays for currents over an amp or two.

I'm using a basic NPN Transistor that comes with the Arduino Kit. It's a 2222 Resistor (mentioned in the first post).

What you need to do is to use a logic level n-channel FET. What was the base will be called the gate and you should use a 100R resistor between it and the Arduino output pin.

I was looking into another option besides a transistor too. Was looking into FET's and yes... You called it :slight_smile: I was going to ask what one.

So do you agree that this Transistor that I'm currently using is responsible for my voltage loss once the LED Load has been turned on?

You mentioned that there was no reason to use the 10oHm resistor where I have it, so that's good and it's out of the equation now. What about adding a CAP? This this would help? Or just keep the same setup with a FET instead of the Transistor?

Lots of questions... Trial and error until I achieve a good solution.

You've been a lot of help.

A 2N2222 cannot handle the current for that entire length.
They're all in parallel, figure 15mA each (maybe more maybe less) multiplied by however many there are (20 would be 300mA, 40 would be 600mA,...) and before you know it things are getting carried away.

Thank You. So do you agree that a MOSFET is the way to go with this example?

Yes, I agree.
Let's make sure that you know what to do to get that to happen first.
You need a source of 5V more than what the Arduino's 5V can provide.

I'm actually planning on using a 9V Source in the future for this (6xAA's) stepped down through a voltage regulator to 5V for these LED's (These LED's are 5V LED's not 12V).

My only issue right now is that this Transistor can't handle the current.

Thank you for the help.