Design and Implementation in Testing and Monitoring of Lead-Acid Battery Using Arduino
Design and Implementation in Testing and Monitoring of Lead-Acid Battery Using Arduino
Revision Page
Abstract iii
List of tables and figures in Table of Contents vi - vii
Circuit diagram with values of components, pins used in Arduino,
14-21
and values used in codes
Remove halfway deliverable 24
Simulate prototype to address specific objective 3 30-33
Relationship of the battery’s internal resistance to the temperature 42-44
Appendix - data sheet of components 52 - 62
___________________________________
Jaybee E. Lacea, R.E.E., M.Eng
Adviser
_______________________________ _______________________________
Engr. Isabelo A. Rabuya, MSEE, REE Engr. Philip M. Wong-Marcon, REE
Panel Panel
____________________________________
Engr. Rafael Domingo Seva, Jr., MSEE, REE
Chairman of the Panel
Design and Implementation in Testing and Monitoring of
An Undergraduate Research
Presented to the
Faculty of the Department of Electrical and Electronics Engineering
University of San Carlos – Technological Centre
Cebu City, Philippines
In Partial Fulfilment
of the Requirements for the Degree in
Bachelor of Science in Electrical Engineering
By:
Fuentes, Edsel Ian, RME
2020
Adviser’s Certification
This Thesis Project entitled “Design and Implementation in Testing and Monitoring of
Lead-acid Battery using Arduino” by Edsel Ian S. Fuentes, RME has been accepted by
______________________________________
ii
Abstract
From industries to homes, batteries are commonly used nowadays due to their
variety of uses as they can provide electricity and store energy. However, batteries, if
necessary to check the status of these batteries as much as possible in order to prolong its
usage, and it is also essential to timely replace them to avoid accidents and mishaps that
can be costly in general. Therefore, the goal of this study is to monitor and assess the
battery through its internal resistance as it was said that the internal resistance of the
battery correlates its capacity and can determine the battery’s health. Specifically, a
fabricated module and a prototype module was made to obtain certain parameters to get
the internal resistance of the 12V, 5Ah lead acid battery. Thirty (30) trials were done to
get the internal resistance of the battery using the two modules. The discharge curve was
also taken using the fabricated module during the thirty trials to determine the discharge
time. It was observed that when the internal resistance reached 25% more from its
original value, the discharge time of the battery significantly dropped and continued to
drop more on successive uses. The result suggests that there is a need for replacement on
the battery if its internal resistance reached the certain level. The study attests that getting
the internal resistance of the battery is a good alternative way in assessing the health of
the battery.
iii
Table of Contents
2.1 Battery…………………………………………………………………………6
iv
4.2 The Discharge Curve of Battery....……………..………..………..…..……..39
5.1 Conclusion....………………………….………..………..………..…..……..45
5.2 Recommendation....……………..…………………...…..………..…..……..46
Documentation………………….…………………………………………..……..……63
Bibliography ...………………….…………………………………………..……..……66
Gantt Chart.....………………….…………………………………………..……..……69
v
List of Tables
List of Figures
vi
4.13 Graph of VOC of a Discharging Battery 37
4.14 Discharge curve of battery from 12V 38
4.15 Temperature of the battery while charging 40
vii
Chapter 1
The Problem and Its Settings
1.1Introduction
Batteries were created around the late 19th century which provided electricity even
before the electric generators. They are also important components to technologies that
have made an impact on the quality of life especially in energy, telecommunication, and
transportation. Engineers and scientists have developed many kinds of batteries over the
years and this development has expanded their uses to continually improve the quality of
life for people all over the world. Since the primary use of a battery is to provide
electricity and to store energy, technologies such as renewable energy systems are in
trend due to how they’re designed to be environment-friendly. If continuously-used, these
batteries may result in a system degradation which loses the effectiveness of storing
energy. It is necessary to check the status of these batteries as much as possible in order
to prolong its usage, it is also essential to timely replace them to avoid accidents and
mishaps that can be costly in general. This is important for people who are not connected
to the electric grid specifically in remote locations where the electric grid is unreachable
to where the batteries are the alternative source of energy [1].
A lot of research is being done to help aid this problem and one of it is the
development of lead acid batteries as an alternative energy power supply that provides
electric power for industrial use. The requirement of electric power enables smooth and
efficient operations that are visible in many transportation vehicles and in
uninterruptible power supply systems (UPS) which are used in heavy industries [2].
According to the world energy outlook survey for the year 2015, 1.2 billion
people around the world don’t have access to electricity. In the Philippines, close to 2.3
million Filipinos don’t have access to electricity and many of these community are living
in rural areas and off-grid small islands. Some of the islands such as Pangan-an Island
deploy solar PV system and battery storage [3]. Due to their low cost, ruggedness, high
1
reliability and ability to supply high surge currents, lead acid batteries are well known
and mostly used for storage purposes.
Through the years, there have been a lot of activities and debates regarding the
use of internal "resistance" characteristics as a battery condition measurement. The desire
and interest for simple electronics spark interest for the researchers as a practical
determination of residual battery capacity, particularly given the increased usage of seal
lead-acid (SLA) batteries. It is regarded that battery internal resistance is known to be an
aid in assessment of battery state-of –health. Simple internal resistance measurements
incorporate various batteries and power system maintenance through Telstra. During
charging and discharging, electrochemical impedance spectroscopy has been used in
studies of electrode and plate behavior. However, there has been only limited application
to the near equilibrium condition for lead-acid batteries on float duty [4].
One of the most important and commonly used components for storage and
transport of renewable energy (e.g. solar and wind energy) are lead-acid batteries. The
simplicity in its design allows hydrogen and oxygen gases to be created during the charge
cycle to vent to the atmosphere so that distilled water must be regularly added to maintain
the electrolyte level and sulfuric acid concentration. With this, it is required to have a
regular maintenance to ensure the functionality of the battery [5].
2
Therefore, a reliable battery system is indispensable for efficient operation in an
off-grid system. However, it is to be noted that these batteries are considerably
expensive and excessive use could result in their malfunction. One damaged lead–acid
batteries from a battery bank may have a negative impact on the over-all energy storage
system. It is important to continuously monitor the development and management of
these batteries in order to prevent unforeseen damage and to extend the lifespan of the
entire battery bank.
Due to intermittent nature of Solar PV System, wind and tidal power, in off-grid
small island communities, energy storage system is added to extend the electricity supply
to 24 hours. Lead-acid battery, a source of standby power, are mostly located in the rural
places in the Philippines. The said battery requires monitoring and testing on its health,
life, and status so that necessary maintenance can be carried out once a problem is
identified. Unfortunately, due to distance constraint from the rural areas to the urban area,
it is difficult to execute the physical testing of the battery. The goal of this study is to find
a solution to the distance barrier in the monitoring process and find an alternative to
diagnose before physical testing.
i) To measure the battery internal resistance of the 12Volts, 5AmpereHour lead acid
battery.
ii) Present the internal resistance of the lead acid battery in relation to its body
temperature, voltage and time of used.
iii) Implement a prototype system that can monitor the battery internal resistance of
the lead acid battery.
3
battery life. Also, it analyzes and supervises battery parameters 24/7 providing invaluable
data every second and generates report which help in preventing battery deterioration and
unplanned power interruptions. Battery monitoring is essential to any industry that relies
on batteries to provide backup power. Usage of battery monitoring will eliminate the risk
of the system failure [6].
1. Students - The results of the study will provide the students with some knowledge
on battery monitoring and as well as a basis for further studies in the future.
2. Society – This study can be beneficial to the installer or implementing of energy
storage system in remote areas where they can save manpower to physically
monitor each battery.
This study is purely grounded on remote monitoring and testing of the battery
impedance and voltage state. The battery to be monitored and tested is Lead-acid battery
which has a capacity of twelve (12) volts and 5Ah. This battery is to be tested for the
implementation and gathering of data focusing on its health status which is the battery
internal resistance and voltage state.
A resistor will be used as a dummy load in order to get the internal resistance to
compare the voltages of the battery before and after it has been connected to the load.
The testing has to be done for a short period so as not to heat the battery and
consequently alter its voltage.
4
The study is to design and implement a prototype that can monitor and test a
Lead-acid battery by using Arduino Uno. The Arduino Uno will be used as a micro-
controller and it will take periodic samples or trials of the battery voltage.
Energy – is an energy newly derived from electric potential energy or kinetic energy.
Lead Acid Battery – a battery which uses sponge lead and lead peroxide for the
conversion of the chemical energy into electrical power.
State of Charge - the charge level of the battery relative to its capacity which is
determined through its open-circuit voltage.
State of Health - reflects the energy capability and power capability of the battery by
looking its capacity and internal resistance.
5
Chapter 2
Review of Related Literature
2.1 Battery
6
years and is known as “Baghdad batteries” [9]. This speculation from König is
supported by the fact that the discovered iron rods inside the earthenware jars revealed
evidence of acidic corrosion, which may have been “submerge in vinegar”. In 1940,
Willard F. M. Gray of the General electric High Voltage Laboratory in Pittsfield
Massachusetts, took time to replicate a Baghdad battery and used a copper sulfite
solution thereby generating electricity [10].
Lead acid batteries have been used as a practical power source for over 100 years
because of their high performance, it has a very cost-effective method for storing
sufficient power and energy [11]. Every year, approximately 3 million tons waste
batteries are generated according to statistics. With sustained and fast advancement of the
economy, the production of lead-acid batteries will continue to increase greatly (11).
7
Figure 2.1 Lead acid Battery
Lead-acid battery has the longest history as a rechargeable battery [15]. For such a
long time, it has been taken under consideration for a large-scale stationary energy
storage. Its importance has escalated as the increase in its usage also increases. As time
progressed, the need for load leveling, load switching (for renewable energy), and power
quality are becoming more demanding so the development of the battery’s functionality
have become more relevant [15].
It has been known that lead-acid technology still remains to be the most reliable,
safe and affordable power source. There are several newly developed batteries but none has
reached the commercial success of lead-acid battery [17]. There are actually a lot of
competing battery technologies including Li-ion, sodium-sulfur but lead-acid batteries are
very well established both for automotive and industrial applications and have been
successfully applied for utility energy storage. In terms of energy density and specific
energy, li-ion batteries have advantages however, this is less important for static
installations. Lead batteries on the other hand, are efficient and capable of long cycle and
calendar lives and have been developed in recent years to have much longer cycle lives
compared to 20 years ago in conditions where the battery is not routinely returned to a
fully charged condition [18].
8
Without significant improvements in meeting the continuously increasing
requirements in the different markets, lead–acid batteries will have difficulties to survive
as a relevant technology in the market within the coming 20 years and maybe earlier [19].
Lead-acid batteries are of significant importance due to its commercial acceptability.
Hence, constant attempt to find new methods to improve its efficiency has been the goal
of a lot of researchers [20]. With this end view, the proponents of the study have seen the
necessity to implement a prototype that can help the users to easily monitor remotely the
battery voltage and internal resistance [21].
9
Harish N, et al, created a management system using IoT for based battery for
vehicles. In their study State of charge and State of Health were considered to be
important parameters for batteries. The study discussed about the detection of Hydrogen
gas emitted from the batteries which provides very safe atmosphere around the battery for
the environment around it to be safe. Battery Management System will help analyze the
data. The concept is analogous to GPS tracking for vehicles [24].
From a study presented by Glenn Alber regarding the use of internal cell
resistance in predicting battery performance, he stated that that internal resistance of a
cell is closely related to its capacity and can, therefore, be used to predict cell’s
performance during a discharge. This can be a potential cost-effective replacement
solution to load testing. However the correlation of battery’s cell resistance and its
capacity is not linear, therefore, not used as an indicator of capacity, but rather, as a
warning indicator that signals if a cell has deteriorated to a level that will affect the
operating integrity of the system. It has been approved by field testing on all types of
batteries. Results shows that if internal resistance increases to more than 25%, above its
base line value, the cell will fail a capacity test [25].
Based on the study of Ashok K. Singal, the internal resistance provides valuable
information about a battery as high reading implies an end-of-life to a battery. Also, in a
closed circuit the electric current flowing within the battery is due to the chemical
reactions, which will take place only if the voltage across the battery V is different from
the chemical potential ℰ. A steady state means the internal current within the battery must
be equal to the current I =V / R through the external resistance R. The internal resistance
could be defined by Ri=1 /¿ dI /dV ∨¿V =E ¿. When current increases the V decreases.
Assuming a constant dI /dV in a certain range of V around ℰ and nothing that I=0 when
V= ℰ, we get Ri=(ℰ-V)/I. From this we could write ¿ E−I Ri , which justifies representing
the battery as a source of emf ℰ with its internal resistance Ri in series. The current
I=V/R is then given by I= ℰ/(R+ Ri). One could even have a reverse current through the
battery when V _ across the battery is made higher than ℰ. For that another source of emf,
say ℰ1 and with an internal resistance Ri1, so that ℰ1> ℰ of the battery in question, is
connected across its terminals. The magnitude of the reverse current through the battery
10
will now be given by I=(V- ℰ)/ Ri, as the recharging voltage V= ℰ1-I Ri1 is larger than ℰ,
then I=(ℰ1- ℰ)/( Ri+R). The reverse current means that the positive charges move towards
the negative electrode while the negative charges move towards the positive electrode,
thereby reversing the chemical reaction and recharging the battery. In the case of non-
rechargeable battery no reverse current takes place and we could say it has a discontinuity
in its internal resistance at V= ℰ+0 [26].
Now eℰ is the amount of chemical energy expended as work on a charge e in
transporting it from one electrode to the other. Out of this, an amount eV is spent against
the electric field, which ultimately gets delivered to the external load, the remaining
energy e(ℰ-V) represents the ohmic losses within the battery. Thus (ℰ-V)I=I2Ri are the
power losses in the battery as expected from a resistance Ri lying outside the battery in
series.
The actual value of the internal resistance of a cell may depend upon a
combination of various factors. If the effective cross-section areas of the electrodes are
large, more current may flow through the battery even for the same ℰ-V change, implying
a lower value. Ri value. Similarly a larger separation between the electrodes would imply
a smaller push on the charges even for the same ℰ-V change, resulting in a smaller
current, implying a higher Ri value. The nature of the constituents (electrodes and the
electrolyte) of a battery also matter as a better conducting electrolyte means a higher
current for the same ℰ-V and thereby a smaller Ri. Further as with usage the density of
chemical components within the battery may decrease, it would lead to an increase in the
internal resistance [26].
11
Chapter 3
Methodology
The process outline is shown in figure 3.1. Lead-Acid Battery to be used will be
acquired according to its specifications needed in monitoring and assessing its capability
in using as the main material for this study. Lead-Acid Battery was assessed according to
its parameters such as voltage and internal resistance. It was physically monitored by
these parameters and tested. The prototype was designed to monitor the Lead-Acid
Battery using Arduino Uno Rev3 and it was tested and monitored. This was done with the
use of Arduino Uno Rev3 in making the operation possible. The data of the parameters of
physical testing and during the remote testing of the Lead-Acid Battery were then
compared to verify the readings of the data. Lastly, the data were sent to SD Card module
for data logging.
12
Testing of
Designing a prototype and
Lead-acid Physical Validation of
battery comparing
battery monitoring and
Acquisition and testing of Lead-
monitoring results using the design of
System precise multi- the prototype
Assessment. acid battery
prototype. meter.
The Lead-Acid Battery were tested and physically monitored with the parameters
of its voltage and internal resistance. It was monitored with the use of the open circuit
voltage method in which the battery’s voltage is measured using a meter connected
across its terminals. A 4-hour rest period was required in case the battery had been
freshly charged to allow diffusion inside the battery to come to an end before the voltage
readings are taken. The readings after the testing will then be gathered and analyzed.
13
In the design of a battery monitoring system, the Arduino Uno was used as a
microcontroller and SD Card module for data logging. The battery was a sealed lead acid
battery which gives out 12 V and 5 AH. It was also rechargeable which can also emulate
various charge levels.
14
Figure 3.4 Circuit Diagram of the Fabricated Battery Monitoring Module
Presented in Figure 3.4 is the circuit of the fabricated module. The parameters of
12V 5Ah Lead acid battery was obtained by getting its voltage through voltage divider to
the Arduino microcontroller. Seven (7) resistors, each with 1MΩ resistance, were used as
a voltage divider. Huge value of resistance was used so that little to no current will pass
through it which is,
12 V
I voltage divider= =1.7 μA
7000000 Ω
The operation amplifier (LM358D) contains two op-amps (IC1 and IC2) and were
used for RSENSE and voltage divider, respectively. The op-amp IC2 was used as a buffer to
isolate the voltage divider circuit to the rest of the circuit so that the resistance value of it
15
would not change. Supposed that the input voltage is 12V, then the voltage after
implementing the voltage divider is,
V @ voltagedivider =12 V ( 17 MΩ
MΩ )
=1.714 V
However, adding another circuit in it, such as ADC and microcontroller, will
change this voltage, especially since there is an input impedance in the pin of Arduino
that will result in changing the equivalent resistance in R7 as shown in Figure 3.5.
Since R7 is in parallel to the circuit added, the equivalent resistance will change
and that will lead to different voltage readings across it. So basically, the purpose of op-
amp acting as a buffer is to prevent this loading error.
The dummy load used was three 50Ω, 5W connected in parallel, which has a total
resistance of 16.66667Ω. There were many things considered in deciding this. First, since
1
current is inversely proportional to the resistance as the supply voltage is fixed ( I ∝ ), it
R
was better to have lower resistance value to have higher discharge current for faster
discharge rate of the battery. However, power is also inversely proportional to the
2
1 V
resistance from the equation ( P ∝ ), from the equation P= as the voltage across the
R R
dummy load is fixed or constant. To avoid having the power dissipation of the load
16
higher than the load’s rated power, the resistance value was kept higher. With three 50Ω,
5W resistor connected in parallel, each had an average discharge current of 0.24A and
power dissipation of 2.88W.
The coulomb counter is used to count the amount of charge. Supposedly the
coulomb counter was used to measure the state of charge of the battery and RSENSE was
used to measure for current. But this was not part of the application of the
implementation of the study, since the researcher did not dwell on the state of charge but
mainly focuses on the internal resistance measurement, temperature, and implementation
of the prototype. The voltage across RSENSE is the voltage input to the coulomb counter.
With the use of Ohm’s Law, the current through RSENSE can be determined. In choosing
RSENSE, the voltage drop across it has to be in the range from 50mV to 75mV. Since the
load used in the circuit is 16.66667Ω, the range of RSENSE should be,
50 mV =12 V ( 16.66667
R
Ω)
SENSE (MIN )
;R SENSE( MIN) =0.06944 Ω
(3.1)
75 mV =12 V ( 16.66667 Ω ); R
R SENSE (MAX )
SENSE( MAX) =0.10417 Ω
(3.2)
The value of RSENSE used in the circuit is 0.1Ω. Therefore, the voltage across it is
72mV. Because the voltage drop of RSENSE is small, the operational amplifier, IC1, was
used to amplify it so that the microcontroller can read it. The IC1 was connected as non-
inverting amplifier, this means that the gain it has is,
RF 250 kΩ
GAIN =1+ =1+ =1+25=26
R 10 kΩ
Therefore, the voltage that the RSENSE will send into the microcontroller is,
V @ ARDUINO=26∗V Rsense=26∗72 mV =1.872V .
A relay was used to get both open circuit voltage and voltage with load. Flyback
or freewheel diode (1n4001) was used to provide a path for decay of current produced
from the coil when the power supply was removed or interrupted. Upon disconnecting the
power supply, the diode mitigates the issue of the reverse polarity voltage in the relay coil
that was built-up and protects the device by forming a current loop between the coil and
17
the diode. The transistor MOSFET (IRFZ44) acts as a switch so that the relay will
function and this will activate depending on the input signal by Arduino if High (1) or
Low (0). Figure 3.6 shows the program flowchart of the fabricated battery monitoring
module.
18
Figure 3.7 Initializing all components
Figure 3.7 shows the codes for initializing the temperature sensor and defining the
pins being used, that is pin 4 for the temperature sensor and pin 5 for the relay. It also
declares the delay between data gathering.
Figure 3.8 Reading the data gathered from the battery and temperature sensor
19
Figure 3.8 shows the codes in getting the data gathered from the battery and
temperature sensor. The relay was initialized so that it will set at HIGH at the start of
program. If the relay is HIGH, the relay will be energized and the contact on the dummy
load will close. Therefore, the voltage with load can be measured at this state. After
getting the voltage with load, the relay was set to LOW, deenergizing the relay and
opening the relay contact to get the open-circuit voltage. The relay was set to HIGH after
this, and the program will read the temperature.
The voltage from the battery was converted through analog-to-digital converter
(ADC) to the microcontroller. It converts the voltage value into ADC value, and the ADC
value will be converted back into voltage by the microcontroller through calculations.
The ADC value has a linear relationship with the voltage. To determine the slope
equation, the ADC value of the corresponding voltage was determined while the voltage
was varied. Shown in Equation 3.3 the slope equation used to get the voltage of the
battery.
(3.3)
Equation 3.3 shows the slope equation used for the fabricated module, which is in
the slope form, y = mx + b. The voltage is the independent variable, the ADC value is the
dependent variable, and the slope and y-intercept are the constants 0.00043518684 and -
0.20758412301, respectively. The delay between getting the voltage with load, open
circuit voltage, and the temperature of the battery is 100 milliseconds.
20
Figure 3.9 Storing data in SD card
Figure 3.9 shows the codes for storing the data in SD card. The file name of data
written into is DHTDATA.txt. The pins being used in the Arduino is shown in Figure
3.10.
21
The temperature sensor is connected to the pin D4 of Arduino, while the transistor
MOSFET that was connected with relay is connected to pin D5 of Arduino. The pins
Chips Select (CS) at D9, Master Out Slave In (MOSI) at pin D11, Master In Slave Out
(MISO) at D12, and Serial Clock (SCK) at pin D13 is connected to the SD Card Module.
Lastly, the pins of serial data (SDA) at pin A4 and serial clock (SCL) at pin A5 is
connected to analog-to-digital converter.
The battery was monitored to obtain its internal resistance through three different
methods. The first method was the standard method where the parameters required were
obtained from the multimeter. The second method used battery monitoring module,
which uses microcontroller with relay, to measure the required parameters. This module
was also used to monitor the battery while discharging. The last method used the
prototype of the study in monitoring the battery. This method uses analog-to-digital
converter (ADC), op-amp, and microcontroller. Shown in Figure 3.11 the steps in
monitoring the battery and getting its internal resistance using the three approaches.
Battery has to be fully charged first before getting its internal resistance. From the
depleted state, the battery was charged for at least 8 hours. Shown in Figure 3.12 the
22
characteristics of battery at charging state [28]. In this study, the battery is considered
fully-charged if the open-circuit voltage of it is 12.6V or above. If the battery was just
charged, the battery had to rest for at least 4 hours before obtaining the required
parameters to allow the surface charge of the battery to dissipate. That is because this
surface charge causes the battery to give different readings while in open state. The
internal resistance of the battery was then determined using the three methods; standard
method, using the battery monitoring module, and using the prototype of the study.
After obtaining the internal resistance using the three methods, the battery was
discharged until 10.5 V. D. Jaya & V. Ramanarayanan states that at 10.5V, the battery is
considered to be fully-depleted [29]. The module was used to monitor the battery to get it
open-circuit voltage while discharging. This was done to obtain the discharge curve for
each trial.
23
When designing a circuit with a battery, battery was often assumed as an
ideal voltage source immediately. This means that no matter how much or little load
attached to the battery, the voltage at the source’s terminals will always stay the same.
In reality, several factors can limit a battery’s ability to act as an ideal voltage
source. Battery size, chemical properties, age, and temperature all affect the amount of
current a battery is able to source. As a result, one can create a better model of a battery
with an ideal voltage source and a resistor in series.
Measuring the voltage of a battery across its terminals without any load connected
was known as the open-circuit voltage (VOC). There was no current flowing through the
internal resistor, the voltage dropdrops across it is 0 V. Therefore, VOC was assumed as
equal to the voltage of the ideal voltage source in the battery.
If a load is connected across the battery, the voltage across the terminals drops.
This drop in voltage is caused by the internal resistance of the battery. The internal
resistance can be calculated using the open-circuit voltage and the voltage across the
battery’s terminals with a load attached. Using the equation 3.6, the value of the internal
resistance of the battery can be obtained.
The charging cycle of the batteries are initially based on their specification sheet.
The batteries will have a voltage test using a multi-meter and it will be compared to the
values in its specification sheet. And alsoalso, in old rechargeable battery, if available,
will be tested in order to prove the 25% measurement correctly.
R set
I= (3.4)
VL
V oc −V L
Ri= (3.5)
I
Ri=
( V oc −V L
VL )
∗( Rset ) (3.6)
Where,
24
Ri = Internal Resistance of Battery
VL = Load Voltage
From this, the internal resistance of the lead acid battery was obtained.
The parameters obtained from the physical monitoring using voltmeter and with
its application and compared the measured parameters with the precise multi-meter.
Specifically, the internal resistance of the battery obtained using the three different
methods, and the discharge curve between each trial were compared.
The design of the prototype of the battery monitoring system was validated by
comparing the internal resistance obtained from it to the internal resistance obtained from
standard method. This was done by getting the percent error for every trial.
25
Chapter 4
Results and Discussion
The internal resistance of the battery was obtained through three approaches:
standard method, using the battery monitoring module, and the prototype of the study.
In standard method, the open-circuit voltage (V OC), the voltage with load (V WL),
and the total current (IT) were obtained using multimeter. By getting the voltage drop of
the internal resistance from subtracting the voltages acquired, and with the use of Ohm’s
Law, the internal resistance of the battery were determined. Figure 4.1 shows the circuit
of standard method. Figure 4.2 shows the setup for the standard method. The dummy
load used for this study were three 50 ohms, 5W in parallel.
26
Figure 4.2 Getting the open-circuit voltage (left), voltage with load (middle), and the
total current (right)
Table 4.1 shows the data gathered using the standard method. Thirty (30) trials
were done in this study. Internal resistance was obtained using the equation (4.1).
27
22 12.83 12.29 0.61 0.885246
23 12.76 12.23 0.61 0.868852
24 12.85 12.26 0.65 0.907692
25 12.9 12.28 0.63 0.984127
26 13.16 12.47 0.61 1.131148
27 13.08 12.4 0.63 1.079365
28 13.13 12.37 0.63 1.206349
29 12.96 12.24 0.61 1.180328
30 12.63 11.84 0.61 1.295082
A battery monitoring module was designed to monitor the battery. This module
measured the open-circuit voltage of the battery and the voltage with load. With the use
of relay, they can be measured while the battery is discharging. The temperature of the
battery was also monitored by the module by placing the temperature sensor on the top of
the battery.
In this method, the internal resistance of the battery was obtained from the open-
circuit voltage (Voc), voltage with load (Vwl), and the resistance of the dummy load
(Rset) as shown below. Shown in Figure 4.4 and 4.5 the setup for the battery monitoring
module and a sample of data gathered from serial monitor using the module.
R V OC −V WL V OC−V WL
∫ ¿= IT
=
V WL
¿ (4.2)
RSET
28
R
∫ ¿=R SET ( )
V OC−V WL
V WL
¿ (4.3)
29
Figure 4.5 Data acquisition using battery monitoring module
There are two open-circuit voltage considered in this method. One is where the
load is not connected to the module, meaning the module solely measures the voltage of
the battery. While the other one is where the load is connected to the module. The open-
circuit voltage of this one is lower than the first one. This might be due to the internal
resistance of the relay. Table 4.2 shows the data gathered using the battery monitoring
module. Internal resistance was obtained using the equation (4.2) for the 30 trials.
30
4.1.3 Using the Prototype of the Study
The prototype of the study consists of the following: voltage divider, operational
amplifier (op-amp), analog-to-digital converter (ADC), and microcontroller. The voltage
divider was used to reduce the voltage level from the battery to which the microcontroller
can handle (0 to 5V). The op-amp is used as a buffer to isolate the voltage divider to
another part of circuit to prevent loading error in the voltage divider. This means that the
output voltage of the voltage divider will not change when ADC and microcontroller is
added to the circuit that is connected in parallel. ADC converts the analog readings from
the circuit into digital to the microcontroller.
In this approach, the internal resistance of the battery was obtained from the open-
circuit voltage (Voc), voltage with load (Vwl), and the resistance of the dummy load
(Rset). The prototype module of the study uses a switch instead of relay to disconnect and
connect the load from the battery to obtain the open-circuit voltage, V OC, and voltage with
load, VWL, respectively. Since the prototype acts as a voltmeter to the circuit, a simulation
was done in LTspice application to show the ideal voltage drop of the battery, as shown
in Figure 4.6.
31
The voltage source in the simulation was set to 12V with an internal resistance of
45mΩ, while the resistors have a rating of 50Ω, 5W with 5% tolerance. The blue line,
V(n002), shown in Figure 4.6 represents open circuit voltage (Voc) ,while), while the
green line, V(n001), represents the voltage of battery with load. Figure 4.7 shows the
operating point of the circuit.
Given their voltages, the internal resistance of the battery can be determined using
equation (4.3).
R
∫ ¿=R SET ( V WL ) (
V OC−V WL 50 12−11.9677
=
3 11.9677 )≈0.045=45 mΩ ¿
32
Shown in Figure 4.8 the circuit diagram of the prototype battery monitoring
module. Voltage divider is added to lower the voltage level from the battery to the
Arduino. If the switch is open, the open-circuit voltage will be measured. If it is closed,
the voltage with load will be measured. Shown below the voltage of ideal open-circuit
voltage and voltage with load presented from LTspice (shown in Figure 4.7) after
implementing the voltage divider.
V OC (voltagedivider)=12 V ( 17 MΩ
MΩ )
=1.714 V
V WL(voltagedivider)=11.9677V ( 17 MΩ
MΩ )
=1.7097 V
Same as the fabricated module, the analog-to-digital converter converts the analog
signal (voltage value) from the battery to digital signal (ADC value) to the
microcontroller. The ADC has 10 bits meaning it has the ability to detect 1024 (2^10)
discrete analog levels from 0 to 102310 (11 1111 11112). The ADC assumes that 5V is
1023 and anything less is the ratio between them. Therefore, the corresponding ADC
value of the open-circuit voltage and voltage with load from the battery down to voltage
divider is,
The digital signals that will go into the microcontroller is in the form of binary
that is, 1010111112 for open-circuit voltage or 1010111102 for voltage with load.
However, the serial monitor will display its corresponding decimal value, which is 351
and 350, respectively. Then, the microcontroller would convert it back to its raw voltage
from the ADC value obtained through calculation which is,
33
From the equation, the raw voltage was calculated from ADC value, by
multiplying it by a constant “7” which is the ratio of the voltage divider, conversion
factor which is from voltage (5V) to ADC value (1023), and calibration factor to have
more precise readings. Shown in Figure 4.9 the output values on each part of the circuit
supposing that the input voltage is 12V.
Shown in Figure 4.9 the setup for the prototype battery monitoring module of the
study.
34
Figure 4.9 Setup for the prototype module of the study
Table 4.3 shows the data gathered using the prototype of the study. Internal
resistance was obtained using the equation (4.3) for the 30 trials.
35
18 13.07 12.41 0.886382
19 12.74 11.79 1.342946
20 12.96 12.37 0.794934
21 12.78 12.15 0.864198
22 12.67 12.08 0.814018
23 12.67 11.97 0.974659
24 12.65 11.94 0.991066
25 12.89 12.08 1.11755
26 13.11 12.45 0.883534
27 13.07 12.3 1.04336
28 13.14 12.15 1.358025
29 12.85 12.01 1.165695
30 12.78 11.93 1.187483
The voltage values shown in Table 4.3 were taken from the prototype module. A
switch was connected to the dummy load to measure the open-circuit voltage and the
voltage with load by opening and closing it. Shown in Figure 4.10 are the data of Trial 16
displayed in serial monitor.
Figure 4.10 Open-circuit Voltage (left) and Voltage with Load (right) of Trial 16
displayed in Serial Monitor using Prototype Module
The internal resistance of the battery was taken on each trial through three
different methods; standard method, battery monitoring module, and prototype of the
study. The standard method uses multimeter as a measuring instrument, while both
module and prototype uses voltage divider and op-amp to decrease the voltage obtained
from the battery so that the microcontroller can read it. In a sense, standard method is
36
more accurate than the other two methods. Therefore, in this study, the standard method
was used as the reference for internal resistance of the battery. The temperature was also
considered in this study. The range of the temperature set in this study was from 30 °C to
35 °C. Table 4.4 shows the internal resistances of each method and the temperature on
the surface of the battery. Shown in Figure 4.11 the graph of the internal resistances taken
from each trial using the three different approach.
Table 4.4. Internal resistance from the three methods with temperature and percent error
Standard Battery-Monitoring
Prototype of the Study
Trials Method Module Temp (°C)
RINT (Ω) RINT (Ω) %error (%) RINT (Ω) %error (%)
1 0.9375 0.872011 6.985466 0.9762901 4.13761 32
2 0.640625 0.606562 5.317167 0.64155064 0.14449 33.5
3 0.769231 0.707155 8.069884 0.79561043 3.429355 33
4 0.609375 0.679989 11.58792 0.68362045 12.18387 34
5 0.59375 0.659522 11.07736 0.69672131 17.34254 34.5
6 0.650794 0.670498 3.027754 0.74768896 14.88879 33.5
7 0.65625 0.589364 10.19215 0.63325249 3.504382 34.5
8 0.639344 0.557823 12.75074 0.65807145 2.929124 34
9 0.580645 0.60208 3.69154 0.67258542 15.83416 34
10 0.6 0.513652 14.39128 0.59760956 0.398406 34.5
11 0.630769 0.571429 9.407666 0.59235326 6.090337 33.5
12 0.681818 0.543774 20.24651 0.53418803 21.65242 34
13 0.721311 0.657159 8.893889 0.70132013 2.771527 34
14 0.6875 0.641562 6.681882 0.6727073 2.151665 33
15 0.612903 0.502172 18.06675 0.55600759 9.282971 33.5
16 0.575758 0.462208 19.72182 0.61629153 7.040108 34.5
17 0.6 0.520833 13.19444 0.64464142 7.440236 35
18 0.671875 0.70518 4.957077 0.88638195 31.92662 35
19 0.725806 0.635184 12.48581 1.342946 85.02812 34
20 0.806452 0.767544 4.824561 0.79493398 1.428186 34.5
21 0.806452 0.837521 3.852596 0.86419753 7.160494 34.5
22 0.885246 0.792327 10.4964 0.81401766 8.046153 34.5
23 0.868852 1.126319 29.63292 0.97465887 12.17772 33.5
24 0.907692 1.002825 10.4807 0.99106644 9.185286 33.5
25 0.984127 0.996072 1.21375 1.11754967 13.55747 33.5
26 1.131148 1.166667 3.140097 0.88353414 21.89046 34
27 1.079365 1.008009 6.610946 1.04336043 3.335725 33
28 1.206349 1.223242 1.40029 1.35802469 12.5731 35
29 1.180328 1.101813 6.651945 1.16569525 1.239708 33
30 1.295082 1.197605 7.526719 1.18748254 8.30831 32.5
Average %error - 9.552601 - 11.56931 -
37
Internal Resistance of the Leoch Battery
1.6 75
70
1.4
65
1.2
60
1
Temperature (C)
55
Rint (ohms)
0.8 50
45
0.6
40
0.4 Standard Method
35 Module
0.2 Prototype
30
Temperature
0 25
1 2 3 4 5 6 7 8 9 101112131415161718192021222324252627282930
Trials
From the graph shown in Figure 4.11, there is a huge difference of internal
resistance between trials 1 and 2. That was because the internal resistance in the 1st trial
was taken immediately after charging the battery. When the battery is just charged,
surface charges are formed in the battery. This will cause higher voltage reading on the
battery than in its normal state. Therefore, the internal resistance of the battery was taken
after 4 hours from charging on the 2nd trial and onwards. Nevertheless, with the
exemption of the 1st trial, the graph shows that the internal resistance of the battery
increases in successive uses. Based from the data in the standard method, the internal
resistance of the battery increased by 102% from its original internal resistance obtained
in the 2nd trial with an internal resistance 0.64 ohms to 1.295 ohms taken from 30th trial.
With the standard method as the reference for the internal resistance of the
battery, the percent error of the module and prototype of the study were taken as shown
in Figure 4.12. The formulas used in getting the percent error of the module and
prototype are shown in equation (4.4) and (4.5), respectively.
|R standard−Rmodule|
%error module = x 100 % (4.4)
R standard
38
|R standard−R prototype|
%error prototype = x 100 % (4.5)
R standard
80
70
60
%error (%)
50
Module
40 Prototype
30
20
10
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Trials
Figure 4.12 Percent error of the RINT of battery using the module and prototype
As shown in Figure 4.12, the module’s highest percent error obtained was almost
30%, while the lowest was 1.2%. In average, the percent error of the battery-monitoring
module is 9.55%. As for the prototype of the study, the highest percent error was 85%
while lowest was 0.15% which has the average percent error of 11.57%. Although the
prototype reached a percent error of 85% which was huge, only one of such were
obtained. Considering that the prototype was just placed on a breadboard, this huge error
might be due to loose connection in the prototype’s circuit. Since the next highest percent
error the prototype obtained was 30%, a huge difference between them, the 85% error can
be concluded as an outlier.
Although the average error of the module and prototype is a huge 10% error, one
should take note that the value of the parameters compared to each other was small,
which is around 1 ohm. Considering this, the difference of value of the internal resistance
39
is at most 0.5 ohms, which is a small difference if compared to the load connected in the
battery having a resistance of 16.67 ohms, ideally.
One of the concerns in this study was the discharge curve of the battery. Thus, the
battery monitoring module was used to measure the open circuit voltage of the battery
over time while discharging. The dummy load used in the setup were three 50 ohms in
parallel as shown in Figure 4.13. The battery was discharged until it reached below
10.5V. Using three 50 ohms resistors in parallel to discharge the battery, the expected
discharge time of the battery with the capacity of 5Ah can be determined.
Figure 4.13 Setup for Discharging the Battery with the Module
12V
I T= =0.72 A
50
ohms
3
5 Ah
discharge time IDEALLY = =6.944 hrs =6 hrs 56 mins
0.72 A
Ideally, the expected time for the battery to fully deplete from full charge is 7
hours. However, the losses in discharging the battery should be taken into account. One
method to consider this is to use Peukert’s Law which considers the efficiency factor of a
discharging battery. To apply this, one should only divide the ideal discharge time by 1.3
to 1.5 [30]. For this study, the constant 1.3 was used so the discharge time is practically,
40
6.9444 hrs
discharge time= =5.342hrs =5 hrs 20 mins
1.3
Thirty (30) trials were done in monitoring the battery to get the V OC of the
discharging battery. Shown in the Figure 4.14 the graph of open-circuit voltage of a
discharging battery over time.
Battery-Discharge Curves
13.5 Trial1 Trial2
Trial3 Trial4
13 Trial5 Trial6
Trial7 Trial8
12.5
Open-Circuit Voltage (Voc)
Trial9 Trial10
Trial11 Trial12
12 Trial13 Trial14
Trial15 Trial16
11.5 Trial17 Trial18
Trial19 Trial20
11
Trial21 Trial22
Trial23 Trial24
10.5
Trial25 Trial26
Trial27 Trial28
10
Trial29 Trial30
0:30:00
1:00:00
1:30:00
3:00:00
5:00:00
5:30:00
7:00:00
7:30:00
0:00:00
2:00:00
2:30:00
3:30:00
4:00:00
4:30:00
6:00:00
6:30:00
Duration
The graph shows that the battery discharges at a constant rate until it reaches at a
certain voltage where upon the rate of discharge drastically increases after reaching this
voltage. This means that one should avoid reaching this voltage since the battery drains
faster at this point. The age of the battery affects its discharge time. The graph shows that
the discharge point, which is the voltage where the battery starts to discharge quickly,
increases as the battery ages. This was shown clearly starting trial 20 onwards.
However, the changes of discharge time of every trial is difficult to compare if the
graph in Figure 4.14 is used since they didn’t have the same starting voltage. That is
because, aside from the factors mentioned, the settled voltage, the voltage after resting
the battery from charging, also affects the discharge time of the battery. One example of
it is shown in trial 17 where the battery discharged the longest because its settled voltage
41
is 13V. Thus, the data was modified so that the discharge curve of battery will start at
12V as shown at Figure 4.15.
Trial 15 Trial 16
10.5 Trial 17 Trial 18
Trial 19 Trial 20
10 Trial 21 Trial 22
Trial 23 Trial 24
9.5 Trial 25 Trial 26
Trial 27 Trial 28
0:15:00
1:00:00
1:15:00
2:00:00
2:15:00
3:00:00
0:00:00
0:30:00
0:45:00
1:30:00
1:45:00
2:30:00
2:45:00
3:15:00
Trial 29 Trial 30
Duration
Although the graph only shows the discharge curve of the battery starting from
12V, not the duration from the fully-charged battery, it can be clearly seen that the
discharge time of the battery from trials 1 to 18 is in the range between 2 ¾ hours and 3
hours. The discharge time starts to decrease at trial 19 where it settles in the range
between 1 ½ hours and 1 ¾ hours. The discharge time of thirty trials were shown in Table
4.5.
Table 4.5. Discharge time from full charge and from 12V
Full Discharge Time Discharge Time
Trials Charge from Full Charge from 12V
Voltage (hr:min:sec) (hr:min:sec)
1 12.69 V 5:06:24 2:46:33
2 12.71 V 5:07:06 2:44:51
3 12.72 V 5:17:36 2:47:21
4 12.69 V 5:07:00 3:00:51
5 12.8 V 5:37:24 2:55:54
6 12.85 V 5:50:12 2:50:51
7 12.79 V 5:20:45 2:49:36
8 12.89 V 5:54:36 2:45:18
9 12.83 V 5:38:09 2:56:21
10 12.9 V 6:34:57 2:52:12
11 12.84 V 6:02:24 2:56:30
42
12 12.86 V 5:57:21 2:48:03
13 12.61 V 4:43:09 2:57:12
14 12.65 V 4:52:39 2:54:30
15 12.73 V 5:57:03 2:45:42
16 12.83 V 5:28:09 3:01:18
17 13.09 V 7:08:09 2:58:51
18 13.05 V 6:49:57 2:44:18
19 12.74 V 5:07:21 2:28:51
20 12.93 V 5:49:00 2:27:51
21 12.76 V 5:08:27 2:19:06
22 12.77 V 4:51:51 1:57:39
23 12.67 V 4:06:03 1:45:57
24 12.69 V 4:08:51 1:47:15
25 12.79 V 4:43:39 2:16:12
26 13.09 V 5:24:33 1:41:42
27 13.01 V 4:21:33 1:40:09
28 13.05 V 4:32:36 1:34:51
29 12.94 V 4:16:36 1:38:51
30 12.76 V 4:14:48 1:31:45
The table shows both the discharge time from full charge and from 12V. It was
expected to discharge from full charge for 5hrs and 20min. Many trials had satisfied this,
however, there are some whose discharge time exceeds greatly from the expected time.
Trial 17, for example, which has a discharge time of 7 hours, has the longest discharge
time of battery out of all trials made. The reason for this is because its settled voltage is
13.09V. Although trial 26 has the same settled voltage with trial 17, battery in this trial
has already deteriorated, that’s why the discharge time of it is lesser than in trial 17. The
decrease of duration starts trial 19 where it also shows the increase of discharge point
from this trial onwards. The rate of discharge from the discharge point drastically
increases that’s why one should avoid reaching this voltage. Since the discharge point
increases as the battery ages, the range of voltage where you can operate also became
lesser.
An experiment was done to show the relationship how temperature affects the
battery’s internal resistance. This was done through monitoring the temperature of the
battery while charging. The highest temperature monitored while charging for an hour
was noted. The battery was rested right after for 30 minutes. While the battery was still at
43
its normal body temperature, the internal resistance was taken using the standard method.
Then, the battery was charged until it reached the highest temperature. The internal
resistance was taken at this state for comparison. Figure 4.16 shows the setup for
monitoring the battery while Figure 4.17 shows the temperature of the battery while
charging.
31
30.5
30
Temperature
29.5
Trial1temp
29
Trial2temp
28.5 Trial3temp
28
27.5
0:00:000:07:120:14:240:21:360:28:480:36:000:43:120:50:240:57:361:04:481:12:00
Duration
44
Figure 4.17 Temperature of the Battery while charging
As shown in Figure 4.17, there was a slight change in the temperature of the
battery within an hour of charging. Nevertheless, the internal resistance were still taken
on its rest state and the highest temperature reached while charging.
Table 4.6 Relationship between the Internal Resistance of the Battery to the Temperature
Trial Temperature Internal Resistance
28.5 1.1592
1
29.5 1.1661
29 1.1295
2
30 1.2102
28.5 1.1973
3
29 1.1644
Theoretically the temperature of the battery affects the internal resistance in two
ways. First, decrease the internal resistance by hastening chemical processes allowing the
current to flow easier. The other one is increase the internal resistance because the
molecules of the conductor, cathode, and anode inside the battery are energized and
moves more rapidly in space making it harder for electricity to flow through it, thus
internal resistance increase. Based on the experiment, the more dominant outcome is
having a slight increase in internal resistance of the battery as temperature increase.
45
Chapter 5
Conclusion and Recommendation
5.1 Conclusion
Battery Monitoring is essential in the world today due to increasing of Solar Panel
PV, Wind, and Tidal power system in the industry and community. Energy storage
system is used to store the standby energy produced and generate electricity once it is
needed. Lead-acid batteries are one of the most common energy storage and it is crucial
to understand the battery characteristic over time to know when to conduct battery
maintenance and replacement.
The Internal Resistance of the battery increases as the battery gets old and the
cycle count increases. In the study, there is a correlation between discharge time of the
battery and its internal resistance. As the internal resistance increases, its discharge time
decreases, decreasing the duration of the battery supplying the load in the same setup. In
the study, the internal resistance of the 12V, 5Ah lead-acid battery increased twice from
its original resistance from trial 2 to trial 30. The huge increase of internal resistance
causes clear changes in the battery, especially the decrease of discharge time of the
battery. Throughout the trials, the discharge curve of the battery also shows changes in its
form every time the battery was used. This includes the increase of the discharge rate of
the battery and the increase of discharge point. The battery drains faster after reaching the
discharge point, that’s why the increase of discharge point will result in decrease of the
battery’s discharge time. Mentioned in the related studies that once the battery internal
resistance is +25% from its original internal resistance, the battery was needed to be
replaced. This was achieved starting at trial 20 and the internal resistance increased more
onwards. The study also shows a significant change of discharge curve from trial 20
where the discharge point drastically increases that results in decreasing the discharge
46
time of the lead-acid battery. With these changes, the study proves that changing battery
is needed when the internal resistance increased by 25% from its original value.
The study concluded that the battery’s internal resistance can be used as an aid in
assessing the battery’s state of health. Monitoring the internal resistance of the battery
time to time is a good practice for everyone in checking the health of the battery for
replacement.
5.2 Recommendation
The researcher recommends to monitor the lead-acid battery using the Arduino
system to monitor the open circuit voltage and the battery internal resistance. It is
essential to know when to recharge the battery if the terminal voltage is low, and to
monitor the increasing internal resistance using the data in the SD card. This is needed to
know when to replace the battery if the internal resistance is already high.
As one can see in the data, especially the graph of internal resistance of three
methods, the internal resistance can be seen as fluctuating. This fluctuating data might be
due from the measuring instrument. That is because the data observed in this study has a
very low value, which is around 1 ohm. Thus, it is recommended to have more accurate
measuring device or instrument and if possible, can read more than two decimal places.
The module and the prototype did not satisfy this since these methods passes many steps
to obtain the data; voltage divider and op-amp to decrease the voltage value, ADC to
convert the value before the microcontroller reads and process the converted data, which
results in gaining errors along the process. Taking this in consideration, it is
recommended to conduct this experiment on other lead-acid batteries at the same and
different voltage and ampere-hour (Ah) rating to have a more in-depth conclusion on the
behavior of lead-acid battery in general. While doing so, one should take note the
increase of internal resistance and the changes of the battery’s discharge curve.
47
Appendix A
Arduino Codes of the Module for Battery Monitoring
#include <MCP3428.h>
#include <Wire.h>
MCP3428 MCP(0x6B); // Declaration of MCP3428: A2, A1, A0 bits (011, 0x6B)
float raw_voltage_OC;
float raw_voltage_WL;
#include "RTClib.h"
RTC_DS1307 RTC;
DateTime now;
#include <SPI.h>
#include <SD.h>
File dataFile;
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into port 4 on the Arduino
#define ONE_WIRE_BUS 4
#define TEMPERATURE_PRECISION 9
// Setup a oneWire instance to communicate with any OneWire devices (not just
Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
// arrays to hold device addresses
DeviceAddress thermometer = { 0x28, 0xAA, 0xBF, 0x16, 0x1B, 0x13, 0x02, 0x12 };
float temperature;
void setup()
{
Serial.begin(9600);
sensors.begin();
sensors.setResolution(thermometer, TEMPERATURE_PRECISION);
pinMode(relay_pin, OUTPUT);
digitalWrite(relay_pin, HIGH);
48
delay(100);
Wire.begin();
RTC.begin();
//check or the Real Time Clock is on
if (! RTC.isrunning()) {
Serial.println("RTC is NOT running!");
// following line sets the RTC to the date & time this sketch was compiled
// uncomment it & upload to set the time, date and start run the RTC!
//RTC.adjust(DateTime(__DATE__, __TIME__));
}
//setup SD card
Serial.print("Initializing SD card...");
// see if the SD card is present and can be initialized:
if (!SD.begin(9)) {
Serial.println("Card failed, or not present");
// don't do anything more:
return;
}
Serial.println("Card initialized.");
/*
Main function, calls the temperatures in a loop.
*/
void loop()
{
unsigned long start_time = millis();
read_sensors();
write_data();
while (millis() - start_time < PERIOD) {
// wait for next cycle
}
}
49
void read_sensors()
{
// MCP3428 is configured to channel 1 with 16 bits resolution, one shot mode and gain
defined to 1
// This arrangement of the mentioned parameters can be changed as per convenience
void write_data() {
File dataFile = SD.open("DHTDATA.txt", FILE_WRITE);
if (dataFile) {
now = RTC.now();
dataFile.print(now.year(), DEC);
dataFile.print("/");
dataFile.print(now.month(), DEC);
dataFile.print("/");
dataFile.print(now.day(), DEC);
dataFile.print(",");
dataFile.print(now.hour(), DEC);
dataFile.print(":");
dataFile.print(now.minute(), DEC);
dataFile.print(":");
dataFile.print(now.second(), DEC);
dataFile.print(",");
50
dataFile.print(raw_voltage_OC);
dataFile.print(",");
dataFile.print(raw_voltage_Load);
dataFile.print(",");
dataFile.print(temperature);
dataFile.println(';');
dataFile.close();
Serial.print(now.year(), DEC);
Serial.print("/");
Serial.print(now.month(), DEC);
Serial.print("/");
Serial.print(now.day(), DEC);
Serial.print(",");
Serial.print(now.hour(), DEC);
Serial.print(":");
Serial.println(now.minute(), DEC);
}
}
51
Appendix B
Arduino Codes of the Prototype for Battery Monitoring
/*
ReadAnalogVoltage
Reads an analog input on pin 0, converts it to voltage, and prints the result to the Serial
Monitor.
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and
ground.
http://www.arduino.cc/en/Tutorial/ReadAnalogVoltage
*/
52
Appendix C
53
Data Sheet of Lead Acid Battery 12V 5Ah
Appendix D
54
Data Sheet of Analog-to-Digital Converter (MCP3428)
55
56
57
Appendix E
Data Sheet of Operational Amplifier (LM358D)
58
59
60
Appendix F
Data Sheet of Coulomb Counter (LTC4150)
61
62
Appendix G
Data Sheet of MOSFET Transistor (IRFZ44)
63
64
Documentation
65
Figure 7.3 Data collected in SD card
66
Figure 7.4 Meeting with the Adviser
67
Bibliography
[1] WikiPedia. (2019, March). Retrieved from WikiPedia: [Accesed: 25 March 2019]
https://en.wikipedia.org/wiki/History_of_the_battery?
fbclid=IwAR38qBcpayrTpj7pNrEhWNfRXpf9z-44xMtoWP_d4xDLaogX9U8r2Aol4to .
[4] Tantichanakul, T., Chailapakul, O., & Tantavichet, N. (2013). Influence of fumed
silica and additives on the gel formation and performance of gel valve-regulated lead-
acid batteries. Journal of Industrial and Engineering Chemistry, 2085-2091.
[5] WikiPedia. (2018, October 8). Retrieved from WikiPedia: [Accesed: 3 October 2018]
https://en.wikipedia.org/wiki/Internet_of_things
[7] Murph, D. (2007, March 18). EaglePicher. [Accesed: 5 October 2018] Retrieved
from Engadget: https://www.engadget.com/2007/03/18/eaglepicher-claims-worlds-
smallest-implantable-battery/
[8] Conway, E. (2003, August 28). The Telegraph. [Accesed: 5 October 2018] Retrieved
from The Telegraph: https://www.telegraph.co.uk/finance/2861493/Worlds-biggest-
battery-switched-on-in-Alaska.html
[9] Baghdad Battery. (n.d.). [Accesed: 5 October 2018] Retrieved from WikiPedia:
https://en.wikipedia.org/wiki/Baghdad_Battery
[10] Krystek, L. (1998). The Baghdad Battery. [Accesed: 5 October 2018] Retrieved
from Unmuseum: http://unmuseum.mus.pa.us/bbattery.htm
68
[11] XinZhoua, J. (2017). Battery state of health monitoring by estimation of the number
of cyclable Li-ions . Control Engineering Practice, 51-63.
[13] Křivík, P. (2018). Methods of SoC determination of lead acid battery. Journal of
Energy Storage, 191-195.
[15] A.J.Rand, D., & T.Moseley, P. (2015). Energy Storage with Lead–Acid Batteries.
Electrochemical Energy Storage for Renewable Sources and Grid Balancing, 201-
222.
[16] Křivík, P. (2018). Methods of SoC determination of lead acid battery. Journal of
Energy Storage, 191-195
[18] May, G. J., Davidson, A., & Monahov, B. (2018). Lead batteries for utility energy
storage: A review. Journal of Energy Stirage, 145-157.
[19] Micael Nascimento, M. S. (n.d.). Real time thermal monitoring of lithium batteries
with ?ber sensors and thermocouples: A comparative study .
69
[21] A.J.Rand, D., & T.Moseley, P. (2015). Energy Storage with Lead–Acid Batteries.
Electrochemical Energy Storage for Renewable Sources and Grid Balancing, 201-
222.
[23] Křivíka, P., & Vaculíka, S. (2017). Impedance Methods for SoC Determination of
Lead Acid Battery Cell. The Electrochemical Society.
[24] N, H., V, P., & Sivakumar, D. D. (2018). IOT Based Battery Management System .
International Journal of Applied Engineering Research, 5711-5714.
[25] Arber, G. (n.d.). Predicting Battery Performance Using Internal Cell Resistance.
AlberCorp., 1-8.
[27] Anruari. (2011). Battery University. [Accesed: November 2018] Retrieved from
https://batteryuniversity.com/learn/article/charging_the_lead_acid_battery
https://file.e-disti.com/DJW12-5.0.pdf
[29] Deepti, D. & Ramanarayanan, V. (2006) State of Charge of Lead Acid Battery
https://sci-hub.tw/10.1109/iicpe.2006.46853 47
https://batteryunivers
ity.com/learn/article/bu_503_how_to_calculate_battery_runtime
70
[31] Coulomb Counter/Battery Gas Gauge [Accessed: 11/07/2020] Retrieved from
https://cdn.sparkfun.com/datasheets/BreakoutBoards/LTC4150fc.pdf
71
Gantt Chart
Task Aug Sep Oct Nov Dec Jan Feb Mar Apr May
Picking of Topics
Gathering of Related
Literature
Group Discussion
Choosing of
Materials and
Equipment
Finalization of Paper
for Project Proposal
Submission of the
Project Proposal
Proposal
Purchasing of
Materials
Assembly of Project
Model
Data Gathering
Preparation of Final
Research Paper
Oral Defense
69