Maximum Power draw for Teensy++ 2.0

Status
Not open for further replies.

aedile

Member
Sorry for the relatively basic questions, I'm ace at programming but brand new at embedded electronics.

I am currently developing a matrix of 4x4 RGB arcade buttons. The LEDs are driven by 3 tlc5940 ICs and can each pull a maximum of (5v) 20ma per color channel for a total of 60ma at full brightness. At 16x60ma, obviously this will exceed the recommended USB draw (I'm trying to avoid external power). I can tweak the brightness to max out at half easily, but I am wondering now, what's the maximum power I can pull over USB via the Teensy itself (Teensy++ 2.0)? I searched the docs and didn't find anything. Is there an upward limit to the amount of power I can pull from the VCC pin? Are there any tricks to maximizing it? I've seen some other projects that use far more than 16 rgb led's with no external power source so it would seem that there are ways of getting enough power to make things work. I just want to make sure I'm maximizing my brightness without exceeding any tolerances and staying within USB spec. I'm wondering if maybe I need to use a different product for my LED buttons or even a different board altogether.

Related question - to those of you who are experienced with electronics, how does one generally go about planning for power requirements? I'm 4 weeks into this project making prototypes out of the various pieces I'm including (encoders, potentiometers, buttons, LEDs, a DOGM163), writing custom libraries, etc, and only now am I thinking of this. I haven't even begun to think about power draw for any other components. I'm guessing this is a typical hurdle people run into when starting out, so how do I avoid these issues in the future?

Thanks!
 
Last edited:
With USB, there are 2 factors to consider with power... hardware and software.

Software-wise, there's a byte in the USB descriptors that tells your PC how much current you will consume. It's "bMaxPower". If you want to edit this byte, you'll need to change the code in hardware/teensy/cores/... Search and you'll find that name in the code's comments. Teensy's default number is 100 mA. Of course, Teensy draws much less, and the total can be much more after you connect lots of LEDs!

The computer doesn't actually provide power differently no matter what data you give it, so that byte doesn't actually do anything useful. Its only purpose is to advise your computer of power requirements. If the computer knows there isn't enough power available, it will display an error instead of configuring your device.

Hardware-wise, most USB ports are rated for 500 mA. They're supposed to have over-current protection, which will shut off the power or reduce the voltage if the current goes over the limit. Some really good machines may trigger the hardware current protection around 600 or 700 mA. Lower quality machines may have only PTC "fuses" which become higher resistance at 1 amp or more (and the response depends on temperature). Some really low quality machines might not have any limiting at all.

USB hubs with power are also supposed to be able to provide 500 mA per port. Hubs are cheap and often a 7 port hub will be sold with a 1 or 1.5 amp power adaptor, where they assume you won't plug a full 500 mA device into every single port.

USB hubs without power are rated for 100 mA per port. Usually you can get a bit more, but the hub is getting its power from a 500 mA port and probably uses 50 to 100 mA for itself.

One other thing to consider is the USB cable. Many of the Mini-B and Micro-B cables on the market have very thin power wires, which have considerable resistance. It's not an issue at 50 mA, but at 500 mA you may find the 5 volts from the computer ends up being only 4 volts or less at your end of the cable. We have the PJRC ones custom-made with #24 wire, so they can actually be used for 500 mA projects. If you use a different cable, be aware of voltage loss.

If you set the LED current to be about 9 mA per segment, that's 432 mA for the 16 RGB LEDs. Teensy++ 2.0 can use about 50 mA, so you'll still have a bit left over for other stuff, if needed. If you give make these devices for others, editing bMaxPower is wise, so they'll get a helpful error message instead of believing your device is defective when the real problem is an unpowered hub. You can also try pushing beyond the 500 mA limit, but doing so risks tripping the over-current protection circuits in higher quality computers, or even the low quality ones if you push to really high current.
 
Status
Not open for further replies.
Back
Top