Fast Charging with Lithium Batteries: Save 300 Yuan

Fast Charging with Lithium Batteries: Save 300 Yuan

Introduction

Recently, I discovered an open-source project for both embedded software and hardware on GitHub —Fast Charging Solution for Lithium Batteries Based on STM32G0, powered by a Type C charger, designed using STM32G0, it supports charging 1s – 4s lithium battery packs and includes a 2s-4s balancing charging feature.

Fast Charging with Lithium Batteries: Save 300 Yuan

Currently, this project has been mass-produced and is available for sale on Hackaday store for $60.

Fast Charging with Lithium Batteries: Save 300 Yuan

Basic Functions

The main features include:

  • Balancing charge for single lithium cells and 2s-4s lithium battery packs
  • Supports USB PD power, charging up to 60W
  • Supports non-USB PD power (limited to 2.5W – 5V, 0.5A)
  • Automatically reduces charging power as device temperature rises
  • Provides user feedback through RGB LED
  • Open-source schematics, BOM, and firmware
  • UART command line interface for debugging and runtime information

Fast Charging with Lithium Batteries: Save 300 Yuan

It has been tested with the following models of USB PD fast chargers:

  • Lenovo Thinkpad 65W Charger
  • Lenovo Thinkpad X1 Carbon USB C Port
  • Anker PowerPort Atom PD 1 30W
  • Aukey PA-Y8 27W Turbo Charger
  • Nintendo Switch Power Supply
  • Generic 2.5W USB A Wall Wart

Fast Charging with Lithium Batteries: Save 300 Yuan

Key Knowledge Points

  • Lithium battery balancing charging circuit and its microcontroller control logic
  • Using STM32G0 official USB PD fast charging protocol middleware
  • Running FreeRTOS with CLI command interaction
  • Using Makefile or TrueStudio for compilation
  • Basic peripheral usage of STM32G071CBT6 GPIO/ADC/UART/IIC/TIMER/DMA
  • Using BQ25703ARSNR lithium battery management chip

Fast Charging with Lithium Batteries: Save 300 Yuan

Hardware Circuit

The schematic is quite simple, only 3 pages, and the overall hardware block diagram of the project is as follows:

Fast Charging with Lithium Batteries: Save 300 Yuan

The main control part uses the STM32G071, which is an MCU with Cortex-M0+ core launched by ST at the end of 2018, with over 93% IO utilization. Its biggest feature is support for USB-C Power Delivery, and many power banks are based on this chip.

Fast Charging with Lithium Batteries: Save 300 Yuan

The charging circuit for single lithium cells uses the TI lithium battery management chip BQ25703ARSNR.

Fast Charging with Lithium Batteries: Save 300 Yuan

The multi-cell lithium battery balancing charging is achieved using a MOS switch regulation circuit, with resistive voltage division to monitor the battery voltage status in real-time, using battery voltage as feedback to achieve balancing charging functionality.

Fast Charging with Lithium Batteries: Save 300 Yuan

Software Implementation

On the software side, the development environment used is TrueStudio, with CubeMX generating the basic driver code, porting FreeRTOS, using STM32G0 GPIO, ADC, IIC, TIMER, DMA, UART basic peripherals, using the STM32G0 USB C driver library, and implementing exception protection logic and charging management logic, which can be monitored in real-time through a serial terminal:

Fast Charging with Lithium Batteries: Save 300 Yuan

Resources Download

Whether you attempt to build one yourself or not, the principles behind the lithium battery charging circuit and the use of the STM32G0 fast charging library are very worth learning and referencing. The complete materials includeschematics, PCB, BOM, STL shell files, etc.

  • Software
    github.com/AlexKlimaj/LiPow-Firmware
  • Hardware
    github.com/AlexKlimaj/LiPow-Hardware
HAPPY NEW YEAR
Fast Charging with Lithium Batteries: Save 300 Yuan

Fast Charging with Lithium Batteries: Save 300 Yuan

Leave a Comment