Download as pdf or txt
Download as pdf or txt
You are on page 1of 66

INTELLIGENT BATTERY HEALTH MONITOING AND

MANAGEMENT SYSTEM FOR ELECTRIC VEHICLES

A PROJECT REPORT
PHASE II

Submitted by

A. ABINESH (142219106002)

S. BHARATH KUMAR (142219106016)

L.DEENADHAYALAN (142219106018)

S. DINESH (142219106022)

in partial fulfillment for the award of the degree

of

BACHELOR OF ENGINEERING
in

ELECTRONICS AND COMMUNICATION ENGINEERING

SRM VALLIAMMAI ENGINEERING COLLEGE


(An Autonomous Institution)

ANNA UNIVERSITY: CHENNAI 600 025


March 2023
ANNA UNIVERSITY: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report “ Intelligent Battery Health Monitoring and
Management system for Electric Vehicles ” is the bonafide work of

A. ABINESH (142219106002)

S. BHARATH KUMAR (142219106016)

L.DEENADHAYALAN (142219106018)

S. DINESH (142219106022)

who carried out the project work under my supervision.

SIGNATURE SIGNATURE

Dr. KOMALA JAMES M.E., Ph.D. Dr.N.USHA BHANU M.E,Ph.D

HEAD OF THE DEPARTMENT SUPERVISOR


Professor Professor & Head Medical Electronics
Department of Electronics and Department of Electronics and
Communication Engineering Communication Engineering
SRM Valliammai Engineering College SRM Valliammai Engineering College
Kattankulathur-603203 Kattankulathur-603203
Submitted for viva voce held on at SRM Valliammai Engineering

college, Kattankulathur-603203.

INTERNAL EXAMINER EXTERNAL EXAMINER

ii
ACKNOWLEDGEMENT

A project work of this magnitude would have not been possible without the guidance and

co - ordination of many people. Our sincere thanks and profound sense of gratitude to our

respected Founder & Chancellor Dr. T.R.PAARIVENDHAR, Chairman Dr.RAVI

PACHAMUTHU, Vice-Chairman Mrs.PADMAPRIYA RAVI and Correspondent

Ms.R.HARINI for providing us with adequate infrastructure and congenial academic

environment.

We consider it a great privilege to recur our deep sense of gratitude to our Director

Dr. B. CHIDHAMBARARAJAN, Principal Dr. M. MURUGAN and Vice-Principal Dr.

H. Krishnan. We also express our sincere gratitude and profound thanks to the Head of

the Department Dr. KOMALA JAMES who patronized us throughout our project work.

We express our profound thanks and gratefulness to our Project Coordinator Dr. G.

UDHAYAKUMAR Associate Professor, for his valuable guidance and suggestion, which

enabled us to come out successfully with our project work.

Our heartfelt thanks to our supervisor Dr.N.USHA BHANU, Professor & Head

Medical Electronics for her constant support, guidance and motivation in making this

project a successful one. We express our sincere salutation to all other teaching and non-

teaching staffs for their valuable suggestions in this endeavor of us. Last but not the least,

we dedicate this work to our parents and the Almighty who have been with us toovercome

the hard times.

iii
ABSTRACT

Electric Vehicle is becoming popular since the fuel prices becoming more
expensive. Most EV's uses rechargable battery which is Lead acid battery It produces great
advantages in terms of energy saving and environmental protection. An important reason
that limits the application of EV is the safety of existing battery technologies.
Our proposed system monitors and stores parameters that provide an indication
of the Lead Acid battery's voltage, current, temperature sensor and the remaining charge
capacity in a real-time scenario. The information collect from all the associated battery
clients in the system is analyzed.
In order for the system to work, initially, the voltage sensor, Temperature sensor
and current sensor measures the battery’s voltage level, Temperature and the amount of
current consuming by the load. The Readings from sensors of the vehicle are conveyed to
an Node MCU controller for processing.
If the Temperature is greater than 40 Degree Celcius the speaker will startblowing
till the sensor level is not greater than to threshold value.The other conditionsare that if
the voltage sensor value is greater than 12V the charger is turned off and if the voltage is
less than 10V the motor is turned off and the speaker is turned blow until the voltage
returns to optimal level.
The malfunction of the battery status are continuously monitored based onsudden
charge & discharge voltage of battery bank and battery conditions are viewed in the cloud
and mobile application with help of loT module.If any tedious find the battery
automatically motor off.

iv
TABLE OF CONTENTS
CHAPTER No. TITLE PAGE No.
ABSTRACT iv
LIST OF FIGURES viii
LIST OF TABLES v

1 INTRODUCTION
1.1 EXISTING METHOD 10
1.2 OBJECTIVES 11
1.3 SCOPE OF THE PROJECT 12

2 LITERATURE SURVEY 13

3 PROPOSED METHOD
3.1 BLOCK DIAGRAM OF 18
THE PROPOSED SYSTEM
3.2 METHODOLOGY 18
3.3 TEMPERTAURE MODULE FLOW 19
CHART
3.4 VOLTAGE MODULE FLOW 20
CHART
3.5 CURRENT MODULE FLOW 21
CHART
3.6 STATE OF CHARGE 22
3.7 MAP FUNCTION 22
3.8 SYSTEM DESIGN 23
HARDWARE REQUIREMENTS
4 4.1 NODE MCU 25

4.1.1 Esp 32 Architecture 26


4.1.2 Power Jack 27
4.1.3 Digital Inputs 27
4.1.4 Analog Inputs 27
4.1.5 AREF 27
v
4.2 LCD 28
4.2.1 Feature of LCD 30
4.2.2 Registers of LCD 30
4.2.2.1 Command register 30
4.2.2.2 Data register 30
4.2.3 LCD Commands 30
4.3 LITHIUM ION BATTERY 31
4.3.1 Design 32
4.3.2 Electrochemistry 34
4.4 TEMPERATURE SENSOR 35
4.5 VOLTAGE SENSOR 36
4.5.1 Types of voltage sensor 37
4.6 BUZZER 38
4.6.1 Pin diagram 38
4.6.2 Specification 39
4.6.3 Working principal 39
4.6.4 Need of buzzer 39
4.6.5 Classification of buzzer 40
4.6.5.1 Classification 40
according to buzzer
construction
4.6.5.2 Classification 40
according to the way the
buzzer is driven
4.6.5.3 How to distinguish 40
active buzzer from passive
buzzer
4.7 CURRENT SENSOR 41
4.8 RELAY 42
4.9 DC MOTOR 43
4.10 CHARGER 44
5 SOFTWARE REQUIREMENTS
5.1 EMBEDDED C 45
5.2 ARDUINO SOFTWARE 48
5.2.1 Software tools 49
5.2.2 Compilation and Uploading 50
5.2.3 Libraries 51
5.2.4 Serial Monitor 51

vi
5.2.5 Reference 51
5.2.6 Language support 51
5.2.7 Boards 52
5.3 PROTEUS DESIGN SUITE 52
5.3.1 Introduction 52
5.3.2 Why are proteus 53
5.3.3 Getting started wuth proteus 53
5.3.4 Component Selection in 54
Proteus ISIS
5.3.5 Instruments in Proteus ISIS 56
5.4 BLYNK APPLICATION
5.4.1 Blynk Interface 57
5.4.2 Creating Blynk 58
5.4.3 Add widgets to the project 59
5.4.4 Uploading the Firmware 59
5.4.5 Output 60
6 RESULTS AND DISCUSSION
6.1 Result 61
6.2 Simulation Output 62
6.3 Hardware Output 63
7 CONCLUSION 64
7.1 Future Scope 64
REFERENCES 65

CHAPTER NO LIST OF TABLE PG.


NO
6 6.1 Observed Result 61

vii
LIST OF FIGURES

FIGURE NAME
FIGURE No. Page No.

1.1 Existing block Diagram 11

Block Diagram of the Proposed System 18


3.1

3.2 Flowchart for Temperature sensor module 19


3.3 Flowchart for Voltage sensor module 20
3.4 Flowchart for current sensor module 21
3.5 Circuit Diagram 24
4.1 ARDUINO Architecture 26
4.2 LCD 28
4.3 LCD Pin Diagram 29
4.4 Lithium-ion Battery diagram 31
4.5 Electrochemistry Diagram 34
4.6 Temperature sensor diagram 35
4.7 Voltage sensor diagram 36

4.8 Buzzer pin diagram


38
4.9 How to distinguish active from passive 40
buzzer
4.10 Current sensor diagram 41
4.11 Relay diagram 42
4.12 DC Motor diagram 43
4.13 12V Charger diagram 44
5.1 Interface Proteus software 53
5.2 Proteus software section diagram 54
5.3 Proteus software components diagram 55
5.4 Creating New Project 58
5.5 Uploading the firmware 59
5.6 Output of Blynk 60
6.1 Simulation output 62
6.2 Hardware Output 63

viii
CHAPTER 1

INTRODUCTION

