Two months ago, I wrote a blog post on battery safety and how to keep your lithium-ion batteries from exploding as a hobbyist. Today, I’m finally ready to reveal one of the two biggest electronics projects I’ve been working on in the past several months – a fully-functioning, 42 volt battery management system.
Why design my own?
The answer to why is quite simple – I need a big battery. While I could order a pre-built battery online, there is a significant markup compared to buying individual cells and assembling the battery myself. Assembling my own battery also allows me to choose the battery capacity much more precisely and add whatever kinds of features I want to the battery management system.
How does it work?
My battery management system is composed mainly of the BQ77PL900, which is a 5-10 cell lithium-ion battery monitor chip. This chip acts as an analog front end to take battery voltages and convert them into something that can be read by my RP2040’s ADC. The board, of course, has an RP2040 on-board as the microprocessor to control the BQ77PL900 and other support circuitry.
The board boasts:
- CHG and DSG MOSFETS
- 4-layer design for incredibly compact footprint
- 5V switching regulator for microcontroller and support circuitry
- USB programming
- Exposed UART and 5-pin JST-PH connector for indicator LEDs and power on/off button
MOSFETs for charging and discharging
The board has two MOSFETs – a charge MOSFET, and a discharge MOSFET. These P-channel MOSFETs are activated by a negative voltage on the GATE pin, and they are installed with their drains facing each other to allow bidirectional current flow, depending on whether we want the battery charging or discharging.
4-layer design
I designed this board with my knowledge of 4-layer PCB design – this was to keep the footprint as small as possible. In reality, I could have gotten away with a 2-layer design, but the board would have been much larger, and traces would have had to be much smaller in order to fit all the necessary traces for the board. Smaller traces means higher trace resistance, which means more heat and less maximum current flow. As this is a lithium-ion battery, it should have a very high maximum current flow. I designed the board with a maximum current flow of 20 amps (840W peak), but this can be increased by switching the MOSFETs out for higher current rated MOSFETS.
5V switching regulator
In order to power the RP2040 and supporting circuitry, I needed to be able to take the 42v and get it down to 5v/3.3v. While I could have used a linear voltage regulator to do this, it would have run at about 12% efficiency because of the massive voltage difference (with a linear voltage regulator 1 amp at 5 volts (5W) output would require 1 amp at 42 volts (42W) input, which is terribly inefficient). A switching voltage regulator acts as a PWM voltage regulator with capacitors to keep voltage stable, so it’s significantly more efficient and doesn’t generate anywhere near as much heat.
UART, 5-pin JST-PH, and USB
My battery management system board has exposed I/O (obviously) for programming, monitoring, and sending commands from a mainboard in the future. UART is exposed to allow direct communication between the RP2040 on the BMS and a possible mainboard in the future. USB was exposed so its easier for me to program the RP2040 through USB and is much more intuitive to debug and work with. I also included a 5-pin JST-PH connector to allow a battery interactions board to be connected to the BMS, with an on/off button and three LED indicators to show charge.
Conclusion
While this board is still very much a work-in-progress, I’ve made leaps and bounds worth of progress in the last two months with my PCB design and battery management skills. I know so much more now than I did before, simply because I decided to take the plunge and try to design my own BMS – I would highly recommend this to any highly-skilled individual who wants to expand their knowledge on battery management and analog circuitry.