Trying to use a PC USB port as a power supply

Discussion in 'Power Electronics' started by TheSmouk, Jul 16, 2017.

  1. TheSmouk

    Thread Starter New Member

    Jun 4, 2017
    Well, I have a really simple circuit that uses no more than a battery case (composed of 2 AA batteries), a switch, 3 resistors and 3 infrared LEDs. This is a little sketch I made: Track IR circuit sketch. By the way, the resistors are 32 Ohm 1/4 W.

    The thing is that I have to change batteries every couple weeks because the LEDs start to decrease their intensity and can't be seen that well by the camera so I thought I would take out the battery case and just sold the cables to a phone charger and plug it into the USB port, but there is one thing that I am worried about and that is LEDs burning next to my face.

    My question is, knowing that the USB port outputs 5V and 500mA, am I good to plug it in just like that? Or should I change the resistors by some with a higher value? I really don't know how much voltage or current I need to make the LEDs be seen well enough and that is why I am posting this.

    Thank you in advance.
  2. bertus


    Apr 5, 2008

    Do you have details on the used IR led?
    On 5 Volts you could probably have the leds in series.

  3. TheSmouk

    Thread Starter New Member

    Jun 4, 2017
    Not really, just went to the store and asked for some IR LEDs and that's it. Sorry :/
  4. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    Can't access your sketch.
    If each LED has its own 32Ω current-limiting resistor then it is drawing about 30mA. So to run from a 5V supply instead of the present 3V one, you could replace each 32Ω with 100Ω (or 120Ω if you want to prolong the life of the LEDs).
    If you put two of the LEDs in series as Bertus suggested then the series string would need a 32Ω resistor.
    Last edited: Jul 17, 2017
  5. Papabravo


    Feb 24, 2006
    According to the USB specification (2.0) what you can rely on is 5V @ 100 mA. If you want more you have to negotiate for up to 500 mA with the USB controller in the PC. I'm guessing your device has no ability to negotiate with the USB controller
  6. WBahn


    Mar 31, 2012
    I think IR LEDs typically have forward voltages in the 1.5 V range, give or take. If so (and note that it's a pretty significant "if so"), that means each LED is currently drawing about 40 to 50 mA on fresh batteries.

    Your USB port MAY be willing to supply 500 mA no questions asked, in which case you are okay by using something in the range of 75 Ω to 82 Ω. You can probably use 100 Ω and be fine. You might want to start with 180 Ω and work your way down until you get an acceptable brightness.

    Your USB port also may choose to not supply more than 100 mA unless the device negotiates for more. But if you use a charging port then you should be fine. But you are close enough to 100 mA total draw that you might be able to live with that. A 100 Ω resistor should put you close to that, but I'd recommend going with a 120 Ω to stay below the limit.
  7. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    That's a safer figure to go with than my assumed ~2V. So the resistor values I suggested shoud be upped as per Wbahn's suggestion.
  8. TheSmouk

    Thread Starter New Member

    Jun 4, 2017
    Well there is something very important I didn't mention and that is that I intend to use a USB 3.0 port :/
  9. be80be

    Distinguished Member

    Jul 5, 2008
    In the USB 1.0 and 2.0 specs, a standard downstream port is capable of delivering up to 500mA (0.5A); with USB 3.0, it moves up to 900mA (0.9A). The charging downstream and dedicated charging ports provide up to 1,500mA (1.5A).Apr 19, 2017
  10. muhzd

    Active Member

    May 25, 2009
    Getting one of these and this guy is showing 0.9A from the desktop PC USB port.
  11. dl324

    Distinguished Member

    Mar 30, 2015
    The USB 3.0 spec says you can draw up to 150mA without negotiating for more.

    If you require more and can't negotiate for it, you shouldn't connect it to a USB port.
  12. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    Since the TS has only three LEDs the max current drawn will be 90mA (or 60mA if two LEDs are connected in series), so no negotiation is necessary.