Nowadays, electric vehicle (EV) is becoming popular since the fuel prices becoming more
expensive. Due to these scenarios, many vehicles manufacturer looking for alternatives of
energy sources other than gas. The use of electrical energy sources may improve the
environment since there are less pollution. In addition, EV produces great advantages in
terms of energy saving and environmental protection. Most EVs used rechargeable battery
which is Lead acid battery. It is smaller to be compared with lead acid. In fact, it has a
constant power, and energy’s life cycle is 6 to 10 times greater compared with lead acid
battery. Lead acid battery life cycle can be shortened by some reasons such as overcharging
and deep discharges. On the other hand, EV usually has limited range of travelling due to
battery size and body structure. Now, an important reason that limits the application of EV
is the safety of existing battery technology. For example, overcharging battery not only
could significantly shorten the life of the battery, but also cause a serious safety accident
such as fire. Therefore, a battery monitoring system for EV that can notify the user about
battery condition is necessary to prevent the stated problems. Previous battery monitoring
system only monitor and detect the condition of the battery and alarmed the user via battery
indicator inside the vehicle. Dueto the advancement of the design of notification system,
internet of things (IoT) technology can be used to notify the manufacturer and users
regarding the battery status. This can be considered as one of the maintenance supports.

9
1.1 EXISTING METHOD
Reliable battery management is necessary for safety purposes. There are several reasons
that cause battery breakdown such as deterioration of battery and design defects. Manual
battery monitoring system are like normal battery monitoring system which means that it
does not save the data into the database. But only show the data collected in real time.
Therefore, it is essential to remotely monitor battery systems using wireless
technology.There are various battery monitoring system using wireless communication
that have been developed for the industry such as uninterruptible power supply (UPS)
which is important to ensure continuity of power supply for domestic and commercial
during power interruption. Suresh et al. proposed a PLC-based battery health monitoring
system for an UPS using GSM modules and SCADA by providing alert messages when
batteries are in critical condition and room temperature. Sardar et al. also developed a
battery monitoring system for UPS using GSM.
The system could monitor voltage, current and temperature of the battery.Hommalai et al.
developed battery monitoring system using wireless communication for UPS to detect dead
battery cells. There are also several studies related to the development of battery monitoring
system for EV using wireless communication. Dhotre et al. developed an automatic battery
charging and engine control system for EV using GSM module. SMS is sent to the user
when battery health goes below threshold value. Then, user can reply via SMS to auto-start
the engine to charge the battery. Mathew et al. proposed a wireless battery monitoring
system using 2.4GHz radio transmission scheme for EV. The modular design consists of
transmit module (monitors batteries) and controller module (receives batteries status).
Bacquet et al. also developed a battery management system using 2.4GHz radio
transmission for EV.

10
Figure 1.1 : Existing block diagram

As shown in the above figure based on the sensor values, it shows that there are no
automatic monitoring system available to notify the user with regard to the performance
of the battery.

1.2 OBJECTIVES :

To develop a smart Battery management system for Electric vehicles. Collect all the
sensors values by using Arduino and use various sensors and techniques to store
parameters that provide an indication of the Lead acid battery’s voltage, current,
temperature sensor, Soc and the remaining charge capacity in a real-time scenario. To
achievethe simulated result using simulation software.

11
1.3 SCOPE OF THE PROJECT:

The scope of Electric Vehicles is determined by fundamentally the top most cruial factors
drive the road towards sustainable mobility solution . Battery Management is a
performance management framework for monitoring the status of the battery and
determining its health and charge staus.Battery status can be monitored remotely on screen
/ smartphone.

The organisation of this thesis is follows : Chapter 2 covers the Literature survey of the
existing systems, Chapter 3 discuss about the proposed system and the implementation
methodology of the system, Chapter 4 discusses about the hardware and software
description of the project and the Chapter 5 deals with the obtained results and conclusion
of the project.

12
CHAPTER 2

LITERATURE SURVEY

The Literature survey describes about the are papers that are studied and analysed for the
project. The Temperature sensor, Voltage sensor and Current sensor are considered for this
project.Therefore , the corresponding project papers are discussed below.

Mahammad A. Hannan ,et.al “State-of-the-Art and Energy Management System of


Lithium-Ion Batteries in Electric Vehicle Applications”,
2018[ 10.1109/ACCESS.2018.2817655 ]

ABSTRACT : A variety of rechargeable batteries are now available in world markets for
powering electric vehicles (EVs). The lithium-ion (Li-ion) battery is considered the best
among all battery types and cells because of its superior characteristics and performance.
The positive environmental impacts and recycling potential of lithium batteries have
influenced the development of new research for improving Li-ion battery technologies.
However, the cost reduction, safe operation, and mitigation of negative ecological impacts
are now a common concern for advancement. This paper provides a comprehensive study
on the state of the art of Li-ion batteries including the fundamentals,structures, and overall
performance evaluations of different types of lithium batteries. A study on a battery
management system for Li-ion battery storage in EV applications is demonstrated, which
includes a cell condition monitoring, charge, and discharge control, states estimation,
protection and equalization, temperature control and heat management, battery fault
diagnosis, and assessment aimed at enhancing the overall performance of the system
INFERENCE :
In this method, this paper provides a comprehensive study on the state of
lithium ion battery including the fundamentals ,structures ,and overall performance
evaluations of different types of lithium batteries.

13
Radzi Ambar ,et.al.,“IoT-Based Battery Monitoring System for Electric
Vehicle.”,2018[ DOI:10.14419/ijet.v7i4.31.25472 ]

ABSTRACT : This paper describes the application of Internet-of-things (IoT) in


monitoring the performance of electric vehicle battery. It is clear that an electric vehicle
totally depends on the source of energy from a battery. However, the amount of energy
supplied to the vehicle is decreasing gradually that leads to the performance degradation.
This is a major concern for battery manufacture. In this work, the idea of monitoring the
performance of the vehicle using IoT techniques is proposed, so that the monitoring can
be done directly. The proposed IoT-based battery monitoring system is consists of two
major parts i) monitoring device and ii) user interface. Based on experimentalresults, the
system is capable to detect degraded battery performance and sends notification messages
to the user for further action.

INFERENCE :
In this method, the application of Internet-of-things (IoT) in monitoring the
performance of electric vehicle battery.It is clear that an electric vehicle totally depends
on the source of energy from a battery.

14
Quanqing Yu ,et al., “Critical Review on the Battery State of Charge Estimation
Methods for Electric Vehicles”, 2017,[ 10.1109/ACCESS.2017.2780258 ].

ABSTRACT : Battery technology is the bottleneck of the electric vehicles (EVs). It is


important, both in theory and practical application, to do research on the modeling and
state estimation of batteries, which is essential to optimizing energy management,
extending the life cycle, reducing cost, and safeguarding the safe application of batteries
in EVs. However, the batteries, with strong time-variables and nonlinear characteristics,
are further influenced by such random factors such as driving loads, operational
conditions, in the application of EVs. The real-time, accurate estimation of their state is
challenging. The classification of the estimation methodologies for estimating state-of-
charge (SoC) of battery focusing with the estimation method/algorithm, advantages,
drawbacks, and estimation error are systematically and separately discussed. Especially
for the battery packs existing of the inevitable inconsistency in cell capacity, resistance
and voltage, the advanced characterizing monomer selection, and bias correction-based
method has been described and discussed. It will be very helpful for choosing an
appropriate method to develop a reliable and safe battery management system and energy
management strategy of the EVs. Finally, the paper also highlights a number of key factors
and challenges, and presents the possible recommendations for the development of next
generation of smart SoC estimation and battery management systems for electric vehicles
and battery energy storage system.

INFERENCE :
In this system , the highlights of a number of key factors and challenges ,
and presents the possible recommendations for the development of next generation of
smart SoC estimation and battery management system for electric vehicles and battery
energy storage system.

15
Mukhopadh , et.al., “Battery Energy Management Techniques for an Electric
Vehicle Traction System” 2022 , [ DOI :10.1109/ACCESS.2022.3195940 ].

ABSTRACT : This paper presents two battery energy management (BEM) techniques for
an electric vehicle (EV) traction system which incorporates an indirect field-oriented (IFO)
induction motor (IM) drive system. The main objective of the proposed BEM techniques
is to regulate the IM’s speed while minimizing the lithium-ion (Li-ion)battery bank state
of charge (SOC) reduction and state of health (SOH) degradation. In contrast to most of
the existing work, the proposed BEM techniques operate without any prior knowledge of
driving profiles or road information. The first BEM technique incorporates two cascaded
fuzzy logic controllers (CSFLC). In CSFLC, the first fuzzy logic controller (FLC)
generates the reference current signal for regulating the motor speed, while the second
FLC generates a variable gain that limits the current signal variation based on the battery
SOC. The second BEM technique is based on model predictive control (MPC) which
generates the current signal for the speed regulation. It features a fuzzy tuned model
predictive controller (FMPC), where an FLC adjusts the input weight in the MPC objective
function such that the battery SOC is considered while generating the command current
signal. A real-time implementation is carried out on a prototype EV traction system using
the New European Drive Cycle (NEDC) and the Supplemental Federal Test Procedure
(US06) drive cycles. The experimental results validate that the proposed CSFLC and
FMPC BEM techniques exhibit a lower reduction in the battery SOC and SOH
degradation, thus prolonging the battery bank runtime and lifetime as compared to the
conventional FLC and MPC speed regulators.

