Battery pack build

So, I just got a new toy! A spot welder, and some 3500mAh 18650 cells and nickel strip. This is going to end up being a long stick, because it’s going inside a acrylic tube and I’m making another light-up cane.

I’m debating if I want to do 4s2p, or 8p, assuming I can fit all 8 cells in vertically along with controller, voltage buck (or boost) to 5v for the LED strips, BMS/PCB, fuse, power switch & charging port.

For 4s2p configuration, I got a BMS that can do balancing, and I’m trying to see if I should do that, or just do like the last one, all cells in parallel and keep it simple and easy. My reasoning to go for 4s2p is I can put in more power and charger quicker for the same amps (I’m figuring a 2a over a 3a rated small JST type connector). Fully charging might be a challenge at some points in time, if I want to use it multiple nights in a row in 8p, since I can only do 4.2v.

My questions on 4s2p configuration, is what AWG should the individual cell/balance line lines be? Can I get away with 24awg, to keep the extra wiring along the cells very small, and tight to the cells? Or do I actually need to go up to 20awg?

And also, I’d do 2p and put those cell groups into series, right? Thinking about physical configuration, I can put 2 cells (A) + to +, fold over into vertical orientation, then the next group is in (B) - to - configuration, and then I join A to B on A’s - to B’s +, and continue. And of course solder onto the nickel strip the balancing wire between each group. That should work out? I’ll have very short nickel strips, and I get the feeling I should pre-bend them to get the crease where I want, so after welding they’ll fold where I want, the way I want.

What’s your BMS balance current? If it’s more than a few hundred mA, I’d be shocked. Most of the small ones are something like 50mA, for which 24AWG is more than enough. If you can’t find it, go see what the balance resistors are rated, and you can math it out at ~4.2V across them.

Correct. Once you’ve got 2P welded together, they’re effectively a single cell, chemically - they’ll always be at the same voltage. Any modern lithium pack will be parallel groups in series. The only time I’ve seen the opposite was older BionX packs, but they used a kind of screwball chemistry anyway that isn’t relevant anymore (spinel LiMn, it was legitimately self balancing).

I’m not sure what you’re proposing here, actually. If they’re going to be a single “8 cell long” layout, it’s actually rather difficult to do that with what you want, since you’d need quite a bit more than balancing wire running between the non-facing ends. Can you diagram it out somehow? Doing a 2P4S pack in a single line is going to be tricky, and have a lot of potentially exciting points in it.

But, yes, you should probably pre-bend the strips if you care about exact bend points.

So I got https://www.aliexpress.us/item/2255800163241145.html, since they physically will fit into the tube well.

Yeah, going to be tricky. Basically a long stick. And yes, I’ll have to run a larger gauge up the entire length for either the Pos or Neg, probably solid core 18awg, since it doesn’t need to flex at all. What I used for v1. But in this instance, I don’t need to to run 2, just 1, since the other end I can have a short length to tie into the boost/buck boards to get the 5v I need.

Hm, and as I go to diagram it out, it’ll be more complicated than I was imagining, since I’ll need the balancing wires.

I was thinking this:

A-==++==- B+==–==+ C-==++==- D+==–==+

However, unless on B & D I add a wire from one + end to the other, I can’t add the balancing lead to it. Which I’m not sure that’s a good thing to do or not, since it’d make a (very!) tiny impedance difference between the 2 cells for balancing. Probably doable & OK, but not sure.

I could, I suppose, do a strip spot welded from the middle of each pair (e.g. all of them are like A or C above), and run it down the side of one cell to where it’d connect to the next pair, and well insulate (kaptan tape and 3D printed shield?) separating the 2 battery groups so no dead-short can possibly happen.

I got these cells, so even at only 2p I expect the 5-6a@5v peaks well below the discharge limits, so I don’t think a relatively long strip to put them in series would have significant appreciable negatives on voltage/heat.

It’s probably OK to do that, with the low currents you’re drawing. But it’s going to be a complex enough build, and I’d probably avoid it for those reasons, personally. At least do it with the batteries below 30% SoC, so if they short, they won’t get too exciting.

As long as the voltage can equalize at rest, it’s fine if there are some minor differences from wire length when running.

Sounds like I should do a bit of discharge, they came to me ~3.4v. Not too much more, but a bit more.

And might be a bit complicated, but doesn’t seem too complicated. More I need to have it well planned out, with everything ready to go, along with the heatshrink ready to go. And having measured to be sure it’ll all fit in first, before I start spot welding anything. And probably spot weld a few bits of nickel strips together for some practice, and to find probably what “gear” (why is it that name anyways?) to probably use to start at.

If you drain them to ~3.0V/cell, they’ll be well below half and should lack the energy to do anything more than be a hot nuisance if shorted.

