0

Help with Power to D+ and D- on USB
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Help with Power to D+ and D- on USB

by joeygemma on Thu Nov 18, 2010 12:55 am

I'm building a switching voltage regulator using an LM2675. I am converting 28VDC to 5VDC @ 1A. The 5V end is USB and needs to be able to charge an iPhone. The entire circuit works and I have voltage going to D+ and D- (about 1.5 and 2.0 respectively).

I used the resistor layout from http://www.ladyada.net/make/mintyboost/icharge.html to adjust the voltage for D+ and D-. This voltage comes out differently, which I can't figure out. She has one resistor from each D pin to 5V and one to ground, which I also did. My question is can I just use a resistor to go from 5V to 2V and 2.8V without another resistor going to the ground?

Thanks for your input.
joeygemma
 
Posts: 7
Joined: Thu Nov 18, 2010 12:53 am

Re: Help with Power to D+ and D- on USB

by franklin97355 on Thu Nov 18, 2010 12:34 pm

Show us what you mean (schematic or drawing)

franklin97355
 
Posts: 21488
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Help with Power to D+ and D- on USB

by mtbf0 on Thu Nov 18, 2010 1:28 pm

joeygemma wrote: She has one resistor from each D pin to 5V and one to ground, which I also did. My question is can I just use a resistor to go from 5V to 2V and 2.8V without another resistor going to the ground?


that's a voltage divider. that's how they're done. two resistors in series from vcc to ground with a tap in between. have a look at the formula at the bottom of the page you linked to see how the voltage at the tap is gotten.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Re: Help with Power to D+ and D- on USB

by stinkbutt on Thu Nov 18, 2010 3:30 pm

joeygemma wrote:She has one resistor from each D pin to 5V and one to ground, which I also did. My question is can I just use a resistor to go from 5V to 2V and 2.8V without another resistor going to the ground?


No, you can't. By using both resistors you create a voltage divider, which gives you a third voltage on that pin, besides the regular 5V and 0V ground. The iPod/Phone reads that voltage and uses it to determine if and how much it can charge. If you're not getting precisely the same voltage as what Ladyada is getting but you're close, say 2.65V instead of 2.8V, you should be OK. If you're trying for 2.8V and you're getting 3.8V, then you're doing something wrong and it might not work.
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Help with Power to D+ and D- on USB

by joeygemma on Thu Nov 18, 2010 5:16 pm

Okay, thanks very much; that answers my question. I'm actually getting a bit less. I'm getting about 2.0 on D- and about 1.5 on D+ (analog multimeter). I read another post that recommended the use of slightly different (lower) resistor values. I will attempt that and see what it reads.

I'm using 1/8 watt resistors, should I up them to 1/4?
joeygemma
 
Posts: 7
Joined: Thu Nov 18, 2010 12:53 am

Re: Help with Power to D+ and D- on USB

by stinkbutt on Thu Nov 18, 2010 5:31 pm

Probably won't matter, provided you're not using tiny (~ohms, as opposed to ~Kohm or ~Mohm) resistors The cutoff's about 200 ohms, if you must know. Your entire voltage divider must have a total resistance of at least 200 ohms for you to to be dissipating less than 1/8th of a watt.

If you want to get 2.8V on one pin, the ratio between the resistor closest to ground and the resistor closest to 5V should be 14:11 or 1.27:1.
Last edited by stinkbutt on Thu Nov 18, 2010 5:54 pm, edited 3 times in total.
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Help with Power to D+ and D- on USB

by oPossum on Thu Nov 18, 2010 5:48 pm

An analog meter usually will not give an accurate reading due to the rather low input impedance.
I am the Possum, and I approve of this message. Sent from MacBook Wheel Sorry for my bad German.
oPossum
 
Posts: 636
Joined: Fri Oct 26, 2007 12:42 am
Location: Michigan, USA

Re: Help with Power to D+ and D- on USB

by joeygemma on Thu Nov 18, 2010 10:31 pm

stinkbutt wrote:Probably won't matter, provided you're not using tiny (~ohms, as opposed to ~Kohm or ~Mohm) resistors The cutoff's about 200 ohms, if you must know. Your entire voltage divider must have a total resistance of at least 200 ohms for you to to be dissipating less than 1/8th of a watt.

If you want to get 2.8V on one pin, the ratio between the resistor closest to ground and the resistor closest to 5V should be 14:11 or 1.27:1.



