5v LED Strip Not Bright Enough Using TIP31C

Hello all, I watched this video some time ago and recently ordered all the parts and I tried it out using my 5v 2 meter long RGB LED strip. (which is very bright when controlled from the dinky IR remote)

I use an external power supply.

I got code working from another post on here which works great. I connected everything perfectly as the video said but the brightness is really lacking.

The TIP31C is a BASE, COLLECTOR, EMITTER and when testing various voltages from 5v to 8v the brightness stays the same.

I used 1k, 220 ohm resistors (also no resistor) and the results did not change.

When I ground the collector and emitter the brightness goes way up, which makes sense.

I have been doing a lot of reading online and I just ordered the IRLB8721 and will give that a try but just curious if someone could lead me in a direction that can help me understand what is going wrong.

Thanks so much.

// ARDUINO CONSTANT & VARIABLE DEFINITIONS
// -------------------------------------
//   Arduino output pin receiving brightness levels for a specific color
#define RED_PIN 9
#define GREEN_PIN 10
#define BLUE_PIN 11
//   # of milliseconds to pause between each pass of the main Arduino loop
#define Loop_Delay 30
  
//brightness level of each color (0..255)
  int Brightness_R;
  int Brightness_G;
  int Brightness_B;
//fade step counter for LED cycle through off (510 steps), fade on (255 steps),
//    on (510 steps), fade off (255 steps) 1530 total steps
  int FadeStep_R;  
  int FadeStep_G;
  int FadeStep_B;
//number of times LED has completed a full fade cycle
//  int CycleCountB; 
//  int CycleCountR;
//  int CycleCountG;
//used to establish what values to send to LED strip  
//  int ColorValue;
// =====================================
// ARDUINO SETUP ROUTINE
// -------------------------------------
void setup() {
//Serial.begin(9600);
  pinMode(RED_PIN, OUTPUT);
  pinMode(GREEN_PIN, OUTPUT);
  pinMode(BLUE_PIN, OUTPUT);
//set initial strip color. 0(off) to 255(on). can be anything or nothing. 
//This value is constrained to 0 - 255. any number higher than 255 will be rounded down to 255.
//                                      any number lower than 0 will be rounded up to 0.
  Brightness_R = 0;
  Brightness_G = 0;
  Brightness_B = 0;

//Set starting fade step position. -764 to -255 = on (brightness level is 255)
//                                 -254 to 0 = fading on (this number *-1 = brightness level)
//                                 0 to 510 = off (brightness level is 0)
//                                 511 to 765 = fading off (this number - 510 = brightness level
//must each be 510 steps apart for smooth color pauses. 
//if pauses removed by commenting out or removing ColorValue if statements and rplacing 
//with setLEDS (Brightness_R, Brightness_G, Brightness_B); ,which I've already done, these number 
//can be any value from -764 to 765 in any combantion, likely making many unplesant fade patterns,
//but also with many possibilities for interesting patterns.  If all values are 510 steps apart   
//the results will ROY G BIV either forward or backward and starting at different positions 
//depending on the values given. the farther off the 510 steps of seperationg the further from
//ROY G BIV the pattern will move.
  FadeStep_R = 0;      //0      These setting for normal ROY G BIV
  FadeStep_G = 325;    //510
  FadeStep_B = 650;    //-510
//Set each LED's fade cycle counter to 0
//  CycleCountB = 0;
//  CycleCountR = 0;
//  CycleCountG = 0;
}

