Final Report
Final Report
INTERNET OF THINGS(IOT)
A PROJECT REPORT
Submitted by
of
BACHELOR OF ENGINEERING
IN
NOV 2023
BONAFIDE CERTIFICATE
SIGNATURE SIGNATURE
Dr. V GEETHA Dr. T.R.SUMITHIRA
HEAD OF THE DEPARTMENT SUPERVISOR
Professor and Head Assistant Professor
Department of Electrical and Electronics Department of Electrical and
Engineering Electronics Engineering
GOVERNMENT COLLEGE OF GOVERNMENT
ENGINEERING SALEM-11 COLLEGE OF
ENGINEERING
SALEM-11
ABSTRACT
ii
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 experimental results,
the system is capable to detect degraded battery performance and sends
notification messages to the user for further action.
ACKNOWLEDGEMENT
iii
We would like to express our sincere thanks to our Principal
Dr.R.VIJAYAN Ph.D., for forwarding us to do our project and offering adequate
duration to complete our project.
I feel privileged to express my grateful thanks and gratitude to
Dr. V. GEETHA M.E., Ph.D., Head of the Department for Electrical and Electronics
Engineering, for his precise and inspiring guidance, valuable and generous
suggestions for this project.
We express our heartfelt and sincere thanks to our project guide
Dr. T.R. SUMITHIRA, Associate Professor, Department of Electrical and
Electronics Engineering for his kind guidance and encouragement during this
project. She contributed to a measure in surmounting all hardships; I faced during the
project work. Her tolerance in dealing the problems and encouragement were
constant source of inspiration
We are also expressing our indebt thanks to our teaching and non-teaching
faculties of mechanical engineering department, Government College of engineering,
Salem.
KISHORE K - 2041019
NITHISH S R - 2041024
SUBRAMANI K -
61772141T315
iv
TABLE OF CONTENTS
CHAPTER PAGE
NO TITLE NO
ABSTRACT iii
TABLE OF CONTENTS v
LIST OF TABLES ix
LIST OF FIGURES x
LIST OF ABBREVIATIONS xi
1 INTRODUCTION 1
1.1 GENERAL 1
1.2 INTRODUCTION 1
1.3 BATTERY 3
1.4 BATTERY MANAGEMENT SYSTEM 4
1.5 INTRODUCTION TO EMBEDDED SYSTEMS 5
1.6 EMBEDDED SYSTEM 6
1.7 EMBEDDED C 6
1.8 SIGNIFICANCE OF THE PROJECT 7
2 LITERATURE REVIEW 8
2.1 GENERAL 8
2.2 LITERATURE SURVEY 8
3 OVERVIEW OF PROPOSED SOLUTION 12
3.1 GENERAL 12
3.2 PROBLEM STATEMENT 12
3.3 OBJECTIVE 12
3.4 EXISTING METHODS 13
3.5 PROPOSED SOLUTION 13
3.6 BLOCK DIAGRAM OF PROPOSED SYSTEM 14
3.7 INNOVATION 15
4 HARDWARE REQUIREMENTS 16
v
4.1 GENERAL 16
4.2 ESP 8266(NODE MCU) 16
4.2.1 About ESP 8266 16
4.2.2 Specifications 17
4.2.3 Pin Diagram and Explanation 18
4.3 TEMPERATURE SENSOR 22
4.3.1 General 22
4.3.2 Types of temperature sensor 22
4.3.2.1 Thermocouples 23
4.3.2.2 RTD (Resistance Temperature Detector) 24
4.3.2.3 Thermistor 26
4.3.3 DHT Temperature and Humidity Sensor 30
4.3.3.1 Pin Configuration 30
4.3.3.2 DHT11 Sensor Specifications 30
4.4 BREAD BOARD 32
4.5 JUMPER WIRES 33
4.6 PRESSURE SENSOR(BMP180) 35
vi
4.9.1 Specifications of Rechargeable battery 44
4.10 TP4056 CHARGING MODULE 46
4.10.1 Pin details of TP4056 Charging Module 46
5 SOFTWARE REQUIREMENTS 49
5.1 GENERAL 49
5.2 ARDUINO IDE 49
5.2.1 About ARDUINO IDE 49
5.2.2 Setup( ) Block 50
5.2.3 Loop( ) Block 50
5.2.4 List of Icons and Explanation 51
5.3 EMBEDDED C 51
5.3.1 Introduction to Embedded Systems 52
5.3.2 Embedded Systems Programming 53
5.3.3 Use of C in Embedded Systems 54
6 APPENDICES 56
6.1 GENERAL 56
6.2 SOURCE CODE FOR MICROCONTROLLER 56
7 RESULT 62
7.1 GENERAL 62
7.2 RESULT 62
8 CONCLUSION AND FUTURE SCOPE 64
8.1 GENERAL 64
8.2 CONCLUSION 64
REFERENCES 65
APPRECIATIONS 67
vii
LIST OF TABLES
TABLE PAGE NO
NO TABLE DESCRIPTION
viii
ix
LIST OF FIGURES
FIGURE PAGE
FIGURE DESCRIPTION
NO NO
3.1 Block Diagram of Proposed Solution 14
4.1 Arduino UNO Board 16
4.2 Pin Diagram of Arduino UNO 18
4.3 Pulse width Modulation in Arduino 19
4.4 Thermocouple construction 23
4.5 RTD 24
4.6 Thermistor 26
4.7 Semiconductor based Temperature sensor 28
4.8 Infrared temperature sensor 29
4.9 Thermometer 30
4.10 DS18B20 and its pinout diagram 31
4.11 Internal structure of DS18B20 32
4.12 Bread Board 34
4.13 Jumper Wire 35
4.14 L298N Module and Pinout 37
4.15 L298N Parts 38
4.16 Internal Circuit Diagram of L298N 39
4.17 Piezoelectric Buzzer 40
4.18 LED Strip 43
4.19 DC Motor 45
4.20 Amptek AT12-1.312V, 1.3AH Battery 46
4.21 LCD Display 47
4.22 Pin Diagram of LCD 48
5.1 Arduino IDE 51
7.1 Demo project in off mode 64
7.2 Demo project in on mode 64
x
LIST OF ABBREVIATIONS
AC Alternating Current
BMS Battery Management System
BTMS Battery Thermal Management System
CD Compact Disc
CPU Central Processing Unit
DC Direct Current
EV Electric Vehicle
I2C Inter-Integrated Circuit
ICSP In Circuit Serial Programming
IDE Integrated Development Environment
IOT Internet Of Things
KB Kilo Byte
LCD Liquid Crystal Display
LED Light Emitting Diode
NTC Negative Temperature Coefficient
PC Personal Computer
PTC Positive Temperature Coefficient
xi
CHAPTER 1
1. INTRODUCTION
1.1 GENERAL
Now a day’s battery Powered Vehicles are gaining popularity, this is mainly
because of its environment friendly nature. These vehicles are called Electric Vehicle
or in short EV. A lot of research is being done in Electric vehicle to make them reality
and safe to be used in real world situations. A very important part and also called
heart of an electrical vehicle is Battery Management System (BMS). Battery
Management System is the central unit used to monitor different aspects of battery
that is being used in electric vehicle or any electric system like SOC, Temperature,
Voltage and current ranting and many more. This project is based on monitoring
temperature of electric vehicle and implementing corrective measures to maintain
battery temperature.
1.2 INTRODUCTION
Battery Thermal Management System (BTMS) is a subunit of battery
management system that is used to monitor and maintain temperature of batteries so
that life of batteries can be improves and reduce risk of burning of battery and
overheating of system that can damage EVs and can put human life in danger, BTSM
is being researched thoroughly and we have come a long way but still there is a lot to
achieve in this field. Battery thermal management system can regulate the
temperature of battery system either by using air as coolant or cooling liquid as
coolant. Method using cooling liquid is more efficient and can be used to cool or heat
the battery if it is required considering environment in which system is being used.
The search for alternative ways to replace the generation of electric energy that
comes from the use of non-renewable sources is very important for the current
situation of the electric sector. Seeking to generate energy through renewable sources,
various devices capable of converting other types of energy into electric energy have
1
been developed. For example, solar panels that transform solar energy into electric
energy or wind turbines to transform kinetic energy from wind into electric energy.
These devices need to store the generated energy because wind and sunshine are not
always available. Additionally, these sources of energy vary in different timescales,
from some seconds to hours and days. In this way, storing energy becomes
indispensable to overcome the intermittency behavior of non-renewable sources. A
way to store electrical energy is through the use of batteries. A battery is a set of cells
connected in series. These cells can be manufactured in various combinations of
materials. Some examples of materials used for the construction of these cells are
nickel-cadmium (NiCd), Lithium-ion (Li-ion), Lithium polymer (Li-ion polymer),
lead acid (Pb) and Sodium-Sulphur (NaS).
The battery’s temperature, voltage, current and state of charge (SoC) are the
most common parameters that are normally monitored. Monitoring each battery in the
battery bank ensures the battery system operating levels and conditions remains
optimal. And the battery should provide a power without interrupting the device
operations of the system in the absence of ac input power. In order to provide the
power for the systems in the absence of ac input, the battery should be in good
condition to provide the sufficient amount of power to the devices without
interruption. In order to know the condition of battery, it does require monitoring
2
each battery in the battery bank periodically in real time. The main goal of this
system is to inform the users regarding the present status or condition of individual
battery in the battery bank periodically and sends the alert information to authorized
person through IoT module. To know the present status of battery some important
parameters of the battery should be measure in regular interval. The important
parameters are terminal voltage, load current, capacity, discharge current and room
temperature of each battery.
1.3 BATTERY
12V 1.3 Ah Rechargeable Lead Acid Battery is normally use for robots in
competition. Wired or Wireless Robots runs for a long time with high speed with this
type of battery. Seal Lead Acid (SLA) Rechargeable battery is the most common
general-purpose battery. Low cost, robust and less maintenance required are the
advantages of SLA. But it is considered heavy weight for certain robotic application.
To charge SLA batteries, you can use any general DC power supply as long as it
provides the correct voltage to your battery.
Features:
Rechargeable
Recyclable
No Memory Effect
Able to use for most of the 12V controllers, motors or any other appliances
Specification:
Voltage: 3.7V
Capacity: 2500mAh
Power:7.4W
Weight: 0.450kg
3
1.4 BATTERY MANAGEMENT SYSTEM
4
In and Embedded system there is only one application software that is typically burn
into ROM. An x86PC Contain or it’s connected to various Embedded Products such
as keyboard, printer, modem, Disc controller, Sound card, CD-ROM Driver, Mouse
& so on. Each one of these peripherals as a microcontroller inside it that performs
only one task. For example, inside every mouse there is microcontroller to perform
the task of finding the mouse position and sending it to PC.
One of the most critical needs of the embedded system is to decrease power
consumptions and space. This can be achieved by integrating more functions into the
CPU chips. All the embedded processors based on the x86 and 680x0 have low power
consumptions in additions to some forms of I/O, Com port & ROM all on a single
chip. In higher performance Embedded system, the trend is to integrate more & more
function on the CPU chip & let the designer decide which feature he/she wants to us.
5
computer, such as a PC, an embedded system performs predefined task’s usually with
very specific tasks design engineers can optimize it reducing the size and cost of the
product. Embedded systems are often mass produced, so the cost savings may be
multiplied by millions of items.
1.7 EMBEDDED C
This device that is adapted for placement on (or in thermal contact with) a
surface of an operating unit of equipment, machine, or the like, for the purpose of
raising a visible, tabular, warning flag when the operating machine unit is
6
experiencing overheating. The up-standing warning flag is sized and located to
inform nearby operating personnel that the operating unit is in danger of being
damaged by its overheated condition. Advantages of Microcontroller based Overheat
detector using Temperature sensor with Buzzer indication. This project is easy to use.
CHAPTER 2
2. LITERATURE REVIEW
2.1 GENERAL
The following journal papers has been reviewed and the technology used, pros
and cons are inferred.
7
Temperature sensing in electric motors is an important task to ensure
component protection against excessive heat while maximizing the power and torque
capabilities. In order to optimize the dynamic performance limits of a motor during
online operation, important motor temperatures must be known in real time. Since
temperature measurements are associated with costs and integration efforts,
modelbased estimation methods became highly relevant. In recent years, many
promising contributions have been made to this field leading to a vast literature basis.
This paper organizes the literary landscape and gives a bird's-eye overview of the
three most important estimation classes: Indirect methods, which track temperature-
sensitive electrical motor parameters, and direct methods, namely lumped-parameter
thermal networks as well as supervised machine learning.
5. Xinghui Zhang, Zhao Li, Lingai Luo, Yilin Fan and Zhengyu Du, 'A review on
thermal management of lithium-ion batteries for electric vehicles', Energy,
Volume 238, Part A, 1 January 2022, Page 121652, 2021.
9
6. F. H. Mohd Helmy Abd Wahab, "IoT-Based Battery Monitoring System for
Electric Vehicle," International Journal of Engineering & Technology, 2018.
3.1 GENERAL
Security and safety threats are major issues in today’s world. In such a case,
consider a few scenarios like,
• Electrical energy is not 100% converted to power, some energy is lost in the form
of heat so that the motor temperature rise affects the operating time limit and
motor life.
• The temperature of the battery pack will increase in case of internal Short Circuit
this can occur when the battery got a severe shock, so that the battery will have a
high current discharge and will heat up.
10
• Failure of charge controller leads to over-charging and over-discharging of the
battery pack and ends in temperature rise.
• Due to the temperature rise (over heating) of motor and battery in EV’s causes
great damage to the windings of the motor & damage to the battery pack and
electric vehicle as well. Finally leads to burning of EV.
3.3 OBJECTIVE
The aim of this project is thus to describe the designed system. In the designed system,
current and temperature sensors are used as inputs to the analog to digital converters of an
Microcontroller.
The microcontroller then communicates the sensor data to an ESP8266 Wi-Fi module.
The Wi-Fi module connects to the Internet of Things (IoT) cloud server named Thing
Speak, where the data is stored and displayed. The structure of this project is as follows.
Firstly, the Wi-Fi Module, the Things Speak server, and the Microcontroller is introduced.
After that, the Batteries of the electric vehicle was monitored.
• We are using this system in electric vehicle’s battery and motor temperature
detection.
• Nowadays temperature monitoring system is made in built in the BMS but when
BMS failed to work properly, the temperature will not be monitored and leads to
damage of EV.
11
• If the motor or battery found to be overheated, it will give the alert signal to the
vehicle driver till the temperature reaching the maximum threshold value with
motor running in constant decreased speed.
• If it runs again and reaches the maximum temperature, the signals from the
microcontroller stops the working of motor with the help of motor driver and
gives continuous alert to the driver.
• If the temperature of the motor rises above the threshold value of the particular
motor design specified in the controller program, the power supply gets isolated
from the motor using motor driver circuit.
• However, it is important to note that the maximum temperature limits may vary
between different manufacturers and models of electric vehicles, and may also be
affected by factors such as the ambient temperature, charging and discharging
rate, and the duration of operation.
• We also indicate the pressure sensor, voltage sensor, current sensor for the
measurement purposes.
• 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.
12
Figure 3.1 Block Diagram of Proposed Solution
3.7 INNOVATION
• Here we use this system in the electric vehicle to avoid overheating of the motor
and battery, thus prevents the damage of and burning or spark from the EV.
• This system can be used anywhere apart from the above uses to detect the
overheating of any machines or batteries.
13
CHAPTER 4
HARDWARE REQUIREMENTS
4.1 GENERAL
This chapter gives the basic description of the hardware components that is
used in the proposed solution.
4.ESP8266(NODE MCU)
14
The chip was popularized in the English-speaking maker community in August 2014 via
the ESP-01 module, made by a third-party manufacturer Ai-Thinker.
4.2.2 Specifications
15
Figure 4.2 Pin Diagram of ESP8266
16
11.GPIO 11, GPIO 12, GPIO 13, GPIO 14, GPIO 15: General-purpose
digital I/O pins.
12.TXD1 and RXD1: Additional serial communication pins.
13.SDA and SCL: I2C communication pins.
14.D9 (also known as S2), D10 (also known as S3): General-purpose
digital I/O pins.
15.D5, D6, D7, D8: General-purpose digital I/O pins.
4.3.1 General
A temperature sensor is a type of sensor used to measure the temperature of a
body, surface, liquid, or air using an active or passive sensing element. In other
words, a temperature sensor measures the degree of hotness or coldness of a surface,
liquid, gas, or air.
1. Thermocouples
3. Thermistor
6. Thermometers
4.3.2.1 Thermocouples
17
Thermocouples are the most commonly used types of temperature sensors
consisting of two junctions (Hot and Cold Junctions) of dissimilar metals welded
together. Voltage is produced at the junction because of the temperature difference.
And this voltage is used to determine the temperature.
B
Platinum Rhodium-6% 0 to 1800
Platinum Rhodium-30%
C Tungsten 5% rhenium
Tungsten 26% rhenium 0 to 2300
E
Chromel (nickel 10% Constantan (nickel 45% copper) -270 to 2000
chromium)
J Iron
Constantan (nickel 45% copper) -210 to 760
K Chromel (nickel 10% -270 to 1370
Alumet (nickel 5% aluminum and
chromium)
silicon)
S
Platinum -50 to 1770
Platinum 10% Rhodium
Advantages of Thermocouple
18
1. Simple in Design
2. Ease of use
3. Good response time to the change in temperature.
4. Working limit from -200°C to up to +1750°C
Disadvantages of Thermocouple
RTD works on the principle that any change in temperature results in a change in
the electrical resistance of the conductive material. Any Increase in the temperature
results in an increase in electrical resistance. Whereas a decrease in temperature
decreases the electrical resistance of the conductive material This change in electrical
resistance is measured to determine the relative change in the temperature.
19
1. Thin Film Type
RTD Materials
➢ Advantages of RTD
1. Highly Precise
2. Stable Reading
➢ Disadvantages of RTD
1. High Cost
2. Self-Heating
4.3.2.3 Thermistor
20
used in RTD. Therefore, change in resistance in the thermistor is higher compared to
RTD.
Types of Thermistors
NTC resistance decreases with an increase in temperature. They are used for
temperature sensing applications.
Advantages of Thermistor
1. Small Size
2. Low Cost
3. Fast Response
4. More Sensitive
5. Higher Accuracy
Limitations of Thermistor
21
1. Non-Linear Temperature Response Curve
2. Self-Heating Problem
1 Ground Connect this pin to the ground (0V) of your power source
22
4.3.3.2 DHT11 TEMPERATURE AND HUMIDITY SENSOR Specifications
The DHT11 is a popular sensor for measuring temperature and humidity. It consists of a
thermistor for temperature sensing and a humidity sensing component. The sensor provides
digital output, making it easy to interface with microcontrollers like Arduino.
To use the DHT11:
Use a library (e.g., in Arduino IDE) to read data from the sensor.
23
Compared to more permanent circuit connection methods, modern breadboards
have high parasitic capacitance, relatively high resistance, and less reliable
connections, which are subject to jostle and physical degradation. Signaling is limited
to about 10 MHz, and not everything works properly even well below that frequency.
A jump wire (also known as jumper, jumper wire, DuPont wire) is an electrical
wire, or group of them in a cable, with a connector or pin at each end (or sometimes
without them – simply "tinned"), which is normally used to interconnect the
components of a breadboard or other prototype or test circuit, internally or with other
equipment or components, without soldering.
Individual jump wires are fitted by inserting their "end connectors" into the slots
provided in a breadboard, the header connector of a circuit board, or a piece of test
equipment.
A jumper wire is an electric wire that connects remote electric circuits used for
printed circuit boards. By attaching a jumper wire to the circuit, it can be
shortcircuited and short-cut (jump) to the electric circuit.
By placing the jumper wire on the circuit, it becomes possible to control the
electricity, stop the operation of the circuit, and operate a circuit that does not operate
with ordinary wiring. Also, when specification change or design change is necessary
on the printed circuit board, reinforcement of the defective part, partial stop of the
24
unnecessary function, and change of the circuit configuration of the unnecessary
output part by attaching or detaching the jumper wire can.
SHOWA jumper wire (NSL: New Showa Lead) is a lead-free tin-plated annealed
copper wire. Tin plating is tin: 99.2%, copper: 0.8%.
In general, it is said that hot plating is difficult to control the plating thickness
compared with electroplating, but we control the plating thickness by the original
processing method.
A pressure sensor measures force applied per unit area and converts it into an electrical
signal. Types include:
Strain Gauge Pressure Sensors: Utilize the strain in a material due to applied pressure.
25
Capacitive Pressure Sensors: Measure changes in capacitance due to pressure-induced
deflections.
SDA (SERIAL Connects to the data line of your microcontroller for I2C
DATA) communication
SCL (SERIAL Connects to the clock line of your microcontroller for I2C
CLOCK) communication
26
Figure 4.14 BMP180 PIN DIAGRAM
The BMP180 is a digital barometric pressure sensor designed for use in mobile
applications, and it's commonly used in electronic projects. Here are some key points
about the BMP180 pressure sensor:
27
Temperature Measurement: In addition to pressure, the BMP180 also includes a
temperature sensor. This allows for compensation of pressure readings with temperature
variations.
Accuracy: The BMP180 is known for its accuracy in measuring pressure and temperature.
It can be used for applications where precise environmental data is required
A current sensor is a device that measures the flow of electric current in a circuit. It
provides a way to monitor and control current levels in various applications.
28
There are different types of current sensors, including Hall effect sensors, shunt resistors,
and transformers.
These sensors can be used in industrial, automotive, and electronic systems to ensure safe
and efficient operation by monitoring current levels and providing feedback or triggering
actions based on the measured values.
• Input voltage: +5 V
• Types: 5,20and 30 A module
• Current: Both AC and DC
• Easy to integrate with MCU, since it outputs analog voltage
The ACS712 is a Hall effect-based current sensor that is used to measure the intensity of
electrical current flowing through a conductor. It works on the principle of Hall effect,
where a voltage is generated across a conductor when subjected to a magnetic field
perpendicular to the current flow.
The ACS712 uses a Hall-effect sensor to measure this voltage and provides an analog
output proportional to the current.
There are different variants of the ACS712 sensor with various current ratings, allowing
users to choose one that suits their specific application. It is commonly used in electronic
projects and automation systems to monitor and control current flow.
29
Figure 4.18 VOLTAGE SENSOR
Voltage sensors can have various pin configurations based on the specific model or
type. Generally, voltage sensors may have three pins:
VCC (Power Supply): This is the pin where you provide the power supply voltage for the
sensor to operate.
30
GND (Ground): Connect this pin to the ground or common reference point in your circuit.
OUT (Output): The voltage sensor provides an output signal proportional to the input voltage,
and this pin carries that signal.
31
4.9.1 Specifications for Rechargeable battery
• Lithium ion battery (2 Nos)
• Capacity: 2500mAh
• Voltage: 3.7V
• Power: 7.4wh
The TP4056 is a lithium-ion battery charging module commonly used in electronic devices.
It's a compact and cost-effective solution for charging single-cell lithium-ion or lithium-
32
polymer batteries. The module typically includes a linear charger, current sensor, and
protection circuitry.
Charge Status Indicator: Many TP4056 modules have LEDs to indicate the charging
status. For example, a red LED might indicate that the battery is charging, and a green LED
could signify a fully charged battery.
The TP4056 charging module typically has the following pin specifications:
BAT- (Battery Negative Terminal): Connects to the negative terminal of the
rechargeable battery.
OUT+ (Output Positive Terminal): Provides the positive output voltage after
charging. Connects to the load or device being powered.
OUT- (Output Negative Terminal): Connects to the negative side of the load or
device being powered.
33
PROG (Programming Pin): Used to set the charge current. Connecting it to BAT+
or leaving it floating with a resistor to BAT+ sets different charge currents.
VCC (Voltage Input): Connects to the power source for charging. Typically, it's
connected to a 5V source.
34
CHAPTER 5
5. SOFTWARE REQUIREMENTS
5.1 GENERAL
This chapter gives the description of the software methods used in this proposed
system.
The Arduino UNO board is programmed using Arduino IDE software which is an
official software introduced by Arduino.cc to program the board. Arduino programs are
written in the Arduino Integrated Development Environment (IDE). Arduino IDE is a
special software running on your system that allows you to write sketches (synonym for
program in Arduino language) for different Arduino boards. The sketch is nothing but a
set of instructions that allow the board to perform certain functions as per your
requirements.
35
Figure 5.1 Arduino IDE
The setup function is the first to execute when the program is executed, and this
function is called only once. The setup function is used to initialize the pin modes and
start serial communication. This function has to be included even if there are no
statements to execute.
• void setup() – this sets up the things that need to be done once and they
don’t happen again in the running program.
After the setup( ) function is executed, the execution block runs next. The
execution block hosts statements like reading inputs, triggering outputs, checking
conditions etc. In the above example loop( ) function is a part of the execution block. As
the name suggests, the loop( ) function executes the set of statements (enclosed in curly
braces) repeatedly.
• void loop() – this part comes with the instructions that get repeated again
and again until the board is turned off.
5.2.4 List Of Icons and Explanation
36
Verify
Check your code for errors compiling it.
Upload
Compiles your code and uploads it to the configured board.
See uploading below for details.
New
Creates a new sketch.
Open
Presents a menu of all the sketches in your sketchbook.
Clicking one will open it within the current window
overwriting its content.
Save
Save your sketch.
Serial Monitor
Opens the serial monitor.
Through Arduino programming, Arduino uno can be interfaced with LCD display,
MATLAB, Relay, Power supply and IOT module etc.
5.3 EMBEDDED C
37
syntax and semantics of standard C, e.g., main () function, variable definition, data type
declaration, conditional statements (if, switch. case), loops (while, for), functions, arrays
and strings, structures and union, bit operations, macros, unions, etc.0
Initially C was developed by Kernighan and Ritchie to fit into the space of 8K
and to write (portable) operating systems. Originally it was implemented on UNIX
operating systems. As it was intended for operating systems development, it can
manipulate memory addresses. Also, it allowed programmers to write very compact
codes. This has given it the reputation as the language of choice for hackers too.
38
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:
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.
• Machine Code
39
5.3.3 Use Of C in Embedded Systems
Many of these advantages are offered by other languages also, but what sets C
apart from others like Pascal, FORTRAN, etc. is the fact that it is a middle level
language; it provides direct hardware control without sacrificing benefits of high-level
languages. Compared to other high-level languages, C offers more flexibility because C
is relatively small, structured language; it supports low-level bit-wise data manipulation.
Compared to assembly language, C Code written is more reliable and scalable, more
portable between different platforms (with some changes). It is easier to write good
code in C & convert it to an efficient assembly code rather than writing an efficient code
in assembly itself. Benefits of assembly language programming over C are negligible
when we compare the ease with which C programs are developed by programmers.
40
CHAPTER 6
APPENDICES
6.1 GENERAL
This program is used to control the motor operation according to the temperature
sensor values through motor driver module.
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#define ONE_WIRE_BUS 2
#define alert 4
#define Motor 5
#define Speed 6
#define light 7
#define bright 3
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature
setup(void)
41
pinMode(alert, OUTPUT);
pinMode(Motor, OUTPUT);
pinMode(light, OUTPUT);
Serial.begin(9600);
Serial.print("Locating devices...");
sensors.getDeviceCount();
Serial.print(deviceCount, DEC);
Serial.println(" devices.");
Serial.println("");
digitalWrite(alert, LOW);
digitalWrite(Motor,
LOW); digitalWrite(light,
LOW);
analogWrite(Speed, 255);
analogWrite(bright,165);
delay(1000);
Lcd.begin(16, 2);
delay(100);
} void
loop(void)
Serial.print(0);
42
Serial.print(" : ");
tempB = sensors.getTempCByIndex(0);
Serial.print(tempB);
Serial.println(":C");
Lcd.setCursor(0, 0);
Lcd.print("B T:");
Lcd.setCursor(4, 0);
Lcd.print(tempB);
Lcd.setCursor(10, 0);
Lcd.print("C");
Serial.print("Sensor ");
Serial.print(1);
Serial.print(" : ");
tempM = sensors.getTempCByIndex(1);
Serial.print(tempM);
Serial.println(":C");
delay(1000);
Lcd.setCursor(0, 1);
Lcd.print("M T:");
Lcd.setCursor(4, 1);
Lcd.print(tempM);
Lcd.setCursor(10, 1);
Lcd.print("C");
43
analogWrite(Speed, 50);
analogWrite(bright, 50);
digitalWrite(Motor,
HIGH); digitalWrite(light,
HIGH); digitalWrite(alert,
HIGH); delay(400);
digitalWrite(alert, LOW);
delay(7000);
Lcd.setCursor(12, 0);
Lcd.print(" ");
digitalWrite(Motor, LOW);
digitalWrite(light, LOW);
delay(3000);
Lcd.setCursor(12, 0);
Lcd.print("HIGH");
delay(1000);
analogWrite(Speed, 50);
analogWrite(bright, 50);
digitalWrite(Motor,
HIGH); digitalWrite(light,
44
HIGH); digitalWrite(alert,
HIGH); delay(400);
digitalWrite(alert, LOW);
delay(7000);
Lcd.setCursor(12, 1);
Lcd.print(" ");
digitalWrite(Motor,
LOW); digitalWrite(light,
LOW); delay(3000);
Lcd.setCursor(12, 1);
Lcd.print("HIGH");
delay(1000);
else {
digitalWrite(alert, LOW);
digitalWrite(Motor,
HIGH); digitalWrite(light,
HIGH);
analogWrite(Speed, 255);
analogWrite(bright, 165);
delay(1000);
45
}
46
CHAPTER 7
RESULT
7.1 GENERAL
7.2 RESULT
The electric vehicle's motor and battery temperatures are sensed by our project.
On the LCD panel, the motor and battery's current temperatures are shown. When a
system's, motor's, or battery's temperature surpasses the pre saturation value, which we
fixed the threshold value in the microcontroller (threshold value – 5 deg). The motor
speed will be reduced, and the driver will receive a warning signal continuously. The
system is shut down when the temperature hits or surpasses the threshold setting. The
driver should be aware of the vehicle throughout the alert period and take the required
steps to cool the vehicle.
Currently we are setting 40deg as maximum threshold value and 35deg as pre
saturation value in the Arduino microcontroller. These temperature settings vary for
different EV’s according to the surrounding temperature and different rating of the
motor and battery pack of the electric vehicles.
47
Fig: 7.1 Demo project in off mode
48
CHAPTER 8
8.1. GENERAL
This chapter tells the conclusion of the proposed system and further ways to
develop the system.
8.2 CONCLUSION
All of the earlier experiments were unique in that they had separate temperature
measurement system for the motor and the battery. In this instance, a single device uses
temperature detection for both the battery and the motor. Finally, we are monitoring the
Motor and Battery temperatures and protecting our electric vehicle.
REFERENCES
49
2. A. M. Anjali Vekhande, "IOT-Based battery parameter monitoring system for an
electric vehicle," International journal of creative research thoughts, vol. 8, no.
7, p. 7, 2021.
3. Xinghui Zhang, Zhao Li, Lingai Luo, Yilin Fan and Zhengyu Du, 'A review on
thermal management of lithium-ion batteries for electric vehicles', Energy,
Volume 238, Part A, 1 January 2022, Page 121652, 2020.
4. Lu Jin, Jun Tian, Shen Gao, Peng Xie, Mohsen Akbarzadeh, Theodoros
Kalogiannis, Maitane Berecibar, Yuanliang Lan, Daozhong Hu, Yulong Ding
and Geng Qiao, 'A novel hybrid thermal management approach towards
highvoltage battery pack for electric vehicles', Energy Conversion and
Management, Volume 247, 1 November 2021, 114676, 2020.
7. Song, Younha & Yang, Y. & Hu, Zechun, 'Present status and development trend
of batteries for electric vehicles', Dianwang Jishu/Power System Technology.
35. 1-7, 2018.
50
9. P. G. P. Kunal Pardeshi and R.Y. Patil, ‘Cooling System for Electronics in
Computer System - An Overview’, International Journal of Recent Engineering
Research and Development (IJRERD), vol. 02, no. 02, pp. 01-04, 2017.
10. K. Kim, J. Lee, and J. Kim, ‘Thermal analysis of electric vehicle battery packs
using temperature sensors’, Energy, vol. 36, pp. 5863-5868, 2016.
12. B. Chen and X. Liu, ‘An intelligent thermal management system for electric
vehicle battery packs’, IEEE Transactions on Vehicular Technology, vol. 67, pp.
6076-6087, 2015.
13. J. Zhang, Y. Wang, and H. Wang, ‘A novel temperature prediction method for
electric vehicle battery pack based on machine learning’, Energy Conversion
and Management, vol. 198, pp. 111711-1716, 2014.
APPRECIATIONS
1. Our project is approved by Tamil Nadu State Council for Science and
technology (TNSCST) and they have sanctioned Rs. 7500/- for the
implementation of our project.
51
2. Received appreciation certificate for the “Poster Presentation Contest”
conducted by Department of Humanities & Science (Physics) – NCMFM-2023
organized by FMRL.
52
53