Question: I have a large set of circuits to make using Lithium Ion cells for power. The circuit requires ~12V, which is easily achieved by stacking three cells in series, but the charging circuits I've obtained are little TP4056s which (AFAIK?) can only charge one cell each.

I'd like to avoid having to decouple or remove the batteries for charging, so I thought up the circuit below, basically adding some diodes to separate the cells when they're charging (and the circuit is switched off). I'm basically asking for a sanity check: does adding diodes this way correctly separate the cells? Or am I missing something about how voltage/current will work out, given that all the IN+ and IN– will be paralleled to a 5V supply?

![schematic](https://i.stack.imgur.com/iIsqA.png)

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fiIsqA.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/)

Answer: 
No this won't work because the output from the chargers is not electrically isolated (transformer). The chargers will all share a common ground so the positive from charger 2 will short circuit into the negative of charger 1, and charger 3's positive will short circuit to charger 2's negative.

Your diagram isn't entirely accurate according to the datasheet for the TP4056. The sample wiring diagram on their datasheet clearly shows the battery negative tied to ground. Your diagram shows the negative isolated from the charger inputs which suggests some sort of isolation, but that's not the case.

If you want a quick and dirty way to charge your batteries in this configuration, then I suggest a linear charger monitored by an op-amp or comparator. It's by no means the best way to charge a battery, but it's safe and might be what you're looking for. Here's something to get you started. NOTE, the values and components here are arbitrary. This is just something I threw together.

[![enter image description here](https://i.stack.imgur.com/dYufy.png)](https://i.stack.imgur.com/dYufy.png)
It looks like many people have the same dilemma.
For me its for using/charging LiIon cells in power tools.
My solution is quick and dirty but works.
The ultimate answer is to remove the cells from the device for individual charging in a dedicated (say, 4-cell) charger that charges each cell separately.
So I use a multiple-pin plug/socket depending on how many cells in the tool.
The socket is mounted on the tool, I use a matching plug that is wired to the charger's output for each cell. So that's charging covered.
To use the tool, I insert a blanking plug into the socket that links the cells together in series.
For tools or devices that have less than 4 cells, the system still works, as there are simply less connections in the socket on the device.
As I said - quick and dirty but it works and it is surprisingly easy to use.