INFERENCE:

In this method, the two battery energy management (BEM) techniques for
an electric vehicle (EV) traction system which incorporates an indirect field oriented (IFO)
induction motor (IM) drive system.

16
CHAPTER 3

PROPOSED METHOD

The solution to the Battery burning issue is to monitor and as well control the vehicle
function in real time. IN the proposed system, the battery parameters which are responsible
for battery condition such as Voltage, Temperature and current levels are monitored using
various sensors in real-time continuously and. The Readings fromsensors of the vehicle
are conveyed to an Arduino Uno microcontroller for processing. Once data transfer is
successful, the battery monitoring interface will show the updated data of battery status.
When the battery produced low voltage level, a notificationmessage is displayed to the
user using a LCD display which is fit in the dashboard of the vehicle and if the voltage is
high, the relay turns of the charger and an audio signal is produced. Similarly, when
temperature is above the threshold level the motor is turned off and an audio alarm is
given to notify the user. The online battery system not only can measure the voltage of the
batteries but also communicate with the battery monitoring system to get the parameter of
batteries. The use of IoT technology that incorporates together within the monitoring
system can help in improving the preventive maintenance in ensuring the battery quality
and increase the safety of the user which will implementedin the next phase.

17
3.1 BLOCK DIAGRAM OF THE PROPOSED SYSTEM

Figure 3.1 Block Diagram of the Proposed System

3.2 METHODOLOGY:

Figure 3.1 depicts the overview of the proposed system. In order for the system to
work, initially, the voltage sensor, Temperature sensor and current sensor measures the
battery’s voltage level, Temperature and the amount of current consuming by the load. The
Readings from sensors of the vehicle are conveyed to an Node MCU controller for
processing. Once data transfer is successful, the battery monitoring interface will show the
updated data of battery status. When the battery produced low voltage level, a notification
message is displayed to the user and if the voltage is high,the relay turns of the charger
and an audio signal is produced. Similarly, when temperature is above the threshold level
the motor is turned off and an audio alarm is given to notify the user. The online battery
system not only can measure the voltage of the batteries but also communicate with the
battery monitoring system to get the parameter of batteries

18
3.3 TEMPERATURE MODULE FLOWCHART
The working of Temperature sensor module is simple and can be easily understood.This
sensor sense the battery temperature value and sent it to the Node MCU Esp 32 board after
the microcontroller sense the value of the battery temperature and check it to the threshold
value and works respectively.

Figure 3.2 Flowchart for Temperature sensor module

As shown in the above figure 3.2 the readings from the temperature sensor is sent to the
Esp 32 and the microcontroller compares the sensor value with the predefined threshold
value, if it is greater than the threshold value (40 Degree Celcius) the charger and motor is
turned OFF. Buzzer is triggered ON.

19
3.4 VOLTAGE MODULE FLOWCHART

The working of Voltage sensor module is simple and can be easily understood. This
Volatge sensor sense the battery volatge value and sent it to the Node MCU board after
the microcontroller sense the value of the batterys volatge and check it to the volatge
threshold value and works respectively.

Figure 3.3 Flowchart for Voltage sensor module

As shown in the above figure 3.3 the readings from the voltage sensor is sent to the Esp
32 and the microcontroller compares the sensor value with the predefined threshold
value. If the threshold value is greater than 12V the charger is turned off and buzzer is
triggered and if it is less than 11V motor is turned off and buzzer is triggered.

20
3.5 CURRENT MODULE FLOWCHART:
The working of Curerent sensor module is simple and can be easily understood. This
current sensor sense the battery current value and sent it to the Node MCU board after the
microcontroller sense the value of the batterys current and check it to the current threshold
value and works respectively.

Figure 3.4 Flowchart for Current sensor module

As shown in the above figure 3.4 the readings from the current sensor is sent to the Esp
32 and the microcontroller compares the sensor value with the predefined threshold
value. If the threshold value is greater than 700mAh the charger is turned off and buzzer
is triggered and the whole system is turned off.

21
3.6 STATE OF CHARGE:
State of Charge (SOC) refers to the amount of energy that remains in a battery compared to
its full capacity, expressed as a percentage. In other words, SOC indicates how much energy
is left in a battery before it needs to be recharged. For example, if a battery has a capacity of
1000 mAh (milliampere-hours) and its SOC is at 50%, it means that the battery has 500
mAh of energy remaining. Knowing the SOC of a battery is important for effectively
managing its usage and avoiding power interruptions. SOC can be monitored and estimated
using various methods, including voltage measurement, coulomb counting, and impedance
spectroscopy.
Battery manufacturers typically provide a voltage versus SOC lookup table, which can be
used to estimate the SOC based on the battery's voltage. However, this method can be
inaccurate due to voltage fluctuations under different operating conditions.
Coulomb counting involves measuring the amount of current flowing in and out of the
battery and integrating it over time to calculate the SOC. This method is more accurate than
voltage measurement but can be affected by factors such as temperature and battery age.
Impedance spectroscopy involves measuring the impedance of the battery at various
frequencies and using it to estimate the SOC. This method provides accurate results but
requires complex equipment and is not commonly used in everyday battery monitoring.
Overall, monitoring the SOC of a battery is essential for optimizing its performance,
prolonging its lifespan, and ensuring uninterrupted power supply.

3.7 MAP FUNCTION:


To find the state of charge (SOC) of a battery using the map() function in Python, we can
define a function that takes a voltage or current measurement as input and returns the
corresponding SOC value. Then, we can use the map() function to apply this function to
each element of a list of voltage or current measurements and obtain a list of corresponding
SOC values.
((voltage - min_voltage) / (max_voltage - min_voltage)) * 100

For example, let's say we have a list of voltage measurements from a battery, [2.5, 2.8, 3.0,
22
3.2, 3.5], and we want to find the SOC values for each measurement. We can define a
function voltage_to_soc() that takes a voltage measurement as input and returns the
corresponding SOC value using a lookup table or a formula.
We define the voltage_to_soc() function to take a voltage measurement as input and return
the corresponding SOC value using a formula based on the maximum and minimum voltage
values of the battery. We then create a list of voltage measurements voltage_measurements
and use the map() function to apply the voltage_to_soc() function to each element of the list.
Finally, we convert the map() object into a list of SOC values using the list() function and
print the result.
Note that the max_voltage and min_voltage values in the voltage_to_soc() function should
be adjusted based on the specific characteristics of the battery being measured, and a similar
function can be defined for other types of measurements, such as current or temperature.

23
3.8 SYSTEM DESIGN
The implementing step of the proposed system has determined the Temperature, Voltage,
Current sensors are connected to the Battery. Here we used the Proteus Design Suite
Simulation Software for designing the circuit connection for all the components. In this
we are used relay, temperature sensor, voltage sensor, current sensor ,battery ,Arduino
UNO, LCD all the components are connected with microcontroller.

Figure 3.5 Circuit Diagram

As shown in the figure 3.5 the voltage, Temperature and Current sensor are connected to
the Arduino using jumper wires. The sensor measures the parameter such as voltage,
temperature and current. If the values are above or below the threshold values, the Arduino
turns the motor and charger on or off using the relay and the speaker is triggered.

24
CHAPTER 4

HARDWARE REQUIREMENTS

4.1 NODE MCU ESP 32:

Node MCU is an open-source Lua based firmware for the ESP32 and ESP8266 WiFi SOC
from Espressif and uses an on-module flash-based SPIFFS file system. NodeMCU is
implemented in C and is layered on the Espressif ESP-IDF.
The firmware was initially developed as is a companion project to the popular ESP8266-based
NodeMCU development modules, but the project is now community-supported, and the
firmware can now be run on any ESP module.

Support for the new ESP32 WiFi/BlueTooth SOC from Espressif is under way.
NodeMCU ESP32 is a development board based on the ESP32 microcontroller. The ESP32
is a powerful WiFi and Bluetooth-enabled microcontroller that can be used for a wide range
of IoT applications. The NodeMCU ESP32 is designed to make it easy to develop IoT
applications, with built-in WiFi and Bluetooth connectivity, and a wide range of input/output
pins that can be used to interface with sensors and other hardware.
The NodeMCU ESP32 board typically includes a USB port for programming and power, as
well as a microcontroller with built-in WiFi and Bluetooth antennas, GPIO pins for interfacing
with external hardware, and support for various communication protocols such as I2C, SPI,
and UART.
The board can be programmed using the Arduino IDE or other programming environments,
and there are many libraries and resources available online to help get started with developed.

25
4.1.1 ESP 32 ARCHITECTURE

NodeMCU is an open-source firmware and development kit that allows you to build Internet
of Things (IoT) projects using the Lua scripting language. The NodeMCU architecture is
based on the ESP8266 System-on-Chip (SoC), which is a low-cost Wi-Fi microchip with
full TCP/IP stack and microcontroller capabilities.
The NodeMCU board is a small, breadboard-friendly module that integrates the ESP8266
chip, flash memory, and voltage regulators. It features a USB-to-serial converter for
programming and debugging, and exposes GPIO pins for connecting to sensors, actuators,
and other devices.
The NodeMCU firmware provides a high-level API for accessing the hardware resources of
the ESP8266, such as Wi-Fi, GPIO, PWM, ADC, I2C, SPI, and UART. The Lua interpreter
runs on top of the firmware and allows you to write scripts that control the behavior of the
board.
Overall, the NodeMCU architecture is designed to simplify the development of IoT
applications by providing an easy-to-use platform that combines Wi-Fi connectivity,
microcontroller functionality, and scripting capabilities.