And, yes, you need to plan it out for sure, with a build like this.

Welding strips together is different from welding to a battery terminal. Short answer is “You should start high, and turn it down if the weld is really too hot.” You’ll be in a high vibration environment (walking stick), and my general guideline is that if I can’t put my finger on the weld immediately without burning myself, it’s too hot. Otherwise, if you’re doing several welds, just let it cool down between welds - perks of spot welding. As long as you can (somewhat uncomfortably, perhaps) touch the terminals, you’re not overheating them welding.

1 Like

8p is close to 30v nominal. If you’re using 5v LED strips, is it reasonable to run them in groups of 6 in series? That’ll simplify the layout of the cells in the pack and eliminate the need for a buck/boost circuit.

What welder did you get?

So I’m about to embark on this project! Well, in the next few weeks.

@CoolModine I got this one, with this pen since I decided having it side-by-side like this, with pressing down for contact, would make it a bit easier to be consistent and also avoid the possibility of having the 2 pen tips too close together.

Also @CoolModine, these are WS2812, so 5v per pixel, individually addressable, so can’t have the LEDs in series to make up the “~30v” if I did 8s1p. Not the way these work, unfortunately.

Going to get all the cells down to ~2.95-3v each (spec sheet) says 2.5v min, so well discharged but not close enough to be close to damaging them.

And based on my current physical space estimates, I can do a full 8 cells, so I’ll be doing 4s2p. No bucks small enough that’ll do for 36v (well, 33.6v full charge) → 5v that’ll fit. So 16.8v on one that maxes out at 24v seems about right. And has a nice fixed 5v solder output, and even better an Enable pin. So I can hook it up to the ESP32 and WLED has the concept of a relay pin when turning on/off. So I can potentially have it “on”, but just the micro is on, and the strips won’t even draw quiescent current.

So going to have to do the cell groups end-to-end with each other, I’m thinking this order, and those are the BMS solder points. 0.15x6mm pure nickel strip, at absolute peak, which I should never reach with any reasonable config is ~5.5-6a from the battery, so those strips should be plenty. In practice, probably 2-3a, maybe even less.

So I think this arrangement, although with B-C + to - connection, that’ll be a lot shorter, but I think it’ll be OK as I’m not going to really be close to limits, so the marginal resistance difference should be OK. I’ll just have to use lots of kapton tape to wrap the batteries with the nickel strips, and will end up with multiple wraps, and then once I do the balance wires & 18 awg from one end to the other, do a long heatshrink on the entire thing.

And as I said, 18awg solid copper to go from one end to the other to get the power to the other end of the battery stick, and probably 24awg for the balance wires should be fine with minimal bulk.

Also contemplating adding Adafruit INA260 High or Low Side Voltage, Current, Power Sensor : ID 4226 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits into the battery circuit (after the fuse) to add monitoring to the micro. On the other hand, I can probably do this OK by planning to measure current usage before soldering on the on/off switch, and put my multi-meter in the middle. However, it won’t give me voltage readings (aka battery %), unless I do some kind of crazy voltage divider or something and pass it to a GPIO. There is https://github.com/Aircoookie/WLED/tree/main/usermods/Battery, but that is talking about a 1s reading the voltage, rather than 4s. That’s really more what I’m after, a current battery %. I do see using op-amp, but that’s more reading each cell individually, not a single value of the pack as a whole. Any thoughts?

Separately, for charging the battery, I almost want to see if I can fit in a buck-boost CC/CV to charge from a USB-PD source, specifically a 12-20v USB-PD source. The problem is if it’s 12v, most chargers will only do up to 3a (regardless of cable), so I’d need to limit my charging to 2a@16.8v, ~33W, which would barely fit in the 36W of the USB-PD. 20v@3a is no problem. I’d really prefer to charge at 3a, which will give me ~50W. Given the entire pack is juuuuust under 100Wh (aka OK to take on a plane! hahaha), that’d probably be about 2.5-3 hours from drained (~3v per cell). Which more or less matches the battery spec list at 0.5C, although doing 3a@16.8v pack voltage would give me slightly below 0.5C charge per cell. If I can find a small enough buck-boost CC/CV, I suppose I can experiment (outside) of the cane with a load tester and check if it’ll work OK at 12v@3a USB-PD, or if it’ll just try and over-amp and cause the USB-PD source to shut down.

I did also just find https://fpx.oxplot.com/, which seems really cool. Seems like I can program it to do 20v@3a primary, and otherwise negotiate at 12v@3a.

