Measuring Current Consumption of USB Devices
Do this:


Unplug the cable from the host and the device.
Make S1.
Adjust the power supply for 5V out as read on V.
Open S1
Connect the cable to the host.
Connect the cable to the device.
Make S1.
If required, readjust the power supply for 5V across V.
Read the current into the device on I.




S1 is a simple ON-OFF toggle, slide, or alternate-action pushbutton switch rated to carry at least the device load current and hot-switch 5VDC, and the 100µF cap is used to debounce it.

The device's input voltage is measured on the load side of the ammeter, and by setting it to 5V using the voltmeter, the burden imposed by the ammeter will be lifted.

The circuit works by having the host and the device ready to talk to each other when the cable is connecting them, and then allowing them start when S1 is made.