design of the lithium-ion battery pack tester

65
Aayush Giri, Milan Kharel Design of the Lithium-ion Battery Pack Tester Metropolia University of Applied Sciences Bachelor of Engineering Electronics Bachelor’s Thesis

Upload: others

Post on 18-May-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Design of the Lithium-ion Battery Pack Tester

Aayush Giri, Milan Kharel

Design of the Lithium-ion Battery Pack Tester

Metropolia University of Applied Sciences

Bachelor of Engineering

Electronics

Bachelor’s Thesis

30 August 2019

Page 2: Design of the Lithium-ion Battery Pack Tester

Abstract

Author

Title

Number of Pages

Date

Aayush Giri, Milan Kharel

Design of the lithium-ion battery pack tester.

51 pages+ 1 appendix

December 2019

Degree Bachelor of Engineering

Degree Programme Electronics Engineering

Professional Major Electronics

Instructors

Timo Kasurinen, Senior Lecturer

The goal of the work was to study several evaluation boards from Linear Technology and use them to design a simple Lithium-ion battery test system. A detailed study on them was done along with the search for new design components to achieve the main objective.

The main motive behind this study was to test the given sets of batteries under several circumstances and study their behavior. Initially, the project was carried out using a charging board, buck converter, battery stack monitor, and an advanced microcontroller called Linduino One, all designed by Linear Technology. The supervisor handed all of these mentioned modules in advance. However, the defect and malfunctioning of the buck converter led to rethinking and formulating a new plan with different components to obtain the final goal. Thus, a separate method was implemented using a simple charging module called TP4056, some relay switches, and an Arduino UNO. A simple circuitry and codings were sufficient to yield the desired results.

The final product can successfully test two battery cells simultaneously through numerous cycles. With Arduino UNO and the right coding, the data generations on the state of charge (SOC) of the cells, time taken to complete one cycle, measured voltages, cell capacity, currents, etc are generated flawlessly throughout the operations. The tester has a benefit over commercial products for small-scale operations and to the hobbyists. This method can be used easily to determine the different conditions of Lithium-ion batteries. However, there is room for improvement and upgrade to the system to achieve the capacity of being able to test a battery pack containing more than two individual cells.

Keywords Charging, Discharging, SOC, TP4056, CC, CV

Page 3: Design of the Lithium-ion Battery Pack Tester

Contents

List of Abbreviations

1 Introduction 1

2 Battery Background 2

2.1 General History of Batteries and Lithium-ion Batteries 3

2.1.1 Battery Classification 4

2.2 Battery Parameters and Specifications 5

2.3 Charging 8

2.4 Discharging 10

2.5 Cell Balancing 12

2.5.1 Passive Balancing 13

2.5.2 Active Balancing 14

2.6 Batteries under Test 14

3 Lithium-Ion Battery Pack Tester 15

3.1 Commercial Battery Pack Tester 15

3.2 Alternative Design for Battery Tester 19

4 Design Based On Linear Technology Evaluation Modules 20

4.1 DC2259A Battery Stack Monitor 20

4.2 DC2026C Linduino One 22

4.3 DC1830B-A 23

4.4 DC1619A 25

4.5 Nitecore Intellicharger 26

4.6 Application 27

4.6.1 Discharging Unit 29

4.6.2 Shortcomings 32

5 Design Based On Arduino 33

5.1 TP4056 Module 34

5.1.1 TP4056 IC 35

5.1.2 DW01 IC 37

Page 4: Design of the Lithium-ion Battery Pack Tester

5.2 Hardware Design 37

5.3 Software Integration 40

6 Testing And Results 41

6.1 Battery Test Results 42

7 Conclusion And Discussions 49

8 References 50

Appendices

Appendix 1. Automated Battery Charging/Discharging Station Arduino Code File

Page 5: Design of the Lithium-ion Battery Pack Tester

List of Abbreviations

ADC Analog to Digital Converter

CC Constant Current

COM Common

CV Constant Voltage

DC Demo Circuit

DAC Digital to Analog converter

DC Direct Current

GND Ground

GUI Graphic User Interface

IC Integrated Circuit

I/0 Input Output

NC Normally Closed

NO Normally Open

SOC State of Charge

VCC Power Input

V Voltage

Page 6: Design of the Lithium-ion Battery Pack Tester

1

1 INTRODUCTION

Lithium-ion batteries are vital in today’s world of science and advancement. They are

used in almost every modern electronics and devices because of their effective charge

and discharge efficiency[1]. The success in present technologies has led to more

research and study regarding this topic to improve its performances, costs, and safety

further.

This project aims to design a simple Lithium-ion battery tester. The goal is to build a

system that has a functionality of automated charging and discharging the cells,

complete hundreds of charging/discharging cycles, and finally study the aging properties

of the cells based on the experimented results. The study provides a good insight into

the battery cell characteristics and helps determine the performance and reliability of the

cells under several conditions.

The study focuses on studying and analyzing the experimented data and vital information

on charging and discharging performances of a cell under test. Additionally, the effects

and changes in charging and discharging rate, state of charge (SOC), the energy of the

cells can be assessed with an increasing number of battery usage cycles. The system

needs to be executed well enough with different types of cells. The data collected from

the system needs to be satisfactory to deduce the battery properties and analyze their

performances. However, the designed system had to be simple, and it offered the testing

solution only for two individual cells at a time.

The theoretical background of the battery and other factors related to battery charging

and discharging is described in Chapter 2. Chapter 3 is dedicated for pre-existing battery

testing product available on the market. Various battery testing products are available in

the market. Among them, three of those products are analyzed in this chapter. Chapter

4 describes the first implementation carried out using LTC 6811, from Linear Technology

as a battery stack monitor as well as it emphasizes on various demo boards, from Linear

Technology used in this thesis for charging, discharging, and monitoring the battery.

Chapter 5 describes the second implementation regarding automated charging and

discharging station based on Arduino. Chapter 6 shows the testing and results from the

Page 7: Design of the Lithium-ion Battery Pack Tester

2

second implementation. Chapter 7 gives the conclusion of the project and suggests

future research on battery aging.

2 BATTERY BACKGROUND

A cell is a single power unit that stores chemical energy and converts to electrical

energy. It consists of three essential components, an anode, a cathode, and an

electrolyte. An anode is the negative side of the cell, a cathode is the positive side of the

cell, whereas electrolyte is a gel or liquid which reacts chemically with an anode and a

cathode [2], as shown in Figure 1.

Figure 1: Representation of a Cell [2]

Electrons flow out of the anode, whereas electrons flow into the cathode. When a circuit

is connected to the cell, a chemical reaction occurs between electrolyte and anode. This

reaction produces electrons, and the process is known as oxidation [2].Similarly, another

chemical reaction occurs between cathode and electrolyte. This process is known as

reduction [2]. For the reduction process to take place, an extra electron is required. Extra

electrons needed during the reduction process are supplied from the anode side. Without

any electrically conductive circuit between cathode and anode, electrolyte makes it

difficult for the movement of electrons from anode to cathode. Cells are usually of four

types, which are a dry cell, wet cell, reserve cell, and fuel cell [3]. A battery is simply a

combination of electrochemical cells either in series or parallel [3]. They are of two types:

primary battery and secondary battery. A primary battery is a single-use battery. It implies

that when a chemical of a cell reaches equilibrium, the reaction between anode and

Page 8: Design of the Lithium-ion Battery Pack Tester

3

cathode does not occur. Hence there is no flow of electrons. Recharging of the battery

is needed to eliminate chemical equilibrium. This kind of battery, which can be recharged,

is known as a secondary battery.

2.1 General History of Batteries and Lithium-ion Batteries

Batteries have been with us for a long time. They have come a long way with drastic

improvements and have only gotten better as the time has elapsed. Alessandro Volta

invented the first actual battery [3]. Zinc-Carbon battery was most common until scientist

realized the ‘alkali’ electrolyte offered more lifespan [3]. Thus, they are labeled alkaline

batteries because they use Potassium hydroxide (KOH) as an electrolyte in most primary

cells and Nickel-based rechargeable cells. The lead-acid battery would be an example

to the oldest rechargeable battery dating back to 1859 and is still being used presently

in engine cars to start internal combustion.

Lithium battery invention in 1970 [4]was a massive leap forward as today’s technologies

demand higher capacity, safety, rechargeability, and more compact batteries. Lithium is

one of the lightest elements and possesses the most substantial electrochemical

potentials [4]. It is combined with the transition metal such as cobalt, nickel, manganese,

or iron – and oxygen to form the cathode. Lithium can easily migrate from one electrode

to the other as a lithium-ion, which is how the current is formed. In 1970 M.Stanley

Whittingham and his team made the first lithium-based rechargeable battery [4]. Titanium

disulfide was used as a cathode and metallic lithium as an anode. The operating voltage

was at 2.5V. Later in 1980 John B.Goodenough used metal oxide instead of metal sulfide

as a cathode, which enabled more powerful batteries [4]. John’s team used lithium cobalt

oxide as a cathode, which significantly increased the operating voltage to 4V.In 1985

Akira Yoshina and his team used petroleum coke, a carbon-rich material derived from oil

refineries through which lithium-ion could pass in and out [4]. His team replaced highly

reactive metallic lithium anode with a safer material. This led to the development of the

first viable commercial lithium-ion batteries. After that, it has revolutionized the lives of

people. Due to their excellent work on a lithium-ion battery, the trio were awarded Nobel

prize in chemistry for the year 2019.

Page 9: Design of the Lithium-ion Battery Pack Tester

4

2.1.1 Battery Classification

Every Battery is not similar. Even if the chemistry of the battery is the same. The main

reason for that is that batteries fall either under the high power category or high energy

category. Often the manufacturers classify the battery as high energy or high power rated

batteries, but not both [3]. The other factor for the classification of batteries is high

durability, in which the power and energy of a battery are compromised.

Rechargeable Battery

Rechargeable battery or secondary cells work with the same mechanism as primary cells

to produce current [3]. The electrochemical reaction from anode to cathode inside an

electrolyte gives the current. This reaction is reversible in secondary cells. Once the

charge stored is drained, the electrochemical reaction occurs again, in reverse, thereby

storing a new charge. They can be charged with matching chargers in general. Several

combinations such as lead-acid, nickel-cadmium (NiCd), lithium-ion, lithium-ion polymer,

rechargeable alkaline batteries, etc. are used as rechargeable batteries.

Lithium-Ion Batteries

Lithium-ion batteries works on the concept of electrochemical potential [5]. Lithium has

the highest tendency to lose electrons [5]. In its pure form, Lithium is highly reactive.

However, it is quite stable as a part of a metal oxide.

Figure 2: Batteries used in the project

Page 10: Design of the Lithium-ion Battery Pack Tester

5

A practical lithium-ion cell uses an electrolyte and graphite. Graphite has a layered

