Using USB for power

Discussion in 'General Electronics Chat' started by richard_h, Aug 12, 2013.

  1. richard_h

    Thread Starter New Member

    Jul 2, 2010
    4
    0
    Hi all,
    I'm building a very simple project - a desklamp consisting of 9 LEDs. They draw up to 20mA each at 3.2V, so that's 180mA total.

    I was planning to power this off 5V from USB, so use a 100Ω resistor on each one to drop the 1.8V, giving me 18mA, or 162mA total.

    Then, having chopped the end off a USB cable, I started having second thoughts.

    1) Do I need to talk to the computer to negotiate how much power I want to draw?

    2) If not, do I still need to terminate the data lines somehow to keep it happy?

    3) If I got keen later and used a microcontroller or something to PWM the LEDs, will the USB port be happy with the interrupted current draw, or do I need a capacitor to smooth it out? And then do I need to prevent the capacitor feeding back into the port when the computer is turned off?

    Any tips most welcome.
    Richard
     
  2. LDC3

    Active Member

    Apr 27, 2013
    920
    160
    You could probably make the lamp as you originally planned if you plugged it into a powered USB hub. I believe the powered hubs have more than enough power for all the attachments. The USB hub on the computer limits the current (I think it is below 50mA) until you negotiate for more (but you may not always get it).
     
  3. richard_h

    Thread Starter New Member

    Jul 2, 2010
    4
    0
    A useful option, thanks. I think I'd rather not rely on user behaviour, though, even if the most likely user for the foreseeable future is me :)

    Richard
     
  4. richard_h

    Thread Starter New Member

    Jul 2, 2010
    4
    0
    Actually this device https://www.sparkfun.com/products/8376 leaves the data pins unconnected, so I guess at least Sparkfun thinks it's ok ...

    The PTC is probably a good idea though.

    Richard
     
  5. wayneh

    Expert

    Sep 9, 2010
    12,155
    3,061
    At that current level, I don't think so. Just be careful about how many other things share the same USB power source.

    Nope, just leave them disconnected in such a way that there in no risk of short.
    While I suspect this would be fine, I'd probably be nervous about doing it to my beloved laptop. So yes, I think I'd look to smooth out the load.

    I think USB is already designed to handle reverse current but a blocking diode would eliminate any question. A diode would further drop voltage a bit, about 0.7V. If you incorporate this from the beginning, you can just use smaller resistors to compensate.
     
  6. BobTPH

    Active Member

    Jun 5, 2013
    789
    114
    Without communicating with the host, you are only allowed to draw 100mA from a USB port.

    This only applies to actual USB data ports. A USB charger will typically supply 500mA or more without any action from the consumer.

    Bob
     
    Last edited: Aug 12, 2013
Loading...