Figure 4.1 Esp 32 Architecture

26
4.1.2 POWER JACK

Esp 32 can be power either from the pc through a USB or through external source like
adaptor or a battery. It can operate on a external supply of 5 to 12V. Power can be applied
externally through the pin Vin or by giving voltage reference through the IO Ref pin. The
Esp 32 can be powered via the USB connection or with an external power supply. The
power source is selected automatically. External (non-USB) power can comeeither from
an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging.
The board can operate on an external supply of 5 to 20 volts. If supplied less than five volts
the board may be unstable. If using more than 12V, the voltage regulator may overheat
and damage the board. The recommended range is 5 to 12 volts.

4.1.3 DIGITAL INPUTS

It consists of 14 digital inputs/output pins, each of which provide or take up 40mA current.
Some of them have special functions like pins 0 and 1, which act as Rx and Tx respectively,
for serial communication, pins 2 and 3-which are external interrupts, pins 3,5,6,9,11 which
provides PWM output and pin 13 where LCD is connected.

4.1.4 ANALOG INPUTS


It has 6 analog input/output pins, each providing a resolution of 10 bits.

4.1.5 AREF
It stands for Analog Reference. It is sometimes used to set an external reference voltage
(between 0 and 5 volts)

27
4.2 LCD 16X2

Figure 4.2 LCD 16X2

The term LCD stands for liquid crystal display. It is one kind of electronic display module
used in an extensive range of applications like various circuits & devices like mobile
phones, calculators, computers, TV sets, etc. These displays are mainly preferred for multi-
segment light-emitting diodes and seven segments. The main benefits of using this module
are inexpensive; simply programmable, animations, and there are no limitations for
displaying custom characters, special and even animations, etc.
4.2. LCD 16×2 Pin Diagram
The 16×2 LCD pinout is shown below.
Pin1 (Ground/Source Pin): This is a GND pin of display, used to connect the GND
terminal of the microcontroller unit or power source.
Pin2 (VCC/Source Pin): This is the voltage supply pin of the display, used to connect the
supply pin of the power source.

28
Figure 4.3 LCD 16X2 PIN DIAGRAM

• Pin3 (V0/VEE/Control Pin): This pin regulates the difference of the display, used
to connect a changeable POT that can supply 0 to 5V.
• Pin4 (Register Select/Control Pin): This pin toggles among command or data
register, used to connect a microcontroller unit pin and obtains either 0 or 1(0 =
data mode, and 1 = command mode).
• Pin5 (Read/Write/Control Pin): This pin toggles the display among the read or
writes operation, and it is connected to a microcontroller unit pin to get either 0 or
1 (0 = Write Operation, and 1 = Read Operation).
• Pin 6 (Enable/Control Pin): This pin should be held high to execute Read/Write
process, and it is connected to the microcontroller unit & constantly held high.
• Pins 7-14 (Data Pins): These pins are used to send data to the display. These pins
are connected in two-wire modes like 4-wire mode and 8-wire mode. In 4-wire
mode, only four pins are connected to the microcontroller unit like 0 to 3, whereas
in 8-wire mode, 8-pins are connected to microcontroller unit like 0 to 7.
• Pin15 (+ve pin of the LED): This pin is connected to +5V
• Pin 16 (-ve pin of the LED): This pin is connected to GND.

29
4.2.1 Features of LCD16x2
The features of this LCD mainly include the following.
• The operating voltage of this LCD is 4.7V-5.3V
• It includes two rows where each row can produce 16-characters.
• The utilization of current is 1mA with no backlight
• Every character can be built with a 5×8 pixel box
• The alphanumeric LCDs alphabets & numbers
• Is display can work on two modes like 4-bit & 8-bit
• These are obtainable in Blue & Green Backlight
• It displays a few custom generated characters
4.2.2 Registers of LCD
A 16×2 LCD has two registers like data register and command register. The RS (register
select) is mainly used to change from one register to another. When the
register set is ‘0’, then it is known as command register. Similarly, when the register set
is ‘1’, then it is known as data register.
4.2.2.1 Command Register
The main function of the command register is to store the instructions of command which
are given to the display. So that predefined tasks can be performed such as clearing the
display, initializing, set the cursor place, and display control. Here commands processing
can occur within the register.

4.2.2.2 Data Register


The main function of the data register is to store the information which is to be exhibited
on the LCD screen. Here, the ASCII value of the character is the information which is to
be exhibited on the screen of LCD. Whenever we send the information to LCD, it transmits
to the data register, and then the process will be starting there. When registerset =1, then
the data register will be selected.
4.2.3 16×2 LCD Commands
The commands of LCD 16X2 include the following.
• For Hex Code-01, the LCD command will be the clear LCD screen
30
• For Hex Code-02, the LCD command will be returning home
• For Hex Code-04, the LCD command will be decrement cursor
• For Hex Code-06, the LCD command will be Increment cursor
• For Hex Code-05, the LCD command will be Shift display right
• For Hex Code-07, the LCD command will be Shift display left
• For Hex Code-08, the LCD command will be Display off, cursor off
• For Hex Code-0A, the LCD command will be cursor on and display off
• For Hex Code-0C, the LCD command will be cursor off, display on
• For Hex Code-0E, the LCD command will be cursor blinking, Display on
• For Hex Code-0F, the LCD command will be cursor blinking, Display on
• For Hex Code-10, the LCD command will be Shift cursor position to left
• For Hex Code-14, the LCD command will be Shift cursor position to the
right
• For Hex Code-18, the LCD command will be Shift the entire display to the left
• For Hex Code-1C, the LCD command will be Shift the entire display to
the right
• For Hex Code-80, the LCD command will be Force cursor to the
beginning ( 1st line)
• For Hex Code-C0, the LCD command will be Force cursor to the
beginning ( 2nd line)
• For Hex Code-38, the LCD command will be 2 lines and 5×7 matrix.
4.3 LITHIUM-ION BATTERY :

figure 4.4 lithium-ion battery diagram

31
A Lithium-ion or Li-ion battery is a type of rechargeable battery which uses the
reversible reduction of lithium ions to store energy. It is the predominant battery type used
in portable consumer electronics and electric vehicles. It also sees significant use for grid-
scale energy storage and military and aerospace applications. Compared to other
rechargeable battery technologies, Li-ion batteries have high energy densities, low self-
discharge, and no memory effect (although a small memory effect reported in LFP cells
has been traced to poorly made cells).
Chemistry, performance, cost and safety characteristics vary across types of lithium-ion
batteries. Most commercial Li-ion cells use intercalation compounds as the active
materials. The anode or negative electrode is usually graphite, although silicon-carbon is
also being increasingly used. Cells can be manufactured to prioritize either energy or
power density. Handheld electronics mostly use lithium polymer batteries (with a polymer
gel as electrolyte), a lithium cobalt oxide (LiCoO2) cathode material, and a graphite anode,
which together offer a high energy density. NMC and its derivatives are widely used in the
electrification of transport, oneof the main technologies (combined with renewable energy)
for reducing greenhouse gas emissions from vehicles.
Lithium-ion batteries can be a safety hazard if not properly engineered and manufactured
since cells have flammable electrolytes and if damaged or incorrectly charged, can lead
to explosions and fires. Much development has made progress in manufacturing safe
Lithium-ion batteries batteries.Lithium Ion All Solid State Batteries are being developed
to eliminate the flammable electrolyte. Improperly recycled batteries can create toxic
waste, especially from toxic metals and are at risk of fire. Moreover, both lithium and other
key strategic minerals used in batteries have significant issues at extraction, with lithium
being water intensive in often arid regions and other minerals often being conflict minerals
such as cobalt. Both environmental issues have encouraged some researchers to improve
mineral efficiency and alternatives such as iron-air batteries.
4.3.1 DESIGN
Generally, the negative electrode of a conventional lithium-ion cell is graphite madefrom
carbon. The positive electrode is typically a metal oxide. The electrolyte is a lithium salt
in an organic solvent. The anode and cathode are prevented from shorting by a separator.
The electrochemical roles of the electrodes reverse between anode and