structure, and they are loosely bonded. It helps in storing the separated lithium-ions. The

electrolyte only allows lithium-ion through.Figure 2 shows the batteries under testing.

Starting from left in Figure 2 is Pansonic NCR18650, and on the right-hand side is

Keepower 18650. Their detailed specification is explained in subheading titled ’’Batteries

under test.’’

Advantages and Disadvantages of Lithium-ion Batteries

Lithium-ion batteries are the top tier product in the modern world of engineering. From

the portability to giving high performance and long cycling life, they deliver everything.

Lithium-ion batteries have a very high energy density [5], meaning they can give higher

output voltage compared to other batteries of similar class types. Furthermore, the leaks

are negligible because the electrolyte is not water. The self-discharge rate is quite

insignificant, energy loss during charging and discharging are less, and they can handle

more charge/discharge cycles [5]. All these perks make Lithium-ion batteries more

suitable for electronic gadgets like phones and laptops.

Despite their long lists of benefits, they do have their limits like everything else. Lithium-

ion batteries are highly sensitive to higher temperatures [5], which could degrade the

battery faster. When overcharging, the potential risk of explosion is high. It means Li-ion

batteries demand protection circuit or a BMS (Battery Management System) to enhance

their performance.

2.2 Battery Parameters and Specifications

This section describes the different variables of a battery and also includes general spec-

ifications of a battery. A basic understanding of battery parameters and specifications is

a necessity to study a battery life cycle.

Nominal Voltage

Nominal voltage is known as the reported voltage of a battery [6]. Nominal values are

assigned to define voltage class. The actual voltage can vary with nominal voltage de-

pending on the specifications and equipment used.

Page 11: Design of the Lithium-ion Battery Pack Tester

6

Cut-off Voltage

Cut-off Voltage is the voltage when the battery is considered to be fully discharged when

it reaches that specific voltage level [6].

Charge Voltage

This is the opposite of the cut-off voltage. It is defined as a condition when the battery is

charged fully to its capacity [6].

Charge and Discharge Current.

The specific current, in which battery gets charged, is known as charge current, while

the maximum current by which battery can be discharged continuously, is known as dis-

charge current [6]. The manufacturer usually defines both the operating current.

Cycle Life

Cycle life is the accumulation of charging and discharging cycles [6]. Battery life ends

when it fails to meet the standard criteria set by the manufacturer. Usually, an end of

battery life is considered when the battery reaches around 80% of its rated capacity.

Cycle life differs with battery types ranging from 500-2000 cycles before the battery

reaches the end of life.

Terminal Voltage

Terminal voltage is the voltage across the battery terminal when the load is applied to it.

It varies with different conditions such as charge, discharge current, and SOC [6].

Open-Circuit Voltage (OCV)

This is the voltage of a battery when no load is applied to it [6]. It depends on a different

level of SOC and temperature. It is also known as electromotive force.

Page 12: Design of the Lithium-ion Battery Pack Tester

7

Internal Resistance

Internal resistance is the resistance within the battery. Usually, they are dependent on

age, chemical properties, discharge current, and size. But, mainly for lithium-ion batter-

ies, internal resistance is relatively less dependent on SOC, but it does increase with age

[6].

Capacity Rate(C-Rate)

C- rate is associated with charge and discharge characteristics of the battery [1]. C-rating

regulates the current the battery is being charged and discharged at. The capacity of a

battery is usually rated at 1C, which means a fully charged battery rated at 1000mAh

should supply its displayed amperage current, which is 1000mA in this case for one hour.

Now, the same battery, if discharged at 0.25C, should provide 250mA current for four

hours. In general, a formula shown in equation 1 [1] can be derived as

𝐶𝑟 = 𝐼/𝐸𝑟…….…………………………………………….(1)

where Cr= C-rate, Er= Rated energy in Ah, and I= Charge or discharge current.

State of Charge (SoC)

The State of Charge is known as the remaining capacity of a cell in comparison to the

related capacity [7]. It is always represented in a range of 0% to 100%. There are differ-

ent approaches to estimate SOC. They are as follows:

• Voltage method

• Coulomb Counting

• Impedance Spectroscopy

Page 13: Design of the Lithium-ion Battery Pack Tester

8

Coulumb Counting

This particular method was used for the project to determine the state of charge in this

thesis project. In this specific process, SOC is calculated by measuring a cell current that

flows in and out during charge and discharges integrated with time [7]. SOC estimation

formula used for the charging and discharging process is expressed in equation 2 [8]

and equation 3 [8]. Equation 2 is used during the charging process, while equation 3 is

used to estimate SoC during the discharge process.

𝑆𝑜𝐶 =𝑄𝑔𝑎𝑖𝑛𝑒𝑑

𝑄𝑟𝑎𝑡𝑒𝑑∗ 100 …………………… (2)

𝑆𝑜𝐶 =𝑄𝑙𝑜𝑠𝑡

𝑄𝑟𝑎𝑡𝑒𝑑∗ 100 ……………………... (3)

Where Q is the capacity of a cell. Qgained and Qlost are the capacities of a cell in two

different conditions, i.e., charging and discharging.

2.3 Charging

A battery is an energy storage device. During the charging process, electrical energy is

supplied to the battery, which in the process changes the balance of charge between the

chemically active materials. The charge process converts DC electrical energy to stored

chemical energy. The stored chemical energy can be later used as electrical energy for

any remote applications [9].

Figure 3: Charging Mechanism [9]

Page 14: Design of the Lithium-ion Battery Pack Tester

9

In Figure 3, when a power source is added to the positive side, it attracts the electrons

from the cathode. Since the electrons cannot flow through the electrolyte, they go all the

way through the external circuit and reach the graphite layer. Hence, they are trapped in

the graphite layer. The cell is thereby fully charged when all the lithium atoms reach the

graphite sheet.

To make the charging process to be safe, efficient and effective, controlling voltage and

current is a must [9]. It is needed because the batteries must not overcharge, under-

charge, or get damaged during the process. If the charge current is too high, battery gets

overheated and can be damaged. Conversely, if the battery is charged at low current

and low charge voltage, the charging process takes too long time to complete the charg-

ing process. So, the charging process is a balancing act, in which voltage and current

should be continually monitored and maintained between high and low limits.

Any lithium-ion or lithium polymer cells charge the same way [9]. The only difference is

the charge voltage. Commonly the charge voltage is either to be 4.2v or 4.1v plus-minus

at-least 1 percent accuracy, depending on the manufacturer. Lithium-ion battery's shelf

life and the number of recharges is directly proportional to maximum charge voltage and

charge rate as well, but the charge voltage is very critical.

Figure 4:Charging stages of lithium-ion cell [9]

Page 15: Design of the Lithium-ion Battery Pack Tester

10

In Figure 4, different charging stages of a lithium-ion cell are presented. It has a two-

phase Constant Current (CC) and Constant Voltage (CV) mode. Constant Current is a

first part of the charge cycle, where charger supplies constant current and current is

regulated at C/5, as shown in the above figure 4. Once a cell reaches its high cell voltage,

which in this case is to be 4.2V, the mode changes from constant current to constant

voltage mode. In constant voltage, mode voltage remains constant at 4.2V and current

variate. The charge cycle is completed when the current drops to ~0.03C.

2.4 Discharging

A battery is an electrochemical storage device that, when discharging, converts chemical

energy to moving electrical charges [10]. In this section, discharge characteristics are

described, i.e., internal resistance, discharge curve, and the factors affecting the battery

capacity. The discharge process exhausts chemically active materials in such time the

chemical reaction slows down and eventually ceases out [10]. In a perfect world,12 volts

battery would provide a constant current at constant 12 volts for a predetermined length

of time, then drop off and cease to function whole time maintaining a flat line of 12 volts.

The original batteries do not exhibit this behavior due to different factors that affect the

battery capacity.

Figure 5: Discharging representation [10]

Page 16: Design of the Lithium-ion Battery Pack Tester

11

As shown in the above Figure 5, any load applied across the cell tends to start the pro-

cess of electrons moving from the anode side to the cathode side. Eventually, when all

the electrons move from anode to cathode, a cell is fully discharged.

Batteries exhibit internal resistance sometimes called es R or equivalent series re-

sistance. The internal resistance comes from two sources, constant electric resistance

and varying ionic resistance [10], which is a function of electrolyte mobility and functional

surface area. The internal resistance is the simplification of these two effects into a single

resistor within the battery. The internal resistance is constant but the varying ionic re-

sistance which changes at an extreme level during discharge is something to be aware

of. The voltage regulation curve for a battery is a plot of battery working voltage as a

function of the current drawn. The figure 6 below is an example of voltage regulation.

Figure 6: A case of voltage regulation of 12 volts battery capacity of 7Ah

The above Figure 6 illustrates that when fully charged 12 volts battery of 7Ah capacity is

asked to supply 140milliamps, the working voltage is approximately 12.89 volts. How-

ever, when asked to provide current at 14 amps, the working voltage drops to 11.03

volts. The internal resistance of the battery could be estimated using different techniques

at a specific point on the curve. Internal resistance, among other things like temperature

and discharge period, is subject to change with the age and condition of the battery.

Page 17: Design of the Lithium-ion Battery Pack Tester

12

Battery capacity is ordinarily determined using four different methods. They are as fol-

lows:

⚫ Constant current

⚫ Resistive load

⚫ Constant power

⚫ Pulsed current mode

The most common specification used is the constant current mode, or a battery is sub-

jected to a load that draws a constant current for a measurable quantity of time [10].

When the battery reaches a predetermined cutoff voltage, any further discharge beyond

may permanently damage the battery. If it is still in discharging after the cutoff voltage

has been reached, the remaining energy will drain to empty. It would produce lithium

dendrites, which eventually would short circuit the battery internally. Due to this, the bat-

tery will be damaged permanently and could not be used any further. Lastly, lithium-ion

batteries have specific requirements for discharging, which needed to be taken care of

during the discharging process.

2.5 Cell Balancing

A battery pack in a more significant application contains multiple lithium cells in series or

parallel. Even the two identical cells function differently because of many factors, and

their voltage level may vary when in use. It could potentially cause problems inside the

battery pack. Therefore, cell balancing is needed. Cell balancing can be referred to as a

technique that maintains the voltage level of individual cells inside a pack to the same

value [11]. Balancing maximizes the capacity and efficiency of the battery pack.The un-

balancing of cells can happen because of SoC imbalance, different internal resistances,

and temperature. It might result in various problems. For instance, if one cell is 3.6V and

the other is 3.1V, the cell with the higher voltage will be overcharged since the lower

voltage cell still requires charging. Thus, this degrades the battery over time and reduces

Page 18: Design of the Lithium-ion Battery Pack Tester

13

its life cycle. Similarly, lower capacity cells charge and discharge faster. When charging

a battery pack with serially connected cells, once a weaker cell achieves its maximum

charge, and the charging process is stopped, the remaining cells in the pack are left

without complete charging. And while discharging the weaker cell drains out quickly, and

as a result, the pack will be disconnected from the load despite the healthy cells having

enough energy left in it. Hence, the capacity of the battery pack remains unutilized. Fig-

ure 7 is the representation of a battery pack with three cells of different SoC levels.

Figure 7:Battery pack of different SoC levels

Now, to overcome all these problems, outside interference is required in the form of a

Battery Balancing System. Some of the broadly used balancing methods are discussed

below:

2.5.1 Passive Balancing

It is the most widely used method in most of the systems because of its simplicity and

cost-effectiveness [11]. In this method, the burning of the energy of the top cell takes

place. Depending on the type, it does it only by attaching a resistor to the battery itself,

and the power is dissipated as heat from the higher voltages cell until it is equalized with

the rest in a pack. As in Figure 7, the initial burning of energy happens until Cell 1 and

Cell 2 drops down to 30% SOC as Cell 3. Since all of them now have the same amount

of energy, when charging up, they should stay consistent both at top and bottom, if all

the cell capacities are the same.

Page 19: Design of the Lithium-ion Battery Pack Tester

14

2.5.2 Active Balancing

Unlike passive balancing, excess energy will not be wasted in this method. They are

instead transferred from one cell to another within the pack. So, the cells with higher SoC

helps out the cells with lower SoC by moving its excess charge and thereby maintaining

the equal voltage [11]. It is more useful in the packs that consist of battery cells with

different capacities. For example in Figure 7, in a battery pack of three cells A, B and C

with capacity 1Ah, 2Ah and 3Ah respectively, active balancing method can potentially

provide up to 2Ah of runtime by energy transfer between cell A and cell C, whereas

passive balancing can never exceed the runtime of 1Ah in the same configuration.

2.6 Batteries under Test

Two different types of batteries were tested in this project, which is illustrated in Table 1

with its specifications.

Table 1: Specifications of batteries under test [12] [13]

Battery types

Rated charge

Rated dis-charge

Rated ca-pacity

Mini-mum ca-pacity

Nomi-nal volt-age

Maxi-mum charge voltage

Dis-charge cut-off voltage

Keeppower 18650

1A CCCV 2C maximum,3V 2600mAh 2500mAh

3.6-3.7V

4.2V 3 V

Panasonic NCR18650B

1.625A CCCV

0.65A, 2.5V 3350mAh 3250mAh

3.6V 4.2V 2.5V

Page 20: Design of the Lithium-ion Battery Pack Tester

15

3 Lithium-Ion Battery Pack Tester

Various long term charge and discharge tests must be done on the battery cells to ensure

its performance and reliability. There are several battery pack testers available in the

market globally.In order to have a general understanding of the lithium-ion batteries

testing process, three commercial products were studied. This chapter also explains the

general overview of two implementations carried out in this thesis project.

3.1 Commercial Battery Pack Tester

Three battery pack testers were studied for the purpose of building a battery pack tester

for this thesis project. Some of the commercial product are discussed below:

CHROMA 17011

The Chroma 17011 is a high precision system with outstanding features and a wide

range of applications. The key features include [14]:

• High precision output and measurement

• High sampling rate up to 10 mS

• Fast current response up tp <100 µS

• High-efficiency charge and low heat discharge

• AC/DC bidirectional regenerative series

• Waveform simulation function

• Operating modes: CC/ CP/ CV/ CR/ CC-CV/ CP-CV

• Multilevel safety protection mechanism

• Integrating data logger and chamber

• Built-in DCIR test function

• Built-in EDLC capacitance and DCR test function

Page 21: Design of the Lithium-ion Battery Pack Tester

16

All these optimized features allow this system to perform battery lifecycle tests, safety

evaluation, quality control, analysis of battery characteristics, production tests, etc. The

functionality offered by this system are highlighted below:

a. Battery DCIR test application:

The DCIR or direct current internal resistance test reveals the power characteristics

and aging characteristics of the battery. Two different types of DCIR tests are built-

in this system, and it allows the user to select the test mode manually. The results

are generated, which can further be compared with IEC standards.

b. Battery capacity test application:

The current and time readings can be taken at the start of charging/discharging until

the cut-off condition [14]. The capacity of the cells can be calculated by integrating

the readings. This test is instrumental as it can be used to analyze different products.

Battery cell capacity affects performances, and through this test, the right products

can be determined.

c. Life cycle test application:

The system can be used to put the same battery through repeated charging and

discharging conditions. Doing so for an extended period will degrade the cell

capacity. It drops the cell capacity to 80%, the system then calculates the number of

cycles [14]. This result is highly effective in determining cell longevity and

performance. These parameters will also assist in finding the applicable condition for

the use of the batteries.

d. Coulombic efficiency test application:

It is the ratio of discharge capacity to charge capacity. So the higher the coulombic

efficiency, the better. Provided the coulombic efficiency test is accurate, the battery

lifespan can be estimated with only a few cycles [14].

Various other tests can be done using this test system. Additionally, Chroma 17011

works with computer software, and the tests can be controlled manually. Different

Page 22: Design of the Lithium-ion Battery Pack Tester

17

parameters can be programmed for rapid testings. It allows real-time monitoring, and

upon the completion, the statistics reports can be generated in many formats.

ARBIN LBT21024

Arbin instruments provide this battery test system. It is superior to most of the battery

testers because of the precision it delivers while recording electrical parameters and

other electrochemical indicators. They would be lost as noise during the

measurement with ineffective testers. Higher-resolution DAC and ADC in this system

during the reconstruction and sampling of signals contribute to more accurate and

smooth outputs. The other key features are listed below [15]:

• 0-10V

• 8-channel

• 100A/25A/5A/500mA

• Four current ranges for each channel with 24-bit resolution

• 2000 points per second data logging via embedded controllers

• Integrates with Electrochemical Impedance Spectroscopy (EIS) workstations

• Interfaces with Arbin Life Cycle Chambers or other chambers

The test channels are fully independent and provide both potentiostatic and galvanostatic

control [15]. A constant current pulse is placed upon an electrode, and the variation of

the resulting current through the system is studied in the galvanostatic method. Thus,

control over the current flow through the system is achieved through this technique.

Potentiostatic approach, on the other hand, is suitable to observe anodic and cathodic

behaviors of a metal surface. The desired potential can be maintained at the sample

electrode by using the reference electrode. Thus, the behaviors, when monitored and

evaluated, can determine many properties of the material used.

The current handling capacity of this system can be spiked up by adjusting many

channels in parallel. It also provides zero switching time between charge and discharge

as there is a bipolar linear circuitry used [15]. It manages to achieve smooth CC to CV

transition as each channel has digital voltage control [15]. A software package by Arbin

can be used to analyze and plot data for user convenience, including current and power

simulations. The system is equipped with several auxiliary inputs/outputs that can further

Page 23: Design of the Lithium-ion Battery Pack Tester

18

be assigned to collect additional data or to monitor the temperature [15]. With several

built-in safety features and air-cooling function, this system is highly applicable to Battery

Life Cycle Testing, Electrochemical Research and Development, Half-Cell Testing and

Materials Research, Coulombic Efficiency Measurements, and so on [15].

Procyon Battery Test System

Procyon 2100-20 by INTEPRO SYSTEMS is an excellent battery test system that

implements regenerative technology to save energy. It is built so that it can be easily

placed on top of the desk, bench or mounted in the rack. It brings into play Intepro’s bi-

directional charge/discharge regenerative power stage that sends back more than 93%

of the power back to the AC mains [16]. Subsequently, this leads to reductions in energy

costs and ensures the need for no additional air or water cooling loads. The other key

features include [16]:

• Scalable solutions from 5kW-480kW

• Voltages from 40V to 1500V

• Currents up to 8,000A

• Built-in arbitrary generator for complex charge and discharge curves

• Automated test sequencer or manual control

• Ability to set critical safety levels for voltage, current, and temperature

The system makes use of Intepro’s ‘’fill-in-the-blanks’’ PowerStar Test Sequencer

software that smooths the way for test setup and operation. Thus, the test sequences

can be adjusted according to the desired need. Also, PowerStar offers ‘’Programming

without Coding’’ that enables users to define the charge and drive profiles unique to their

vehicles or a particular standard [16]. This system can easily be configured and adjusted.

The addition of new hardware modules, expansion, and upgrade are possible for new

batteries tests and differing test standards. Generally, the battery test includes battery

balancing, battery charge/discharge, battery, simulation, measuring of the internal

resistances, etc [16].

The technical data provided by the manufacturer [16] is highlighted below:

• Source Mode: Real-world efficiency upto 93%

Page 24: Design of the Lithium-ion Battery Pack Tester

19

• Sink Mode: Recoup up to 95% of loaded energy

• AC Line 340-528 VAC 2-phase or 3-phase

• DC voltage: <0.1% Accuracy

• DC current: <0.2% Accuracy

• DC power: <1% Accuracy

• DC resistance: <1% + 0.3% of nominal current

• Programmable Protection: OT, OVP, OPP, PF, OCP

3.2 Alternative Design For Battery Tester

The need to dig deep on choosing the needed electronic boards for carrying out the

project was not necessary because the project supervisor already provided the required

components.The initial target was to study the given modules thoroughly before

formulating a plan and then engineer a suitable circuitry or a setup that would fulfill the

project's end goal. The demo boards provided were from Linear Technology, which

included LTC6811 or the battery stack monitor, DC2026C Linduino One, DC1830A or

power management board, and DC1619A or DC/DC buck converter. Besides, different

types of rechargeable batteries were handed along with a smart charger from

NITECORE. More on these given modules, along with their features, are further

discussed in Chapter 4.

A detail and in-depth study were done on the modules. The datasheets were studied,

and every board was tested and experimented for a proper understanding of their

functions. Starting with the battery stack monitor and Linduino One, series of batteries

were assembled and then studied further with the help of a pre-existing GUI. During that

phase, the batteries in use were still being charged using the given charger. However,

as the project progressed, the need to develop a charger was a must to achieve the final

goal. At this point, the buck converter had a significant role to play, but unfortunately,

while testing and configuring the board, the outcomes were unexpected. It turned out the

board was faulty and did not deliver the output voltage as it was designed. Despite many

attempts to sort out the issue, the problem was persistent. Given the circumstance and

a significant setback, the need for improvisation was imminent. It was when the second

planning was performed where different electronic components were brought in, and a

Page 25: Design of the Lithium-ion Battery Pack Tester

20

new design system was made for the execution of the task. The second implementation

that managed to pull the job is further described in Chapter

4 DESIGN BASED ON LINEAR TECHNOLOGY EVALUATION MODULES

This chapter mainly consists of important theoretical information regarding the evaluation

boards and tools provided by the supervisor to carry out the project. Additionally, few

successful applications of some of these modules are described further below, along

with the setbacks and problems encountered during the testing. In the essence, a detail

description of the given tools with their effectiveness and the need to engineer a new

approach are highlighted.

4.1 DC2259A Battery Stack Monitor

Figure 8 is a DC2259A multi-battery stack monitor from Linear Technology. LTC6811 is

the main IC of this module. It can measure up to 12 serially connected batteries.

Figure 8: DC2259A battery stack monitor [17]

Page 26: Design of the Lithium-ion Battery Pack Tester

21

It is based on daisy-chain communication, which means the microcontroller does not

assign an independent signal to each slave device, whereas the commands transmitted

through devices connected in series. In short, the command is initially sent to the first

slave, and the following slave in the chain receives its input from the output of the former

slave and so on. This method is quite useful when there are many slave devices in the

system because the microcontroller will not be needing so many individual signal

outputs, which in turn simplifies the hardware and layout [18]. It has a measurement

range of 0V to 5V, which is decent for most batteries. The total measurement error is

considered to be 1.2mV. It takes less than 300 micro-seconds to measure all 12 cells

[17]. Isolated supply can be used to power up the LTC6811. It is most widely used in

electric and hybrid electric vehicles, backup battery systems, high power portable

equipment, etc. LTC6811-1 IC is shown in Figure 9.

Figure 9: Pin Configuration of LTC6811-1 IC [17].

Pin features are listed below [17]:

Pin1 (V+) is a positive power supply unit. The connection can be made either with the

most positive potential of battery back or external supply.

C0 to C12 (Pins 26,24,22,20,18,16,14,12,10,8,6,4,2) are the cell inputs.

Page 27: Design of the Lithium-ion Battery Pack Tester

22

S1 to S12 (Pins 25,23,21,19,17,15,13,11,9,7,5,3) are the pins for balancing the battery

cells. Internal MOSFET connects them, and cells are discharged when the MOSFET is

switched on.

V- is the negative supply pin.

GPIO pins can be used as digital inputs or outputs. GPIO[3:5] can be used as an I2C or

SPI port.

Pin 37 (Vreg) is a 5V regulator input.

Pin 36 (DTEN) is a discharge timer enable and can be connected to Vreg to enable the

discharge timer.

CSB, SCK, SDI are digital inputs, and SDO is an open drain NMOS output pin, and it

requires a 5k pull-up resistor .

4.2 DC2026C Linduino One

Linduino is divided into two parts. Figure 10 is the Linduino one, which is the hardware.

The codes are written for this using a standard free Arduino IDE. All code can be loaded

through USB. It does not involve any bootloading and tricky wiring. Linduino one has

similar features to Arduino Uno with extra linear technology features. It comes with an

LTM2884 USB isolation module that protects anything that is plugged into this USB port

from anything that is plugged in on the other side.

Figure 10: Linduino One Basic Connections [19].

Additionally, a 14 pin QuikEval connector is assembled in this board that facilitates the

Linduino One to connect to hundreds of existing LTC QuikEval compatible demo boards.

However, there is more to this than just this demo board. The Linduino development

Page 28: Design of the Lithium-ion Battery Pack Tester

23

platform consists of a vast library of example firmware. The interaction with Linear

technology parts is much more comfortable with these example firmware. Any standard

C compiler can be used to compile this library of code. The code is also Arduino

compatible. The codes are accessible even without hooking up the hardware. Due to the

easiness of Linduino, hundreds of existing codes can be modified during the big projects

that help move things quickly.

The setup is simple and easy. The Linduino One comes preloaded with a DC590

emulator program that allows the attached demo boards to run with the standard

QuikEval GUI software. It is called ”sketch,” and the sketchbook can be downloaded,

which holds the entire code base for the Linduino board. After interfacing with QuikEval,

the Linduino One can be reprogrammed as needed through Arduino IDE. Arduino IDE is

the development platform for the Arduino, and this is an absolute must to modify the

base code as well as to load programs into the Linduino One. J1-J7 pins of Lindiuno

one(see figure 10) are described below [19]:

J1 is the QuikEval header. Connection to QuikEval compatible demo boards can be

made here by using 14 conductor ribbon cable.

J2 IS an AC ADAPTOR IN, or 7V to 20V DC power input can be given as well.

J3, J6, J7, and J8 are Arduino shield headers.

J4 is an ICSP or In-circuit serial programming header.

J5 is a USB connector that allows the connection to be made to the host computer [19.].

4.3 DC1830B-A

DC1830B-A is a battery charge controller and PowerPath manager featuring the

LTC4000 [20]. Front-end DC/DC power supply should be connected to this board for a

complete charger solution. The DC1830A can provide output voltages from 3V to 30V

and output currents up to 6.5A [20]. LTC4000 converts external DC/DC power supply

into a fully-featured battery charger. It offers precision input and charges current

regulations. It also supplies power to the system load when input power is limited. It is a

compatible charger with a variety of battery chemistries. The chip is mostly used in high

power battery charger systems, high-performance portable instruments, industrial

battery-equipped devices, etc.

Page 29: Design of the Lithium-ion Battery Pack Tester

24

Figure 11 is a demo circuit from Linear Technolgy, which function as a battery charge

controller and PowerPath manager, featuring the LTC4000 as its IC.

Figure 11: Demo circuit 1830B-A [20].

The other features include [20]:

• Wide Input and Output voltage range

• High-performance battery charger when paired with a DC/DC converter

• Instant-on operation with the heavily discharged battery

• Programmable input and charge current

• Accurate programmable float voltage

• Timer-based charge termination

• NTC input or temperature qualified to charge

• Input ideal diode for low loss reverse blocking and load sharing

Figure 12 represents the specifications and different parameters related to DC1830B-A

at 25-degree celsius.

Figure 12: DC1830B-A Specifications at 25-degree Celsius [20].

Page 30: Design of the Lithium-ion Battery Pack Tester

25

4.4 DC1619A

DC1619A is a 100kHz to 500kHz programmable frequency, high voltage, current mode

DC/DC step-down converter featuring the LT3845A. The operating frequency can be

synchronized up to 600kHz. This demo board gives 12V up to 10A output from a 16V to

60V input. Different modes of operations such as burst mode, discontinuous current

mode, and continuous current mode can be used through the jumpers. At light loads, the

efficiency increases with burst and discontinuous current mode operations. The constant

switching frequency can be maintained regardless of the load current with the continuous

current mode. LT3845A is a high voltage, synchronous, current-mode controller. It is

used for medium to high power, high-efficiency supplies. LT3845A is a high voltage,

synchronous, current-mode controller. It is used for medium to high power, high-

efficiency supplies [21].

Figure 13: Demo Circuit 1619A [21].

The above Figure 13 is a demo circuit 1619A board, which is a high voltage synchronous

buck converter with adjustable operating frequency.

The input range lies from 4V to 60V, and 7.5V is the minimum start-up voltage. The

features are as follows [21]:

• High voltage operations

• Synchronizable up to 600kHz

• Output voltages up to 36V

Page 31: Design of the Lithium-ion Battery Pack Tester

26

• Stable operation in current limit

• Standard gate N-channel power MOSFETs

• Reverse overcurrent protection

• 1% regulation accuracy

• 120 microamperes no-load quiescent current

• 10 microamperes shutdown supply current

• 16-lead thermally enhanced TSSOP package

Figure 14: DC1619A specifications at 25-degree Celsius [21].

Different conditions and values of the buck regulator at different parameters are shown

in Figure 14. Additionally, the operating frequency can be synchronized to an external

clock for noise-sensitive applications, and it provides short-circuit protection as well. It is

mostly used in 12V and 42V automotive and heavy equipment, 48V telecom power

supplies, avionics, and industrial control systems, distributed power converters, etc.

4.5 Nitecore Intellicharger

This smart battery charger was provided for the project. It has a 100% charging

acceleration powering up to 1A to each cell. So, the charging is rapid, and two batteries

can be charged at a time. The current selection of this charger is automatic, which means

the charger detects the battery’s need and operates accordingly.It also displays the

battery power status and charging process. It is almost compatible with all the IMR/ Li-

ion/ LiFePO4 batteries. It is also equipped with two buttons to override the automatic

charging settings of this charger. The charger also has protection settings against a non-

Page 32: Design of the Lithium-ion Battery Pack Tester

27

rechargeable battery [22]. An additional input slot of 12V is available on the top of this

charger, as well. On top of this below are listed more features of this charger [22]:

• Active Current Distribution (ACD) Technology

• Compatible with 1.2V, 3.7V, 4.2V, 4.35V batteries

• Charging program optimized for IMR batteries

• Two charging slots charge and control independently

• Fire resistant

• Reverse polarity protection and short circuit prevention

• Automatically stops charging upon completion

4.6 Application

DC2259A is a daisy chain isoSPI battery-stack monitor featuring the LTC6811. Using a

DC2026 Linduino One as a USB interface, the communication was made to a PC. A

Graphical User Interface (GUI) was used to monitor the battery voltage.

Figure 15: 12-cell battery pack connection to DC2259A

Figure 15 shows the wiring of a 12 cell in series to the J1 connector of DC2259A.The

batteries that were being monitored were used to power the DC2259A. J1 is the cell

connector, where position 4 is the most negative potential, and position 16 is the most

positive potential. So, cell voltages were wired from position 4 with increasing potentials

up to position 16. Cell 1 is connected between J1-4 and J1-5, where the negative terminal

Page 33: Design of the Lithium-ion Battery Pack Tester

28

was connected to J1-4 and the positive terminal to J1-5. The rest of the cells were

connected accordingly in the sequence where the next cells were connected through J1-

5 and J1-6, J1-6, and J1-7, respectively, as shown in Figure 14. However, only four cells

were used for the testing, and the unused higher terminals in the J1 connector were

shorted together. J1 connector pins were screwed in nice and tight to maintain effective

and uninterrupted connections between the battery cells and the battery stack monitor

board.

A 14-pin ribbon was used from DC2026 to connector J2 of DC2259A board to set up

their connection. DC2026 was connected through a USB cable to a PC USB port. The

GUI program is called ’QuikEval,’ which was downloaded and installed into the PC before

hooking up DC2026.

Figure 16: GUI Control Panel Start-Up Screen [17]

Figure 16 is what the start-up screen looks like when the GUI is launched. The primary

control features that are available inside this GUI are briefly discussed below:

• Read configuration command button displays the Hex codes for the six bytes,

provided everything is connected correctly. This configuration appears in the

Page 34: Design of the Lithium-ion Battery Pack Tester

29

CONFIGURATION REGISTERS section. The initial configuration bytes is 0×D8

for register 0 and 0×00 for the other five bytes [17].

• Write configuration command puts into effect the changes that have been made

in the configuration. The failure to execute this command after making changes

will change nothing. This button illuminates when information changes have been

made, telling the user to run this command further.

• Undervoltage and Overvoltage reference value can be adjusted as necessary.

The desired values can be manually entered in the section SET VOLTAGE

LIMITS. The voltage range for these thresholds is 0V to 6.5520V.

• The READ CELLS is a command button that displays cell voltage measurement

in groups of 3, such as (1-3) first to third cells, (4-6) fourth to sixth cells, and so

on [17].

• Battery balancing can be done within the stack of batteries by ticking the small

checkbox called Dcc and is available for each cell. In DC2259A, a P-channel

MOSFET is placed in series with a 33Ohms resistor across each cell connection,

which, when enabled, the cell loses its energy. So, ticking the Dcc box followed

by WRITE CONFIGURATION and finally pressing the STARTCELL DCC

command button discharges cells.

4.6.1 Discharging Unit

A combination of ceramic power resistors was built in different combinations to test the

battery discharge performance, i.e., to check the battery capacity. A total of 12 ceramic

power resistors were used. They were non-inductive resistors and had an advantage

over non-inductive wire-wound, film, and composition resistors because they did not

have film or wire to create a malfunction.

Also, they were chemically inert and thermally stable. An eight channels input, and eight

channels output Keyes relay module was used to control a different combination of a

ceramic power resistor. It was designed to switch up to eight high current or high voltage

from microcontroller. Each relay could be switched individually either on or off due to the

opto-isolated input feature in the relay board [23].

Page 35: Design of the Lithium-ion Battery Pack Tester

30

In Figure 17, a Keyes 8-channel 5V relay module is shown whose specifications are

listed below it [23].

Figure 17: 8-channel 5V relay module

⚫ 8*5v relays

⚫ Board size:14cm*5.5cm

⚫ Relay rating:10A/250VAC/30VDC

⚫ Relay draw current:30mA @ 5v

⚫ Each relay has NO and NC ports, easier to connect and control the connected de-

vices.

⚫ High-level trigger

The load comprised of 12 ceramic power resistors where the values of each resistor are

labeled as R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12. The values of each

resistor were R1, R9, R10=12ohm, R2, R4, R5, R6, R7, R8, R11, R12=2.2ohm, and

Page 36: Design of the Lithium-ion Battery Pack Tester

31

R3=2.2Kohm rated at 10 watts as power rating. The layout design of load modulation is

represented in Figure 18.

Figure 18: Layout design of load connection with a relay module and battery stack.

Six input pins K3, K4, K5, K6, K7, K8 of 8-channel relay were connected to the combi-

nation of power resistors. The combination of power resistors is listed below.

1. When K3 was ON R10, R11, R1, R2, R3 were connected in series, which would total

to 2.216 kOhm and was able to undertake 14.8 volts and was able to conduct a

current of 6.64mA.

2. When K4 was ON R11, R1, R2, R3 were connected in series, which would total to

2.206 kOhm and was able to conduct a current of 6.66mA.

3. When K5 was ON R1, R2, R3 was connected in series, which would total to 2.204

kOhm and was able to conduct a current of 6.67mA.

4. When K5, K6, and K7 were ON R1, R2, R3 were connected in series, R4, R5, R6

were connected in series and R7, R8, R9 were connected in series. As shown in

Figure 8, the three lines of serially connected resistors were connected in parallel to

Page 37: Design of the Lithium-ion Battery Pack Tester

32

each other to put three switches K5, K6, and K7 ON. The total value of resistor

equaled to 0.21 ohm and was able to conduct a current of 69mA.

5. When K5, K6 was ON R1, R2, R3 were connected in series, and R4, R5, R6 were

connected in series. As shown in Figure 8, the two lines of serially connected resis-

tors were connected in parallel to each other to put two switches K5, K6 on. The

total value of resistor equals to 0.060 ohms and can conduct a current of 246.6mA.

6. When K4 and K8 were ON R1, R2, R3, R11 were connected in series, and R4, R5,

R6, R12 were connected in series. As shown in Figure 8, the two lines of serially

connected resistors were connected in parallel to each other to put two switches K4

and K8 ON. The total value of resistor equaled to 0.11 ohm and was able to conduct

a current of 134.5mA.

The two ends, i.e., a positive terminal, and the negative terminal was connected corre-

spondingly to the positive and negative end of the battery pack.

4.6.2 Shortcomings

Demonstration circuit 1619A was used for the project. However, this step-down converter

was missing quite a few capacitors, and some surface mounts resistors. So, resistors

R4=143kohms, R6=200kohms, and R17=0.007ohms were brought in and soldered with

utmost caution back in their proper spots. These particular values were taken from the

schematic diagram-modified DC1619A as used with DC1830A, which is available in the

DC1830A datasheet. Even after all the necessary modifications, the output result was a

disaster and contradicted the expected outcome. The converter ultimately failed to

provide an output voltage, and thus the charging of the batteries was an impossible ask

down to this unanticipated failure of the buck converter. Hence, the improvisation in the

plan was a must for the completion of the project since the goal was to design an

automated battery charging/discharging system.

Page 38: Design of the Lithium-ion Battery Pack Tester

33

5 DESIGN BASED ON ARDUINO

The failure of the LTC evaluation module, DC1619A, second approach was considered

for the design and implementation of an automated charging/discharging station. The

plan was straightforward, based on Arduino Uno. An LCD 16*2, I2C display was used to

display the battery parameters. Four voltage dividers were used to determine the voltage

across two load resistance. The idea of using two MOSFET was to connect and discon-

nect two load resistance separately with two isolated batteries. One 2*5v relay module

was utilized to connect two TP4056 modules.

Table 2 shows the different components used in the second implementation to build a

charging/discharging station.

Table 2 : Components Used

ITEM QUANTITY REFRENCE PART DESCRIPTION MANUFACTURER

1 1 P1 Arduino uno_r3 ARDUINO

2 2 P2, P3 TP4056 module SMARTCLIMA

3 8 R1-R8 RES, chip,10K,0.1W,5% VISHAY

4 2 PR1, PR2 Po RES, chip, 3ohm, 7W

5 1 U1 2*5v Relay module SONGLE

6 1 1 LCD,16*2, I2C JOY-IT

7 2 Q1, Q2 IRLZ44N, MOSFET INTERNATONAL

RECTIFIER

8 1 LM2596 STEP DOWN DC/DC

CONVERTER, CV,5A

TEXAS INSTRU-

MENT

9 1 DC FAN,5V,0.9A

Page 39: Design of the Lithium-ion Battery Pack Tester

34

5.1 TP4056 Module

Figure 19 is a TP40456 module, which is a single cell linear charger for lithium-ion

batteries using constant-current/constant-voltage (CC/CV) charging method.

Figure 19: TP4056 Module

TP4056 module uses the TP4056 lithium-ion charge controller IC and a separate DW01

protection IC. Thus, it provides many protection features as listed below [24]:

a. It has overcharge protection and will safely charge up to the desired 4.2v.

b. The module has the function that cuts the output from the battery if the discharge

rate goes beyond 3A or during short-circuit conditions.

c. There is over-discharge protection meaning it keeps the battery from being

discharged below 2.4V.

d. It manages the constant current to constant voltage charging of a connected lith-

ium-ion battery.

More features of TP4056 module are listed below [24]:

• It can be powered with a micro USB cable or a + and – connections.

• It uses a linear charging method.

• The standard charging current is 1A, but it can be configured externally through

Rprog resistor(R3).

• No MOSFET, sense resistor, or blocking diode is required.

• There are 2 LED indications: Red indicates charging, and blue indicates when

the battery is fully charged.

Page 40: Design of the Lithium-ion Battery Pack Tester

35

• Input supply voltage range from 4.5V to maximum 8V.

• The complete charge voltage is 4.2V.

• It charges single-cell Li-ion batteries directly from a USB port. Charging two cells

in parallel is possible, provided both cells are at the same voltage level.

• Working temperature: -10 to +85 (Celsius)

• Automatic recharge

• Trickle charge threshold

• Charge termination is C/10, where C is the initial current supplied at the beginning

of the charging process.

5.1.1 TP4056 IC

TP4056 IC is a standalone lithium-ion battery charger. Its pin configuration is shown in

Figure 20.

Figure 20: TP4056 IC [24]

Pin Description of TP4056 IC is listed below [24]:

• TEMP1 (Pin1) is a temperature sense input. If pin1 voltage is higher than 80%

and lower than 45% of the supply voltage. The battery’s temperature is deemed

to be either high or low. If this condition does occur, then IC suspends the charg-

ing process.

• PROG (Pin2) is a constant current setting pin. It can be adjusted by connecting

a resistor from this pin to the GND.

• GND (Pin3) is a ground terminal pin.

Page 41: Design of the Lithium-ion Battery Pack Tester

36

• Vcc (Pin4) is a positive input supply voltage pin. It is the power supply to the

circuit.

• BAT (Pin5) is a pin where the positive end of the battery terminal is connected to.

• STDBY (Pin6) is a status output pin that indicates charge termination. And usu-

ally, it is in high impedance state.

• CHRG (Pin7) indicates status output when the battery is being charged.

• CE (Pin8) is a chip enable input pin. When the CE pin is pulled high with internal

switches, it puts the device in normal operating mode, and when it is pulled low

device goes to disable mode. A CMOS logic level or TTL can drive the pin.

Electrical Characteristics of TP4056 IC is shown in figure 21 below

Figure 21: Electrical Characteristics of TP4056 IC [24]

Page 42: Design of the Lithium-ion Battery Pack Tester

37

5.1.2 DW01 IC

The DW01 is a single cell battery protection IC. It is designed to protect lithium-ion, lith-

ium polymer batteries from overcharge, over-discharge, and over current [25]. It is shown

in Figure 22.

Figure 22: DW01 IC [25]

The features of the DW01 IC are listed below [25]:

⚫ Operating temperature: -40 to 85(Celsius)

⚫ Precision Overcharge Protection Voltage.

⚫ Load detection for overcharge mode.

⚫ Different detection levels for overcurrent protection.

⚫ Extra capacitors are not required.

⚫ Ultra-low quiescent current.

⚫ Ultra-low power-down current.

Page 43: Design of the Lithium-ion Battery Pack Tester

38

5.2 Hardware Design

Two Lithium-ion cells were monitored at a time. Two identical circuits were built, one for

each cell. The voltage across two load resistors was measured by Arduino using the

voltage divider circuit [26]. It consists of eight resistors with values 10k each, four re-

sistance for first load/power resistor, and rest four resistance for a second load/power

resistor. The output from the voltage divider has been connected to Arduino's analog

pins A0 and A1 for the first cell and pins A2 and A3 for the second cell. The voltage

