I'm using a pair of lithium batteries in series as a backup source for a raspberry pi zero w. Charging them isn't too complicated, (for now) I have a cheap ebay special bms handling them, and am using an MIC29xxx series LDO reg to drop my 9V rail to 8.4V with an LM317 to current limit at 250mA. Doesn't seem to get too hot to worry me there, a small heat sink is doing fine. There is probably a better way to do this, but that's what was readily available in my parts bins. Under normal circumstances, the 5V for the pi comes from a buck converter straight from the input, but on power failure, it'll have to come from the batteries.
Now, to get from the 8.4 down to 5v, I'm using another MIC29xxx series regulator. Which gets incredibly hot under any sort of load. From logging on my bench supply, the pi draws about 295mA idling, to about 725mA running at full capacity. My biggest problem with using a series resistor for this is the changing input voltage. It's not going to stay at 8.4V long. The two 14500 cells have 720mAh rated capacity (actual tests show 729 and 723). The bms claims it'll cut out at 2.5-3V/cell, but we'll see what reality brings there. I may be making a custom bms for it need be, I'd like it to cut out above 2.75V/cell. The datasheet for the MIC29xxx includes the recommended formula for adding the series resistor as this:
RMAX = VIN MIN - (VOUT MAX + VDO) / (IOUT PEAK - IGND)
This gives me RMAX = 5.5 - (5.1 + 0.2) / (0.725 + 0.015) = 0.27ohm
The LDO reg is dissipating about 2.5w, which of course makes it toasty, but only when the batteries are completely full. When the batteries are near flat, it's only about 0.6w.
The resistor isn't doing me much good here.... (0.725 + 0.015)2 * 0.27 = 0.15w. Reducing heat in the LDO reg by 0.15 watts isn't even worth the effort.
I've thought about alternatives, such as a buck reg, but there isn't enough voltage difference with the batteries low.
Also, due to design constraints, I'm limited to 2 batteries (they are molded into the enclosure, I can't change that on my end). 3 would have been simple. It's also crossed my mind to parallel the cells and use a boost converter, but there isn't much room in the enclosure for that, and I see it as extra inefficiency.
I'm open to suggestions...