Measuring current that cell phone is using to charge

Is there a way to use an Arduino Uno r3 and my 16x2 display to be rigged up to show me the amount of electricity my phone is using to charge through the USB cable?

I added a photo attachment of what I envisioned...

PS (different wall chargers can supply different max amounts of mA electricity. This would be able to show me how well each charger supplies current.)

I have a killawatt that shows me the AC current being used, but that is not the same as measuringthe low voltage current going into the phone after the transformer 110ac to 12dc/5dc.

isitpossible.jpg

Google it. There are several available for just a few dollars.

Also remember that the choice of USB cable can affect charging current

A starting point in your search here. Smaller and cheaper than an Arduino/LCD combination.

Thank you very much. That adafruit one was exactly what I was looking for...
Now how would I modify that, or recreate it so I could store the amount of energy used / time in my SD card shield :wink:

Riva:
A starting point in your search here. Smaller and cheaper than an Arduino/LCD combination.

Using the code they have here->USB-Power-Gauge/adafruit_usbpowergauge.ino at master · adafruit/USB-Power-Gauge · GitHub

All you would need to do is add an energy measurement to their code is change this:

uint32_t vcc, icc, watt;
void loop()
{
  vcc = readVCC();
  icc = readCurrent();
  watt = vcc * icc;
  watt /= 1000;
}

To this:

uint32_t vcc, icc, watt;
uint32_t timestamp;
uint64_t uWs = 0; // Unfortunately, you need 36 bits for 10Wh which is the size of most cell phone batteries.
void loop()
{
  // Take timestamp for when the voltage/current were sampled.
  uint32_t newtime = micros();

  // Read the voltage and current.
  vcc = readVCC();
  icc = readCurrent();

  // It seems that "watt" is actually mW, as vcc seems to be in mV and icc seems to be in mA.
  watt = vcc * icc;
  watt /= 1000;

  // Integrate power over time to get energy.
  // mW * us / 1000 = uWs
  uWs += watt * (newtime - timestamp) / 1000;
  timestamp = newtime;

  // If you want to print Wh using their function (that I didn't include here)
  printDotDecimal(uWs / (1000 * 3600), 3);
}

Now we're talking, Thanks Big-Bobby and 2 of them are on the way....

BigBobby:
Using the code they have here->USB-Power-Gauge/adafruit_usbpowergauge.ino at master · adafruit/USB-Power-Gauge · GitHub

All you would need to do is add an energy measurement to their code is change this:

uint32_t vcc, icc, watt;

void loop()
{
  vcc = readVCC();
  icc = readCurrent();
  watt = vcc * icc;
  watt /= 1000;
}




To this:


uint32_t vcc, icc, watt;
uint32_t timestamp;
uint64_t uWs = 0; // Unfortunately, you need 36 bits for 10Wh which is the size of most cell phone batteries.
void loop()
{
  // Take timestamp for when the voltage/current were sampled.
  uint32_t newtime = micros();

// Read the voltage and current.
  vcc = readVCC();
  icc = readCurrent();

// It seems that "watt" is actually mW, as vcc seems to be in mV and icc seems to be in mA.
  watt = vcc * icc;
  watt /= 1000;

// Integrate power over time to get energy.
  // mW * us / 1000 = uWs
  uWs += watt * (newtime - timestamp) / 1000;
  timestamp = newtime;

// If you want to print Wh using their function (that I didn't include here)
  printDotDecimal(uWs / (1000 * 3600), 3);
}

I have this one
http://www.ebay.com/itm/111861977778

what amazes me is the voltage drop and drop in power on some of my wall warts.

it helped me find 3 bad cables as well.