ELECTRIC VEHICLE (EV) AND IT’S BATTERY MONITORING SYSTEM USING IoT
2449 2
Mainak Biswas

ELECTRIC VEHICLE (EV) AND IT’S BATTERY MONITORING SYSTEM USING IoT

The battery management system (BMS) needs to be improved to provide better performance. The Battery...

Description:-

The battery management system (BMS) needs to be improved to provide better performance. The Battery Monitoring System (BMS) is part of the BMS and is used to monitor the operating system, performance, and battery life, such as charging and discharging processes. The battery monitoring system is composed of measuring equipment for measuring the voltage, current, and temperature of the battery. By processing these parameters, the battery's state of charge (SOC) and the state of health (SOH) can be estimated. The Internet of Things (IoT) enables smart microgrids to share information for more users and improves connectivity in many infrastructures. Numerous studies have developed the Internet of Things for various fields and have been implemented in various fields, such as transport and logistics, environment home, office and factory, personal and public, biomedicine and energy. The Internet of Things-based Energy domain allows users to view energy consumption in real-time. One of the applications in the energy sector is the smart grid. Smart grid applications based on the Internet of Things have been developed for emergency management using smart charges. Batteries are the most important part of electric vehicles. to power the entire system, and it is important to monitor the voltage level of the battery, mainly due to improper charging and discharging of lithium-ion batteries, which is a big safety issue. Electric vehicles (EVs) have a separate system called Battery Monitoring System (BMS), which monitors all properties of the battery pack, such as voltage, current, and temperature, and ensures the safety of lithium batteries. Previously, the battery monitoring system only monitored the battery status and reminded the user through the vehicle's battery indicator. The Advances in technology have enabled the use of the Internet of Things (IoT) to remotely notify manufacturers and users of battery health. You can check the battery status of your vehicle battery on your smartphone from anywhere in the world, which is one of the maintenance supports provided by the manufacturer. Internet of Things (IoT), which is a system of interconnected physical objects system that is assigned an IP and can connect networks without manual intervention. The system also transfers data over the Internet without human-to-human, human-machine interaction. This IoT system is created by exchanging data between the server and the microcontroller on a microcontroller equipped with a WIFI chip, sensors, etc. Technology is constantly changing every second. This is based on current technologies, Battery Monitoring Systems (BMS), and the Internet of Things (IoT).

EV

Hardware Used: 

Esp32 Dev kit V1,4-Channel Relay,Lithium-ion Batteries,TP4056 Li-On Battery Charging Module, 12V led lights, Jumper Wires, CPU fan as AC.

Software Used: 

ThingSpeak, Alexa mobile app,MATLAB, Arduino IDE
 

Hardware and Software Selection: 

That particular software and hardware tools are used here because of the working as well as the different features of the particular hardware or software. Such as TP4056, The TP4056 1A Lithium-Ion Lithium Battery Charging Module with Overcurrent Protective-Mini USB is designed to charge a single 3.7V 1Ah or more Lithium-Ion (Li-on) cell, such as the 16550, without the need for its own protection circuit. It is an ultra-compact module that is ideal. This module, which uses the TP4056 Charger IC and the DW01 Battery Protection IC, offers a charging current of 1A and will turn off when the charge is complete. The TP4056 is a 1-cell lithium-ion battery charger with a complete constant-current/constant-voltage linear charger. The TP4056 is suited for portable applications due to its SOP package and minimum amount of external components. The TP4056 can also operate within the USB and AC adapter. after that another one Relay, Relay is basically an electromagnetic switch. It needs a small voltage (5v for this purpose) to trip. Total three states are present in the relay such as Normally Open (NO), Normally Closed (NC) & Common (COM), the appliances are connected to those states. A relay is a switch that uses a separate mild current to permit the electromechanical closing or opening of circuits that carry heavy current. When the relay is turned on, it connects two circuit ends and disconnects them when it is turned off. Electromechanical relays of various types all function in essentially the same way. Electromagnets, springs, mechanically moveable contacts, and switching points are the key components. Three contacts make up a basic relay. The common contact (COM) is connected to the mechanical moving contact as the first contact. The other two contacts are known as switching points and are used to connect to a high-ampere load. They are ordinarily open (NO) and typically closed (NC) contacts, respectively. Both AC and DC electricity can be used to operate the relay. Despite this, the relay coil demagnetizes during every current zero position since AC is an alternating current. As a result, the relay would constantly break the circuit, impairing the electronics’ operation. To address this issue, AC relays are designed with special features that allow them to maintain magnetism even when the current is zero. Shaded coil mechanisms and electronic circuit arrangements are two ways used to tackle this problem in AC relays. Next is ThingSpeak, ThingSpeak is a cloud-based IoT analytics platform that aggregates, visualizes, and analyses real-time cloud data streams. You can use your device to send data to ThingSpeak, build real-time visualizations of live data, and issue alarms. Sensors and actuators are examples of things. Sensors provide information about our surroundings. Consider a cell phone's temperature sensor or GPS receiver. Temperature controllers, lights, pumps, and outlets are all controlled by actuators. The "Internet of Things" connects everything and lets us interact with objects. ThingSpeak is an internet of things application platform. ThingSpeak enables us to create apps based on the data collected by the sensors. Real-time data collecting, data processing, visualization, apps, and plugins are all features of ThingSpeak. The Thing Speak channel is at the heart of the Thing Speak system. The stored data is sent across the channel. Each channel has eight fields for various data kinds, three location fields, and one status field. Getting a ThingSpeak channel allows us to send data to the channel, have it processed by ThingSpeak, and then send the data back to our application.
 

Circuit Diagram

Circuit

EV Circuit

The battery management system (BMS) needs to be improved to provide better performance. The Battery Monitoring System (BMS) is part of the BMS and is used to monitor the operating system, performance, and battery life, such as charging and discharging processes. The battery monitoring system is composed of measuring equipment for measuring the voltage, current and temperature of the battery. By processing these parameters, the battery's state of charge (SOC) and the state of health (SOH) can be estimated. The Internet of Things (IoT) enables smart microgrids to share information for more users and improves connectivity in many infrastructures. Numerous studies have developed the Internet of Things for various fields and have been implemented in various fields, such as transport and logistics, environment home, office and factory, personal and public, biomedicine and energy. The Internet of Things based Energy domain allows users to view energy consumption in real-time. One of the applications in the energy sector is the smart grid. Smart grid applications based on the Internet of Things have been developed for emergency management using smart charges. Batteries are the most important part of electric vehicles. to power the entire system, and it is important to monitor the voltage level of the battery, mainly due to improper charging and discharging of lithium-ion batteries, which is a big safety issue. Electric vehicles (EVs) have a separate system called Battery Monitoring System (BMS), which monitors all properties of the battery pack, such as voltage, current, and temperature, and ensures the safety of lithium batteries. Previously, the battery monitoring system only monitored the battery status and reminded the user through the vehicle's battery indicator. The Advances in technology have enabled the use of the Internet of Things (IoT) to remotely notify manufacturers and users of battery health. You can check the battery status of your vehicle battery on your smartphone from anywhere in the world, which is one of the maintenance supports provided by the manufacturer. Internet of Things (IoT), which is a system of interconnected physical objects system that is assigned an IP and can connect networks without manual intervention. The system also transfers data over the Internet without human-to-human, human-machine interaction. This IoT system is created by exchanging data between the server and the microcontroller on a microcontroller equipped with a WIFI chip, sensors, etc. Technology is constantly changing every second. This white paper is based on current technologies, Battery Monitoring Systems (BMS), and the Internet of Things (IoT).
 
It is clear that an Electric Vehicle (EV) totally depends on battery source. The amount of energy supplied to the vehicle is decreasing gradually which leads to performance degradation. This is a bigger concern for battery manufacturers. Here a model of an Electric Vehicle (EV) (Figure) has been developed which is cost-effective and provides a user-friendly interface for the users. We can operate as well as monitor our vehicles from anywhere in the world by using the internet. We can start and stop the vehicle, control lights, fan, AC, or any other switching devices easily from anywhere. The best thing is that we can monitor our vehicle battery status or state of charge (SoC) so we don’t need to check it manually. Here Alexa app is used which is a virtual assistant developed by Amazon and available in Google play store and Apple store also readily available with a larger dataset and for battery status monitoring ThingSpeak dashboard has been used here which is an amazing dashboard made by MathWorks, specially designed for IoT technology.

Code

#include <ESP8266WiFi.h>
 
String apiKey = "M3JBXHIQBZYUBZXA";
const char* ssid =  "Mainak's Wifi Zone";     
const char* pass =  "aprimtechindiaprivatelimitedmainak8";
const char* server = "api.thingspeak.com";
 
int analogInPin  = A0;    
int sensorValue;          
float calibration = 0.36;
int bat_percentage;
 
WiFiClient client;
 
void setup()
{
  Serial.begin(115200);
  Serial.println("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, pass);
 
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(100);
    Serial.print("*");
  }
  Serial.println("");
  Serial.println("WiFi connected");
}
 
void loop()
{
  sensorValue = analogRead(analogInPin);
  float voltage = (((sensorValue * 3.3) / 1024) * 2 + calibration);
 
  bat_percentage = mapfloat(voltage, 2.8, 4.2, 0, 100);
 
  if (bat_percentage >= 100)
  {
    bat_percentage = 100;
  }
  if (bat_percentage <= 0)
  {
    bat_percentage = 1;
  }
 
  Serial.print("Analog Value = ");
  Serial.print(sensorValue);
  Serial.print("\t Output Voltage = ");
  Serial.print(voltage);
  Serial.print("\t Battery Percentage = ");
  Serial.println(bat_percentage);
  delay(1000);
 
  if (client.connect(server, 80))
  {
 
    String postStr = apiKey;
    postStr += "&field1=";
    postStr += String(voltage);
    postStr += "&field2=";
    postStr += String(bat_percentage);

...........................................................................................................................................................................................

#ifdef ARDUINO_ARCH_ESP32
#include <WiFi.h>
#else
#include <ESP8266WiFi.h>
#endif
#include <Espalexa.h>

#define RelayPin1 5  
#define RelayPin2 4  
#define RelayPin3 13
#define RelayPin4 14
#define RelayPin5 12

int analogInPin  = A0;    
int sensorValue;          
float calibration = 0.36;
int bat_percentage;


boolean connectWifi();


void firstLightChanged(uint8_t brightness);
void secondLightChanged(uint8_t brightness);
void thirdLightChanged(uint8_t brightness);
void fourthLightChanged(uint8_t brightness);
void fifthLightChanged(uint8_t brightness);


const char* ssid = "Mainak's Wifi Zone";
const char* password = "aprimtechindiaprivatelimitedmainak8";


String Device_1_Name = "AC";
String Device_2_Name = "Back Light";
String Device_3_Name = "Fan";
String Device_4_Name = "Front Light";
String Device_5_Name = "Vehicle";

boolean wifiConnected = false;

Espalexa espalexa;

void setup()
{
  Serial.begin(115200);

  pinMode(RelayPin1, OUTPUT);
  pinMode(RelayPin2, OUTPUT);
  pinMode(RelayPin3, OUTPUT);
  pinMode(RelayPin4, OUTPUT);
  pinMode(RelayPin5, OUTPUT);

 
  wifiConnected = connectWifi();

  if (wifiConnected)
  {
    
    espalexa.addDevice(Device_1_Name, firstLightChanged);
    espalexa.addDevice(Device_2_Name, secondLightChanged);
    espalexa.addDevice(Device_3_Name, thirdLightChanged);
    espalexa.addDevice(Device_4_Name, fourthLightChanged);
    espalexa.addDevice(Device_5_Name, fifthLightChanged);

    espalexa.begin();
  }
  else
  {
    while (1)
    {
      Serial.println("Cannot connect to WiFi. Please check data and reset the ESP.");
      delay(2500);
    }
  }
}

void loop()
{
  espalexa.loop();
  delay(1);
}


void firstLightChanged(uint8_t brightness)
{
 
  if (brightness == 255)
    {
      digitalWrite(RelayPin1, LOW);
      Serial.println("Device1 OFF");
    }
  else
  {
    digitalWrite(RelayPin1, HIGH);
    Serial.println("Device1 ON");
  }
}

void secondLightChanged(uint8_t brightness)
{
   
  if (brightness == 255)
    {
      digitalWrite(RelayPin2, LOW);
      Serial.println("Device2 OFF");
    }
  else
  {
    digitalWrite(RelayPin2, HIGH);
    Serial.println("Device2 ON");
  }
}

void thirdLightChanged(uint8_t brightness)
{
   
  if (brightness == 255)
    {
      digitalWrite(RelayPin3, LOW);
      Serial.println("Device3 OFF");
    }
  else
  {
    digitalWrite(RelayPin3, HIGH);
    Serial.println("Device3 ON");
  }
}

void fourthLightChanged(uint8_t brightness)
{
 
  if (brightness == 255)
    {
      digitalWrite(RelayPin4, LOW);
      Serial.println("Device4 OFF");
    }
  else
  {
    digitalWrite(RelayPin4, HIGH);
    Serial.println("Device4 ON");
  }
}

void fifthLightChanged(uint8_t brightness)
{
 
  if (brightness == 255)
    {
      digitalWrite(RelayPin5, LOW);
      Serial.println("Device5 OFF");
    }
  else
  {
    digitalWrite(RelayPin5, HIGH);
    Serial.println("Device5 ON");
  }
}


boolean connectWifi()
{
  boolean state = true;
  int i = 0;

  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  Serial.println("");
  Serial.println("Connecting to WiFi");

 
  Serial.print("Connecting...");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
    if (i > 20) {
      state = false; break;
    }
    i++;
  }
  Serial.println("");
  if (state) {
    Serial.print("Connected to ");
    Serial.println(ssid);
    Serial.print("IP address: ");
    Serial.println(WiFi.localIP());
  }
  else {
    Serial.println("Connection failed.");
  }
  return state;
}