Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I'm making a small project which will take +5v from USB, What should I do with the D+ and D-, keep it open or short them to ground or do I have to add some components?

I want to run ATMEGA168 and 16x2 LCD with back light.

share|improve this question
1  
You're only using this for power, presumably? How much power are you drawing? What are you supplying? iPods require the D+ and D- lines connected in a certain way to charge, while cell phones require a different way, and the USB charging spec requires yet a different way. – endolith Apr 17 '12 at 15:23
@endolith This would be relevant if he was designing a charger. But the power user needs nothing. – Rocketmagnet Apr 17 '12 at 16:06
1  
if he wants to be compliant and draw more then 100mA he'll need to negotiate with the controller, although I don't think I've seen a single host interface that actually gives a variable current limit. :-) – Andrew Kohlsmith Apr 17 '12 at 16:38
1  
@AndrewKohlsmith they might not implement a variable current limit, but the USB Host Controller Driver is keeping an eye on the required amount of current for all connected devices, and will fail enumeration for a device that asks for more current than what remains for a given bus. Even if you use less than 100 mA, by not enumerating you create a mismatch between what the host controller thinks is being consumed and what is actually being consumed. – ajs410 Apr 17 '12 at 17:02
@ajs410 that's not been my experience. Most motherboards I have have the V+ line tied to the system +5 through a self-resetting fuse. – Andrew Kohlsmith Apr 17 '12 at 17:11
show 2 more comments

3 Answers

up vote 9 down vote accepted

Don't do anything to them.

They refer to differentially encoded transmission scheme that USB uses. Leave them alone, floating.

All you need to power your circuit is the ground and power pins coming from the USB. Many devices that are purely USB powered only have wire connections for those two pins and nothing for the +/-D

Also, be aware of the maximum current draw of your USB port, its something like 500 mA. If you draw too much your port will shut off to prevent short circuiting.

share|improve this answer
2  
He's intending to have 0mb speed - ie not send any data. – pjc50 Apr 17 '12 at 16:09
2  
Sometimes some USB hubs, motherboards or laptops will not supply +5v if there is no load sensed. Leaving it floating is not a good idea, especially with ones that have power on usb during sleep. – ppumkin Apr 17 '12 at 16:22
3  
The data lines are pulled down to ground through 15k by the host. The host will not attempt to negotiate until it detects device's 1k5 pullup on one of the lines. – avakar Apr 17 '12 at 16:34
3  
@ppumkin, the host will, of course, supply 5V always, otherwise the USB client could not bootstrap. – avakar Apr 17 '12 at 16:35
2  
Do note that according to the specifications, the maximum current a device can pull without negotiation is 100 mA for USB 2.0 and 150 or USB 3.0. If that limit is exceeded, the host can shut the power down. – AndrejaKo Apr 17 '12 at 16:44
show 5 more comments

(Re-edited.)

USB 2.0, at high speed:

45 ohms from each data line to ground (to have 90 ohm differential impedance).

http://www.usb.org/developers/docs/usb_20_101111.zip High-speed operation

share|improve this answer
2  
"Characteristic impedance" is not the same as a resistor. – pjc50 Apr 17 '12 at 16:12
I know, but that (with the 90 ohms) would be the way to have zero reflections. However, the next section in the document says that 44 ohm is the maximum (?). Not clear to me. – Telaclavo Apr 17 '12 at 16:14
Actually, the data line is only terminated in high-speed mode, and in that case both lines are terminated with 45ohm to ground (giving 90ohm differential impedance). – avakar Apr 17 '12 at 16:32
@avakar Where did you read that? – Telaclavo Apr 17 '12 at 16:36
@Telaclavo, in the spec. I'd give you more details, but having just reinstalled my PC, I can't open any PDFs yet :) – avakar Apr 17 '12 at 16:37
show 2 more comments

you can leave them floating, or you can ground them...whatever you do it doesn't really matter if you are using the USB port for just powering your device or whatever you need the power for, you just need to stick to the "Current Limits", its 850mA or something like that , im not really sure..

i made a simple LED light for my Desktop and it worked fie with the USB, i connected the D+ with the D- through a 10kilo ohms Resistance and its doing fine

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.