// =====================================
// ARDUINO MAIN LOOP ROUTINE
// -------------------------------------
void loop() {

//decrement each LED's fade step counter by one at the start of each loop
    FadeStep_R = FadeStep_R - 1;
    FadeStep_G = FadeStep_G - 1;
    FadeStep_B = FadeStep_B - 1;
    
//fade red LED according to it's fade step counter.         
 if (FadeStep_R == -764) {FadeStep_R = 765;}
 if (FadeStep_R < 0) {Brightness_R = FadeStep_R * -1;}  
 if (FadeStep_R >= 510) {Brightness_R = FadeStep_R - 510;}
// if (FadeStep_R == -510) {CycleCountR = CycleCountR + 1;} //count + 1 for each full fade cycle
 
//fade green LED according to it's fade step counter.      
 if (FadeStep_G == -764) {FadeStep_G = 765;}
 if (FadeStep_G < 0) {Brightness_G = FadeStep_G * -1;}  
 if (FadeStep_G >= 510) {Brightness_G = FadeStep_G - 510;}
// if (FadeStep_G == -510) {CycleCountG = CycleCountG + 1;} //count + 1 for each full fade cycle
 
//fade blue LED according to it's fade step counter.  
 if (FadeStep_B == -764) {FadeStep_B = 765;}
 if (FadeStep_B < 0) {Brightness_B = FadeStep_B * -1;}  
 if (FadeStep_B >= 510) {Brightness_B = FadeStep_B - 510;}
// if (FadeStep_B == -510) {CycleCountB = CycleCountB + 1;} // count + 1 for each full fade cycle
  
//  if step counters are intialized 510 steps appart, -510 is the step in each LED's fade cycle
//  that it will be on full brightness while the other 2 LED's are off. 

    Brightness_B = constrain(Brightness_B, 0, 255);
    Brightness_G = constrain(Brightness_G, 0, 255);
    Brightness_R = constrain(Brightness_R, 0, 255); 

// if (CycleCountB == 8) {CycleCountB = 0;}  
// if (CycleCountR == 8) {CycleCountR = 0;}
// if (CycleCountG == 8) {CycleCountG = 0;}
    
// if (CycleCountR == 2) {ColorValue = 1 ;} //set point for pattern to pause on red
// if (CycleCountR > 2) {ColorValue = 0;}   

// if (CycleCountG == 4) {ColorValue = 2;}   //set point for pattern to pause on green
// if (CycleCountG > 4) {ColorValue = 0;}
  
// if (CycleCountB == 6) {ColorValue = 3;}   //set point for pattern to pause on blue
// if (CycleCountB > 6) {ColorValue = 0;}
 
//Send brightness levels to LED strip
setLEDS (Brightness_R, Brightness_G, Brightness_B);
// if (ColorValue == 0) {setLEDS (Brightness_R, Brightness_G, Brightness_B);} // default to fade pattern
// if (ColorValue == 1) {setLEDS (255, 0, 0);}  //LED strip red
// if (ColorValue == 2) {setLEDS (0, 255, 0);}  //LED strip green
// if (ColorValue == 3) {setLEDS (0, 0, 255);}  //LED strip blue
     
 //    slow the loop down a bit
    delay (Loop_Delay);

}
    
 //    send the LED levels to the Arduino pins
 void setLEDS (int ipR, int ipG, int ipB) {
  analogWrite (RED_PIN, ipR);     // send the red brightness level to the red LED's pin
  analogWrite (GREEN_PIN, ipG);
  analogWrite (BLUE_PIN, ipB);
   
 }

At a gain of 20 this transistor is a very poor choice.

Let’s see your actual wiring.

A ‘logic level’ power MOSFET is what you want for this.

Example: IRL540

An IRLB8721 would be good also.

Your power supply is 12vdc?

Measure the voltage ‘collector to emitter’ when your Arduino o/p pin is HIGH, what do you get?

I will order those, and also take a picture of the breadboard and circuit hookup.

It's exactly like the video that I posted, which they got working perfectly, I'm curious how.

Try the simple blink program on the output pins.

Do the LEDs on the strip turn on and off?

Send a slow HIGH to LOW pulse train (say .5hz) to the output pins, measure the collector to emitter voltages. What levels do you get?

Confirm your Arduino output pins are going from 5v to 0v.

Is your LED strip 5v or 12v.

Hi
woudt the very comen FQP30N06L also fit the need of this Setup ?

It's exactly like the video that I posted, which they got working perfectly,

How do you know? That video only shows the LEDs in the semi dark. It is hard to take a video of bright LEDs because the colours wash out, so to me that video says they were not too bright.

@ Grumpy mike
there shoudt be some advice on making Images or Videos of a Display made of Neopixels...

if there is one
i did struggle also presenting the gives of my Ws2812 Projekts
only gives good imaing at 127 or lower brightness

The OP said this is a 5V strip, in the subject. I assume a 5V PSU is being used.

If the transistor drops 0.7V, that's 15% of your voltage gone. And that drop could be higher still. With 220R based resistor, around 20mA will flow through the base. If the strip draws 2A, and the transistor gain is 25, you would need 80mA through the base to get even close to saturation, which is more than an Arduino pin can source. So the transistor is probably a long way from being saturated, and it's voltage drop could be significantly higher, loosing a lot of your 5V supply, and getting pretty warm!

PaulRB:
The OP said this is a 5V strip, in the subject. I assume a 5V PSU is being used.

If the transistor drops 0.7V, that's 15% of your voltage gone. And that drop could be higher still. With 220R based resistor, around 20mA will flow through the base. If the strip draws 2A, and the transistor gain is 25, you would need 80mA through the base to get even close to saturation, which is more than an Arduino pin can source. So the transistor is probably a long way from being saturated, and it's voltage drop could be significantly higher, loosing a lot of your 5V supply, and getting pretty warm!

I see what you are saying.

So this transistor IRL540 has a much lower current saturation, also the FQP30N06L?

I think I need to learn how to read those datasheets, I bet the answer to the question I just asked would be in it.

doing that tonight

BJTs have an intrinsic voltage drop. VCE(sat)

MOSFETs have an RDS(on) resistance that creates the voltage drop.

MOSFETs are more efficient than BJTs.

IRL540 has an RDS(ON) of 110mΩ at VGS = 4V
At 2 amps, the voltage drop will be ~.22V

FQP30N06L has an RDS(ON) of 45mΩ at VGS = 5V
At 2 amps, the voltage drop will be ~.09V

Travisbklein:
So this transistor IRL540 has a much lower current saturation, also the FQP30N06L?

Well, no, not as such.

There are different types of transistor. They do essentially the same job and are made of essentially the same material (silicon) but using quite different principles. The earlier type to be invented were "base junction transistors" or BJTs, and tip31 is this type. Later, but still a long time ago, "field effect transistors" or FETs were invented and IRL540 and FQP30N06L are this type.

