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)
Be careful when charging these cells in series. One cell will always win and get overcharged (too many volts.) If left in this state it will possibly explode. Limiting the current is not good enough (power is watts = amps x volts.) To do the job safely place a clamp Zener diode across each cell. Limit the charging circuit to within the recommended current for one cell only. Also use a big Zener just in case.