Author Topic: USB power monitor  (Read 3928 times)

0 Members and 1 Guest are viewing this topic.

Offline PhaedrusTopic starter

  • Frequent Contributor
  • **
  • Posts: 714
  • Country: us
USB power monitor
« on: January 22, 2014, 05:21:45 pm »
I'm looking into a simple project to measure voltage and current on USB. Something that would fit between a charger and a tablet, for instance, and report V/A/W to the tablet screen (some software there of course). Just a simple MCU plus a 0.1% shunt resistor and some passives.

What's a good MCU with at least two >8-bit ADCs that would be suitable for this? I've been looking at the TI MSP430, but was wondering if there might be better options.
"More quotes have been misattributed to Albert Einstein than to any other famous person."
- Albert Einstein
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2754
  • Country: fr
    • kripton2035 schematics repository
Re: USB power monitor
« Reply #1 on: January 22, 2014, 05:31:32 pm »
 

Offline PhaedrusTopic starter

  • Frequent Contributor
  • **
  • Posts: 714
  • Country: us
Re: USB power monitor
« Reply #2 on: January 22, 2014, 05:45:55 pm »
Looking for a project, not an off the shelf one. ;)
"More quotes have been misattributed to Albert Einstein than to any other famous person."
- Albert Einstein
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2754
  • Country: fr
    • kripton2035 schematics repository
Re: USB power monitor
« Reply #3 on: January 22, 2014, 06:18:19 pm »
usb can pass 2 amps of current, if you want to measure the milliamp, you need a >11 bits for the adc
part from that, any mcu can do the job.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5190
  • Country: ro
  • .
Re: USB power monitor
« Reply #4 on: January 22, 2014, 06:38:29 pm »
Well, go do it then... grab a pic or atmega and a couple of adcs and you can basically do it on a breadboard. 

Even 16-18 bit i2c ADCs are a few dollars, and those will give you enough precision to measure up to 2-3 amps with no problems at all.
 

Offline MLXXXp

  • Frequent Contributor
  • **
  • Posts: 351
  • Country: ca
Re: USB power monitor
« Reply #5 on: January 22, 2014, 07:35:40 pm »
Note that for a mini-USB or micro-USB connection, the extra fifth pin, not present on full size USB, may affect current draw. This pin is sometimes used to indicate that the device is a charger and is able to provide higher current. To do this the pin might be tied to ground, or be on a resistor to +5V or ground, or on a resistor divider between +5V and ground. If you want correct current measurement in this case, you may need to bring this pin through from the charger to the device.

Cables with connections to this pin are very rare. For a mini-USB breakout board that I built, I ended up cutting into and stripping away the plastic of a moulded mini-USB connector, to add an extra wire to the fifth pin. I then sealed the connector back up with wire, solder and heat-shrink tubing.

Attached are some pictures.
« Last Edit: January 22, 2014, 07:38:35 pm by MLXXXp »
 

Offline PhaedrusTopic starter

  • Frequent Contributor
  • **
  • Posts: 714
  • Country: us
Re: USB power monitor
« Reply #6 on: January 22, 2014, 07:41:44 pm »
Thanks,


I'd prefer a single chip solution, but I'll throw a cheap 12-bit ADC in there if I need it. For now I'm looking at the ATmega16U4. It does everything I need, except that it requires a <3.6V supply, which isn't ideal for 5V USB. And throwing an inefficient in LDO in there might affect the voltage output of the charger...
"More quotes have been misattributed to Albert Einstein than to any other famous person."
- Albert Einstein
 

Offline notsob

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: au
Re: USB power monitor
« Reply #7 on: January 22, 2014, 08:48:20 pm »
There's this one that dave showed on a mailbag

http://www.jmedved.com/usbamps/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf