Detecting that a phone is charging?

I've been learning Arduino for the last few months, which has been awesome given my background in engineering and C++. Wish I'd discovered this hobby sooner.

I want to create a project where I can validate that my child's phone is plugged in in a charging station that I want to build. The simplest thing I can think of is to have a female USB port that any cable can plug into, and some way to detect that something is plugged in. I don't want to mess with building a charger or current monitoring. The simpler the better. Low current is fine as it will charge through the night.
Are there any microcontrollers that have some sort of outgoing power supply capability?

I'll write a program to detect the time using a DS3231, and I haven't yet decided on the output. Something like a light or audio signal at bedtime if there's no phone.

Isn't there a light on the phone that can do this. I imagine all of them have an audio alert signifying successful connection as well.

Connect the B- terminal of the female USB connecter, through a low-value (1 ohm?) resistor, to GND on the Arduino. Connect the B+ terminal of the female USB connecter to +5V on the Arduino. Connect the non-GND end of the resistor to an analog input pin. The voltage across the resistor is a measure of the current being drawn from the female USB connector. You can then read the voltage to see if the phone is drawing power (and how much).

Use the internal 1.1V (+/- 0.1V) voltage reference to get better resolution at these low voltages.

1 ohm is too high if we assume charging current of 500 mA, already 0.5 volt drop and worse if it’s 1 Amp, 1 volt lost.

I dont know how phones work with reduced voltage on the input for charging. But this is just a go/no-go kind of testing, so 0.1 ohm would give 0.1 volts at 1 amp and still be a/d able to read to 1 percent or so if the current measurement is of interest.

Check my Ohm’s law. I hope better than my metric system chops.

We (well, I ) won’t live long enough but children might to see the cellular phone you toss after a few years when the “life time” internal battery is finished serving. Or maybe there will be so much microwave radiation around phones could just power themselves off that…

a7

eBay search term: MAX741 voltage current sensor.

My phone and all I've ever owned come up with a message "charging".
Old ones (20 years ago)used to have a charge light built in.

Thank you for all the responses. I used the directions (and new search terms) you gave me to find this tutorial that will get me started. I was hoping for some method other than cutting a cable and measuring current, but oh well.

Arduino Controlled Phone Dock With Lamps : 14 Steps (with Pictures) - Instructables

I hope it's clear that the point isn't for ME to know that my phone is charging, but for a program I'm writing to know when the phone is charging.

No, it wasn't clear at all. For all that, I can't see why you need to cut any cables if you are disinclined. Surely, you can get Arduino to monitor the charge light, or perhaps measure the Oersted effect at the cables?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.