Simultaneously charging a phone and reading voltage from separate usb line

Immya Polzovatelya

New member
Jun 3, 2018
1
0
0
Visit site
Dear everyone,

I'm working on a project which is a portable solar phone charger. Solar panels charge a battery, and the battery charges the phone through a usb cable. On the phone, I will make an app that shows the battery level on the charger. My question is: can my android phone (Galaxy S6 or S9) somehow read the voltage on the data lines of usb (the voltage will come from a voltmeter that shows the battery level)?

This question might seem a little off-topic, but it is actually related just to android: is it capable of such a low-level tasks like reading the voltage directly from usb?
 

Mooncatt

Ambassador
Feb 23, 2011
10,751
311
83
Visit site
It can read the the input voltage, but that'll change based the charge level of the phone battery. By default, Android doesn't know if it's plugged into a wall charger, battery pack, etc, so it wouldn't be able to determine the external pack's remaining capacity.

There are possibly two work arounds. One would be to add some level of communication ability to the pack that feeds capacity levels through USB, with a companion app on the phone that knows how to read these. The other (which I have with my headset) would be a Bluetooth connection where the pack reports the capacity to the phone that way.

I'm not sure if such a battery pack even exists (it may, I just haven't looked heavily at them). It may take a bit of work to design this from the ground up on a custom solar charger.
 

Rukbat

Retired Moderator
Feb 12, 2012
44,529
26
0
Visit site
I think your best bet would be a V-to-F converter in the charger, and a frequency counter calibrated in voltage in the phone app. Reading a DC level on the data lines isn't guaranteed in USB. (It can probably be done, but the reading might be different for different phones. Frequency is frequency - if the charger is generating 3,748 Hz, that's what the app will get. Remember, though, if you're using a lithium battery in the charger, you're going to have to use a DC-to-DC converter to step the 3.8 [nominal] battery voltage to 5 Volts or it won't charge the battery in the phone. If you use 2 in series, you're wasting power in the step-down from 7.6 Volts to 5 Volts.)
 

Trending Posts

Forum statistics

Threads
943,007
Messages
6,916,858
Members
3,158,771
Latest member
planeboy