Close
0%
0%

LiPow - The USB C LiPo Battery Charger

USB Power Delivery based lithium polymer battery charger

Public Chat
Similar projects worth following
Starting from
$89.99
aklimaj has 0 orders / 0 reviews
Ships from Cottonwood Heights, US
This project 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 60W.

Input is a USB Type C Port. Charging is done through an XT60 connector and has JST connectors for balancing 2s-4s packs.

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.

User feedback is through an RGB LED.

I got the idea for this project while on a vacation where I only took a single 65W USB C power supply from my Thinkpad to charge the laptop, Nintendo Switch, and cell phone. Having worked with hobby style lithium polymer batteries and bulky chargers, I thought it would be nice to have a small device that could charge LiPo batteries from a USB C power supply.

Input is a USB Type C Port. Charging is done through an XT60 connector and has JST connectors for balancing 2s-4s packs.

The device will be pre-programmed with a fixed max current limit up to 6A. 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.

The only user feedback is through an RGB LED.

A STM32G0 microcontroller controls runs the system and handles USB PD communication. TI makes the perfect programmable buck boost regulator for this project with the BQ25703A. It accepts input voltage from 3.5V to 24V and the output is meant to charge lithium batteries up to 4s with a current limit of 6.35A. It is programmed through I2C.

A 3.3V linear regulator was needed to provide power for the electronics. The hardest part is that it needs to accept up to 20V on the input due to the power delivery specifications. The IFX25001 from Infineon accepts up to 45V and is a good fit for the project.

I chose to have balance ports for 2s-4s packs for balancing with charging done through an XT60 connector. Originally I was going to support charging through the balance ports, but the typical gauge of wire used for those connections would severely limit the charging current. I also had to design a circuit to automatically route the output from the regulator to the top cell depending on what type of pack was connected. I designed the circuit and thought it was pretty clever, but ultimately, made the decision to reduce complexity and support higher charging current by going with an XT60 connector.

Balancing is controlled by the STM32G0. It monitors the cell voltages using its ADC through voltage dividers to scale the voltage to safe levels. Open drain level shifters were needed to control the PFETs used for discharging. Because of this, it create a large VGS on the PFETs, up to the max of a 4s pack ~16.8V. I needed to find PFETs that could handle 20V VGS.

  • More Power!

    Alex Klimaj05/10/2019 at 20:00 0 comments

    I have spent more time testing and fixing bugs today. It can now push 60W of power into a 4s pack. I've also added a case to handle non USB PD chargers. That is limited to 5V 500mA.

    For fun, I tried charging off of my Thinkpad. It transmits a capability of 5V 3A and works flawlessly! I envision people carrying Lipow out in the field combined with a large USB PD power pack to charge batteries on the go.

  • Firmware MVP!

    Alex Klimaj05/10/2019 at 05:39 0 comments

    I have completed a firmware MVP today. All features are functional. Battery cell number detection, cell voltage readings, balancing, USB PD discovery, auto selection of PD voltage for highest efficiency, auto calculation and setting of max charge voltage, and a basic command line interface for debugging.

    I have tagged the release as v0.1-alpha.

    https://github.com/AlexKlimaj/LiPow-Firmware/releases/tag/v0.1-alpha

    In other news, I have placed the first order of production boards. They are Rev 3.0 and I'm calling this run a beta. They will go up for sale on Tindie. I plan on creating a machined aluminum case that will also serve as the heatsink. I will eventually put it up for sale as a finished product.

  • USB PD Working!

    Alex Klimaj05/05/2019 at 20:12 0 comments

    https://github.com/AlexKlimaj/LiPow-Firmware/pull/13


    I have finally got the ST USB PD middleware basics working on the STM32G0. It reads in the capabilities from the source supply and can request the supply to change it's power profile.  I still need to implement algorithm to a select power profile from source based on connected battery type to provide highest efficiency for the bq25703a regulator.

  • Rev 3.0 Ready for Beta

    Alex Klimaj04/30/2019 at 23:07 1 comment

    I have Rev 3 of the design ready for beta and I am in the process of getting quotes!

    Still working on getting the USB PD middleware working without bugs.

  • Almost ready for beta

    Alex Klimaj04/24/2019 at 19:46 0 comments

    I have been working the last couple of weeks trying to get the USB PD Middleware from ST up and running but have not been having much success. Once I get this working, I can do some more testing and order beta units. Does anyone have advice on getting this running?

  • Charging and Balancing Functional!

    Alex Klimaj04/05/2019 at 05:59 0 comments

    I finally got some time to work on this project again. Picked up where I left off and got 2s and 3s charging tested. It is now automatically charging and balancing 2s, 3s, and 4s batteries!

    I set my bench supply to 20V and was able to get it to charge a 4s battery at 45W! It was also balancing and the temperature of the MCU did rise to 44C at room temperature. So heat may be an issue in the future.

  • Status Update

    Alex Klimaj02/25/2019 at 06:03 0 comments

    It's been a while since I've posted an update for this project but I have been making progress on the firmware. Everything except for the USB PD code and a master state machine is finished. I successfully got it charging 4S batteries this last week. My plan is to try and get this to a state where I would be comfortable sending people beta units in the next couple of week.
    https://github.com/AlexKlimaj/LiPow-Firmware

  • Command Line Interface Up and Running

    Alex Klimaj02/02/2019 at 02:08 0 comments

    I have the FreeRTOS Command Line Interface up and running on the STM32G0 over the UART

    I plan on the stats command showing the entire state of the system. As well as an interface to modify the charging parameters on the fly.

    I only have the scaling done for the Battery and Cell One ADCs.

    Here is the current state of the CLI.

    Starting LiPow.
    Type Help to view a list of registered commands.
    
    >help
    
    help:
     Lists all the registered commands
    
    
    stats:
     Displays a table showing the system stats
    
    
    [Press ENTER to execute the previous command again]
    >stats
    Variable                Value
    ************************************************
    Battery Voltage (V)     15.310484
    Cell One Voltage (V)    3.795976
    Cell Two Voltage (V)    0.000000
    Cell Three Voltage (V)  0.000000
    Cell Four Voltage (V)   0.000000
    MCU Temperature (C)     0.000000
    
    [Press ENTER to execute the previous command again]
    > 

  • ADC Up and Running!

    Alex Klimaj01/29/2019 at 06:58 0 comments

    The ADC is up and running on the STM32G0 using DMA! All raw values are being read. So far I have only taken measurements for the Battery Voltage calculation.

    The code can be found here.

    Here is where I am collecting the data for the ADC input calculations.

  • Blinky - FreeRTOS Up and Running!

    Alex Klimaj01/09/2019 at 01:38 0 comments