32
cathode, depending on the direction of current flow through the cell. The most common
commercially used anode (negative electrode) is graphite, which in its fully lithiated state
of LiC6 correlates to a maximal capacity of 1339 C/g (372 mAh/g). The positive electrode
is generally one of three materials: a layered oxide (such as lithium cobalt oxide), a
polyanion (such as lithium iron phosphate) or a spinel (such as lithium manganese oxide).
More experimental materials include graphene-containing electrodes, although these
remain far from commercially viable due to their high cost.
Lithium reacts vigorously with water to form lithium hydroxide (LiOH) and hydrogen gas.
Thus, a non-aqueous electrolyte is typically used, and a sealed container rigidly excludes
moisture from the battery pack. The non- aqueous electrolyte is typically a mixture of
organic carbonates such as ethylene carbonate and propylene carbonate containing
complexes of lithium ions.
Ethylene carbonate is essential for making solid electrolyte interphase on the
negative carbon anode, but since it is solid at room temperature, a propylene carbonate
solvent is added. The electrolyte salt is almost always lithium hexafluorophosphate
(LiPF6), which combines good ionic conductivity with chemical and electrochemical
stability. Hexafluorophosphate is essential for passivating the aluminum current collector,
used for the positive electrode (cathode). Titanium tab is ultrasonically welded to the
aluminum current collector. Other salts like lithium perchlorate (LiClO4), lithium
tetrafluoroborate (LiBF4), and lithium bis(trifluoromethanesulfonyl)imide
(LiC2F6NO4S2) are frequently used in research in tab-less coin cells, but are not usable
in larger format cells., often because they are not compatible with the aluminum current
collector. Copper current collector (with a spot-welded nickel tab) is used as the anode
(negative) current collector.

33
4.3.2 ELECTROCHEMISTRY

Figure 4.5 electrochemistry diagram

The reactants in the electrochemical reactions in a lithium-ion cell are materials of anode
and cathode, both of which are compounds containing lithium atoms. During discharge,
an oxidation half-reaction at the anode produces positively charged lithium ions and
negatively charged electrons. The oxidation half- reaction may also produce uncharged
material that remains at the anode.
Lithium ions move through the electrolyte, electrons move through the external circuit,
and then they recombine at the cathode (together with the cathode material) in a reduction
half-reaction. The electrolyte and external circuit provide conductive media for lithium
ions and electrons, respectively, but do not partake in the electrochemical reaction. During
discharge, electrons flow from the negative electrode (anode) towards the positive
electrode (cathode) through the external circuit. The reactions during discharge lower the
chemical potential of the cell, so discharging transfers energy from the cell to wherever
the electric current dissipates its energy, mostly in the external circuit
During charging these reactions and transports go in the opposite direction: electrons move
from the positive electrode to the negative electrode through the external circuit.

34
To charge the cell the external circuit has to provide electric energy. This energy is then
stored as chemical energy in the cell (with some loss, e. g. due to coulombic efficiency
lower than 1).
Both electrodes allow lithium ions to move in and out of their structures with a process
called insertion (intercalation) or extraction (deintercalation), respectively. As the lithium
ions "rock" back and forth between the two electrodes, these batteries are also known as
"rocking-chair batteries" or "swing batteries" (a term given by some European industries).
4.4 TEMPERATURE SENSOR

Figure 4.6 temperature sensor diagram

A temperature sensor is an electronic device that measures the temperature of its


environment and converts the input data into electronic data to record, monitor, or signal
temperature changes. There are many different types of temperature sensors. Some
temperature sensors require direct contact with the physical object that is being monitored
(contact temperature sensors), while others indirectly measure the temperature of an object
(non-contact temperature sensors). Non-contact temperature sensors are usually infrared
(IR) sensors. They remotely detect the IR energy emitted by an object and send a signal to
a calibrated electronic circuit that determines the object's temperature.

35
Non-contact temperature sensors are usually infrared (IR) sensors. They remotely detect
the IR energy emitted by an object and send a signal to a calibrated electronic circuit that

determines the object's temperature.

Among the contact temperature sensors are thermocouples and thermistors. A


thermocouple is comprised of two conductors, each made of a different type of metal,
that are joined at an end to form a junction. When the junction is exposed to heat, a voltage
is generated that directly corresponds to the temperature input. This happens on account
of the phenomena called the thermoelectric effect. Thermocouples are generally
inexpensive, as their design and materials are simple. The other type of contact
temperature sensor is called a thermistor. In thermistors, resistance decreases as
temperature increases. There are two main types of thermistors: Negative Temperature
Coefficient (NTC) and Positive Temperature Coefficient (PTC). Thermistors are more
precise than thermocouples (capable of measuring within 0.05-1.5 degrees Celsius), and
they are made of ceramics or polymers. Resistance Temperature Detectors (RTD) are
essentially the metal counterpart of thermistors, and they are the most precise and
expensive type of temperature sensors. Temperature sensors are used in automobiles,
medical devices, computers, cooking appliances, and other types of machinery.
4.5 VOLTAGE SENSOR

Figure 4.7 Voltage sensor diagram

36
A voltage sensor is a sensor used to calculate and monitor the amount of voltage in an
object. Voltage sensors can determine the AC voltage or DC voltage level. The input of
this sensor is the voltage, whereas the output is the switches, analog voltage signal, a
current signal, or an audible signal. Sensors are devices that can sense or identify and react
to certain types of electrical or optical signals. The implementation of a voltage sensor and
current sensor techniques have become an excellent choice for the conventional current
and voltage measurement methods.

4.5.1 TYPES OF VOLTAGE SENSOR


A voltage sensor can determine, monitor, and measure the supply of voltage. It can
measure the AC level and/or DC voltage level. The input to the voltage sensor is the
voltage itself, and the output can be analog voltage signals, switches, audible signals,
analog current levels, frequency, or even frequency- modulated outputs.
That is, some voltage sensors can provide sine or pulse trains as output, and others can
produce amplitude modulation, pulse width modulation, or frequency modulation outputs.
In voltage sensors, the measurement is based on a voltage divider. Two main types of
voltage sensors are available: capacitive type voltage sensor and resistive type voltage
sensor.
CAPACITIVE VOLTAGE SENSOR:
We know that a capacitor comprises of two conductors (or two plates); between these
plates, a non-conductor is kept. That non-conducting material is termed dielectric. When
an AC voltage is provided across these plates, current will start to pass due to either the
electrons’ attraction or repulsion via the opposite plate’s voltage. The field among the
plates will create a complete AC circuit without any hardware connection. This is how a
capacitor works.Next, we can discuss the voltage division in two capacitors which are in
series. Usually, in series circuits, high voltage will develop across the component with high
impedance. In the case of capacitors, capacitance and impedance (capacitive reactance)
are always inversely proportional.

37
4.6 BUZZER
An audio signaling device like a beeper or buzzer may be electromechanical or
piezoelectric or mechanical type. The main function of this is to convert the signal from
audio to sound.
Generally, it is powered through DC voltage and used in timers, alarm devices, printers,
alarms, computers, etc. Based on the various designs, it can generate different sounds
like alarm, music, bell & siren.
4.6.1 PIN DIAGRAM
The pin configuration of the buzzer is shown in Figurer4.6. It includes two pins namely
positive and negative. The positive terminal of this is represented with the ‘+’ symbol or
a longer terminal.
This terminal is powered through 6Volts whereas the negative terminal is represented with
the ‘-‘symbol or short terminal and it is connected to the GND terminal.

Figure 4.8 Buzzer pin diagram

38
4.6.2 SPECIFICATION

The specifications of the buzzer include the following:

• The frequency range is 3,300Hz

• Operating Temperature ranges from – 20° C to +60°C

• Operating voltage ranges from 3V to 24V DC

• The sound pressure level is 85Dba or 10cm

• The supply current is below 15Ma

4.6.3 WORKING PRINCIPLE

The working principle of a buzzer depends on the theory that, once the voltage is given
across a piezoelectric material, then a pressure difference is produced. A piezo type
includes piezo crystals among two conductors.
Once a potential disparity is given across these crystals, then they thrust one conductor &
drag the additional conductor through their internal property. So this continuous action
will produce a sharp sound signal.
4.6.4 NEED OF BUZZER
A buzzer is an efficient component to include the features of sound in our System or
project. It is an extremely small & solid two-pin device thus it can be simply utilized on
breadboard or PCB. So in most applications, this component is widelyused.
There are two kinds of buzzers commonly available like simple and readymade.
Once a simple type is power-driven then it will generate a beep sound continuously. A
readymade type looks heavier & generates a Beep. Beep. Beep. This sound is because of
the internal oscillating circuit within it.
This buzzer uses a DC power supply that ranges from 4V – 9V. To operate this, a 9V
battery is used but it is suggested to utilize a regulated +5V/+6V DC supply. Generally, it
is connected through a switching circuit to switch ON/OFF the buzzer at the necessary
time interval.

39
4.6.5 CLASSIFICATION OF BUZZER
4.6.5.1 Classification according to buzzer construction
Piezoelectric buzzer: It uses piezoelectric material, which generates electric charge when
the piezoelectric material is deformed by external force.Similarly, the piezoelectric
material deforms when energized. Electromagnetic buzzer: mainly uses the magnetic field
generated by the energized conductor to drive the drum film fixed on the coil by the
magnetic forcegenerated by a fixed magnet and the conducting conductor.
4.6.5.2 Classification according to the way the buzzer is driven
Active buzzer (with drive line): With oscillator inside, it can chime when energized. The
ideal signal is direct current, usually marked as VDC, VDD, etc., which can convert
constant direct current into pulse signal of a certain frequency. Passive Buzzer (External
Drive): There is no oscillator inside. It can not be chirped by DC signal. It must be driven
by 2K~5K square wave because the magnetic circuit is constant.
4.6.5.3 How to distinguish active buzzer from passive buzzer
The height of active buzzer is slightly different from that of passive buzzer. The active
buzzer is usually 9mm high and the passive buzzer is 8mm high. When placing the two
buzzers with their pins facing up, the one with a green circuit board is a passive buzzer,
and the one without a circuit board and sealed with vinyl is an active buzzer.

