Battery management without a mainboard?

I’m considering building a lapdock using a framework chassis. As far as I know, there are relatively easy to find display adapters, there’s an adapter for the keyboard and touchpad, and those things plus the external ports can be handled by a basic usb hub, but the one thing I’m not sure about is battery management. If I bought a framework 12 chassis, everything but the mainboard, what would I need to do to charge the battery via a usb c port, and supply power to the display, peripherals, and phone during use?

Does the battery have a built-in bms, or is the mainboard the bms?

It would take a good bit of effort.
With any laptop battery, really, most any battery period, the raw battery pack will not have a built-in charge controller. The charge controller is part of the laptop mainboard. You need to find or make a charge controller. And you would need to talk to the battery’s BMS. The Framework’s mainboard EC (embedded controller) normally talks to the battery. Framework has the EC’s firmware open source on their github, so one could find the details of what their battery needs there.

The battery is a smart battery with an internal controller.
You can read from the controller and find out the max/best voltage and current to charge the battery with. It has a “desired V and desired A” value you can read.
The EC reads the value, and programs the charger chip to charge the battery with those values.
So, you will probably need to build a small adapter board with an EC chip and a charger chip / circuit on it.

2 Likes

I’m going ahead with this project. I’ve ordered a framework 12, and while I wait I’m sourcing parts I’ll need.

After doing some research and working with AI (hopefully I’m not just drowning in slop. If I am please say so), here’s my plan for managing the battery. Does it look good, or am I in over my head/should I go with an easier option like using a standard power bank?

I’ll use a SparkFun Power Delivery Board - USB-C (Qwiic) - SparkFun Electronics to pull in power, and since I’ll be using a separate pi pico for getting keyboard input and managing a variety of other things, I can have it read the smbus desired V/A and use i2c to configure the voltage and amps to feed the battery.

Then, I’ll connect a XL4015 buck converter to the battery to get 5v power for the whole system, with an AMS1117-3.3 LDO for 3.3v power.

I found www.aliexpress.us/item/3256806259468917.html which seems like it should work for controlling the screen, and I’ll use a pi pico or 2040 to manage the keyboard, trackpad, touchscreen, webcam, audio, and battery, and a deconstructed usb hub to pass it all in to one usb port for my phone to connect to. Obviously there’s still a lot of detail to iron out, but that’s the high level plan. I’ve been focusing on making sure I can manage the battery and screen.

BTW, does anyone know of a breakout board for the framework 12 battery? I found that it uses a OCTEKCONN BTJ-08TFBRAB socket, but can’t find any connectors for it

Seems like that is the same one used on the 16.
See here, community.frame.work/t/pinout-of-the-16s-85whr-battery/49610

Acer Aspire V5-571

1 Like

Ohhhh, wait… I realized that you didn’t mention a dedicated li-ion charge controller. It should have an ntc temperature sensor to adhere to the battery. The BMS will have it’s own ntc temperature sensor, but you can not rely on pi pico coding to respond to that, software can have bugs, especially if vibe coding, using AI to handle any of the coding.

You very much can not just feed the output of a USB-PD trigger board directly into the battery! Please read about li-ion charging profiles. It’s abbreviated as cc/cv, for constant current followed by a constant voltage phase to provide the saturation charge at the top. No pi pico or other general purpose mcu should serve as the li-ion charge controller, only a dedicated chip.

Laptop batteries pack a lot of power, and all li-ions can get truely violent if not treated properly, with caution and respect. Li-ion manufacturers likes to give it the rather soft name of “venting with flame”. Shoots a stream of fire, quite far for large batteries. Also, highly toxic smoke that can cause permanent lung damage. Hydrogen fluoride, which becomes hydrofluoric acid when it touches mosture, like in one’s lungs. Leaves a toxic residue on everything. Oh, and you can’t put out the fire with water. Fire extinguishers may not do it either.

1 Like

Absolutely agree. I’ve vibe coded some js and web stuff, and it’s helpful while researching and planning, but for something like the battery I would write the code myself.

But thank you! I was actually planning to use a XL4015 to convert from a cheap fixed voltage usb-c pd component, but then I remembered @James3 mentioned that being able to give the battery it’s desired voltage is better. The sparkfun allows for a configurable input and output, and all of the XL4015 I saw just have a physical adjuster screw, so I thought the sparkfun option would allow that. But if not I’ll have to keep looking for a different option, do you know of anything that would work well for it? Or did I misunderstand what @James3 meant?

I don’t know XL4015 off the top of my head.
But battery charging should only come from a dedicated li-ion charge controller chip (no pi pico or other general purpose mcu should serve as the li-ion charge controller). An i2c / programmable dedicated li-ion charge controller might be required, looks like that’s what he was talking about.

1 Like

I don’t think that would work.
The battery tells the EC the desired voltage AND desired current.
The charge controller IC must then keep within both those.
It is not as simple as just setting the voltage == the desired voltage.

The general profile for a Lithium Ion battery is generally a constant current initially when the battery is low on charge, and then voltage controlled towards the end. But there are also various exception cases, where the battery might have some desired current, but the charger should charge with an especially low current. The EC also needs to keep an eye on battery temperature and stop using the battery if it gets too hot or too cold.

So, like @MJ1 says. you need to be really careful with charging Lithium Ion batteries.
If you take a look at the battery charging source code in the EC, you will see it is pretty complex.

Note, getting it wrong can result in flames.

2 Likes

Ok, I’ve been learning a lot about pcb/circuit design. I read the isl9241 datasheet, watched some videos on kicad, made the reference schematic from the isl9241 datasheet in it (haven’t figured out specific component specs tho), but then I found out about easyeda and it is really nice to be able to see jlcpcb’s stock for parts in it, and have the footprints already defined, so I think I’m gonna use that. But it doesn’t have the isl9241 in it’s library, so I looked around for alternatives, and I think the BQ25710 should work, but before I go and make the circuit schematic and everything, does it look like it should work to y’all? Here’s the datasheet https://www.ti.com/lit/ds/symlink/bq25710.pdf

I’m planning to add an rp2040 onto the same board to handle the smbus communication, as well as converting keyboard/trackpad to usb, handle touchscreen i2c, the orientation hall sensor, and the power button, and maybe the audio. I’ll probably also end up adding connections on it to connect to and breakout the webcam usb device. If any/all of that’s a bad idea, please lmk