Adam Bender
How to Design a Lithium Battery Pack (Part 2 of 2)
Make sure to check out part one of this series for the battery build. Link here
Designing a custom lithium battery pack is a fun way to learn about electricity and engineering. Lithium batteries can be used for countless applications including electric bikes, scooters, vehicles, backup power suppliers, off the grid solutions, and much more.
I've broken this tutorial into the following sections:
1. How Lithium Battery Cells Work
2. Basic Electricity Fundamentals
3. How Many Cells to Put in a Battery Pack
4. How to Join Cells Together 5. BMS, Charging, and Circuit Diagram
1. How Lithium Battery Cells Work
There are countless types of lithium battery cells, but for this tutorial I'll focus on the most popular size, the 18650. The 18650 is a type of lithium cell, the name corresponds to the size of the cell. 18mm in diameter by 65mm in length.

Looking inside the cell, it a long roll of sandwiched anode and cathode material insulated by a separator. There is also a lithium based electrolyte between all layers that acts as a transporter for the lithium ions. The separator is porous enough to allow the lithium ions to pass through itself, but still insulates the anode and cathode from each other.

Looking at a cross section of an 18650 cell shows how just many layers are wrapped together:

As the cell is discharged in use, lithium ions move from the anode to the cathode, using the electrolyte as a transporter. This causes a charge imbalance on the cathode side, which forces electrons to move through whatever is connected in the circuit back to the anode side, powering the device.
When the cell is recharged, this process is reversed, and and lithium ions pass back from the cathode to the anode:
This is a very deep topic, but this basic understanding is sufficient to design a battery pack.
2. Basic Electricity Fundamentals
There are a few concepts we need to cover to help understand what the specifications of a battery mean.
Voltage = Electrical potential. This is the "force" behind electricity.
Amperage = The amount of electrons being transferred. This is "flow rate" behind electricity
Resistance = What slows down the flow of electricity.
Here is a mechanical analogy to a water system that can help explain the electrical meaning:

Now what does this mean for building real life things: For electric bikes:
The higher the voltage, the faster a motor will spin. Motors usually have a voltage limit for this reason. For brushless motors, the "KV" rating is how many RPM a motor will spin per volt applied.
ex) 10kV motor powered with 10V will rotate at 10*10 = 100RPM
Thinking back to the waterwheel analogy above, the wheel won't spin at all unless there is sufficient flow rate. This means, the more opposition there is for the wheel to turn, the more current is needed to overcome this
Ohm's Law
Ohm's law is enough to describe all the behavior here. Ohm's law explains how voltage, current and resistance relate to each other.

Buying Lithium Batteries
Lithium batteries are rated as follows:
Size: Rated as diameter and length, like 18650 or 2170
Voltage: Voltage will vary according to the charge and is chemistry dependent.
Current Output: Maximum allowable output current without sustaining damage
Capacity: Rated in Amp-hours. Example: a 3Ah battery can run for 3 hours at 1A, or 1 hour at 3A of output
C Rating: Discharge rate with respect to capacity. C = Amps*Capacity. Example a 10C battery that has a capacity of 3Ah can safety discharge at 10/3 = 3.3A
18650 cells generally charge up to 4.2V, and during discharge, drop to 3V or less. Here is a discharge graph showing the voltage over time as the battery is drained for a Samsung 30Q cell. The normal rated voltage of a 18650 cell is around the middle of this chart at 3.7V

18650 cells will also degrade with charge cycles, as the chemistry slightly changes, and minor material degradation take place. Here is the capacity vs cycle chart for the same Samsung 30Q cell:

To increase the lifespan of the cell, it's not recommended to drop below 3V, as completely draining a lithium cell will permanently damage it.
Additionally, heat is the enemy of a lithium cell, it's important not to exceed the manufacturers recommended current discharge rating, otherwise internal damage to the cell could occur.
3. How Many Cells To A Battery Pack?
You need to know what the battery will be used for to pick the right cell.
1. What voltage is needed (how many cells in series)
2. What maximum discharge current is needed (how many cells in parallel)
3. What capacity is needed (how many cells in parallel)
Stacking cells end to end, in series, increases the voltage but keeps the capacity and output current the same. 1 cell = 1S || 2 cells in series = 2S || 3 cells in series = 3S || 4 cells in series = 4S