Figure 4.9 How to distinguish active buzzer from passive buzzer

The height of active buzzer is slightly different from that of passive buzzer asshown in
Figure 4.7. The active buzzer is usually 9mm high and the passive buzzer is 8mm high.
40
When placing the two buzzers with their pins facing up, the one with a green circuit
board is a passive buzzer, and the one without a circuit board and sealed with vinyl is an
active buzzer. Multimeter resistance Rxl test: When the black meter pen contacts the'+'pin
of the buzzer and the red meter pen touches back and forth on the other pin, if it clicks and
the resistance is only 8Ω (or 16Ω), then it is a passive buzzer; connect the'+'pin of the
buzzer with a black pen and touch the red pen back and forth on the other pin. If a
continuous sound is emitted and the resistance is overseveral hundred ohms, then it is a
active buzzer.
The active buzzer can sound continuously by directly connecting the rated power supply
(note on the label); passive buzzers are similar to electromagnetic speakers, and need to be
connected to the audio output circuit to sound.
In addition, the buzzer can also be classified according to other ways:
1. Different packaging methods of buzzer: dip buzzer and SMD buzzer.
2. The current of buzzer is different: DC buzzer and AC buzzer, of which DC
is the most common.
4.7 CURRENT SENSOR:

Figure 4.10 Current Sensor diagram

A current sensor is a device that detects and converts current to an easily measurable output
voltage, which is proportional to the current through the measured path. There are a wide
variety of sensors, and each sensor is suitable for a specific current range and
environmental condition. Among these sensors, a current sensing resistor is the most
commonly used. It can be considered a current-to-voltage converter, where inserting a
41
resistor into the current path, the current is converted to voltage in a linear way. The
technology used by the current sensor is important because different sensors can have
different characteristics for a variety of applications.
The sensed current and the output signal can be:

⚫ Alternating current input

◼ Analog output, which duplicates the wave shape of the sensed current.

Bipolar output, which duplicates the wave shape of the sensed current.
Unipolar output, which is proportional to the average or RMS value of the
sensed current.
Direct current input,
unipolar, with a unipolar output, which duplicates the wave shape of the sensed
current
digital output, which switches when the sensed current exceeds a certain threshold.

4.8 RELAY

Figure 4.11 Relay diagram

A relay is an electrically operated switch. It consists of a set of input terminals for a single
or multiple control signals, and a set of operating contact terminals. The switch may have
any number of contacts in multiple contact forms, such as make contacts, break contacts,
or combinations thereof. Relays are used where it is necessary to controla circuit by an
independent low-power signal, or where several circuits must be
42
controlled by one signal. Relays were first used in long-distance telegraph circuits as signal
repeaters: they refresh the signal coming in from one circuit by transmitting it on another
circuit. Relays were used extensively in telephone exchanges and early computers to
perform logical operations.
4.9 DC MOTOR

Figure 4.12 DC motor diagram

A DC motor is any of a class of rotary electrical motors that converts direct current (DC)
electrical energy into mechanical energy. The most common types rely on the forces
produced by induced magnetic fields due to flowing current in the coil. Nearly all types of
DC motors have some internal mechanism, either electromechanical or electronic, to
periodically change the direction of current in part of the motor.DC motors were the first
form of motors widely used, as they could be powered from existing direct-current lighting
power distribution systems. A DC motor's speed can be controlled over a wide range, using
either a variable supply voltage or by changing the strength of current in its field windings.
Small DC motors are used in tools, toys, and appliances. The universal motor, a
lightweight brushed motor used for portable power tools and appliances can operate on
direct current and alternating current. Larger DC motors are currently used in propulsion
of electric vehicles, elevator and hoists, and in drives for steel rolling mills.

The advent of power electronics has made replacement of DC motors with AC motors
possible in many applications. LEDs without phosphor, while a poorer solution for general
lighting, are the bestsolution for displays, either backlight of LCD, or direct LED based
pixels.

43
4.10 CHARGER

Figure 4.13 12V charger diagram

A 12 volt charger can be had from a low milliamp output (100, 200, 500 milliamps), up
to 90 amps, that will plug into a 115 volt wall outlet (chargers above about 65 amps usually
require a 20 amp circuit, so check). Some of the smaller units are unregulated, and simply
have a fixed voltage output, like the chargers of old. These tend to take longer to charge,
and should be avoided when possible. Smaller amp capacities are appropriate for smaller
batteries, like motorcycle, ATV, etc., or electronic and security type applications in the
1.3to 12 amp hour range. They also can be used for maintenance on larger batteries. A
medium amp output 12 volt charger would be in the range of 20 to 50 amps or so, and be
used for many applications using about 100 amp hours of battery and up, or applications
with a constant amp load (power supply application). Larger units in the 12 volt charger
models are about 55 to 90 amps output. These are used in largeamp hour battery banks,
or applications desiring faster recharge times (possibly at the expense of maximum battery
life). Sometimes the larger units are used where a generator is the AC power source, and
generator run time is a consideration.

44
CHAPTER 5

SOFTWARE REQUIREMENTS

5.1 EMBEDDED C

Embedded C is a set of language extensions for the C Programming Language by the C


standard Committee to address commonality issues that exist between C extensions for
different Embedded system. Historically, embedded C programming requires nonstandard
extensions to the C language in order to support exotic features such as fixed-point
arithmetic, multiple distinct memory blanks, and basic I/O operations.
In 2008, the C Standards Committee extended the C language to address these issues by
providing a common standard for all implementations to adhere to. It includes a number
of features not available in normal C, such as, fixed-point arithmetic, named address
spaces, and basic I/O hardware addressing.
Embedded C uses most of the syntax and semantics of standard C, e.g., main () function,
variable definition, datatype declaration, conditional statements (if, switch, case), loops
(while, for), functions, arrays and strings, structures and union, bit operations, macros, etc.
A Technical Report was published in 2004 and a second revision in 2006.
NECESSITY
During infancy years of microprocessor-based systems, programs were developed using
assemblers and fused into the EPROMs. There used to be no mechanism to find what the
program was doing. LEDs, switches, etc. were used to check for correct execution of the
program. In-circuit Simulators (ICEs), but they were too costly and were not quite reliable
as well. As time progressed, use of microprocessor-specific assembly-only as the
programming language reduced.
As assembly language programs are specific to a processor, assembly language didn’t offer
portability across systems. To overcome this disadvantage, several high-level languages,
including C, came up. Some other languages like PLM, Modula-2, Pascal, etc.also came
but couldn’t find wide acceptance. Amongst those, C got wide acceptance for not only
embedded systems, but also for desktop applications. Even though C might have lost its
sheen as mainstream language for general purpose applications, it still is having a
45
strong-hold in embedded programming. Due to the wide acceptance of C in the embedded
systems, various kinds of support tools like compilers & cross-compilers, ICE,etc. came up
and all this facilitated development of embedded systems using C. Assembly language
seems to be an obvious choice for programming embedded devices. However, use of
assembly language is restricted to developing efficient codes in terms of size and speed.
Also, assembly codes lead to higher software development costs and code portability
is not there. Developing small codes are not much of a problem, but large
programs/projects become increasingly difficult to manage in assembly language. Finding
good assembly programmers has also become difficult nowadays. Hence high- level
languages are preferred for embedded systems programming.
ADVANTAGES
• It is small and simpler to learn, understand, program and debug.
• Compared to assembly language, C code written is more reliable and
scalable, more portable between different platforms.
• C compilers are available for almost all embedded devices in use today,
and there is a large pool of experienced C programmers.
• Unlike assembly, C has advantage of processor-independence and is not
specific to any particular microprocessor/microcontroller or any system. This makes it
convenient for a user to develop programs that can run on most of the systems.
• As C combines functionality of assembly language and features of high- level languages,
C is treated as a ‘middle-level computer language’ or ‘high level assembly language’.
• It is fairly efficient.
• It supports access to I/O and provides ease of management of large embedded projects.
• Java is also used in many embedded systems but Java programs require the Java Virtual
Machine (JVM), which consumes a lot of resources. Hence it is not used for smaller
embedded devices.
• Other High-level programming language like Pascal, FORTRAN also provide some of
the advantages.

46
EMBEDDED SYSTEMS PROGRAMMING
Embedded systems programming is different from developing applications on a desktop
computer. Key characteristics of an embedded system, when compared to PCs, are as
follows:
• Embedded devices have resource constraints (limited ROM, limited RAM,
limited stack space, less processing power)
• Components used in embedded system and PCs are different; embedded systems
typically use smaller, less power consuming components. Embedded systems are more
tied to the hardware.
Two salient features of Embedded Programming are code speed and code size. Code speed
is governed by the processing power, timing constraints, whereas code size is governed by
available program memory and use of programming language. Goal of embedded system
programming is to get maximum features in minimum space and minimum time.
Embedded systems are programmed using different type of languages:
• Machine Code
• Low level language, i.e., assembly
• High level language like C, C++, Java, Ada, etc.
• Application level language like Visual Basic, scripts, Access, etc.
Assembly language maps mnemonic words with the binary machine codes that the
processor uses to code the instructions. Assembly language seems to be an obvious choice
for programming embedded devices. However, use of assembly language isrestricted to
developing efficient codes in terms of size and speed. Also, assembly codes lead to higher
software development costs and code portability is not there. Developing small codes are
not much of a problem, but large programs/projects become increasingly difficult to
manage in assembly language. Finding good assembly programmers has also become
difficult nowadays. Hence high-level languages are preferred for embeddedsystems
programming.
Use of C in embedded systems is driven by following advantages
It is small and reasonably simpler to learn, understand, program and debug.
C Compilers are available for almost all embedded devices in use today, and

47
there is a large pool of experienced C programmers.
Unlike assembly, C has advantage of processor-independence and is not specific
to any particular microprocessor/ microcontroller or any system. This makes it
convenient for a user to develop programs that can run on most of the systems.
As C combines functionality of assembly language and features of high-level languages,
C is treated as a ‘middle-level computer language’ or ‘high level assembly language’
DIFFERENCE BETWEEN C AND EMBEDDED C
Though C and embedded C appear different and are used in different contexts, they have
more similarities than the differences. Most of the constructs are same; the difference lies
in their applications.
C is used for desktop computers, while embedded C is for microcontroller- based
applications. Accordingly, C has the luxury to use resources of a desktop PC likememory,
OS, etc. While programming on desktop systems, we need not bother about memory.
However, embedded C has to use with the limited resources (RAM, ROM, I/O’s) on an
embedded processor. Thus, program code must fit into the available program memory. If
code exceeds the limit, the system is likely to crash.
Compilers for C (ANSI C) typically generate OS dependentexecutables. Embedded C
requires compilers to create files to be downloaded to microcontrollers/microprocessors
where it needs to run. Embedded compilers give access to all resources which is not
provided in compilers for desktop computer applications.
Embedded systems often have the real-time constraints, which is usually not there with
desktop computer applications. Embedded systems often do not have a console, which is
available in case of desktop applications.
So, what basically is different while programming with embedded C is the mindset; for
embedded applications, we need to optimally use the resources, make the program code
efficient, and satisfy real time constraints, if any. All this is done using the basic constructs,
syntaxes, and function libraries of ‘C’.
5.2 ARDUINO SOFTWARE (IDE)

The Arduino Integrated Development Environment or Arduino Software (IDE) contains


a text editor for writing code, a message area, a text console, a toolbar with buttons for

48
common functions and a series of menus. It connects to the Arduino and Genuino
hardware to upload programs and communicate with them.

5.2.1 SOFTWARE TOOLS

• Auto Format

• This formats your code nicely: i.e. indents it so that opening and closing curly braces
line up, and that the statements inside curly braces are indented more.

• Archive Sketch

Archives a copy of the current sketch in .zip format. The archive is placed

in the same directory as the sketch.

• Fix Encoding & Reload

Fixes possible discrepancies between the editor char map encoding and

other operating systems char maps.

• Serial Monitor

Opens the serial monitor window and initiates the exchange of data with

any connected board on the currently selected Port.

• Board

Select the board that you're using. See below for descriptions of the

various boards.

• Port

This menu contains all the serial devices (real or virtual) on your

machine. It should automatically refresh every time you open the top-

level tools menu.

49
⚫ Programmer

For selecting a hardware programmer when programming a board or chip

and not using the onboard USB-serial connection.

⚫ Burn Boot loader

The items in this menu allow you to burn a bootloader onto the

microcontroller on an Arduino board.

5.2.2 COMPILATION AND UPLOADING

Allows you to manage sketches with more than one file (each of which appears in its
own tab). These can be normal Arduino code files (no visible extension), C files (.c
extension), C++ files (.cpp), or header files (.h). Before uploading your sketch, you need
to select the correct items from the Tools > Board and Tools > Port menus. The boards are
described below. Once you've selected the correct serial port and board, press the upload
button in the toolbar or select the Upload item from the File menu. Current Arduino boards
will reset automatically and begin the upload. With older boards (pre- Decimal) that lack
auto-reset, you'll need to press the reset button on the board justbefore starting the
upload. On most boards, you'll see the RX and TX LEDs blink as the sketch is uploaded.
The Arduino Software (IDE) will display a message when the uploadis complete, or show
an error.

When you upload a sketch, you're using the Arduino bootloader, a small program that
has been loaded on to the microcontroller on your board. It allows you to upload code
without using any additional hardware. The bootloader is active for a few seconds when
the board resets; then it starts whichever sketch was most recently uploaded to the
microcontroller. The bootloader will blink the on-board (pin 13) LED when it starts (i.e.
when the board resets).

50
5.2.3 LIBRARIES

Libraries provide extra functionality for use in sketches, e.g. working with hardware or
manipulating data. To use a library in a sketch, select it from the Sketch > Import Library
menu. This will insert one or more #include statements at the top of the sketch and compile
the library with your sketch. Because libraries are uploaded to the board with your sketch,
they increase the amount of space it takes up. If a sketch no longer needs a library, simply
delete its #include statements from the top of your code. There is a list of libraries in the
reference. Some libraries are included with the Arduino software. Others can be
downloaded from a variety of sources or through the Library Manager. Starting with
version 1.0.5 of the IDE, you do can import a library from a zip file and use it in an open
sketch. See these instructions for installing a third-party library.

5.2.4 SERIAL MONITOR

It Displays serial data being sent from the Arduino or Genuino board (USB or serial board).
To send data to the board, enter text and click on the "send" button or press enter. Choose
the baud rate from the drop-down that matches the rate passed to Serial, begin in your
sketch. Note that on Windows, Mac or Linux, the Arduino or Genuino board will reset
(rerun your sketch execution to the beginning) when you connect with the serial monitor.
You can also talk to the board from Processing, Flash, MaxMSP, etc.,

5.2.5 REFERENCES

Some preferences can be set in the preferences dialog (found under the Arduino menu on
the Mac, or File on Windows and Linux). The rest can be found in the preferences file,
whose location is shown in the preference dialog.

5.2.6 LANGUAGE SUPPORT

Since version 1.0.1, the Arduino Software (IDE) has been translated into 30+ different
languages. By default, the IDE loads in the language selected by your operating system.
If you would like to change the language manually, start the Arduino Software (IDE) and
open the Preferences window. Next to the Editor Language there is a dropdown menu of
51
currently supported languages. Select your preferred language from the menu, and restart
the software to use the selected language. If your operating system language is not
supported, the Arduino Software (IDE) will default to English. You can return thesoftware
to its default setting of selecting its language based on your operating system by selecting
System Default from the Editor Language drop-down. This setting will take effect when
you restart the Arduino Software (IDE). Similarly, after changing your operating system's
settings, you must restart the Arduino Software (IDE) to update it to the new default
language.

5.2.7 BOARDS

The board selection has two effects: it sets the parameters (e.g. CPU speed and baud rate)
used when compiling and uploading sketches; and sets and the file and fuse settings used
by the burn boot loader command. Some of the board definitions differ only in the latter,
so even if you've been uploading successfullywith a particular selection, you'll want to
check it before burning the boot loader.You can find a comparison table between the
various boards here.

Arduino Software (IDE) includes the built-in support for the boards in the following list,
all based on the AVR Core. The Boards included in the standard installation allows to add
support for the growing number of new boards based on different cores like Arduino Due,
Arduino Zero, Edison, Galileo and so on.

5.3 PROTEUS DESIGN SUITE 8.9

5.3.1 Introduction to Proteus ISIS

◼ Proteus Design Suite (designed by Labcenter Electronics Ltd.) is a software tool


set, mainly used for creating schematics, simulating Electronics & Embedded
Circuits and designing PCB Layouts.

◼ Proteus ISIS is used by Engineering students & professionals to create schematics


&

◼ simulations of different electronic circuits.

52
◼ Proteus ARES is used for designing PCB Layouts of electronic circuits.

◼ It's available in four languages i.e. English, Chinese, Spanish & French

5.3.2 Why use Proteus ?

⚫ Proteus is quite lenient in circuit designing and it works on ideal conditions i.e. if you
don't add pull up resistors in Proteus simulation, then it won't give garbage value.

⚫ Proteus is also used for PCB designing, we use Proteus ARES for that. ( We will
discuss it in upcoming lectures )

⚫ Proteus is also used for designing/testing programming codes for different


Microcontrollers i.e. Arduino, PIC Microcontroller, 8051 etc.

⚫ In Embedded projects, we need to design a programming code for Microcontrollers.

5.3.3 Getting Started With Proteus

You can download Proteus software from it's official website and you should also read
How to Download & Install Proteus software:

⚫ Click on Proteus ISIS and it will open up as shown in below image.

Figure 5.1 interface of proteus software

As you can see in above figure that we have a lot of icons in Proteus software, so let's
first understand these sections one by one.

