# How to tell a battery's ideal charging voltage with a circuit?

simulate this circuit – Schematic created using CircuitLab

I've been looking to build a universal charger for my laptop and phone, and I'm wondering; is there a viable way to adjust the input voltage to match the battery's ideal charging voltage by measuring A and B across an arbitrary load?

The scenario is as follows;

0) I've got a universal charger that can output anywhere from 5V to 24V

1) I want to charge my phone, so I plug it into the universal charger

2) Without my interaction, the circuit and it's microcontroller adjusts itself to the required voltage (5V)

3) I now unplug my phone and plug my laptop in for charging

4) Without my interaction, the circuit and it's microcontroller adjusts itself to the required voltage (24V)

How can I measure the required voltage without checking the battery label?

• you either have interaction or you don't ... you cannot have both .... you need to rethink what you are trying to do .....measuring A and B across an arbitrary load is interaction – jsotola Oct 9 '18 at 6:56