EDIT: I also just realized, I can use a smaller switch that doesn’t handle the full current load. I simply wire it to handle the ESP32 3.3v load (100-200mA max? Less?), which then can trigger a MOSFET or Relay which can handle the full load. And then I also don’t have to worry about wiring in the Enable pin on the bucks for the LEDs. Makes more room for the charging plug, and also let’s me add in a well integrated, sturdier metal “handle” that I can use to more easily pull the whole thing out, as needed. I have some of this small dual boards. Shouldn’t be fine for both load and heat, since I won’t be doing any kind of fast switching/pwm, and the possible battery load is well below max. Or I can just use a standard 3v coil 28v DC 10a relay. That might be easier, and also is a physical disconnect, rather than just powering off. Should still be safe through a MOSFET, but still.

Yeah. Sounds reasonable to me, I wouldn’t worry about it for this lightly loaded of a pack.

What’s wrong with that? Voltage divider to analog input for voltage measurement is like “literally how almost all meters out there work.” I wouldn’t even bother with an op-amp follower, personally. The GPIO pins are usually high enough impedence that you’re fine.

Looking at the ESP32 datasheet, one of the basic GPIO doesn’t have any resistors already (unlike this module) which says the Wemos D1 Mini ESP8266 already has a voltage divider.

And then based on my reading of the ADC (Analog to Digital Converter (ADC) - ESP32 - — ESP-IDF Programming Guide release-v4.4 documentation and ADC - - — Arduino ESP32 latest documentation), I need to voltage divide full down to 3.3v, so based off of this calculator, at V1=16.8v full charge, R1=10.2K, R2=2.5K, I’ll get 3.3v (so 4095 from 12-bit), and at V1=12v (3v per cell 0%) is V2=2.362v, so that should work OK. Just take a bit of experimentation/calibration to get the exact read values at different voltages and back that against the battery % plot to get approximate battery % for display. Or maybe I should change it around so I end up more like 3v at the high, R1=11.5K,R2=2.5K, that way I avoid boundary values being read slightly off.

I’m thinking I’ll use a 2nd pin to control a transistor to turn on/off from + so that it won’t produce any extra power drain, and inject a 0.1-0.5ms (or maybe 1 if that’s the lowest resolution) voltage stabilization before doing the read, and aim to do a read perhaps 30 seconds.

Might actually be able to use that module nearly as is, although I’ll want to add the transistor enable/disable control pin. Does it matter what kind I use? For this use I’d think not.

Check what the input impedence on your GPIO is - the higher it is, the higher voltage divider resistor values you can use and still get a solid read. I might not even bother trying to show percentage, just show voltage, and you mentally translate it. Or copy a datasheet curve in and plot based on that for maximum overdoing it. :slight_smile:

I don’t know why you’d bother with a separate toggle for it. Just hook it to the main power control you’re already talking about.

Well, it’ll have to wait a few weeks, the modules I’m going to use (bare modules I’ll add 3.3v regulator for) is marked as shipped from AliExpress, so likely beginning of Feb until I get them. Which will give me time to work on the battery pack and get the 3D printed bits to hold things centered and hold the BMS, bucks, etc.

I suppose a few uA it’d draw would be lost in the overall LED usage actually if it were to go from the main power on to LED voltage on/off.

I think I’ll have enough room this time to be able to figure out some kind of better wiring for the bucks (last time was boost, with separate +/- for input and output). The GND is easy, it’s shared ground between input & output, so I can just hook the LEDs all up to a shared ground instead of running 2 wires to each strip. Still have to supply to the bucks. Last time I ran the wires to the hollowed inside, and twisted them all together with the main power 18awg solid core and soldered the crap out of them. Was an ungainly mess, but worked after I coated it liberally in E6000 for electrical insulation and additional physical strength. I think maybe just a short length of the 18awg exposed, wrap around it for each bit so each wrap is “vertical” along it, solder, and then coat in some E6000 & kapton tape I think. Seems likely that’ll be an easier arrangement, less finicky.

Hm…actually, maybe getting a few small cheap boards from JLCPCB with some through-hole for the wiring would just be a hell of a lot cleaner and easier, and only seems like it’d be a few $$. Seems well worth the money.

I agree! :smiley: Custom boards are way cheaper than they used to be, and make things a lot easier.

So, I might be a bit crazy, but I’m doing 2 layer (2 sided), 2mm wide trace on each side, 2oz copper trace. Seems a bit overkill for current carrying capacity, and I’m just fine with that :slight_smile: The 2oz copper is a quite a bit extra, $15.80, but I think worth it for this.

And jeeze, the cheapest not-super slow shipping is nearly the cost of the 5 boards with the 2oz copper. 1oz copper and it’d be WAY more than the cost of the boards. Still worth it for this.

So nearly got all of the cells down to ~3v (I’m aiming for steady below 3.1v as close enough). Probably tomorrow evening I’ll lay everything out, and maybe practice with the spot welder on a cell I have around that I need to send off to recycling, but will be useful enough to dial in a reasonable “get it hot but not burning hot” to the touch after hitting it with power.

