You are on page 1of 15

LATHA MATHAVAN POLYTECHNIC

COLLEGE (ISO9001:2008 CERTIFIED INSTITUTION)


LATHAMATHAVA NAGAR, KIDARIPATTI,
N
ALAGARKOVIL, MADURAI –625301.

DEPARTMENT OF ELECTRICAL ELECTRONIC


ENGINEERING

IOT BASED BATTERY MONITORING


SYSTEM
PROJECT WORK DONE BY

Pragatheeshwaran N 22305475
Sachin C 22305477
Saravana Muthu J 22305479
Nantheeswaran K 22392088
Rajasekar V 22392090

Guided By

Mr.J.Jayaprasanth Sr.Lecturer / EEE

PROJECT REPORT 2023- 2024

A Project report submitted to LATHAMATHAVAN


POLYTECHNIC COLLEGE in the partial fulfillment of the
requirement are the award of the DIPLOMA IN
MECHANICAL ENGINEERING of the state board of examination.
• The "IoT based Battery Monitoring System using NodeMCU and ThingSpeak" is a groundbreaking
solution for remotely monitoring battery health. Powered by NodeMCU and the ESP8266 Wi-
Fi module, it gathers data from voltage, current, and temperature sensors connected to the battery
system.

• This information is transmitted to ThingSpeak, where it undergoes real-time analysis and


storage, providing users with a comprehensive view of battery performance. The system's intelligence
extends to proactive maintenance alerts, promptly notifying users of abnormal conditions such
as overcharging, overheating, or low voltage.

• These alerts enable timely interventions, preventing potential battery failures and optimizing
overall performance. One of the system's key advantages is its accessibility. Users can access
critical battery information from any location with internet connectivity, thanks to ThingSpeak's
user-friendly interface.

• This feature ensures that users can monitor battery health remotely, enhancing convenience and
efficiency. Moreover, the system's scalability and affordability make it suitable for various
applications, ranging from small-scale home automation projects to large-scale industrial setups.

• The open-source nature of NodeMCU and ThingSpeak further enhances the system's versatility,
allowing for customization and adaptation to specific user needs. Overall, the "IoT based
Battery Monitoring System" represents a practical and efficient solution for ensuring the
reliable operation of battery systems.

• By leveraging IoT technology, this system not only enhances productivity but also helps prevent
unexpected battery failures, ultimately leading to cost savings and improved efficiency across
diverse environments.
1.Power Source: This represents the source of electrical power for your system. It could be a battery, AC
power supply, solar panel, or any other power source depending on your application requirements.

2.Battery: This block symbolizes the energy storage component of your system. It stores
electrical energy and provides power to the rest of the components as needed. The battery block is
connected to the charging module to ensure it remains charged and ready for use.

3.Charging Module: This block manages the charging process of the battery. It typically includes
components such as a charging IC, voltage regulation circuitry, and protection circuitry to ensure safe
and efficient charging.

4.NodeMCU ESP8266: This block represents the main microcontroller unit in your system. It controls
the overall functionality of the system, including data processing, communication with peripherals, and
execution of programmed logic. The NodeMCU interacts with other blocks to gather sensor
data, display information on the LCD, and manage power usage.
5. LCD: This block represents the liquid crystal display used for visual output. It displays information
such as sensor readings, system status, user interface elements, etc. The NodeMCU controls the content
displayed on the LCD and updates it as necessary.

Each block in the diagram represents a distinct functional unit of the system, and the
connections between them illustrate how data or signals flow between these units. This visual
representation helps in understanding the overall system architecture and facilitates
communication between different stakeholders involved in the project.

Circuit Diagram
CONFIGURING THINGSPEAK TO PLOT CHARGING AND
DISCHARGING VOLTAGE:

ThingSpeak provides a very good tool for IoT based projects. By using the ThingSpeak site,
we can monitor our data and control our system over the Internet, using the Channels and
webpages provided by ThingSpeak. ThingSpeak ‘Collects’ the data from the sensors, ‘Analyze
and Visualize’ the data and ‘Acts’ by triggering a reaction.

Here we are briefly explaining to use ThingSpeak for this IoT Battery Monitoring Project.
You can check various ThingSpeak based Iot projects here to learn more about it.

We will use ThingSpeak to monitor battery charging and discharging voltage. We will also
use IFTTT platform to connect with ThingSpeak to send email/message alerts for a full or
empty battery.

 Step 1: First of all, the user needs to Create an Account on ThingSpeak.com, then
Sign In and click on Get Started.

 Step 2: Now go to the ‘Channels’ menu and click on New Channel option on the same
