Maker Pro
Maker Pro

Really basic circuit help needed (swtiches, LED, resistor and usb)

Ndoki

Feb 22, 2018
4
Joined
Feb 22, 2018
Messages
4
First off, sorry for registering just to ask for help. Last time I took electronics was a LONG time ago.

Anyways, trying to make a simple circuit but it won't work and I'm not completely sure what's wrong with it.

So basically I'm trying to make a phone dock with a usb to micro-usb cable feeding into a box. I'm also trying to rig a LED and two switches in-line forming an and-gate so that the led will only illuminate if:
A) there is a phone charging (acting as a third switch?)
B) The manual on/off switch is on (in case you want it to charge without the light on)
C) the lid is open (so the LED isn't lit when it's closed)

I have the switches designed and tested fine, but my issue is I can't figure out how to wire the LED to the usb cord. The LED I chose came from a 4.5v portable light (3AAA powered) and comes with a resistor. My power source for the USB is a plug rated at 5v 1a so I assumed that the resistor/led pair would work fine already, but I assumed I cannot add the led/resistor/switches direcly to the power line in the USB cable without also resisting the flow of power to the phone itself, reducing its charging speed.

And wiring it up in parallel causes the led to either not light up, or be incredibly dim.

I've also tried testing it with a seperate standalone led also rated at 4.5v without a resistor, and it is also incredibly dim, so I'm not sure what I'm doing wrong, or how I can actually wire this.

Any help would be greatly appreciated. I'd draw a schematic of what I'm trying to do, but I have a feeling it would be easier to have someone else show me how to properly wire it instead of me just guessing. Assuming what I'm trying to do is even possible with the parts I have.

Thank you.
 
Last edited by a moderator:

Ndoki

Feb 22, 2018
4
Joined
Feb 22, 2018
Messages
4
I'd also like to add that I've tested the LEDs with and without the resistor, they work fine, as well as the USB cable. The only thing that seems to work in my setup is charging my phone. :p

Sorry, it won't let me edit my main post.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
How are trying to detect that a phone is charging? The two switches are simply in series with the LED, but show us the circuit you are trying to use to light the LED only when a phone is charging.

Bob
 

Ndoki

Feb 22, 2018
4
Joined
Feb 22, 2018
Messages
4
Well the phone itself acts as the switch, completing the connection. Without a phone the end of the USB cord remains open.

Here's a quick schematic of one of the attempts, sorry if my symbols are wrong.
 

Attachments

  • IMG_20180222_1101411~2.jpg
    IMG_20180222_1101411~2.jpg
    257.8 KB · Views: 97

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
This can't work. Regardless of the 2 switches at the top of your circuit, the LED is always short circuited by the wire in the middle.

I understand you want the LEd to be lit as long as there is current flowing into the phone (charging), right? You can't do this with an LED (or LED + resistor) alone without considerable voltage drop, as you have noticed. You'll need a current sensor without considerable voltage drop to control the LED while allowing charge current to flow to the phone.
Unfortunately the most simple circuits using only a single transistor will develop too much of voltage drop. Therefore you'll have to resort to a circuit using an amplifier. I offer this opamp and accompanying circuit as one example.
The 0.2 Ω sense resistor needs to be replaced by a value such that at normal charge current the output transistor is fully turned on. The 2 kΩ resistor at the output ca be replaced by the LED wih appropriate series resistor for current limiting.

It may be easier to use one of these USB charge indicators.
Or use this kit. YOu can add the LED-off feature (regardless of charge state) by soldering a switch across the built-in current sense resistor. This is easily seen on the schematic diagram in the manual, page 17.
 

Ndoki

Feb 22, 2018
4
Joined
Feb 22, 2018
Messages
4
I'll be sure to check that all out once I get home, thanks a ton.

However my take-away so far is basically, it's going to have to be far more complex? I was worried about that but was hoping otherwise as this is a sort of "do on my free time with free parts" sort of project. So far I've paid 2.50 for the led and magnets. Ha ha.

I also recall a friend of mine having a USB cable with LED's built in, but I can't recall if they were just permanently lit or not.

Anyways, thanks again.
 

Cannonball

May 6, 2017
193
Joined
May 6, 2017
Messages
193
To light up the led you will have to remove the wire in the middle. If the battery is in the circuit to charge the cell phone of the right polarity, turn the led around. It is reversed biased.

The led takes about 20 milliamps to light up. It may or may not be enough to charge the phone, but it will light up the led.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Phones charge at between 1/2 to 2A. You cannot put this current through the LED.

You need a small resistor in series with the charging circuit, then a comparator to detect the small voltage it develops when the phone is charging.

Bob
 

Sunnysky

Jul 15, 2016
541
Joined
Jul 15, 2016
Messages
541
It is so much easier to buy a 6 port USB hub to charge any mobile with the suitable lightnng or micro connector and let the mobile charge with 2.4A available on any port and forget about indicators. Use the mobile to indicate when it is full charged.
 

Bluejets

Oct 5, 2014
6,901
Joined
Oct 5, 2014
Messages
6,901
I use a diode to detect current flow and then strap an npn transistor across the diode to switch any indicator led.
 
Top