# Measure power usage (wattage, voltage and current) while charging an Android device

I am using Samsung Galaxy S21. While charging my phone with a USB-C 65W Lenovo/Chicony power adapter with outputs supporting DC 5V/2.0A, 9V/2A, 15V/3A, and 20V/3.25A, how can I know exactly what power wattage is my device getting charged with? I tried using the Ampere app and the values range from 1000 mA to 2600 mA while the Voltage revolves around 4.1V?

Is there an app that can help provide power input details? Are there Android APIs to provide such information? Is it fine for me to keep using that charger? I understand Galaxy S21 supports USB C with power delivery, so it should be able to select the optimum voltage to charge my device?

From an article, I was expecting my charger to provide a 15W output but voltage x measured current using the Ampere app doesn't seem consistent with that number (5W?). What am I missing? How does USB Type C power delivery work in this case?

• So in your opinion is the optimal voltage the maximum (to get the maximum charge)? You know that fast charging decreases the life time of the battery? The only reliable way to see what voltage and current is used is a hardware dongle that measures it on the cable. Commented Jul 4, 2022 at 19:01
• No, I don't expect fast charging. Probably, the use of optimal is not correct. I wanted to know how does the adapter and the device negotiate what voltage and amp rate to use? Wouldn't there be some logic? Commented Jul 5, 2022 at 4:19
• @MukulGupta yes their is a logic. But you won't find it because it's proprietary ;Market is flooded with at least 6 competing fast charge technologies. Do you expect them to reveal their secrets? //If your device is rooted, you have ways to control // See the charging algorithm (Source ) of an Anker power bank to get a sense of how complex it can be. Commented Jul 5, 2022 at 5:37
• USB PD is fairly complex //besides, it won't fit into "optimal" as asked in your question because legacy devices may be toasted, if optimal power is supplied Commented Jul 5, 2022 at 5:53

First, in Ampere, you can multiply the battery charging / decrease rate in amps by the battery voltage, to get the charging/usage rate in watts. The system does this by measuring how much current goes in or out of the battery, which is also the main way charge percentage is calculated. Power (watts) is the product of voltage and current.

Alternatively, you can use an app called AccuBattery or other similar apps that calculate the power in watts for you. There are many apps that will do this because it's quite easy to do

If it's only to know the voltage and amp rate you are currently charging at for personal knowledge and not necessarily dependent on using software for calculation, I agree with Robert's comment about the dongle for I bought 1 about a year ago from an Oriley parts house around 8 bucks. Works flawlessly!

This requires root to use. It works on all Samsung phones I have used.

Using a terminal emulator, execute this command:

Run `su` to open a root shell, then run this code

``````while cat /sys/class/power_supply/battery/current_now; do sleep 9; done
``````

These commands will print current every 9 seconds. Voltage is usually constant from chargers (not exactly sure) but as per my experience, the higher the current, the better the charger. This solution may not work for everyone, but it could work for other rooted users.

`cat` reads the contents of a file. The /sys directory is a virtual directory on Linux that represents various system information and properties from the kernel inside the filesystem.

• Hey, just adding that yes, voltage is constant from the charger. What can change is voltage between chargers. My new tablet eg can get up to 60W from a wall charger if the charger allows, and from the PD spec, you can see that for 60W it would be around 24V i guess, with 2.4A of current. Commented Jun 11, 2023 at 21:25