Stacking cells side by side, in parallel, increases capacity and output current, but keep the voltage the same.
1 cell = 1P || 2 cells in parallel = 2P || 3 cells in parallel = 3P || 4 cells in parallel = 4P

Let's look at an example using the Samsung 30Q cell. It has:
- Peak voltage 4.2V
- Capacity 3Ah
- Max current output of 15A
If we need to design a battery pack capable of 48V peak and outputting 50A, how many cells do we need? 12 in series = 4.2V*12 = 50.4V
4 in parallel = 15A*4 = 60A
So 4 cells in a parallel group, and 12 parallel groups connected in series.
This is referred to as a 12S4P, since there are 12 cells in series, and each series group contains 4 cells in parallel. Here is what that looks like.

Let's take a closer look at what's going on here, there are 12 groups of 4 cells joined together to make this battery:

Keep in mind, as the capacity is drained, each cell will drop from 4.2V to 3V, lowering the output of the battery to 12*3V = 36V
4. How to Join Cells Together
One of the easiest ways to hold the cells together in the required configuration is cell holders. They click together into just about every combination possible, and they have the perfect cut-outs for busbars.


Link: https://amzn.to/2EBNG3Y
For the electrical connections, busbars are used to join adjacent cells together to form the parallel and series groups:

The best busbars to use for are made of pure nickel. I used the 8mm*0.15mm thickness busbars, since they fit perfectly with the cell holders I'll talk about earlier.

Link (small pack): https://amzn.to/2Qpcl0o
Link (large pack): https://amzn.to/2EBN1zz
The two most popular ways to join the busbar to the cell ends is either soldering or spot welding. I'd highly recommend against soldering, since it generates a large amount of heat, and heat is what destroys the cell.
Instead, I'd recommend using a spot welder, like the SUNKKO 709AD, or similiar:

Link: https://amzn.to/2QvoyAL (I have this exact unit, and it performs great)
This spot welder works by firing short weld bursts, which causes just the local material to melt and fuse together. Since it happens so fast, the heat it localized only to the weld area.

Each busbar should be welded twice to the ends of the 18650. However, even though the heat generated is minimal, it's best to leave some cool down time between welds on the same cell. Here is an example:

Busbar Sizing
Hardly any current flows between parallel cells, all the current flow is in the series connection. The only time current flows between parallel cells, is if one cell drains slightly faster, but it's almost immediately corrected for by the other cells in the parallel group.

To see how current a 8mm * 0.15mm busbar could withstand, I ran a few trials at different amperage's, and measured the temperature rise. Since heat is the enemy of the lithium cell, it's best to keep the temperature rise to no more than 30C.

Heat is generated in the busbar from joule heating (resistance losses). The equation for this is I^2*R, which is the current squared times the resistance of the busbar. So a small change in current can have huge heat implications.
For my battery pack, I require passing 50A, which will take 4 nickel strips between series connections to not overheat the system. This can be done by double stacking the busbars to create the necessary number needed.
From there, it's rinse and repeat joining all of the cells together, and doubling up (or more) the series connections as needed.
5. BMS, Charging, and Circuit Diagram
To protect the fancy new battery, we want to add what is known as a Battery Management System (BMS) that protects the battery during charging and discharging. Earlier, I mentioned that lithium cells do not like to be drained below 3V, and also should not be charged over 4.2V. A BMS does exactly this for series connected cell groups, it makes sure that not a single cell ever goes outside the recommended voltage range, thus increasing the safety of the battery pack, and also the longevity!

Link: http://www.batterysupports.com/ The BMS will be specific to the number of series cells connected, make sure you pick the right one.
Here is how you connect the BMS to the battery pack. Please check the wiring recommendation of your exact BMS, as they can differ in naming conventions.

