How to light led to indicate usb port has a plug in it.

Discussion in 'The Projects Forum' started by Matt Avery, Jun 3, 2015.

  1. Matt Avery

    Thread Starter New Member

    Jun 3, 2015
    4
    0
    I'm looking for a way to light a 3.0v-3.4v 20mA LED to indicate when a usb 2.0 port has a plug in it. The light should only be on when a device is plugged in. My usb 5v line is about 3.2 to 3.3 amps with an Xbox 360 Controller connected. I tried wiring the led and resistor in series with the 5v usb port. The LED lit but the plugged in device did not work. I'm guessing the LED was only allowing 20mA to the device (Xbox 360 Controller) which was not enough for it.
     
  2. tjohnson

    Active Member

    Dec 23, 2014
    614
    121
    You need to wire the LED in parallel. Series wiring divides voltage, so the Xbox doesn't work when wired in series with the LED because it only gets 1.6-2.0V. Parallel wiring divides current, which would allow the LED to get 20mA and the Xbox to get approximately the same amount of current it was using before. Make sure that the resistor you use is the appropriate value.
     
  3. Matt Avery

    Thread Starter New Member

    Jun 3, 2015
    4
    0
    thank you for the reply. Wouldn't the led be on all the time then in parallel? I only want the led to light when something is plugged in. The device completes the 5v usb line.
     
  4. tjohnson

    Active Member

    Dec 23, 2014
    614
    121
    Do you mean that you only want the LED to be lit momentarily when the Xbox is plugged in, or that you want it to stay lit the entire time the device is plugged in?
     
  5. Matt Avery

    Thread Starter New Member

    Jun 3, 2015
    4
    0
    It needs to be lit the entire time the device is plugged in. I've built a PC in a Xbox 360 case and want the usb ports to light up "the ring" when the controllers are plugged in just like the real thing. Microsoft did it with software. I'd like to do it electrically.
     
  6. tjohnson

    Active Member

    Dec 23, 2014
    614
    121
    OK, I understand now. I think this article might explain how to do what you want: http://www.dynatron.org/howto/XBOX/hackit/case/ports.html
     
  7. Matt Avery

    Thread Starter New Member

    Jun 3, 2015
    4
    0
    Almost. And thank you so much for your help. Those leds would remain on whether something was plugged in or not. I need led #1 to light up only to indicate when a controller is plugged in to usb #1 (on the top right). If nothing is plugged in it should be off. Transistor_5.jpg
     
  8. tjohnson

    Active Member

    Dec 23, 2014
    614
    121
    Unfortunately, I don't think there's a simple way to implement what you want. It looks like your question has been answered on StackExchange.
     
    Last edited: Jun 3, 2015
  9. wayneh

    Expert

    Sep 9, 2010
    12,148
    3,058
    I know how I'd do it: Use a comparator (LM393, for example) to sense the tiny voltage increase on the ground return line that will occur when something is plugged into the USB power pins. The output of the comparator can sink ~5mA when it goes low, and this is enough for an indicator LED. If you need more current, you'll need an external transistor (MOSFET) under control of the comparator.

    If you cannot detect a small voltage increase at the ground line, you can add a shunt resistor with <0.1Ω. It will have only a tiny effect on the power to the load, but will give you a few millivolts of voltage drop and that will be plenty for the comparator to see.
     
Loading...