I'm building a music box based on a Raspberry Pi and a HifiBerry AMP2 amp. The amp unit takes 12-24V DC and supplies the Pi with 5V. I want to be able to power the amp/Pi by either a mains adapter (16V DC switching mains adapter), or LiFePO4 batteries built into the music box. I bought this cheap battery management module to experiment with:

enter image description here

The module has these connections: a 5-pin plug for monitoring/protection of the cells, a solder patch labelled C- (charging negative terminal?), a solder patch labelled P- (power out negative terminal?), and a solder patch labelled B- (battery negative terminal?).

The only usage documentation is a diagram on the unit indicating that B- should connect to the negative terminal of the first battery in the series and that P+ and C+ should connect to the positive terminal of the last battery.

So, first, am I right in thinking that this unit would normally charge from C- and C+ and that I should take power from P- and P+?

Second, will my proposed circuit below work as a power supply for my amp/pi, so that when the mains adapter is plugged in power will come from the adapter while allowing the batteries to charge, and when it's not charging the power will come from the batteries? power supply circuit

The terminal blocks in my diagram represent the connectors on the module, the two diodes are 10SQ050 10A 50V Schottky with a specified voltage drop of around 0.5V and J1 is the power connector from the 16v supply.

The reason I'm using the two diodes and supplying power from C- and C+ is so that current won't be flowing through the BMS while the box is connected to the mains. Considering that the BMS will hold the batteries at a constant 3.7V once charged I'm hoping I can just leave the thing plugged in to mains without harm. Is that right?

  • \$\begingroup\$ In case anyone is watching this, I've just bought the batteries, so will be trialling this solution very soon. \$\endgroup\$
    – bernied
    Jul 9, 2018 at 12:49

1 Answer 1


There are two considerations with using these cells. One is keeping the cells in balance after repeated charges. The other is safety if the cell ever gets charged over voltage, shorted out, or whatever. (With LiFePo4 you are already on much better ground than with for instance LiPo, even so this has to be considered.)

You can buy cells with or without internal protection (basically a tiny PCB that goes open the moment bad things happen) and if you you get them with, that is already one major consideration less. In the RC world they typically buy these cells as a pack, and then they are charged together in bulk, with chargers that balance the cells during the charge process. Basically if one cell charges faster than the others, a transistor across it bleeds off current until the others catch up. There is no real alternative, as all cells get the same series current.

However, if you buy individual cells instead of a pack, and charge them individually, the whole problem is much simplified. Cells are kept in balance automatically, and if one ages faster than the rest you don't have to replace the whole pack. Also it is much easier for a single cell charger to ensure that its cell is never exposed to overvoltage. You pay a bit more up front for battery holders, chargers and so on, but there is less to go wrong.

Regarding the powering arrangement - I would do the diodes the other way around - a classic "diode or" arrangement:


simulate this circuit – Schematic created using CircuitLab

This so that everything has a common and unambiguous ground. Or - as you presumably know when you are plugged in - why not a chunky SPCO switch? then no diode losses or leakage at all.

  • \$\begingroup\$ Thanks for taking some time with this. I understand about charging and management of these cells, which is why there is a battery management system unit. The batteries are included in the music box so that individual charging is not an option here. As to your suggested arrangement, this is exactly what I expected to do myself, until I realised that the BMS has common positive terminals, not a common ground. That's why the diodes in my proposed circuit are connected to C- and P- and pointing the other way. The question is, will my circuit work? \$\endgroup\$
    – bernied
    Jun 18, 2018 at 8:18
  • \$\begingroup\$ And I really don't want a 'chunky switch' as it is too easy to forget. Unless it is automatic - is there such a thing? \$\endgroup\$
    – bernied
    Jun 18, 2018 at 8:20
  • \$\begingroup\$ Well, I never tried or heard of diode-or'ing several supplies together on the ground side, and in audio having a common reference is pretty important. When you do it on the + side, there is no problem because all the grounds remain unbroken. I would expect at least some problems with pops and thumps, if not issues with drivers/buffers failing. As for "automatic switches" _ I think they're also known as "relays". :-) \$\endgroup\$
    – danmcb
    Jun 18, 2018 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.