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.

  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – endolith
    Apr 17, 2012 at 15:23
  • \$\begingroup\$ @endolith This would be relevant if he was designing a charger. But the power user needs nothing. \$\endgroup\$ Apr 17, 2012 at 16:06
  • 1
    \$\begingroup\$ 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. :-) \$\endgroup\$
    – akohlsmith
    Apr 17, 2012 at 16:38
  • 1
    \$\begingroup\$ @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. \$\endgroup\$
    – ajs410
    Apr 17, 2012 at 17:02
  • 1
    \$\begingroup\$ @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. \$\endgroup\$
    – akohlsmith
    Apr 17, 2012 at 17:11

1 Answer 1


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.

  • 2
    \$\begingroup\$ He's intending to have 0mb speed - ie not send any data. \$\endgroup\$
    – pjc50
    Apr 17, 2012 at 16:09
  • 2
    \$\begingroup\$ 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. \$\endgroup\$
    – Piotr Kula
    Apr 17, 2012 at 16:22
  • 3
    \$\begingroup\$ 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. \$\endgroup\$
    – avakar
    Apr 17, 2012 at 16:34
  • 3
    \$\begingroup\$ @ppumkin, the host will, of course, supply 5V always, otherwise the USB client could not bootstrap. \$\endgroup\$
    – avakar
    Apr 17, 2012 at 16:35
  • 5
    \$\begingroup\$ 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. \$\endgroup\$
    – AndrejaKo
    Apr 17, 2012 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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