AlexKlimaj / LiPow-Firmware

Lipo Battery Charger with USB C Power Delivery Based on the STM32G0
https://arkelectron.com/product/lipow-the-usb-c-lipo-battery-charger/
GNU General Public License v3.0
322 stars 98 forks source link

Introduction

Firmware for LiPow the open Source Lipo Battery Charger with USB C Power Delivery Based on the STM32G0

LiPow uses USB Type C with Power Delivery to charge Lithium Polymer batteries. It supports charging and balancing for 2s-4s packs. The device supports charging up to 100W.

LiPow Features

User Guide

Everything runs automatically and will charge up to the max capability of the connected USB PD power supply if the max current output limit exceeds the input power supply. Lower current limits can be programmed as well.

Charging current is decided by the USB PD Source capability. First, it checks the available voltages from the source, then selects the voltage that will result in the highest efficiency for the regulator based on the number of cells. For instance, using a 30W supply with a 20V 1.5A (30W) capability and a 4s Lipo battery at 15.0V. The charging current will be 30W/15.0V=2A. As the battery voltage increases, the max charging current will decrease. 30W/16.0V=1.875A.

Tested with these USB PD Supplies

Developer Guide

To load firmware through SWD use a JLINK or STLINK.

To load firmware through UART, use one of these tools:

https://www.st.com/en/development-tools/stm32cubeprog.html

https://sourceforge.net/projects/stm32flash/

To place the STM32G0 into bootloader mode and enable UART firmware loading, jumper BOOT0 to 3.3V before powering on. Use one of the above programs with UART to load the firmware. All necessary pins are located on the debug header shown below.

Hardware Specifications

Debug Header Pinout

LiPow CLI

Sample of the CLI

LiPow CLI

Where to Buy

You can purchase a unit here or a bare PCB here.

Questions, Comments, and Contributions

Pull requests are welcome. If you have questions or comments, you can email me directly at alex@arkelectron.com.