View all 18 project logs

Enjoy this project?

Share

Discussions

Richard Osterloh wrote 05/10/2019 at 08:15 point

Awesome project Alex! You've done a great job on the firmware too. I was wondering why you decided to regulate the VBUS to power the STM rather than using the Secondary Bus from the USB-C connector?

  Are you sure? yes | no

Alex Klimaj wrote 05/10/2019 at 16:13 point

Richard, thanks! I'm reading through the USB C specification and don't see any mention that there is power on the secondary bus pins. The 3.3V regulator I chose can support the whole range of USB PD voltages.

  Are you sure? yes | no

Richard Osterloh wrote 05/11/2019 at 11:50 point

Looking at it again it was VConn that I was meaning. You'll always get 5V out of there but I guess you can't rely on it always being there.

  Are you sure? yes | no

Charles wrote 04/27/2019 at 23:06 point

Awesome job! USB-C is definitely the future and I'm so excited about it! Really nice project!! I will follow your tests 

  Are you sure? yes | no

Albert Phan wrote 04/26/2019 at 20:17 point

Great Idea. I like seeing having a more standardized charging with usb C. I would definitely be interested in beta units. I would use this to charge my quad batteries. Features I would like to see are storage charge and easily settable low current charging, of course that would essentially making a full featured lipo charger and I dont think that's what you are going for. Just being able to charge with usb c is nice and simple.

  Are you sure? yes | no

Alex Klimaj wrote 04/28/2019 at 15:28 point

Yeah, it can do all those things, but you would need to change some #defines and reflash the firmware.

  Are you sure? yes | no

patrick wrote 04/26/2019 at 15:45 point

Great! Would b interested to source a beta version already and test it.

  Are you sure? yes | no

patrick wrote 04/26/2019 at 05:36 point

This is really cool. Have the same drive to reduce all my power components to just usb-c. Also using the anywatt and pd-buddy (also through hack a day) to achieve that.

Have a remote controlled car with 2s lipos I take along and would be great if I could charge those through usb-c. If you need to a an extra tester let me know. Would also be interested once you have Something available through tindie

  Are you sure? yes | no

Alex Klimaj wrote 04/26/2019 at 15:01 point

I should have beta units ready pretty soon. I plan on selling those at cost to early adopters. I plan on having a production version after the beta.

  Are you sure? yes | no

jwalser90 wrote 04/08/2019 at 23:56 point

This is so sick! If you've got another board and components, please pm me and I'd love to receive one and give you some feedback!

  Are you sure? yes | no

Alex Klimaj wrote 04/12/2019 at 20:17 point

I do have more bare PCBs and components. I think the hardware needs a revision to add input protection and level shifting to the CC signals to the STM32G0.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates