Teensy 3.1 PWM, TIP31C, and LED strips

Status
Not open for further replies.

vivi

Member
So I have been having some trouble with my Teensy and I think I have an idea of what it is but I need some help understanding it .

So I have four 12v RGB led strips. Each color pulls close to an amp so I used 12 TIP31C NPN transistors I had. This works but after a minute or so, or less if all the lights are on full, the Teensy will stop responding and even reboot. I noticed it gets very warm as well. As soon as I turn the lights on another LED I have on a digital pin seems to half in brightness.

The way it's wired is that each transistor's emitter is wired to ground, base straight to a PWM pin on a Teensy, and collector to the individual color of the strand.

I believe what's happening is that I am drawing too much current from my Teensy and causing it to overheat and also using too much power to drive the transistors so that the Teensy cant properly run anymore, which causes it to shutdown.

My problem is that I don't know if I need to use MOSFETs instead of the TIP31Cs or if I can use a base resistor between each transistor and the Teensy. I have no idea what value resistor I'd need or any idea what MOSFET I would need if I use that instead. I spent several hours trying to understand the idea behind both calculating a base resistor and also selecting a proper logic level MOSFET but the concepts escape me for both.

The Teensy outputs at 3.3v and each pin is rated for I think a maximum of 20ma. Something that complicates is slightly is that the length of the LED strips will vary a little.
 
The simple solution is to measure your existing Base Emitter voltage, take that as the value and then do 3.3-BE voltage = resistor voltage drop. Then run ohms law-> voltage drop/0.02 to find a possible resistor value. All sorts of wrong things there but will give you a value that's sort of sane, and much better for both the Teensy and the transistor than direct driving a 0.7ish junction with 3.3V.

What you will probably find having done that is that your transistors don't go fully on at that current so driver design beckons, but would be an easy first step.

Edit
First, I'm not someone who really 'got' transistors so will defer to those who can do the math without knowing the answer first but a look at:

http://pdf1.alldatasheet.com/datasheet-pdf/view/2779/MOSPEC/TIP31C.html

Gets us some sample numbers, including a B->E on voltage of 1.5 volts, and down the bottom the sample curves suggest 20ma will get the transistor on with a 1amp C->E current flow, though is not in the full on (lowest voltage drop) state. Notice if you move closer to the max current you move out of the range where 20ma will usefully turn on the transistor. And one risk state here is getting the transistor on, but such that it's still got a sizeable voltage drop, so if we only get 10ma drive current against a 1 amp load we have 2V drop, which both reduces our LED brightness and gets 2V*1A = 2W of heat (ok for our 40W max device but would need proper heat sinking) where pushing out to 20ma drops to 0.3v drop and much cooler 0.3W power disipation. Little change can make a big difference here.
 
Last edited:
The simple solution is to measure your existing Base Emitter voltage, take that as the value and then do 3.3-BE voltage = resistor voltage drop. Then run ohms law-> voltage drop/0.02 to find a possible resistor value. All sorts of wrong things there but will give you a value that's sort of sane, and much better for both the Teensy and the transistor than direct driving a 0.7ish junction with 3.3V.

What you will probably find having done that is that your transistors don't go fully on at that current so driver design beckons, but would be an easy first step.

Edit
First, I'm not someone who really 'got' transistors so will defer to those who can do the math without knowing the answer first but a look at:

http://pdf1.alldatasheet.com/datasheet-pdf/view/2779/MOSPEC/TIP31C.html

Gets us some sample numbers, including a B->E on voltage of 1.5 volts, and down the bottom the sample curves suggest 20ma will get the transistor on with a 1amp C->E current flow, though is not in the full on (lowest voltage drop) state. Notice if you move closer to the max current you move out of the range where 20ma will usefully turn on the transistor. And one risk state here is getting the transistor on, but such that it's still got a sizeable voltage drop, so if we only get 10ma drive current against a 1 amp load we have 2V drop, which both reduces our LED brightness and gets 2V*1A = 2W of heat (ok for our 40W max device but would need proper heat sinking) where pushing out to 20ma drops to 0.3v drop and much cooler 0.3W power disipation. Little change can make a big difference here.

Thank you so much.
 
Status
Not open for further replies.
Back
Top