Also Thur my PCBs should arrive. Hope I did them right, using KiCAD for the first time. Previous things have been done with EasyEDA.

Been debating if I wanted to try and integrate the CC/CV into the charging part of the system, cause I was thinking it’d be nice to have a USB-PD port, and be able to use USB-PD any voltage with a buck-boost, and an auto-select USB-PD trigger. Start at 20v and work it’s way down to whatever the source can do as max voltage/amps. Assuming the CC/CV wouldn’t try and over-amp the source, just pull up to whatever it could get. Not sure if it’d do that.

Found this little guy that claims to auto-negotiate starting at 20v@5a downwards to whatever the max the source can supply.

However, I’m wanting to do 3a@16.8v charging, and there are very few buck-boost CC/CV, and basically none that will be able to handle ~50W of power that would also fit inside the cane. I might be able to manage one that claims 35W, or just use a boost cc/cv and USB-PD 12v max. Dunno. Probably would need a semi-custom design for the physical space if I wanted to do that.

Or I’ll just stick to my original plan of using XT30 connector, and an external box that handles the buck-boost CC/CV. Maybe make it 12v in or USB-PD in. I’ll most likely do this, at least to start with. I thought about using a barrel jack, but I kinda hate those, and like the XT style (or Anderson) because the poles are more separated, whereas with a barrel jack something can somewhat easily go into the end and push one pole up against the other side and cause a short. Ugh.

Hm. I need to find my heatshrink before I start anything, see if I need to order some more actually.

Hmm…I did something wrong…

Apparently KiCad isn’t as easy as EasyEDA that I used before. Time to start watching some “KiCad 101/starting” videos.

I think @Vertiginous has messed with KiCad pretty extensively.

Well someone on Reddit got back to me, apparently on the mask layer I put what I don’t want to be masked, not what I do want to be masked facepalm

So I spent way too long figuring out the placement for the vias, getting both sides, etc. And then I decided to make the board slightly wider so I can use slightly wider copper trace, to get as much current carrying capacity as I can reasonably do. 4.6mm wide, 2oz copper, front and back. And the smaller vias for the buck wiring (1mm hole), so 3.6mm wide on the trace, will obviously reduce the ampacity slightly.

Using this calculator after I ordered, apparently I can get away with 1oz copper, not 2oz. Especially since it’s double sided. limiting to 30C temp, even 3.6mm wide trace at 1oz gives me ~9.8a I can do. And being double-sided I figured a bit under double. And given my estimated max amps is probably 6-7a…I’m way, WAY over. I could have gotten away with 1oz copper double sided no problem. sigh

Ah well, as a learning experience, could have been a lot more expensive.

EDIT: And my re-order is awaiting DHL pickup…but I decided to re-do it because some of the vias are probably overly large for the 18AWG. And I also wanted to get another version for just 18AWG distribution, and while I was at it, added silkscreening for the text for which side is POS, and which is NEG so it’ll be maybe slightly easier to be consistent. Certainly look better at least.

At this rate, when I do version 3, I’ll end up with a PCB with all the buck or boost onboard, thick enough traces to carry all the power, integrated MOSFET switch for the LED on/off, ESP32 (or similar, might be a newer hardware version by then WLED will work on by then) spot to solder it on to the main board, and BQ25703A regulator to go from USB-C PD3/PPS input to charge the system, and properly charge up only at the rate the USB-PD source can handle up to the limits of the 0.5c charging for the battery pack. A single board like that probably would save me so much space (or I’d make 2 boards, power conversion and everything else, and there’s room to put them back to back more or less, to save vertical space) I could add another 2, maybe even 4 cells.

Then again…maybe not. The current 8 cells with typical 12.4Wh rating brings it to 99.2Wh, which means it comes in under the 100Wh FAA limit to not require airline approval.

I’ll just make sure to carry it at ~3.2v/cell onboard just to be a bit safer.

Yeah, below 3.6-3.7V, there’s not enough energy to really make things exciting. That’s a good “short term transport” state of charge.

Welp. I’m glad I re-made the boards, and added the 2nd board. The whole for the 18awg is way too big on these ones. The other holes are a bit big for 24awg (got for the balancing wires), but I’m planning on using 20awg for the wiring from the “bus” board to the buck anyways, so I think it’ll fit pretty great.

So might be a fun Friday night project, doing all of the spot welding and wiring up of the battery stick. Don’t need the boards for that, although they might be here by then. I’m getting pretty close to having all of the 3D printed parts finalized. Still a few bits to design, and I want to get the final length of the battery pack, even though I think I have pretty good measurement guesstimates. I think I might actually have a fair bit of extra vertical room, might add some place holders to add an accelerometer.

Still need to figure out/test the voltage divider, although as you say, just seems like a couple of resistors and it’ll be sufficient.