divider circuit helps to monitor the voltages across the load resistance. Also, two

MOSFET(IRLZ44N) were placed, which function as a switch between the load resistance

and the battery. The PWM digital pins D3 and D6 from the Arduino control the two

MOSFET respectively. Normally when the battery voltage drops off, the current provided

by a fixed value load resistor would also drop off. So, to maintain the target current of 1

ampere, the PWM duty cycle adjusts accordingly [27]. It consumes two ADC channels

per cell to measure the current as a voltage drop across the load resistors. The goal of

using a 3-ohm power/load resistor was used to provide the target discharge current of 1

ampere at the cutoff voltage of 3.0V [27], and it could dissipate 5.88 watts of energy.

This resulted in PWM could track from about 80% to 100%, when cell voltage ranges

from fully charged to discharged [27]. Arduino checks the battery condition and then

instructs MOSFET. Upon feeding a 5V signal to the gate of MOSFET’s, it allows current

to pass from the positive terminal of the battery through the power resistor, and the

MOSFET completes the path back to the negative terminal of the battery [26]. Thus, the

battery is discharged over time.

For charging, two TP4056 modules were used connected with the 2*5v relay

module.NO1 pin of relay1 was connected to the positive end of battery1, and the COM1

pin was connected to battery positive out pin (B+) in the first TP4056 module. The battery

negative out pin(B-) of the first TP4056 module was connected to the negative end of

battery1. To establish communication with the Arduino IN1 pin of relay1 was connected

to the D11 pin of Arduino. Similarly, the NO2 pin of relay2 was connected to the positive

end of battery2, and COM2 pin was connected to battery positive out pin (B+) in the

second TP4056 module. The battery negative out pin(B-) of the second TP4056 module

was connected to the negative end of battery2, and the IN2 pin was connected to the

D12 pin of Arduino.

Page 44: Design of the Lithium-ion Battery Pack Tester

39

Figure 23 is a schematic design of an automated cherging/discharging station built in

this project.

Figure 23: Schematic Design of the Tester

To display the battery voltage, discharge current, charge current, and capacity, the LCD

16*2 display was used. It has 128*64 resolution and uses an I2C bus to communicate

with the Arduino. Two pins SCL and SDA pins of LCD were connected to A5 and A4 pins

on Arduino. The other two pins of LCD, which were VCC and GND, were connected to

+5v on Arduino and GND pin to the GND pin of Arduino.

Step-down DC/DC converter was used to power Arduino and DC fan.DC fan of 5V was

used to cool down the load resistor,which would dissipate a lot of heat during the

discharging process.

Page 45: Design of the Lithium-ion Battery Pack Tester

40

5.3 Software Integration

In the software, if Arduino measures the voltage drop by the power resistor to be between

3.0V to 4.2V. Initially, the charging process takes place until the cells were charged to

4.2V, and till current falls to ~0.1% of 1 ampere. Figure 24 shows the basic working

structure of the Arduino code when the battery is placed into the battery holder. Now that

it had achieved the maximum threshold voltage(4.2V) set in the code, the battery starts

discharging, and it discharges till the battery reaches 3.0V, which is the cut-off voltage.

When the cut-off voltage was reached, one complete cycle of battery charging and dis-

charging had been completed. And again, the charging process started until it reached

the threshold voltage, and yet the discharge process was started.

But, in the beginning, if the battery voltage was lower than the cut-off voltage, the charg-

ing process would take place with trickle current. It means only a small amount of current

is induced by the TP4056 charging module until the voltage reaches 3.0V, and after that,

it would resume a normal charging process with 1 ampere current.

The other condition was set in the code, if the voltage reading was above the maximum

threshold voltage (4.2V) at the beginning of a process. Discharging process would gain

priority over the charging process. This would mean cell would discharge till cut-off volt-

age (3.0V), and only the charging process would start. Figure 24 is a general outlook of

the working of the software.

Figure 24: Software Architecture

Page 46: Design of the Lithium-ion Battery Pack Tester

41

In order to record all the measurement results in real-time, PLX-DAQ software was used.

PLX-DAQ is a simple add-on feature for excel, which enables easy logging of data in an

excel sheet [28].

Figure 25: Sample excel sheet of PLX-DAQ

Figure 25 is a simple representation of the PLX-DAQ excel sheet on starting the PLX-

DAQ software. To run PLX-DAQ, it was easy. The process was to install the software

from the third party and open the PLX-DAQ sample excel sheet and connect the appli-

cation with the correct port and baud of the Arduino

6 TESTING AND RESULTS

The accuracy of the system measurement was verified and tested. The cell voltage

measurements were compared with a multimeter. The digital multimeter that used for the

test was in the type of MS8221D from mastech. The voltage range of 20V was used, and

its accuracy was ±(0.5%+1), according to the datasheet [29] [30].There are differences

Page 47: Design of the Lithium-ion Battery Pack Tester

42

between the measurement results on both methods. Table 2 records the measurement

results from both charging/discharging station which was arduino based and from

multimeter manually. Batteries were loaded for charging and discharging, and battery

voltages were measured every two minutes [30]. As introduced before, a power resistor

of 3 ohm was applied as the load. The load is supposed to undertake 4.2V voltage and

able to conduct a current of 1A. Both of the measurements were taken at the same time

point for the closeness.

Table 3: Comparison of Cell votages

Battery type Cell voltage reading by

arduino after 200 complete

cycles (V)

Cell voltage reading by a

multimeter(V)

Keepower 18650 3.05 3.03

Panasonic NCR18650 3.00 3.00

The data shown in Table 3 is after 200th discharging cycle. The maximum measurement

difference between charging/discharging station and multimeter is about 0.02V, as seen

in Table 3. Therfore analysis of the table can prove the measurement from tester build

in this project was pretty accurate. The margin of error was 0.02V~0.03V.

6.1 Battery test results

Two different lithium-ion batteries (Keeppower18650 and Panasonic NCR18650B) were

tested in this work. Their charging graphs, discharging graphs, and cycle life graphs are

presented in this section.

Page 48: Design of the Lithium-ion Battery Pack Tester

43

• KeepPower 18650 2600mAH

Figure 26(a,b,c): KeepPower 18650 2600mAh Charging Cycle’s

Figure 26(a, b, c) is the charging profile of KeepPower 18650. The maximum threshold

voltage was 4.2V, while the cut-off voltage was 3.0V. So, it was charged from 3.0V to

4.2V. The rated capacity of a KeepPower18650 cell was 2600mAh. SoC in %, Voltage

of a cell in ‘V’ is plotted against the capacity(mAh) of a cell. All the tests were carried out

at room temperature, which was to be around 22 degree Celsius.

Figure 26(a) is the 1st charging cycle graph, which took 2.6 hours to complete with 1

ampere current induced to the cell by the TP4056 charging module. It reached a rated

capacity of 2600mAh. At 1200mAH and 46.5% SoC charging process shifted from CC

to a CV, which took approximately 45 minutes. Figure 26(b) is the 100th charging cycle,

Page 49: Design of the Lithium-ion Battery Pack Tester

44

which meant that specific cell had experienced the 99th discharging cycle as well. It took

2.7 hours to complete the 100th charging cycle when 1 ampere current was induced to it.

After 100 cycles of charging, the capacity of a cell was 2500mAh. 100mAh capacity was

lost after the 100th charging cycle. This resulted in a loss of 3.84% of rated capacity. At

1600mAH and at 64% SoC charging process shifted from CC to a CV, which approxi-

mately took 70 minutes. The more charging cycles were carried out. Figure 26(c) illus-

trates the 200th charging cycle before experiencing the 199-discharge cycle. It took 2.8

hours to complete the charging process, where capacity measured was to be 2400mAh

at the end of the cycle. At 1900mAH and 79.6% SoC charging process shifted from CC

to a CV, which took approximately 95 minutes.

Figure 27(a, b, c): KeepPower18650 2600mAh discharging cycle's

Figure 27(a, b, c) above is the discharging profile of KeepPower18650. The discharging

cycle started after one complete charging cycle. It was discharged at 0.5C, which equals

Page 50: Design of the Lithium-ion Battery Pack Tester

45

to 1 ampere constant current. SoC in %, Voltage of a cell in ‘V’ is plotted against the

capacity(mAh) of a cell. The tests were carried out at room temperature, which was to

be around 22 degrees Celsius.

Figure 27(a) is the 1st discharging cycle graph, which took 3 hours to complete. After the

first discharging cycle, the capacity of a cell was found to be 2600mAH.Figure 27(b) is

the 100th discharging cycle. It took 3.15 hours to complete this discharging cycle. After

100 cycles of discharging, the capacity of a cell was 2490mAh. 110mAh capacity was

lost after the 100th discharging cycle. The loss was 4.2% of rated capacity. Figure 27(c)

illustrates the 200th discharging cycle. It took 3.2 hours to complete this discharging cy-

cle, where after the completion of cycle capacity, measured to be 2390mAH. 210mAh of

a cell capacity was reduced during 200 cycles of discharging, which was 8.07% loss

when compared to the capacity of a cell at the beginning of the charging process.

Figure 28 Keeppower18650 cycle life

After 200 cycles of charging and discharging, the remaining capacity of a cell was to be

2390mAh. 210 less than the rated capacity of 2600mAh.The total loss was 8.07% of

rated capacity. Figure 28 illustrates the cycle life of the KeepPower 18650 cell. One com-

plete cycle life means one charging cycle and one discharging cycle. Here in Figure 28,

2250

2300

2350

2400

2450

2500

2550

2600

2650

0 20 40 60 80 100 120 140 160 180 200

ca

pa

cit

y(m

Ah

)

No. of cycles

KeepPower 18650 cell cycle life

Page 51: Design of the Lithium-ion Battery Pack Tester

46

the 200-cycle life of a cell is shown. The capacity of a cell and the number of cycle life is

plotted in the graph.

• Panasonic NCR18650B

Figure 29(a, b, c) deals with the charging profile of Panasonic NCR18650B. The rated

capacity of a cell as per the datasheet is 3350mAH. The test was carried out at room

temperature, which was to be 22 degrees Celsius. In the graph capacity of a cell is plot-

ted against cell voltage and SOC. Figure 29(a) is the first charging cycle, Figure 29(b) is

the 100th charging cycle, whereas Figure 29(c) is the 200th charging cycle. At every

charging cycle, the charge current was 1 ampere and could charge the cell in 3 hours to

3.3 hours depending on its capacity and its age. After every charging cycle, the discharg-

ing cycle occurred. So, the charging cycle alternated. Discharging played a vital role in

diminishing the capacity of a cell under test.

Figure 29(a, b, c):Panasonic NCR18650B charging profile

Page 52: Design of the Lithium-ion Battery Pack Tester

47