That is excellent information. Thank you very much!

The ratio I have is close to that (the one from Ladyada). The ratio comes out to about 1.19:1. The other source that I found has a ratio of 1.42:1. I'm not sure why I can't get the appropriate voltages.

Here is a schematic:
Capture.JPG
I labeled only the resistors and LED for this purpose.
Capture.JPG (74.22 KiB) Viewed 2785 times
joeygemma
 
Posts: 7
Joined: Thu Nov 18, 2010 12:53 am

Re: Help with Power to D+ and D- on USB

by stinkbutt on Fri Nov 19, 2010 2:09 am

I'm sorry, but I have no idea how to read that schematic. I can't tell what's connected and what's not. It looks like there's a 43k going from Vcc to D-, then a 51k between D- and D+, then a short between D+ and ground, with the other 51k going to D+ and not doing anything, except perhaps interacting with the 75k.

Jeez. That is messy.

Let me ask you this:

What voltage do you want D- to be at?
What voltage do you want D+ to be at?
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Help with Power to D+ and D- on USB

by joeygemma on Fri Nov 19, 2010 3:13 am

stinkbutt wrote:I'm sorry, but I have no idea how to read that schematic. I can't tell what's connected and what's not. It looks like there's a 43k going from Vcc to D-, then a 51k between D- and D+, then a short between D+ and ground, with the other 51k going to D+ and not doing anything, except perhaps interacting with the 75k.

Jeez. That is messy.

Let me ask you this:

What voltage do you want D- to be at?
What voltage do you want D+ to be at?


It is somewhat messy, but I laid it out how I was planning on printing the board and that seemed like the most efficient (smallest footprint) way to do it to me (a rookie).

It is set up identically to this image from Ladyada:
usb4res.png
usb4res.png (3.5 KiB) Viewed 2771 times
joeygemma
 
Posts: 7
Joined: Thu Nov 18, 2010 12:53 am

Re: Help with Power to D+ and D- on USB

by joeygemma on Fri Nov 19, 2010 3:15 am

I should note that in my schematic is reversed because it is viewed from the opposite side.

I want 2.8 on D- and 2.0 on D+.

Thanks again.
joeygemma
 
Posts: 7
Joined: Thu Nov 18, 2010 12:53 am

Re: Help with Power to D+ and D- on USB

by stinkbutt on Fri Nov 19, 2010 3:44 am

Oh, I see. The diagram's of traces on the board you want to make. Well, it looks pretty clean, I suppose. You sure you're getting 5V out of your converter?

Actually I also finally understand what you meant by using a third resistor. You want to replace two voltage dividers with a single voltage dividers that has two points, at 2.0V and 2.8V. That's actually not a terrible idea. I can think of no reason why that wouldn't work. Ladyada might've thought of that already, however, and discarded the idea, for reasons I don't know about...
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Help with Power to D+ and D- on USB

by joeygemma on Fri Nov 19, 2010 2:05 pm

The converter is definitely putting out 5V. I've checked it in several areas between the Cout and Pin 1.

Ladyada is waaaaay smarter than I am, so I am sure she must have thought of it and discarded the idea.

I haven't put this on an etched board, so it's possible that I have a weak connection somewhere, resulting in the lower voltages. I plan to etch a board next week and rebuild it. Hopefully that will solve the problem.

Do you agree that those resistor values will result in the desired voltages?
joeygemma
 
Posts: 7
Joined: Thu Nov 18, 2010 12:53 am

Re: Help with Power to D+ and D- on USB

by franklin97355 on Fri Nov 19, 2010 2:34 pm

I plan to etch a board next week and rebuild it. Hopefully that will solve the problem.

Sorry to be such a 'stick-in-the-mud' on this but it is my opinion you should NOT make a board until you already have a totally working circuit. Why spend the time and expense to build a board only to find out it still does not work because you routed the wires wrong or made a bad assumption?

franklin97355
 
Posts: 21488
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Help with Power to D+ and D- on USB

by joeygemma on Fri Nov 19, 2010 4:00 pm

I appreciate your concern, but here is why:

- It will only cost about $1.
- I am sure everything is routed properly.
- The sticking issue is the value of the resistors.
- I originally set it up using the ugly construction method and it worked.
joeygemma
 
Posts: 7
Joined: Thu Nov 18, 2010 12:53 am

Please be positive and constructive with your questions and comments.