VUSB or External Power Supply?

Status
Not open for further replies.

mwm2790

New member
Greetings, first time posting here.

I'm attempting to create a USB volume control / mixer device for my PC.

I have the following hardware:

  • Teensey 3.2
  • 4x NeoPixel Stick (8x 5050 RGB from adafruit: 32 total LED's)
  • 2x Thinpot slider variable resisters
  • 2x Rotary Encoders
  • 1x Amazon Diymall 0.96" Inch I2c IIC Serial 128x64 Oled LCD Display
  • Various other resistors and caps.

My concern is powering all of this from USB or should I go for an external power supply? The Encoders and varistors are all passive devices without much current draw. The OLED is also a lower current draw, but the NeoPixels are my main concern. Their website suggests ~18mA for each LED.

If my math is correct that means ~576mA for all 32 on at one time. This is above I think the 500mA USB current limit, yes?

Plus I'd need some sort of interface / level shifter in between the Teensey and the Neopixels (3.3V to 5V). Still reading up on how to do that.

Any help or comments would be appreciated. I can try and create a schematic if that would be helpful.

Edit: Final thought, this is going to be on my desk above my keyboard, so low brightness is a benefit. I don't need the LED's very bright.

Thanks!
 
Last edited:
The 18mA is the maximum current draw per LED, if you display each pixel at the maximum RGB brightness. However, you likely will find that too bright for something on your desk.

I tend to like 2 16-pixel rings (or 32 total pixels, which is 96 total LEDs) for costumes. I usually limit the output of any one pixel to 30 total (i.e. the power level for each of red, blue, and green is no more than 30). This is bright enough, though I've have some people say it is still too bright if they are near by. If I set each of the pixels to 30 max power, it takes about 75mA, which is well within the range of normal USB power supplies. However, with the additional of the OLED monitor, it might be close if your computer only puts out 100mA.

Before worrying about external power, I would get a USB power meter such as: https://www.adafruit.com/product/1852. See if the total is acceptable. Maybe have another potentiometer switch to control the lights.

For neopixels on the 3.2, I would suggest getting the low cost (LC) Prop Shield (https://www.pjrc.com/store/prop_shield_lowcost.html). This shield provides two pins that map pins 11 and 13 from 3.3v to VIN/VUSB voltage levels and are fast enough for neopixels. I would suggest using pin 11, so that you can keep using pin 13 as a status LED. In addition, since you are getting an i2c OLED monitor, the shield will provide the necessary pull-up resistors, so you can hook up the display directly. If you wanted, the LC prop shield also can be hooked up to a small speaker and it has some flash memory, so that you can play some sound effects. If you go to the standard prop shield, it also includes motion sensors that you could use. There are other ways (stand-alone chip to do the buffering, and adding your own pull-up resistors for i2c).

Assuming that you eventually want to solder the Teensy for a more permanent setup, there are various PCBs that you can get to mount the Teensy and switches. I tend to like the ones that are small enough to fit in an Altoids mint tin, but still give you room to add switches, etc. The two that I've used are (plus a blank tin):
 
If my math is correct that means ~576mA for all 32 on at one time. This is above I think the 500mA USB current limit, yes?

By the USB spec, 500 mA is the limit. Officially (by the USB spec) you're supposed to announce your intention to use 500 mA in the USB descriptors, which would involve editing usb_desc.h. The PC will refuse to configure the USB device if it "knows" 500 mA isn't available, which pretty much only happens if you're plugged into an unpowered hub. So technically to be USB compliant you're also supposed to check whether the USB config got set and avoid drawing over 100 mA if not configured.

As a practical matter, the wires connect through a PTC "fuse" or over-current circuit to the power supply in your PC, which can deliver quite a lot of current. The USB data doesn't alter or configure the circuitry in any way. You can probably go over the limit by 15% with most PCs and (powered) hubs. Some of the older Mac laptops had very good & sensitive over-current detection circuitry, but most machines aren't so precise or fast acting to overcurrent. Many with PTC fuses won't do anything until you reach about 1A or more. Some machines don't have any overcurrent protection at all (in violation of USB specs and probably regulatory safety rules).

Plus I'd need some sort of interface / level shifter in between the Teensey and the Neopixels (3.3V to 5V). Still reading up on how to do that.

Again, a level shifter is the proper approach. But most WS2812 made in the last couple years (and the oldest from 5-6 years ago) will usually work with a 3.3V signal. Not ideal, and definitely gives you less noise margin for problems like ground shift due to high LED current through small wires, but worth trying first while you're just testing or if you're only building a one-off project. If you're going to mass produce a product, definitely design it properly to meet all specs.

Edit: Final thought, this is going to be on my desk above my keyboard, so low brightness is a benefit. I don't need the LED's very bright.

You might be able to get away with just depending on the LEDs using less power at lower settings, if you're careful not to turn them on too much.

Do pay attention to the voltage drop on your USB cable. It's easy to check the 5V power with a voltmeter when you have the LEDs turned on as bright as you'll use them. The USB cables PJRC sells have #24 wire for 5V & GND. Many cheap cables use extremely thin wires (some have #30, even though #28 is the smallest allowed by the USB spec), which works fine for normal USB devices but will cause too much loss if you're at or over 500 mA.
 
Status
Not open for further replies.
Back
Top