53
In the below image, I have divided the Proteus font-end in four sections:
Section 1 is a toolbar which you would have seen on many simulation software, it has
simple functionalities i.e. first icon to create a new layout, second one to open an existing
layout, next one is to save layout, then there comes few zooming options and few other
tools which we will discuss in coming tutorials.
Section 2 has two buttons. P is used to open the components list and E is used for
editing purposes, like you want to edit the properties of any component then simply
click on that component and then click on E and it will open the properties of that
component and you can easily edit it.
Section 3 has different tools, used for designing circuits, we will discuss them in detail,
at the end of today’s tutorial.

Section 4 is the remote control section of Proteus, as it contains four buttons i.e. Play,
Step, Pause & Stop. In order to run the simulation, we have to click on this play button.

Figure 5.2 Proteus software section diagram

54
5.3.4 Component Selection in Proteus ISIS

• As shown in below image, click on the icon that says Click # 1, it’s a Component

Mode Icon.

• After that click on P button and a new window will open up named Pick Devices
• In this new window there’s a textbox on which Keyword is written, this text box is
used for the component search.
• Proteus database has unlimited components in it so now in order to get your desired
component, you have to search for it as I did.

Figure 5.3 Proteus software Component diagram

• I have searched for PIC16F877A and Proteus provided me that component along with
its preview in top right corner and PCB package ( if available ).Unfortunately, my Proteus
doesn’t have the PCB preview of PIC16F877A that’s why it’s blank.
• In order to add the component in Proteus workspace, either double click on it or click on
the OK button.
5.3.5 Instruments in Proteus ISIS
• There are few measuring instruments available in Proteus, which you can open by
clicking the Instruments Icon, as shown in figure on right side.
• First one is oscilloscope, we use it for viewing the behavior of different signals

55
generated. Another important instrument is Virtual Terminal, it is shown on the fourth
number. This Virtual Terminal is used for checking data coming through Serial Port.
• Then there’s Signal Generator, it is used to generate signal like sine wave of desired
frequency.
• We also have Voltmeter & Ammeter for both AC & DC.
• We will discuss them in detail in our coming lectures
• As you can see in figure on right side, Icon A is called Graph mode, used to create graphs
of voltage and current. It has different style of graphs.
• Icon B and C are voltage and current probes respectively. Suppose you have designed
some circuit in Proteus and you want to check the value of voltage at any point in the
circuit. In order to do so, simply select this voltage probe and place it there and when you
run your circuit, the probe will show the value of voltage above it and same for current
probe.
• Icon D is used when we want to design our own component in Proteus.
• Icon E is a simple text editor, used for placing labels, warning or components names etc.

56
5.4 BLYNK APPLICATION:

Blynk is a mobile application that allows users to remotely control various Internet of
Things (IoT) devices using a smartphone or tablet. It provides a simple and intuitive
interface for creating custom apps that can communicate with hardware such as
microcontrollers, sensors, and actuators.

With Blynk, users can design their own interfaces by dragging and dropping widgets onto
a mobile device screen. These widgets can include buttons, sliders, graphs, gauges, and
more, and can be customized with different colors, fonts, and icons.

Blynk also supports a wide range of communication protocols, including Wi-Fi, Bluetooth,
Ethernet, and USB. This means that users can connect their IoT devices to the internet and
control them from anywhere in the world using their Blynk app.

Overall, Blynk is a powerful tool for anyone interested in IoT and home automation. Its
easy-to-use interface and wide range of features make it a popular choice for hobbyists,
students, and professionals alike.

5.4.1 BLYNK INTERFACE:

The Blynk interface is designed to be user-friendly and intuitive, allowing users to quickly
and easily create custom apps for their IoT devices. Here are some of the key components
of the Blynk interface:

Widget Palette: The Widget Palette is where users can select from a variety of widgets to
add to their app, such as buttons, sliders, graphs, and gauges. Each widget can be
customized with different colors, fonts, and icons.

Device Selector: The Device Selector allows users to choose which device they want to
control with their app. Blynk supports a wide range of devices, including Arduino,
Raspberry Pi, and ESP8266.

Virtual Pins: Virtual Pins are a key feature of Blynk, allowing users tothat users can
control multiple devices with a single app, or create complex interactions between different
devices.

57
App Preview: The App Preview shows users what their app will look like on a mobile
device. Users can preview their app as they build it, making it easy to see how changes will
affect the final product.

Project Settings: Project Settings allow users to configure various options for their app,
such as the communication protocol and authentication method. Users can also share their
app with others by generating a QR code or sharing a link.

Overall, the Blynk interface is designed to make it easy for users to create custom apps for
their IoT devices, without needing to have extensive programming knowledge or
experience.

5.4.2 CREATING BLYNK


Click the “Create New Project” in the app to create a new Blynk app. Give it any name.
Blynk works with hundreds of hardware models and connection types. Select the Hardware
type. After this, select connection type. In this project we have select WiFi connectivity.

Figure 5.4 : Creating New project

58
5.4.3 ADD WIDGETS TO THE PROJECT:
Then you’ll be presented with a blank new project. To open the widget box, click in the project
window to open.We are selecting a button to control Led connected with NodeMCU.

1. Click on Button.

2. Give name to Button say led.

3. Under OUTPUT tab- Click pin and select the pin to which led is connected to
NodeMCU, here it is digital pin 2, hence select digital and under pin D2. And
Click continue.

5.4.4 UPLOADING THE FIRMWARE:

Now that your Blynk project is set-up, open Arduino and navigate to the ESP8266_Standalone
example in the File > Examples > Blynk > Boards_WiFi> ESP8266_Standalone menu.

Figure 5.5 : Uploading the firmware

59
5.4.5 OUTPUT:

Figure 5.6 : Output of Blynk

Figure 5.6 shows the output obtained in the blynk application.It dispalys the
temperature,current,voltage and State of charge of the battery.

60
CHAPTER 6

RESULTS AND DISCUSSION

6.1 RESULTS:

The voltage, current and temperature sensors are used to sense the corresponding
parameters from the EV vehicles battery. The data is then sent to the Arduino, based on
the received data corresponding action is taken. If the reading is less than the threshold
value, the buzzer is triggered and motor is turned off.
The system is used to monitor the EV vehicles battery in real time and prevent burning
of the battery

PARAMETERS VALUE MOTOR SPEAKER CHARGER

TEMPERATURE If > 40 OFF ON OFF

VOLTAGE If > 12 ON ON OFF

VOLTAGE If < 10 OFF ON ON

TABLE : 6.1 - Observed Results

As shown in the above table 6.1, the condition implemented in this program are as follows
:
1. If the Temperature is greater than 40 Degree Celcius the speaker will start blowing till
the sensor level is not greater than to threshold value.
2. The other conditions are that if the voltage sensor value is greater than 12V the charger
is turned off and if the voltage is less than 10V the motor is turned off and the speaker is
turned blow until the voltage returns to optimal level.

61
6.2 SIMULATION OUTPUT

Figure 6.1 - Simulation output

Figure 6.1 shows the implementation of the circuit simulation setup.The tempertaure and
voltage is measured by the required sensors and if less than the threshold value , the
equivalent process will be run .

62
6.4 HARDWARE OUTPUT :

Figure 6.2 – Hardware output

The system has shown promising results in terms of accuracy, efficiency, and effectiveness.
The proposed system has the potential to significantly improve the safety, performance, and
lifespan of electric vehicle batteries, making electric vehicles more reliable and attractive to
consumers. Figure 6.2 shows the hardware implementation of the proposed system.

63
CHAPTER 7

CONCLUSION

The project described the design and development of an IoT-based battery monitoring
system for electric vehicle to ensure the battery performance degradation and monitoring.
The objective is to proof that the concept of the idea can be realized. The development of
the system consists simulation of the proposed project using proteus tool. The
system is capable to show battery condition such as voltage, temperature and current via
sensors and monitor the changes in the threshold levels of the EV vehicle battery. Based
on the changes the microcontroller can turn on or off the motor and the charger. Further
modification can be done to improve the system by adding more functions into the system.
The system can be used in smartphones by developing smartphone application that can
help user to monitor battery and as a battery degradation reminder.

7.1 FUTURE SCOPE


The future extend of the project is to use an advanced sensor to increase the efficiency by
employing wireless sensor networks to guarantee high localization accuracy, minimum
cost, and low power consumption for future works.

64
REFERENCES

1. Mahammad a. Hannan (senior member, ieee),md. Murshadul Hoque “state-of-the-art


and energy management system of lithium-ion batteries in electric vehicle applications:
Issues and recommendations” Ieee trans 10.1109/access.2018.2817655,2018.

2. Mohd Helmy Abd wahab, nur Imanina Mohamad Anuar,Radzi Ambar “Iot-based
battery monitoring system for electric vehicle” Doi:10.14419/ijet.v7i4.31.25472,2018.

3. Rui xiong , (senior member, ieee), jiayi cao, quanqing yu “critical review on the battery
state of charge estimation methods for electric vehicles”
10.1109/access.2017.2780258,2018.

4.Ahmed sayed abdelaal , shayok mukhopadhyay “ battery energy mnagement techniques


for an electric vehicle traction system”,Doi :10.1109/access.2022.3195940,2022 .

65
58

You might also like