At the 1st charging cycle, Figure 29(a), the transmission of CC to CV phase was at

1800mAh capacity of a cell, and the SoC was at 53.73%. The capacity of a cell after the

1st charging cycle was to be at 3350mAH. The transmission from CC to CV took about

90 minutes. At 2000mAh and 62.5% SoC in Figure 29(b), which was the 100th charging

cycle CC shifted to CV in about 100 minutes, and the capacity of a cell after the end of

that particular cycle was 3200mAH. In Figure29(c), which shows the 200th charging cycle

of Panasonic NCR18650B, changes to CV from CC took about 105 minutes. It shifted at

2100mAh, and SoC recorded was 66.9%, and a cell under test capacity was 3030mAH

Figure 30(a, b, c): Panasonic NCR18650B 3350mAh Discharging Profile

Figure 30(a, b, c) above is the discharging profile of Panasonic NCR18650B. The stand-

ard discharge cut-off voltage of Panasonic NCR18650B is 2.5V [13], but in this project,

Page 53: Design of the Lithium-ion Battery Pack Tester

48

the cut-off voltage was set at 3.0V. It was discharged at 0.3C at 1 ampere constant cur-

rent. SoC in %, Voltage of a cell in ‘V’ is plotted against the capacity(mAh) of a cell. The

tests were carried out at room temperature which was to be around 22 degrees Celsius.

Figure 30(a) is the 1st discharging cycle graph of Panasonic NCR18650B, which took 3

hours to complete. After the first discharging cycle, the capacity of a cell was found to be

3350mAH.Figure 30(b) is the 100th discharging cycle, which also took 3 hours to com-

plete the 100th discharging cycle. After 100 cycles of discharging, the capacity of a cell

was 3200mAh. 150mAh capacity was lost after the 100th discharging cycle. The loss was

4.47% of rated capacity. Figure 30(c) demonstrates the 200th discharging cycle. It took

3.5 hours to complete the discharging process, where after the completion of cycle ca-

pacity, measured to be 3030mAH. 320mAh of a cell capacity was reduced during 200

cycles of discharging, which was 9.95% loss of rated capacity.

Figure 31: Pansonic NCR18650B 200 cycle life

At the beginning of the process, the rated capacity of a cell was 3350mAh. When 200

cycles of charging and discharging were completed, the capacity of a Panasonic

NCR18650B cell was at 3030mAH. It meant during the process of charging and

discharging a cell had lost a capcity of 320mAH. The total loss resulted in 9.95% of rated

2800

2900

3000

3100

3200

3300

3400

0 20 40 60 80 100 120 140 160 180 200

Ca

pa

cit

y(m

Ah

)

No of cycles

Panasonic NCR18650B cell cycle life

Page 54: Design of the Lithium-ion Battery Pack Tester

49

capacity which is shown in Figure 31. Figure 31 shows the life cycle of the Panasonic

NCR18650B cell. The capacity of a cell and the number of cycle life is plotted in the

graph.

7 CONCLUSION AND DISCUSSIONS

The theory on lithium-ion batteries with its parameters, characteristics, measurements,

and charging/discharging tests have been highlighted in this thesis. Initially, the battery

stack monitor LTC6811 is overseeing a 4-cell lithium-ion battery pack. It monitors battery

cell voltages, charging and discharging states, and the battery’s performances. The

obtained data are constantly shown in the specific GUI that worked perfectly with the

board, and they are continuously updated as time elapses. The data regarding the total

voltage of the pack, individual SOC, cell status is additionally available to be downloaded

in an excel file for the entire time during the monitoring.

The final design or the battery tester has the potential to charge and discharge up to two

cells simultaneously to the desired capacity. With an LCD wired into the system, the cell

voltages, cell capacity, charging, and discharging current are displayed throughout the

operation. Thus, battery cell monitoring and supervision is easy and reliable. This system

can tolerate hundreds of charging/discharging cycles with good efficiency and accurate

results. It is an immense result considering how simple the design is. The project is a

success since several types of lithium-ion batteries are tested and studied under several

conditions using the developed tester.

Despite all the perks and capabilities of this system, there are rooms for future improve-

ment for better results. For instance, DC1619A by Linear Technology is a far superior

buck converter, and the use of it can intensify the performance of the charger along with

its efficiency. The use of multiplexer or an Arduino Mega over Arduino UNO provides

more analog pins options, which increase the quantity of the battery that the system can

monitor at a given time. Also, PWM pins in Arduino UNO when substituted with a DAC

and an operational amplifier, the system gives more precise data and is more efficient.

The addition of chips such as MCP23017 works like a port expander and gives identical

ports to that of Arduino UNO, resulting in an increment in I/O pins that can be very useful

Page 55: Design of the Lithium-ion Battery Pack Tester

50

for multi-batteries testing and charging/discharging switching selection. However, the

lack of any of this does not restrict this system from loads of small-scale operations for

the students or lithium battery enthusiasts and is immensely applicable because of its

simplicity.

Page 56: Design of the Lithium-ion Battery Pack Tester

51

8 References

[1] ”Lithium-based Batteries Information – Battery University,” [Online]. Available:

https://batteryuniversity.com/learn/article/lithium_based_batteries. [Accessed 18

07 2019].

[2] ”How do batteries work?,” [Online]. Available:

http://www.qrg.northwestern.edu/projects/vss/docs/power/2-how-do-batteries-

work.html. [Accessed 18 07 2019].

[3] ”The history and development of batteries,” [Online]. Available:

https://phys.org/news/2015-04-history-batteries.html. [Accessed 18 07 2019].

[4] B. Scrosati, History of lithium batteries, 2011.

[5] D. Linden ja T. B. Reddy, Lithium Batteries, 2002, pp. 14.1-14.106.

[6] ”A Guide to Understanding Battery Specifications,” 2008.

[7] ”Lithium-Ion State of Charge (SoC) measurement - Coulomb Counter method -

OCV,” [Online]. Available: https://www.powertechsystems.eu/home/tech-

corner/lithium-ion-state-of-charge-soc-measurement/. [Accessed 06 08 2019].

[8] I. Baccouche, S. Jemmali, A. Mlayah, B. Manai, N. Essoukri ja B. Amara,

”Implementation of an Improved Coulomb-Counting Algorithm Based on a

Piecewise SOC-OCV Relationship for SOC Estimation of Li-Ion Battery”.

[9] ”Charging Lithium-Ion Batteries – Battery University,” [Online]. Available:

https://batteryuniversity.com/learn/article/charging_lithium_ion_batteries.

[Accessed 15 08 2019].

Page 57: Design of the Lithium-ion Battery Pack Tester

52

[10] ”Battery Discharge Methods – Battery University,” [Online]. Available:

https://batteryuniversity.com/learn/article/discharge_methods. [Accessed 15 08

2019].

[11] Y. Barsukov, ”Battery Cell Balancing: What to Balance and How”.

[12] ”Keeppower 18650,” [Online]. Available:

http://www.keeppower.com.cn/UploadFiles/20140507013812.pdf. [Accessed 22

08 2019] [Accessed 22 08 2019].

[13] ”Panasonic NCR18650B,” [Online]. Available:

https://www.batteryspace.com/prod-specs/NCR18650B.pdf. [Accessed 22 08

2019].

[14] ”Battery Cell Charge/Discharge Test System | Chroma ATE Inc.,” [Online].

Available:

http://www.chromaate.com/product/17011_Battery_Charge_Discharge_Test_Sy

stem.htm. [Accessed 30 09 2019]

[15] ”Arbin LBT21024 Battery Test System | ATEC Rentals,” [Online]. Available:

https://www.atecorp.com/products/arbin/lbt21024. [Accessed 30 09 2019].

[16] ”Intepro Systems,” [Online]. Available:

https://www.inteproate.com/component/rsfiles/download?path=Applications%2F

Battery%2FIntepro-ProcyonPST2100-20-Series-v01.01.pdf. [Accessed 30 09

2019].

[17] L. Technology Corporation, ”LTC6811-1 Daisy Chain isoSPI Battery-Stack

Monitor”.

[18] ”Daisy-Chaining SPI Devices,” 2006.

[19] L. Technology Corporation, ”DC2026C - Linduino One Isolated Arduino-

Compatible Demonstration Board”.

[20] L. Technology Corporation, ”DEMO MANUAL DC1830A-A/DC1830A-B

DESCRIPTION LTC4000 Battery Charger Controller and PowerPath Manager”.

Page 58: Design of the Lithium-ion Battery Pack Tester

53

[21] L. Technology Corporation, ”LT3845 - High Voltage Synchronous Current Mode

Step-Down Controller with Adjustable Operating Frequency”.

[22] ”NiteCore i2 Two-Channel Intellicharger,” [Online]. Available:

https://www.nitecorestore.com/NiteCore-Intellicharger-i2-2-Channel-Charger-

p/chg-nite-i2-2016.htm. [Accessed 30 09 2019].

[23] "8-CHANNEL RELAY," [Online]. Available:

http://www.handsontec.com/dataspecs/module/8Ch-

relay.pdf?fbclid=IwAR1MWq2W-

xbBU41b6WiHzNTozHL1JgUBRu2NIJb7H4GOUFhG0h2xqP2jylo. [Accessed 15

08 2019].

[24] ”南京拓微集成电路有限公司 NanJing Top Power ASIC Corp. TP4056 1A

Standalone Linear Li-lon Battery Charger with Thermal Regulation in SOP-8

DESCRIPTION”.

[25] F. Semiconductor Corp, ”DW01-P One Cell Lithium-ion/Polymer Battery

Protection IC,” 2006.

[26] ”DIY Arduino Battery Capacity Tester - V1.0 : 12 Steps (with Pictures),” [Online].

Available: https://www.instructables.com/id/DIY-Arduino-Battery-Capacity-

Tester-V10-/. [Accessed 12 10 2019].

[27] ”Minimalist Li-Ion Discharger/Capacity meter. | Hackaday.io,” [Online]. Available:

https://hackaday.io/project/163626-minimalist-li-ion-dischargercapacity-meter#j-

discussions-title. [Accessed 12 10 2019].

[28] ”PLX-DAQ | Parallax Inc,” [Online]. Available:

https://www.parallax.com/downloads/plx-daq. [Accessed 13 10 2019].

[29] ”MS8221D HANDHELD DIGITAL MULTIMETER OPERATOR'S INSTRUCTION

MANUAL”.

[30] ”PENG ZHANG 48V BATTERY MANAGEMENT UNIT”.

Page 59: Design of the Lithium-ion Battery Pack Tester

Appendix 1

1 (7)

Automated Charging/Discharging Station V1.0 Arduino Code File

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,2);

#define MOSFET_Pin 3

#define Bat_Pin A0

#define Res_Pin A1

#define nRelayDrive_Pin 9

#define MOSFET1_Pin 5

