Electronic – USB Power – The basics


I am new to designing something to be powered by USB. Ideally It can either be plugged in to an adapter to a UK wall plug, or a powered USB port on another device. I have the circuit design in place using Kicad but I've never powered a device using USB.

Is is simply just connecting V+ to the bits that need power, ground to the bits that need ground and a 1uF capacitor connector between the two (if so which way should they be connected)? Or is this wildly wrong?
I don't need any data transfer to D+ and D- have been left open. Do these need to be connected to ground with pull down resistors or something?
Id like to get this right so I can do it when designing other products.

Im powering an attiny and some 5mm LEDs

Best Answer

USB devices can draw up to 100 mA to perform initial negotiation, called enumeration, with the host. During this process they can request up to 500 mA. The host then decides whether to grant the extra power or shut down the device.

In some cases the host may tell a device to go into low power sleep mode.

Most wall-powered computers just connect the USB power to their 5 V supply via a polyfuse and don't attempt to control or even monitor current. Battery operated device often do carefully manage USB power. You may therefore get away with just drawing power without asking when connected to a desktop computer, but possibly not when connected to a laptop.

Of course, this is all in the USB spec.