A BMS works by connecting balance wires between nodes on serial connections. During charge, If the voltage on any node swings above the 4.2V threshold, the BMS will ensure no more power flows to this parallel cell group to avoid damage. During discharge, if any node dips below 3V, or whatever the BMS is set to, then the BMS will cut power output to the entire pack to save the cells.

The charger needed will depend on the amount of series connected cell groups. When searching, type in how many series cells are connected. For example "12S Charger".
It doesn't matter how many parallel cells are in a group. You want to make sure that the charge rate doesn't exceed that of the cell. For example In the datasheet of the Samsung 30Q cell, it specifies 1.5A as the normal, and 4A as the maximum.
Examples:
- 6S1P, max charge rate is 4A
- 6S2P, max charge rate is 8A
- 6S3P, max charge rate is 12A
- 12S1P, max charge rate is 4A
- 12S2P, max charge rate is 8A
- 12S3P, max charge rate is 12A
12S charger link: https://amzn.to/2MpkYKm

You'll need to buy a DC barrel jack, so that the battery pack can be plugged in and charged as well. Make sure the charger you buy has the same diameter. It should, most are 2.1mm
Link: https://amzn.to/2YX6EKl

The XT line of connectors work really well for lithium battery pack outputs, since they can handle large current loads. There are 3 main sizes, the XT30, XT60, and XT90. The main difference is the current load they can handle.
When sourced from quality suppliers, the plastic housing is made from a flame retardant and self extinguishing nylon that is rated to 120C. They're also keyed so they can only be plugged in one way, no accidentally plugging them in backwards and getting the polarities switched.
Simply solder your wires to the ends. I recommend sliding a bit of heat shrink over when you're done soldering, to act as a bit of a strain relief.
XT30 - 30A rated
Link: https://amzn.to/2YXs9L8

XT60 - 60A rated Link: https://amzn.to/2YWSqsY

XT90 - 90A rated
Link: https://amzn.to/2KiQneq

An optional, but nice to have feature for a battery pack is an on-off switch. This lets you kill the power if needed.
Link: https://amzn.to/2VWAufS

Another optional, but nice to have feature is a battery level indicator. Most of them are configurable to whatever battery is connected. They just need to know how many cells groups are connected in series:
Link: https://amzn.to/2VWeEJM

The final step is to tie it all together with a system wiring diagram. For this example, I'll show a 12S4P battery, but this would work for any S and P variation as well:

You can see how all the parallel cell groups (1S4P for this example) are tied together, with the BMS balance lines connected to each junction. The charging port is connected before the electronic switch, since we want to be able to charge the battery when it's turned off. Finally, the battery meter is on the output of the switch, so the power is only displayed when the battery is on.
For the balance lines, connections to the chargeport, and battery meter, wire in the 18-22 AWG range should work just fine, since the current loads are quite a bit lower that the main output of the battery.
The wiring size for the current carrying portions will depend on the maximum expected current. Below is a chart that provides a rough guideline on the maximum allowable current given the temperature rating of the jacket for copper wire for a 25C ambient condition.

For anything portable, (electric bike, scooter, drone, etc) I'd recommend using silicone jacket cables, since it's rated for 200C, and is highly flexible. This will let you use the lightest possible wire by allowing it to get warmer. For fixed position wiring, like backup power suppliers and off the grid solutions, I'd recommend larger gauge wire to minimize the heat generation. Any heat generated in the cabling is system inefficiencies, and this should be avoided where mass isn't important.

Here are some links for silicone wire:
16AWG (35A max): https://amzn.to/2W2tsGw
14AWG (54A max): https://amzn.to/2MgYhIc
12AWG (68A max): https://amzn.to/2YUFC6b
10AWG (90A max): https://amzn.to/30RJgzF
8AWG (124A max): https://amzn.to/2MiThCH
22AWG (for signals): https://amzn.to/2Mifilh
18650 Battery Cells: https://www.imrbatteries.com/samsung-30q-18650-3000mah-15a-flat-top-battery/

Awesome DIY battery book: https://amzn.to/2MoFEC1

That should be everything you need to start making battery packs!!!
Make sure to check out part one of this series for the battery build. Link here