#define Bat1_Pin A2

#define Res1_Pin A3

#define nRelayDrive1_Pin 10

float Capacity = 0.0; // Capacity in mAh

float Res_Value = 3.0; // Resistor Value in Ohm

float Vcc = 4.99; // Voltage of Arduino 5V pin ( Mesured by Multimeter )

float Current = 0.0; // Current in Amp

float mA = 0; // Current in mA

float Bat_Volt = 0.0; // Battery Voltage

float Res_Volt = 0.0; // Voltage at lower end of the Resistor

float Bat_High = 4.09; // Battery High Voltage

float Bat_Low = 3.0; // Discharge Cut Off Voltage

float Capacity1 = 0.0; // Capacity in mAh

float Res_Value1 = 3.0; // Resistor Value in Ohm

float Current1 = 0.0; // Current in Amp

float mA1 = 0; // Current in mA

float Bat_Volt1 = 0.0; // Battery Voltage

float Res_Volt1 = 0.0; // Voltage at lower end of the Resistor

float Bat_High1 = 3.95; // Battery High Voltage

float Bat_Low1 = 3.0; // Discharge Cut Off Voltage

unsigned long previousMillis = 0; // Previous time in ms

unsigned long millisPassed = 0; // Current time in ms

float sample1 = 0;

float sample2 = 0;

float sample3 = 0;

float sample4 = 0;

int x = 0;

int row = 0;

//

boolean discharging = false;

boolean charging = true;

boolean discharging1 = false;

boolean charging1 = true;

Page 60: Design of the Lithium-ion Battery Pack Tester

Appendix 1

2 (7)

void setup() {

lcd.init(); // initialize the lcd

lcd.backlight();

Serial.begin(9600);

pinMode(MOSFET_Pin, OUTPUT);

pinMode(nRelayDrive_Pin, OUTPUT);

pinMode(MOSFET1_Pin, OUTPUT);

pinMode(nRelayDrive1_Pin, OUTPUT);

digitalWrite(MOSFET_Pin, LOW); // MOSFET is off during the start

digitalWrite(nRelayDrive_Pin, LOW);

digitalWrite(MOSFET1_Pin, LOW); // MOSFET is off during the start

digitalWrite(nRelayDrive1_Pin, LOW);

Serial.println("CLEARDATA");

Serial.println("LABEL,Time,Bat_Volt,capacity,Current");

Serial.println("LABEL,Time,Bat_Volt1,capacity1,Current1");

//Serial.println("Arduino Battery Capacity Tester v1.0");

//Serial.println("BattVolt Current mAh");

}

//********************************Main Loop Func-

tion***********************************************************

void loop() {

//************ Measuring Battery Voltage ***********

for (int i = 0; i < 100; i++)

{

sample1 = sample1 + analogRead(Bat_Pin); //read the voltage from the di-

vider circuit

delay (2);

}

sample1 = sample1 / 100;

Bat_Volt = 2 * sample1 * Vcc / 1024.0;

for (int i = 0; i < 100; i++)

{

sample3 = sample3 + analogRead(Bat1_Pin); //read the voltage from the di-

vider circuit

delay (2);

}

sample3 = sample3 / 100;

Bat_Volt1 = 2 * sample3 * Vcc / 1024.0;

// ********* Measuring Resistor Voltage ***********

for (int i = 0; i < 100; i++)

{

Page 61: Design of the Lithium-ion Battery Pack Tester

Appendix 1

3 (7)

sample2 = sample2 + analogRead(Res_Pin); //read the voltage from the di-

vider circuit

delay (2);

}

sample2 = sample2 / 100;

Res_Volt = 2 * sample2 * Vcc / 1024.0;

for (int i = 0; i < 100; i++)

{

sample4 = sample4 + analogRead(Res1_Pin); //read the voltage from the di-

vider circuit

delay (2);

}

sample4 = sample4 / 100;

Res_Volt1 = 2 * sample4 * Vcc / 1024.0;

//********************* Checking the different conditions *************

if ( Bat_Volt >= Bat_High) {

digitalWrite(MOSFET_Pin, LOW); // Turned Off the MOSFET // No discharge

digitalWrite(nRelayDrive_Pin, LOW);

// digitalWrite(LED_BUILTIN, HIGH);

// beep(200);

Serial.println( "Attention High-V! ");

Serial.print("DATA,TIME,"); Serial.print(Bat_Volt);

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Attention High-V! ");

lcd.setCursor(0,1);

lcd.print( Bat_Volt);

discharging = true;

charging = false;

delay(1000);

lcd.clear();

}

else if (Bat_Volt <= Bat_Low) {

digitalWrite(MOSFET_Pin, HIGH );

digitalWrite(nRelayDrive_Pin, HIGH);

// digitalWrite(LED_BUILTIN, HIGH);

// beep(200);

Serial.println( "CHARGING 1st battery ");

lcd.setCursor(0,0);

lcd.print("CHARGING 1st battery ");

lcd.setCursor(0,1);

lcd.print( Bat_Volt);

discharging = false;

charging = true;

delay(1000);

lcd.clear();

}

if ( Bat_Volt1 >= Bat_High1) {

Page 62: Design of the Lithium-ion Battery Pack Tester

Appendix 1

4 (7)

digitalWrite(MOSFET1_Pin, LOW);

digitalWrite(nRelayDrive1_Pin, LOW);

discharging1 = true;

charging1 = false;

Serial.println( "Warning High-V! ");

Serial.print("DATA,TIME,"); Serial.print(Bat_Volt1);

lcd.clear();

lcd.print("WARNING High-V! ");

lcd.setCursor(0,1);

lcd.print( Bat_Volt1);

delay(1000);

lcd.clear(); // this line is added by kamal

}

else if (Bat_Volt1 <= Bat_Low1) {

digitalWrite(MOSFET1_Pin, HIGH );

digitalWrite(nRelayDrive1_Pin, HIGH);

Serial.println( "CHARGING 2nd battery ");

discharging1 = false;

charging1 = true;

delay(1000);

}

if (Bat_Volt > Bat_Low && Bat_Volt < Bat_High ) { // Check if the battery

voltage is within the safe limit

if (discharging) {

digitalWrite(MOSFET_Pin, HIGH);

digitalWrite(nRelayDrive_Pin, LOW);

millisPassed = millis() - previousMillis;

Current = (Bat_Volt - Res_Volt) / Res_Value;

mA = Current * 1000.0 ;

Capacity = Capacity + mA * (millisPassed / 3600000.0); // 1 Hour =

3600000ms

previousMillis = millis();

Serial.print("DATA,TIME,"); Serial.print(Bat_Volt); Serial.print(",");

Serial.println(Capacity); Serial.print(","); Serial.println(Current);

//lcd.clear();

lcd.setCursor(0,0);

lcd.print(Bat_Volt);

lcd.setCursor(5,0);

lcd.print(Capacity);

lcd.setCursor(10,0);

lcd.print(Current);

Page 63: Design of the Lithium-ion Battery Pack Tester

Appendix 1

5 (7)

lcd.setCursor(14,0);

lcd.print(" D");

row++;

x++;

Serial.println( "Discharging 1st battery ");

delay(4000);

}

else if (charging) {

digitalWrite(MOSFET_Pin, LOW );

digitalWrite(nRelayDrive_Pin, HIGH);

// digitalWrite(LED_BUILTIN, HIGH);

// beep(200);

millisPassed = millis() - previousMillis;

Current = (Bat_Volt - Res_Volt) / Res_Value;

mA = Current * 1000.0 ;

Capacity = Capacity + mA * (millisPassed / 3600000.0); // 1 Hour =

3600000ms

previousMillis = millis();

Serial.print("DATA,TIME,"); Serial.print(Bat_Volt); Serial.print(",");

Serial.println(Capacity); Serial.print(","); Serial.println(Current);

//lcd.clear();

lcd.setCursor(0,0);

lcd.print(Bat_Volt);

lcd.setCursor(5,0);

lcd.print(Capacity);

lcd.setCursor(10,0);

lcd.print(Current);

lcd.setCursor(14,0);

lcd.print(" C1");

Serial.println( "CHARGING 1st battery ");

delay(1000);

}

if (Bat_Volt1 > Bat_Low1 && Bat_Volt1 < Bat_High1 ) { // Check if the bat-

tery voltage is within the safe limit

if (discharging1) {

digitalWrite(MOSFET1_Pin, HIGH);

digitalWrite(nRelayDrive1_Pin, LOW);

millisPassed = millis() - previousMillis;

Current1 = (Bat_Volt1 - Res_Volt1) / Res_Value1;

mA1 = Current1 * 1000.0 ;

Capacity1 = Capacity1 + mA1 * (millisPassed / 3600000.0); // 1 Hour =

3600000ms

Page 64: Design of the Lithium-ion Battery Pack Tester

Appendix 1

6 (7)

previousMillis = millis();

Serial.print("DATA,TIME,"); Serial.print(Bat_Volt1); Serial.print(",");

Serial.println(Capacity1); Serial.print(","); Serial.println(Current1);

//lcd.clear();

lcd.setCursor(0,1);

lcd.print(Bat_Volt1);

lcd.setCursor(5,1);

lcd.print(Capacity1);

lcd.setCursor(10,1);

lcd.print(Current1);

lcd.setCursor(14,1);

lcd.print(" D");

row++;

x++;

Serial.println( "Discharging 2nd battery ");

delay(4000);

}

else if (charging1) {

digitalWrite(MOSFET1_Pin, LOW );

digitalWrite(nRelayDrive1_Pin, HIGH);

millisPassed = millis() - previousMillis;

Current1 = (Bat_Volt1 - Res_Volt1) / Res_Value1;

mA1 = Current1 * 1000.0 ;

Capacity1 = Capacity1 + mA1 * (millisPassed / 3600000.0); // 1 Hour =

3600000ms

previousMillis = millis();

Serial.print("DATA,TIME,"); Serial.print(Bat_Volt1); Serial.print(",");

Serial.println(Capacity1); Serial.print(","); Serial.println(Current1);

Serial.println( "CHARGING 2nd battery ");

//lcd.clear();

lcd.setCursor(0,1);

lcd.print(Bat_Volt1);

lcd.setCursor(5,1);

lcd.print(Capacity1);

lcd.setCursor(10,1);

lcd.print(Current1);

lcd.setCursor(14,1);

lcd.print(" C");

delay(1000);

}

//*************LCD DISPLAY*************

Page 65: Design of the Lithium-ion Battery Pack Tester

Appendix 1

7 (7)

// // when characters arrive over the serial port...

if (Serial.available()) {

// // wait a bit for the entire message to arrive

delay(100);

// // clear the screen

lcd.clear();

// // read all the available characters

while (Serial.available() > 0) {

// // display each character to the LCD

lcd.write(Serial.read());

delay(100);

}