page for further process. You will see a form for creating the channel, fill in the Name
and Description as per your choice. Then fill ‘Charging Voltage’, and
‘Discharging
Voltage’ in Field 1 and Field 2 labels, tick the checkboxes for the Fields. Click on Save
channel at bottom of the page. Now your new channel has been created.

 Step 3: Click on API Keys menu and copy the Write API key. This key will be used in
the code to send the data on ThingSpeak.
Code:

#include <ESP8266WiFi.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

#define LCD_ADDRESS 0x27 // I2C address of your LCD


module LCD_COLS 16 // Number of columns in your
#define
LCD
#define LCD_ROWS 2
// Number of rows in your LCD

LiquidCrystal_I2C lcd(LCD_ADDRESS, LCD_COLS, LCD_ROWS);

const char* ssid = "your_wifi_ssid"; // Enter your WiFi Network's SSID


const char* pass = "your_wifi_password"; // Enter your WiFi
Network's Password
const char* server = "api.thingspeak.com";
String apiKey = "your_api_key"; // Enter your ThingSpeak API Key
String channelID = "your_channel_id"; // Enter your ThingSpeak Channel ID

WiFiClient client; float volt = 0.0;


float r1 = 47000.0; // r1 value 47k
float r2 = 9700.0; // r2 value 9.7 k

void setup() {
Serial.begin(115200);
Serial.println("Connecting to WiFi");
WiFi.begin(ssid, pass);

while (WiFi.status() != WL_CONNECTED)


{ delay(500);
Serial.print(".");
}

Serial.println("\nWiFi connected");

// Initialize the LCD display lcd.init();


lcd.backlight();

// Clear the LCD screen lcd.clear();


}

void loop() {
int analogvalue = analogRead(A0);
float temp = (analogvalue * 3.3) / 1024.0; volt
= temp / (r2 / (r1 + r2));

if (volt < 0.1) { volt = 0.0;


}
Serial.print("Voltage: "); Serial.println(volt);

// Print voltage value on LCD display lcd.clear();


lcd.setCursor(0, 0); lcd.print("Voltage:"); lcd.setCursor(0, 1);
lcd.print(volt, 2); // Print voltage with 2 decimal places

if (WiFi.status() == WL_CONNECTED) { if (client.connect(server, 80)) {


String postData = "api_key=" + apiKey + "&field1=" + String(volt);
String url = "/update.json?api_key=" + apiKey + "&field1=" + String(volt);
client.print(String("POST ") + url + " HTTP/1.1\r\n" +
"Host: " + server + "\r\n" +
"Connection: close\r\n" +
"Content-Type: application/x-www-form-urlencoded\r\n" + "Content-
Length: " + postData.length() + "\r\n\r\n" +
postData);
Serial.println("Data sent to ThingSpeak");
}
client.stop();
} else {
Serial.println("WiFi not connected");
}
delay(10000); // 10 second delay before next
reading
}
 TESTING AND MONITORING BATTERY VOLTAGE ON
THINGSPEAK:
● The battery voltage is successfully tested and monitored on the
ThingSpeak platform.
● Data is uploaded to ThingSpeak at regular intervals,
allowing for real-time monitoring of battery status.
● Graphical Representation of Charging and Discharging Curves:
● ThingSpeak provides graphical representations of the charging
and discharging curves.
● These curves illustrate the voltage trends over time, offering insights into
the battery's performance and behavior.
● Overall, the results demonstrate effective battery
monitoring and
visualization capabilities using ThingSpeak, enabling informed decision-
making and proactive management of battery health.
Conclusion:

In this project, we successfully developed a system using the NodeMCU


ESP8266 microcontroller to measure voltage and transmit data to the
ThingSpeak platform for monitoring and analysis. Here's a summary of the
project's key components, achievements, and potential improvements:
3.Low-cost Solution:Utilizing affordable components such as the
NodeMCU ESP8266 and open-source platforms like ThingSpeak results
in a cost-effective monitoring solution suitable for various applications.

4.Scalability: The project can be scaled up to monitor multiple voltage


sources simultaneously by adding additional sensors and channels to the
system.

Disadvantages:

1.Limited Range: The system's range is limited by the Wi-Fi network's


coverage area, restricting its use to locations within range of the network.

2.Dependence on Internet Connectivity: The system relies on


stable internet connectivity for data transmission to ThingSpeak,
making it susceptible to disruptions in network availability.

3. Power Consumption: Continuous operation of the NodeMCU and


Wi- Fi module may consume significant power, especially in battery-
powered applications, necessitating power management considerations.

4. Security Concerns: Transmitting data over the internet


introduces potential security risks, such as unauthorized access or data
interception, requiring appropriate security measures to mitigate these
risks.

Overall, while the project offers several advantages such as remote


monitoring and real-time visualization, it also presents challenges such as
limited range, dependence on internet connectivity, and security
considerations that need to be addressed during implementation.

You might also like