Li batteries and using esp32 as a bms?   - Page 1
Forum section: electronics / projects

author: viper
author_rank: Regular Contributor
timestamp: September 07, 2025, 12:36:51 am
content: I didn't want to get too far in the weeds but looking at a project with battery power, using an esp32. At the moment, the actual power or Wh requirement is still undecided but may use a 1S2P config, in which I really don't think I would would need cell balancing if doing a slow and careful charge method.But a BMS of some type would be needed, but I also sort of need some control over that to dictate when charging is allowed, when to stop, when charge power is available, etc.So to the point, is there something a BMS can do better than an esp32? I would like to have cell temp, but I can glue something to the pack for that. Don't really want to but probably a good idea.I realize a BMS (good one) would do things like monitor temp and allow or stop charging, shut off battery at low volts, etc. Basically all things I would think would be very easy with the esp32?

author: Smokey
author_rank: Super Contributor
timestamp: September 07, 2025, 02:57:23 am
content: Quote from: viper on September 07, 2025, 12:36:51 amum.. how about reliably keep your batteries from burning your house/car/etc down?ESP has a notoriously terrible ADC, especially the first version.

author: viper
author_rank: Regular Contributor
timestamp: September 07, 2025, 05:09:56 am
content: Quote from: Smokey on September 07, 2025, 02:57:23 amADC can't even read a voltage and flip on a FET?Just askin..lol I heard they sucked. I guess where I am at is I need to do some creative things with solar charging, and make decisions based on battery SOC, temp, and a few others. I guess I have a bit of experience with Li in the commercial solar lane so I was leaning on a bit of that, but to be honest, I don't really want to deal with all the BMS drama, thus why I was trying to get my project spinning with a single cell, but I don't think that can happen.I sort of need to know the BMS parameters, like I need to know the battery temp because it can help in future revisions, but if I can't dictate other parameters such as rejected charge due to temp, I could be left to guess. Basic PWM charge strategy seems to work fine for small stuff. I doubt I need to reach for MPPT for this.In all, I agree that maybe I need to do better to find my own BMS that will serve my needs rather than over complicate it?

author: Smokey
author_rank: Super Contributor
timestamp: September 07, 2025, 05:50:34 am
content: Quote from: viper on September 07, 2025, 05:09:56 am... not below about 100-150mV.. Yeah, that bad.https://docs.espressif.com/projects/arduino-esp32/en/latest/api/adc.html#analogsetattenuation

author: uer166
author_rank: Super Contributor
timestamp: September 08, 2025, 08:21:00 pm
content: A good BMS "does no harm" first and foremost, this means it needs to consume ~uW to ~mW total power when operating basic protection needs. Good luck doing that with a ESP32; more likely than not it'll be a BMS=Battery Murdering System

author: thm_w
author_rank: Super Contributor
timestamp: September 08, 2025, 08:42:48 pm
content: You don't need balancing for parallel cells.There are plenty of ESP32 dev kits and modules with built in battery connectors, or standalone BMS modules, though they are 5V.https://www.aliexpress.com/item/1005006860598580.htmlhttps://www.olimex.com/Products/IoT/ESP32/ESP32-DevKit-LiPo/open-source-hardware

author: amyk
author_rank: Super Contributor
timestamp: September 09, 2025, 03:58:52 am
content: Something from the DW01 family may be sufficient as it has all the protections you need.

author: viper
author_rank: Regular Contributor
timestamp: September 10, 2025, 12:28:11 am
content: Quote from: amyk on September 09, 2025, 03:58:52 amAppreciate. At least getting me to start thinking differently, but to be honest, Nothing is really set in stone yet, so that makes this harder. I might explain more to get some basic ideas. I did look at some other charger ICs such as MCP73841/2/3/4. They are much more expensive, but at least adjustable.basically here are some parameters. Est energy needed is 1Wh/day, estimated peak power draw for only 50ms periods is 12W, but otherwise will be way less than 1W, estimated minimum battery is a single 6000mah Li battery, indicating with no charging, battery life of about 15-21 days.The intent is to supplement with a very small solar cell for maint energy. Even just a 5W cell for a few hrs/day is more than acceptable. However, there is headroom being designed for clouds, rain, etc, but also when battery temps are out of range for charging.Li should not be charged at higher temps, and rejected below cell temp of 0C. The design is to have enough battery capacity to simply not charge unless parameters are acceptable. These would be used in both hot and cold areas so trying to be creative. One is considering a larger solar cell where we can selectively dump extra energy as heat into a battery heater. I believe we could design an insulated cell around the battery to make 1-3W pretty reasonable for heating.Further, I am trying to design a balance of voltages between battery and Vcc requirements as high buck or boost leads to higher losses. There is a 10W load that runs only for 50ms, but will have an automatic boost reg so it will not stay turned up other than when pulling the required power.the issue sort of that if we run a single cell, the LiFe voltages would be about 3.5v down to about 2.8V for minimum. So a small reg could work here for the 3.3Vcc requirements. But we will also have 5V requirements, so I have to decide strategy in going to a 2S battery, which requires balancing, and bump the voltages to 5.6-7V.There are some really simple passive balance strategies but basically just burns off a little charge power from the highest cell until the lower one is on the mark. it might be possible to just do internal resistance matching of the cells which would probably self balance for years.thoughts? is that too much?

author: thm_w
author_rank: Super Contributor
timestamp: September 10, 2025, 12:46:07 am
content: Matched cells use very little power for balancing, and you'd be nearly fully charged at that point anyway so have excess power to spare.The 1S vs 2S choice is probably the main question for yourself. Usually 1S is simpler with slightly higher losses from running a boost all the time, but either one can work.

author: viper
author_rank: Regular Contributor
timestamp: September 10, 2025, 01:12:43 am
content: Quote from: thm_w on September 10, 2025, 12:46:07 amIn running at least a few numbers here, and running through AI, it does seem like a 2S arrangement may be the right approach and buck it. Gives more headroom and I will just have to think about a simple balance strategy. I've seen simple things like the individual cell leads that can be toggled to a simple burn resistor. There is probably a better way.Since temp of cells is critical, I'm thinking of just using the ESP temp sensor, then just doing a "cold kit" as an insulation blanket for the whole device and use the ESP temp for cold as well, with extra margin. Such as reject charging at 2-3C and down.With the extra capacity of a 2S, the device could possible run for a month without charging. Prob some time in there to push charging.

author: thm_w
author_rank: Super Contributor
timestamp: September 11, 2025, 10:45:24 pm
content: I wouldn't do this all in software unless you are looking for the lowest possible BOM cost.There are ICs like this:https://www.ti.com/product/BQ76905and I'm sure many other options.Premade BMS boards also exist but most I've seen don't have temperature protection.