For switching current on and off at relatively high speed (in human terms), and maximizing the voltage for the LEDs, but keeping themselves cool while doing so, FETs are usually the better choice.

Even though they are the older design, BJTs have advantages over FETs in some circuits, but yours isn't one of those circuits!

guys thank you so much, I am learning now about BJTs vs FETs and various applications.

When they arrive I will update this thread so if other people face this issue it might help.

One last question or maybe I should make it a new thread?

I'm doing this to control LED strips inside my car. I will be doing it from a Nano but my question is are there more permanent FETs or BJTs that I should be using or should I just wire up the beefy ones that I order and solder it all up with wires.

thank you so much :slight_smile:

travis

are there more permanent FETs or BJTs that I should be using

Not sure what you mean by permanent?

or should I just wire up the beefy ones that I order and solder it all up with wires.

Yes I would.

You could make a circuit board from a piece of stripboard. Solder the Nano directly to that (make sure you can still plug usb cable in - maybe put Nano at edge of board) or use female PCB strips to make a socket for the Nano. Don't forget to cut the strips underneath the Nano! Then you can solder transistors, resistors, screw terminals etc to the stripboard. Think about where the large currents will flow (+ and ground) and put a thick layer of solder along those strips, otherwise the strips can blow like fuses where the copper is narrow around the holes.

What I don't understand is why you are using 5V strip for use in a car? A 12V strip would have been the sensible choice. With 5V, you will need an additional dc-dc convertor to provide the large currents at 5V, which you would not have needed with 12V strips. Plus, your tip31 transistors might have been good enough at 12V, because their voltage drop would be less noticeable and the saturation current would have been lower. This is why you should always explain your overall project in your first post.

PaulRB:
The earlier type to be invented were "base junction transistors" or BJTs, and tip31 is this type.

"BJT" generally interpreted as Bipolar Junction Transistor,

PaulRB:
Even though they are the older design, BJTs have advantages over FETs in some circuits, but yours isn't one of those circuits!

Interesting point. Where are BJTs preferred? Possibly SHF?

PaulRB:
What I don't understand is why you are using 5V strip for use in a car? A 12V strip would have been the sensible choice. With 5V, you will need an additional dc-dc converter to provide the large currents at 5V, which you would not have needed with 12V strips.

Would you not need extra components for protection with a 12 V strip? The switchmode converter tends - if adequately specified - to do this for you.

Bipolar, yes, thanks Paul!

I guess in very high frequency amplifiers and switching applications, the capacity of a FET's gate becomes a problem, and BJTs, being current amplifiers, don't have that particular issue. There must be other circuits where BJTs are preferred, but I couldn't tell you what they are.

PaulRB:
You could make a circuit board from a piece of stripboard. Solder the Nano directly to that (make sure you can still plug usb cable in - maybe put Nano at edge of board) or use female PCB strips to make a socket for the Nano. Don't forget to cut the strips underneath the Nano! Then you can solder transistors, resistors, screw terminals etc to the stripboard. Think about where the large currents will flow (+ and ground) and put a thick layer of solder along those strips, otherwise the strips can blow like fuses where the copper is narrow around the holes.

What I don't understand is why you are using 5V strip for use in a car? A 12V strip would have been the sensible choice. With 5V, you will need an additional dc-dc convertor to provide the large currents at 5V, which you would not have needed with 12V strips. Plus, your tip31 transistors might have been good enough at 12V, because their voltage drop would be less noticeable and the saturation current would have been lower. This is why you should always explain your overall project in your first post.

thank you so much for the tip about a stripboard, I just ordered a few!

my 12v LED strips I ordered a few weeks ago are on the way, right now I only have 5v, which yea you are right it is stupid trying to prototype and figure out which components when the end result will be a completely different voltage and amps.

Lesson learned!

edit: Probably another stupid question, but should I also get the thicker filmed resistors to use with my permanent circuit instead of the think filmed ones that came with the Arduino starter pack? Maybe get 1/4w ones because 12^2/1k is like 1/7w

Take a look at this thread 500+ posts discussing things like mounting PCBs etc.
Have a cold beer or hot rum (depending on where you live :wink: ).
https://forum.arduino.cc/index.php?topic=445951.0

examples:

See PDF
https://forum.arduino.cc/index.php?action=dlattach;topic=445951.0;attach=195518

Travisbklein:
edit: Probably another stupid question, but should I also get the thicker filmed resistors to use with my permanent circuit instead of the think filmed ones that came with the Arduino starter pack? Maybe get 1/4w ones because 12^2/1k is like 1/7w

I'm struggling to make sense of that... "Thin film resistors" just refers to a manufacturing process, it doesn't mean the resistors are inferior in any way.. Stick with 1/4W, they're fine for your needs. Not sure what you are trying to calculate when you said "12^2/1k is like 1/7w"!

Probably thin film resistors was the wrong terminology.

I'm asking because I'm concerned the thin resistors that came in the starter pack which are 1/8w? 1/16w? are not enough.

I was attempting to calculate the power that the resistor should have with V^2/R, I'm really not sure to be honest