Fyp Update
Fyp Update
Acknowledgement
The success of this project can be attributed to the help of number of people. Firstly, we
would like to thank our advisor’s assistant professor electrical engineering department Engr.
Asif Gulraiz & assistant professor mechanical engineering department Engr. Muhammad
Riaz for their support and technical advice during the course of the project.
A warm thanks also goes to our university and Department of Electrical Engineering which
provided us with support during challenges understanding of many hours spent in
university. Its resources we utilized were of great value.
2
ABSTRACT
A Hybrid Energy System is an innovative solution for energy production and distribution,
which combines two or more energy sources into a single point of connection. This type of
energy system has several advantages, including the ability to maximize the use of
renewable energy sources, reduce maintenance costs associated with backup generators or
energy suppliers, and increase overall system efficiency. However, one of the major
drawbacks of a Hybrid Energy System is the lack of monitoring and management of the
energy load.
To address this challenge, our project aims to design a comprehensive model of a Hybrid
Energy System that incorporates a comprehensive monitoring and control system. This
system will allow users to remotely monitor data on their mobile devices and through a
graphical user interface, and also control the load in an efficient and convenient manner.
The monitoring and control system will be implemented using the ESP8266 microcontroller,
which provides secure data transfer through internet connections. This will allow users to
monitor the data remotely and make adjustments to the load as needed and automatically
controlling between the sources. Additionally, the system will be designed to be fast, cost-
effective, and easy to operate, making it accessible to a wide range of users.
In conclusion, our project seeks to provide a solution for managing and monitoring a Hybrid
Energy System in a more efficient and convenient manner. By incorporating a
comprehensive monitoring and control system, we hope to help users take full advantage of
the benefits offered by a Hybrid Energy System and overcome some of its challenges.
3
Table of contents
Contents:
Acknowledgement 1
Abstract 2
List of Symbols and Abbreviations 6
List of Figures 9
List of Tables 11
Chapter 1: Introduction to Final Year Project 12
1.1 Objective 12
1.2 Problem Statement 12
1.3 Deliverables 12
1.4 Related Work 13
1.5 Scope of Study 13
1.5 Scope of Study 13
Chapter 2: Modeling Approach 15
2.1 Hybrid Energy System 15
2.2 Existing Model 18
2.2.1 Drawbacks of Existing Model 21
2.3 Proposed Model 18
2.3.1 Advantages of Proposed Model 21
Chapter 3: Component Explanation 20
3.1 Implementation of Initial Design of Maxwell 20
3.2 Effects of Varying Various Parameters 21
3.2.1 Effects of Magnet’s Thickness 21
3.2.2 Effects of Active Length 21
3.2.3 Effects of Rotor Core Diameter 22
3.2.4 Effects of Motor’s Outer Stator Diameter 22
3.3 Improved Design Parameter 23
3.4 Results of The Improved Design 23
Chapter 4: Software’s 25
4.1 Introduction 25
4.2 Field Problems with Boundary Conditions 26
4.3 Boundary Conditions 26
4.4 The Finite Element Method 26
4.5 Creation of FEM-Based Model 27
4.6 Simulation of Induced Voltages and Flux Density 28
4.6.1 Results Obtained 29
4.7 Simulation for Currents 33
4
4.8 Simulation at Nominal Condition 33
4.9 Comparison of Fem Results with RMxprt Results 34
Chapter 5: Methodology 35
5.1 Methodology Approach 35
5.2 Flow chart 35
5.3 Methodology of Monitoring 40
5.4 Methodology of Controlling 43
5.5 Conclusion 44
Chapter 6: Monitoring of Hybrid Energy System46
6.1 Why Magnet Working Point Is Necessary 46
6.2 Magnet Working Temperature 46
6.3 Choice of The Magnet 46
6.4 Determination of Magnet Working Arc at Operating Condition 47
6.4.1 Method to Draw Point in Ansys 48
6.4.2 Determination of Magnet Working Point at No Load 48
6.5 Conclusion 50
Chapter 7: Controlling of Hybrid Energy System 51
7.1 RMxprt 51
7.1 Design Setup 51
7.1 Machine 51
7.1 Stator Design 52
7.1 Stator’s Slot Design 53
7.1 Stator Winding 53
7.1 Rotor Design 55
7.1 2d Cross Section Of PMSM 56
7.2 Maxwell 2D 56
7.2 Importing the Motor Design 56
7.2 Solution Setup 57
7.2 Mesh of Machine Geometry 58
7.2 2D Cross Section Of PMSM 59
7.3 Maxwell 3D 60
7.3 3D Cross Section of PMSM 60
Chapter 8: Experimental model 61
8.1 Hardware Implementation 61
8.2 Software Working65
Chapter 11: Testing and Results61
8.2 Maxwell 2D 67
8.2.10 Inductance d_q 73
8.2.11 Flux Linkage d_q 74
8.2.12 Flux Lines 74
5
8.2.13 Flux Density (Vector) 75
8.2.14 Flux Density (Magnitude) 75
8.2.15 Total Loss 76
Future Works 77
Bibliography 78
Appendix A (data sheets) 81
Annex A (RMxprt to Maxwell 2D/3D) 85
6
List of Symbols & Abbreviations
Symbols Definition
Do Outer stator diameter
D Airgap diameter (Inner stator diameter)
PJ Joule losses [W]
Ρcu Resistivity of copper
J Current density [A/m2]
S1 Current loading [A/m]
Kew End winding factor
Airgap Airgap surface area
ΔT Temperature difference between stator winding and ambient
cooling medium [°C]
Rth-eq Equivalent thermal resistance [°C/W]
Heq Equivalent convection coefficient [W/m2 /°C]
Ahe Heat exchange surface area
L Active length [mm]
σT Mean tangential stress [kNm-2]
Tem Electromagnetic torque [Nm]
Vairgap Airgap volume
Bmax Maximum airgap flux density [T]
Im Thickness of permanent magnet [mm]
µrpm Relative permeability of permanent magnet
δ Airgap length [mm]
Br Remanent flux density of permanent magnet [T]
Bδ Airgap flux density [T]
Drc Rotor core diameter [mm]
Di Rotor shaft diameter [mm]
P Number of poles
q Number of stator slots per pole per phase
hss Stator slot height [mm]
Bts Stator tooth width [mm]
hsw Slot wedge height [mm]
Qs Total number of stator slots
Kw Winding factor
Telectric period Time period for one electrical cycle [s]
f Frequency [Hz]
Tstep Time period for one step [s]
Tinitial Time at which simulation begins [s]
Tfinal Time at which simulation ends [s]
7
List of Figures
Figure no Figure name Pg no.
2.2 Existing Model 14
2.3 Block Diagram 16
3.1 ESP8266 19
3.2 PZEM-004T 20
3.3 Optocoupler 20
3.4 ULN2803 21
3.5 Relay 22
3.6 Voltage Regulator IC 22
5.1 System Concept 25
5.3 Methodology of Monitoring 26
5.4 Methodology of Controlling 27
5.6.1 Google Firebase 28
8
List of Tables
Table Table name Pg no.
No
1 Controlling conditions 26
9
Chapter 1: Introduction to Final Year Project
1.1 Objective
Electrical power is the basic need for the human being. The demand of the electrical power
is increasing day by day. Now a days electricity is not only produced by conventional
resources but non-conventional resources also. The use of non-conventional resources is
increasing because of clean energy and it is also cheaper as compare to the electrical energy
that is supplied by electrical companies [1]. In non-conventional resources solar energy and
wind energy is mostly used but there is situation that non-conventional resources not
always complete the demand of the load. So, non-conventional energy can be used with
conventional energy as a hybrid energy system [1]. Two or more energy resources combine
together to a single connection point to fulfil the demand of load is knows as hybrid energy
system [2].
Hybrid energy system consist of Karachi Electric supply, Solar energy and generator. By
using hybrid energy system, we want to use renewable energy more and save the cost of
electricity bill and in order to utilize renewable energy properly, monitoring and controlling
of the system is required [3]. Our Project is to make monitoring and controlling of hybrid
energy system[5].
Monitoring and controlling of hybrid energy system can be done by manually and remotely
by using mobile application and computer desktop [2]. For monitoring and controlling of
hybrid energy system Microcontroller ESP8266 is used. ESP8266 is connected to the Wi-Fi to
transfer and receive the data. The data is transferred to mobile application and computer by
using google firebase [4]. Google Firebase is open-source real time data base which takes
the data form the microcontroller ESP8266 and send it to the mobile application and
desktop and received feedback and commands from the mobile application and computer
desktop to the microcontroller ESP8266[5].
Hybrid energy systems are becoming increasingly popular as they offer a reliable and cost-
effective way of providing energy to remote locations and communities. However,
monitoring and controlling these systems can be challenging due to the complex nature of
the systems and the numerous components involved.
The primary problem is the lack of effective monitoring and control systems that can
accurately track the performance of each component in the hybrid energy system, including
the energy sources, energy storage systems, and energy distribution systems. This results in
difficulties in detecting and correcting any performance issues, which can lead to reduced
system efficiency, increased downtime, and higher maintenance costs.
10
In addition, there is a lack of accurate monitoring that can provide data on the performance
of the hybrid energy system. This makes it difficult to make informed decisions on system
performance, energy usage patterns, and energy distribution needs.
Furthermore, there is a lack of integration between the various components of the hybrid
energy system, which makes it challenging to coordinate and optimize energy production,
storage, and distribution. This leads to inefficient energy utilization, increased energy costs,
and reduced system performance.
To address these challenges, there is a need for an effective monitoring and control system
for hybrid energy systems that can provide monitored data, automate system control, and
integrate the various components of the system to optimize energy production, storage,
and distribution. The monitoring and control system should be able to provide a
comprehensive overview of the hybrid energy system's performance.
The solution should also be scalable to accommodate the growth of the hybrid energy
system, and should be easy to implement, use, and maintain.
1.3 Deliverables
Project Monitoring and Controlling of hybrid energy system has following deliverables
The scope of study for monitoring and controlling of a hybrid energy system can include the
following aspects:
2. System components: Study of the various components of the hybrid energy system,
such as solar panels, wind turbines, batteries, and diesel generators, and their
individual performance [8].
4. Monitoring and control systems: Analysis of the monitoring and control systems used
to manage and regulate the hybrid energy system, including hardware and software
components.
5. Data analysis: Collection, processing, and analysis of data from the hybrid energy
system to improve its performance and efficiency [2].
6. Reliability and stability: Study of the reliability and stability of the hybrid energy
system, including the impact of external factors such as weather conditions and load
variations [9].
7. Cost-benefit analysis: Evaluation of the costs and benefits of the hybrid energy
system, including the economic impact of different energy management strategies[1].
The monitoring and controlling of hybrid energy systems have gained significant attention in
recent years due to the increasing demand for renewable energy sources [13]. Hybrid
energy systems are composed of multiple energy sources, such as photovoltaic panels, wind
turbines, batteries, and diesel generators, which are integrated to form a single system [12].
The aim of monitoring and controlling hybrid energy systems is to optimize the energy
output and ensure efficient, reliable, and safe operation [13].
Studies have shown that the use of monitoring and control systems in hybrid energy
systems can improve the energy output, reduce energy waste, and increase system
reliability [11]. In particular, real-time monitoring of the energy system can provide valuable
information on the performance of each component, which can be used to improve system
efficiency and performance [14]. Additionally, the use of control systems can help to
regulate the energy flow between the various components, ensuring that the energy
produced by each component is used in an optimal manner [9].
Several control strategies have been proposed for monitoring and controlling hybrid energy
12
systems. Mainly strategy is by using IOT. he Internet of Things (IoT) is a rapidly growing
technology that is changing the way we interact with the world around us. One of the ways
IoT is making an impact is in the area of energy management [11]. The use of IoT devices,
such as the ESP8266, is enabling real-time monitoring and control of hybrid energy systems
[12].
A hybrid energy system is a combination of different sources of energy, such as solar, wind,
and battery storage [12]. The ESP8266 can be used to monitor the different energy sources
and to control how they interact with each other. For example, if the battery storage is
running low, the ESP8266 can direct the solar panels to increase their output [2].
The ESP8266 is well-suited for this task because of its low cost and ease of use. It can be
programmed to collect data from various sensors, such as those that measure the output of
solar panels or wind turbines [2]. This data can then be used to make decisions about how
best to manage the energy system [6].
One of the key benefits of using the ESP8266 for monitoring and controlling a hybrid energy
system is that it provides real-time visibility into the system [7]. This means that energy
managers can see exactly how much energy is being produced, where it is being used, and
what is happening with the different components [2]. This information can be used to make
more informed decisions about how to optimize the energy system [9].
In conclusion, the literature review shows that monitoring and controlling of hybrid energy
systems is a crucial aspect of renewable energy systems. The use of monitoring and control
systems can improve energy output, reduce energy waste, and increase system reliability
[11]. the use of the ESP8266 for monitoring and controlling a hybrid energy system is a cost-
effective and efficient way to manage the energy system. The real-time visibility provided by
the ESP8266 enables energy managers to make better decisions about how to optimize the
system and to ensure that it is running efficiently [3].
1.6 Conclusion
The objective of monitoring and controlling a hybrid energy system is to ensure efficient,
reliable, and safe operation by optimizing energy output. The primary problem is the lack of
effective monitoring and control systems that can accurately track the performance of each
component in the hybrid energy system [2]. The project aims to deliver an IOT based
switching and monitoring system hardware, a graphical user interface-based monitoring and
controlling system, and app-based remote access of hybrid energy systems. The literature
review highlights the importance of monitoring and controlling hybrid energy systems and
the need for further research in the field [13].
In hybrid systems, two or multiple different energy systems function synergistically while
converting energy from one source or a selection of sources in a harmonized manner [1].
The advantage is that hybridization is likely to combine very different types of energy
resources or systems, such as photovoltaic modules and wind turbines, hydro energy and
wind turbines, solar and natural gas, coal and concentrated solar power, solar photovoltaics
and hydrogen fuel cells, biomass and coal, geothermal and solar, and ocean thermal and
solar [14].
For example, hybridized systems including power and energy storage options can provide
nuclear power plants with greater capacity factors and promote better grid load leveling.
The current Hybrid Energy System is balancing power between Karachi Electric Supply, solar
energy, and generators. However, the switching between these sources is done
automatically but there is no proper monitoring system in place [12]. The goal of this hybrid
energy system is to ensure an uninterrupted power supply to the load by automatically
selecting the most available source out of the three options: Karachi Electric Supply, solar
energy, or generators. A diagram of the existing system can be seen in Figure 1.
The system works fine for providing uninterrupted power supply, but it lacks a proper
monitoring system to track the energy usage and regulation between the sources.
14
2.2.1 Drawbacks of Existing Model
• The existing system does not use proper of the renewable energy sources.
• There is no proper monitoring system in existing hybrid energy system.
• The existing system use renewable energy but the idea of sustainable development is
supported because there is no monitoring system for peak hours and non-peak hours.
15
Figure 2 Block Diagram
16
1. Remote Access: With a mobile application, you can monitor the hybrid system from
anywhere, as long as you have an internet connection. This allows for real-time
monitoring, which can be useful for remote or inaccessible locations.
2. User-Friendly Interface: A GUI (Graphical User Interface) can make it easy for users to
understand the status and control the functions of the hybrid system. The user can
access the information through a simple graphical interface, reducing the need for
technical knowledge.
3. Data Logging: The ESP8266 can be programmed to log data from the hybrid system,
which can then be accessed and analyzed through the mobile application or GUI. This
can provide valuable information for making informed decisions about the system's
performance and maintenance.
4. Cost Effective: The ESP8266 is a low-cost microcontroller, making it an affordable
option for monitoring and controlling a hybrid system. The use of a mobile application
can also reduce the need for additional hardware or infrastructure, such as a
computer or separate monitoring device.
5. Easy Integration: The ESP8266 can be easily integrated with a variety of sensors and
actuators, allowing for flexible monitoring and control of the hybrid system. The
mobile application can also be integrated with other software or platforms, such as
cloud storage or data analysis tools.
17
Chapter 3: Component Explanation
This chapter give full details of the component that are used in the project. It not only
delves into the specifics of each component, but it also thoroughly explains their pin
configurations
3.1 ESP8266
ESP8266 is a low-cost Wi-Fi microcontroller designed for IoT applications. It is a self-
contained SOC (System on a Chip) with integrated TCP/IP protocol stack that can give any
microcontroller access to Wi-Fi network.
The ESP8266 has a total of 17 pins, which are:
1. VCC: This pin is used to provide the 3.3V power supply to the device.
2. GND: This pin is the ground pin.
3. CH_PD: This pin is used to enable the device and is pulled high with a 10k resistor.
4. RST: This pin is used to reset the device.
5. RX: This is the receive pin, used to receive data from the UART interface.
6. TX: This is the transmit pin, used to transmit data to the UART interface.
7. GPIO0: This pin can be used as an input or output pin.
8. GPIO2: This pin can be used as an input or output pin.
9. GPIO15: This pin can be used as an input or output pin.
10.U0CTS: This pin is used for flow control when using the UART interface.
18
11.U0RTS: This pin is used for flow control when using the UART interface.
12.U0TXD: This pin is used for transmitting data when using the UART interface.
13.U0RXD: This pin is used for receiving data when using the UART interface.
14.U0CTS: This pin is used for flow control when using the UART interface.
15.SDIO_DATA0: This pin is used for SDIO data transfer.
16.SDIO_DATA1: This pin is used for SDIO data transfer.
17.SDIO_DATA2: This pin is used for SDIO data transfer.
In our project, we use two ESP8266 modules, one for monitoring and the other for
controlling. The ESP8266 acts as the brain of the project, collecting data from other
components and transmitting it to the server.
Figure 4 ESP8266
3.2 PZEM-004T
The PZEM-004T is a digital AC power meter that can be used to measure various parameters
such as voltage, current, power, energy, frequency, and power factor. The PZEM-004T is
equipped with an LED indicator that displays various status information. It uses a Modbus
RTU protocol to communicate with other devices. The pin configuration of the PZEM-004T is
as follows:
1. VCC: Positive power supply, 5V-24V DC
2. GND: Ground
3. RX: Receive data, connected to the TX of the host device
4. TX: Transmit data, connected to the RX of the host device
5. A: Current input, connected to the current transformer
6. V: Voltage input, connected to the voltage measurement terminal
7. N: Neutral input, connected to the neutral line.
In our project, we utilize the PZEM-004T for monitoring the load due to its advantages of
providing accurate outputs, easy connectivity, cost-effectiveness compared to CT and PT,
and the ability to measure multiple parameters such as voltage, current, power, energy,
19
frequency, and power factor with just one component, eliminating the need for multiple
components to measure different parameters
Figure 5 PZEM-004T
3.3 Optocoupler
An optocoupler (also called an optoelectronic coupler or optical isolator) is an electronic
device that transfers electrical signals between two isolated circuits using light. It typically
consists of an infrared light-emitting diode (LED) that faces a phototransistor and is used to
transfer signals between the two isolated circuits.
The pin configuration of an optocoupler usually consists of four pins:
1. Anode or positive lead of the LED
2. Cathode or negative lead of the LED
3. Collector of the phototransistor
4. Emitter of the phototransistor.
By connecting the anode of the LED to a voltage source, the LED is illuminated and creates a
current in the phototransistor, which can then be used to control other circuits. In our
project we use Optocoupler because we one side we have AC circuit and one side is DC so,
optocoupler provide safety and the 3.5V AC to UNL2803 IC.
Figure 6 Optocoupler
20
3.4 ULN2803
The ULN2803 is a high-voltage, high-current Darlington transistor array. The device consists
of eight npn Darlington pairs that feature high-voltage outputs with common-cathode clamp
diodes for switching inductive loads. The collector-current rating of each Darlington pair is
500 mA.
The pin configuration of ULN 2803 is as follows:
1. Pin 1: Collector (C1)
2. Pin 2: Base (B1)
3. Pin 3: Emitter (E1)
4. Pin 4: Collector (C2)
5. Pin 5: Base (B2)
6. Pin 6: Emitter (E2)
7. Pin 7: Collector (C3)
8. Pin 8: Base (B3)
9. Pin 9: Emitter (E3)
10.Pin 10: Collector (C4)
11.Pin 11: Base (B4)
12.Pin 12: Emitter (E4)
13.Pin 13: Ground (GND)
14.Pin 14: Collector (C8)
15.Pin 15: Base (B8)
16.Pin 16: Emitter (E8)
In our project ULN2803 is used because esp8266 gives 3.5V as an output but we want to
operate 12V relay and for this we use ULN2803 it give us output of 12V
Figure 7 ULN2803
3.5 Relay
A relay is an electrically operated switch that is used to control other devices. It consists of a
switch that is activated by an electromagnet when a current is passed through its coil. The
switch can then be used to control the flow of electricity to other devices, such as lights,
motors, or other electrical equipment. Relays are often used in control systems, automation
21
systems, and electrical distribution systems to control and direct the flow of electrical
power.
In our Project we use two types of relays one is 5V DC relay for sending single to the
microcontroller to tell which source is on and other one is 12V AC relay for switching
between the sources.
Figure 8 Relay
Chapter 4: Software’s
The ESP8266 controls our project by collecting data from the sensors for monitoring and
providing signals to the relay for control. To remotely monitor and automatically control the
hybrid energy system, the ESP8266 has to send the data to the server. This section provides
a complete description of the software’s that are used in our project.
4.2 Firebase
Firebase is a free server that we use to collect data from the microcontroller ESP8266 and
send it to a mobile application.
4.3 ThingSpeak
ThingSpeak is an IoT analytics platform service that allows you to aggregate, visualize and
analyze live data streams in the cloud. ThingSpeak provides instant visualizations of data
posted by your devices to ThingSpeak.
Android Studio is the official integrated development environment (IDE) for the Android
operating system, developed by Google. Android Studio is free and open source, and it is
the preferred choice of developers worldwide for developing Android apps.
The mobile application for our project was designed using Android Studio.
23
Chapter 5: Methodology
The cost-effectiveness and ease of installation are essential features that make the
proposed hybrid energy system competitive in the global market. In this section, the
complete methodology of the proposed system is discussed.
The system comprises of two main components, the hardware interface module and the
software communication module. The ESP8266 microcontroller serves as the central point
of the system, linking the IoT website and the hardware module. All control and
communication processes within the system are facilitated through the microcontroller. The
IoT-based system records data such as voltage (V), current (I), and power (P) from PZEM-
004T. These data are displayed on an LCD screen, a web server, and a mobile application.
The microcontroller receives data from a 5V relay which serves as the power source and
24
communicates with a 12V relay that controls the load. The data from the relays is then
transferred to the server and displayed on the mobile application as shown in figure 10
The PZEM-004T energy meter is preferred over traditional CTs and PTs for monitoring hybrid
energy systems due to its multiple sensors, ease of installation, communication interface,
and cost-effectiveness. PZEM-004T provide accurate measurement of various parameters,
while multiple sensors can measure voltage, current, power, energy consumption, and
frequency. The PZEM-004T is compact, lightweight, and easy to install, and it can be
integrated with a control system through its communication interface. Additionally, it is a
cost-effective solution as it provides multiple measurement capabilities in one device.
We use relays for actuators. In our system for switching the load between two sources the
relay is used. Relay is easy to connect and works properly. Additionally, relays provide
isolation between the control circuit and the load, making it safer to operate in high voltage
and high current systems.
25
5.3 Methodology of Monitoring
For monitoring the hybrid energy system, we use the PZEM-004T device that is connected to
an ESP8266 microcontroller. The PZEM-004T has two sets of wires. One side of it is
connected to the CT (Current Transformer) and the load, with the CT being connected to the
ground wire of the load. On the other side, the PZEM-004T has four pins that are connected
to the ESP8266 microcontroller. These four pins include the ground, a VCC pin (5V), and two
pins for RX and TX, which are used for serial communication to transfer data to the
microcontroller. The connection of pins of PZEM-004T is shown in figure 11. The
microcontroller then displays the data on the serial monitor and sends it to a web server,
Firebase, which transfers the data to a mobile application and GUI for viewing.
In a hybrid energy system, relays are utilized for control purposes. The project utilizes two
types of relays: a 5V DC relay and a 12V AC relay. The system requires the ability to switch
between multiple sources, which is why two 5V DC relays and two 12V AC relays are used.
The microcontroller, ESP8266, receives signals from the 5V DC relays and determines which
source is active. Adapters are utilized to convert 220V to 5V DC in order to power the 5V
relays.
The 12V AC relays are used for switching between the sources. The power for the 12V relays
is taken from the output of the ESP8266. However, the ESP8266 only provides 3.5V output,
which is not efficient for operating the relays. To resolve this issue, a ULN2083 IC is used,
which takes 3.5V input and provides 12V AC to the relays. The relays operate based on the
conditions indicated in Table 1 and the relay wiring diagram is shown in figure 12.
26
Figure 12 Methodology of Controlling
To send data from the esp8266, we need the Arduino IDE software. we upload the code to
the esp8266 microcontroller using the software. All the parameter of monitoring and
controlling will be shown on the serial monitor. To collect and send data to a firebase
server, we need to include the firebase library in your code. To display the data on an LCD,
we need to include the LCD and i2c converter libraries in your code.
#include "FirebaseESP8266.h"
#include <LiquidCrystal_I2C.h>
To send the data of ESP8266 on Firebase, connect the ESP8266 to a Wi-Fi network and
create a Firebase account. Create a new project in the Firebase console and set up the
Realtime Database. Install the Firebase library for ESP8266 in the Arduino IDE. Write the
code to monitor the data, including the Firebase library, URL and API key. Upload the code
to ESP8266 and view the data in the Firebase console by going to the "Data" section of the
Realtime Database. The data should be updated in real-time. The figure 13 shows the data
on firebase account
27
Figure 13 Google Firebase
5.6.2 ThingSpeak
To send data from an ESP8266 to ThingSpeak and create a graph for monitoring a hybrid
energy system, we first need to sign up for a ThingSpeak account and create a new channel.
After that, we will have to set up the ESP8266 board with the necessary hardware and
software components, including installing the ESP8266 board support package and libraries.
Once we have set up the ESP8266 board, we will have to write an Arduino sketch that reads
data from the energy system and sends it to ThingSpeak using the ThingSpeak API. Now we
have to use the "HTTPClient" library to make HTTP requests to ThingSpeak. After uploading
the sketch to the ESP8266, we configure the network settings on the ESP8266 so that it can
connect to the internet and send data to ThingSpeak. Once the data is being correctly sent
to ThingSpeak, we can create a new graph on the ThingSpeak dashboard. Figure no shows
the data shown on ThingSpeak
To develop an Android application for monitoring a hybrid energy system that takes data
from a Firebase server, follow these steps:
28
4 Set up ESP8266 to collect data from the hybrid energy system and send it to Firebase.
5 Add features to the app such as real-time updates, notifications, and graphs to
visualize the data.
6 APK file will generate
Graphical user interface is created by using ThingSpeak. We have create a channel and
name it load monitoring and then added field of current, voltage, power, power factor and
frequency. Then on dashboard od ThingSpeak we select gauges to represent the parameters
of the load. And for connecting it with arudino ide we have to add following lines in the
code
#include <ESP8266WiFi.h>
#include <ThingSpeak.h>
As shown in Figure 5, a hardware prototype of the proposed model has been developed in a
laboratory environment. A 12V LED is used as a load and is attached to the hardware. Two
microcontrollers, the ESP8266, are utilized - one for monitoring the circuit and the other for
controlling it. In the monitoring circuit, a PZEM004T is attached to monitor the load
29
parameters and an LM317 is attached to provide a fixed voltage to the microcontroller. In
the control section, two 220V AC supplies are provided to power the hardware, and two
adapters are attached to convert 220V to 5V DC to power the 5V DC relays. Optocouplers
are then used to connect the AC circuit to the DC circuit. An ULN2803 is used to power the
12V AC relay, as the ESP8266 microcontroller only outputs 3.5V, and the ULN2803 will
convert this to 12V to power the relay. The 12V is then used to switch between sources.
The ESP8266 is supplied with power and it sends all the data to the server. The server is
created using Firebase and ThinkSpeak. Two ESP8266 are used, one for monitoring which
collects data from the PZEM004T device and the other for control, which receives signals
from the source and sends a signal to the relay to switch between sources. Both ESP8266
30
are connected to the same Firebase and ThinkSpeak servers. Firebase sends data about the
current voltage, power factor, power, and frequency to the mobile application. Firebase also
sends data on whether the source is solar or K Electric, which is displayed on the mobile
application. Mobile Application is created by using software Android studios. Graphical user
interface is created by using ThinkSpeak which takes data from esp8266.
Figure 1 displays the data on the Arduino IDE software serial monitor. This data is then
transferred to a web server, as shown in Figure 2 where the values are displayed on
Firebase. In Figure 3, the data is displayed on the ThingSpeak server. A graphical user
interface was created on ThingSpeak, which is displayed in Figure 4. Finally, Figure 5 shows a
screenshot of a mobile application that displays monitoring and indicates whether the
power source is from solar or K Electric.
In our final year project laboratory, we perform testing on our hardware and compare the
monitored values with the calculated values. Additionally, we also check the status of
sources to verify which source is active through the mobile application and the graphical
31
user interface (GUI).
In table no 1 we compare 12W bulb calculated and monitored value that is coming on
mobile application. Screenshot of mobile application is shown in figure no 2
32
Reference
[1] P. Srivastava, M. Bajaj and A. Singh Rana, "IOT based controlling of hybrid energy system
using ESP8266", IEEE, 2018.
[2] S. Ahmed and B. Chellali, "Simulation and control of Solar Wind hybrid renewable power
system", 2017 6th International Conference on Systems and Control (ICSC), 2017.
[3] M. Elmnifi, "Hybrid power generation by using solar and wind energy hybrid power",
April 2019, [online] Available: https://www.researchgate.net/publication/332584510.
[4] P. Satish Kumar, R.P.S. Chandrasena, V. Ramu, G.N. Sreenivas and Victor Sam Moses
Babu, "Energy Management System for Small Scale Hybrid Wind Solar Battery Based
Microgrid", IEEE Access, pp. 10, 2017.
[5] S. Ahmed, majed m. alhaisoni, m. naeem, A. ahmad and M. altaf, "Joint Energy
Management and Energy Trading in Residential Microgrid System", IEEE ACCESS, no. july 6,
pp. 13, 2020.
[6] H. Hajebrahimi, S. Makhdoomi Kaviri, S. Eren and A. Bakhshai, "A New Energy
Management Control Method for Energy Storage Systems in Microgrids", IEEE ACCESS, pp.
14, 2020.
[7] H.E. Keshta, O.P. Malik, E.M. Saied, F.M. Bendary and A.A. Ali, "Energy management
system for two islanded interconnected micro-grids using advanced evolutionary
algorithms", ELSEVIER, no. 6 novemeber, pp. 14, 2020.
[8] G. Otiang Okot, I. Adabara, Mufana Masisani William, Emalu Mark, Kalulu Mathias and
Yusuf Olusola, "Android Platform Based Smart Grid Hybrid Load Control System", research
gate, no. april, pp. 17, 2020.
[9] S Murugesan and M.V. Suganyadevi, "Hybrid Renewable Energy Parameter Monitoring
And Control Of Smart Street Light Using IoT", International Journal of Scientific &
Technology Research, vol. 8, no. 10, pp. 7, October 2019.
[10] K. Baraka, M. Ghobril, S. Malek, R. Kanj and A. Kayssi, "Low Cost Arduino/Android-Based
Energy-Efficient Home Automation System with Smart Task Scheduling", Fifth International
Conference on Computational Intelligence Communication Systems and Networks, 2013.
[11] A. S. Patttanayak, B. S. Pattnaik and B. N. Panda, "Implementation of a smart grid
system to remotely monitor control and schedule energy sources using Android based
mobile devices", 9th International Conference on Industrial and Information Systems (ICIIS),
2014.
33
[12] M. Kumar, "Social Economic and Environmental Impacts of Renewable Energy
Resources", intechopen, 2020.
[13] S. Dorahakia, R. Dashtia and H. Reza Shakerb, "Optimal energy management in the
smart microgrid considering the electrical energy storage system and the demand-side
energy efficiency program", ELSEVIER, no. 18 January 2020, pp. 11, 2020.
[14] Adaramola MS, Agelin-Chaab M, Paul SS (2014) Analysis of hybrid energy systems for
application. Energy Conversion and Management 88(8): 284–295.
[15] Adaramola MS, Oyewola OM, Paul SS (2012) Technical and economic assessment of
hybrid energy systems. Energy Exploration & Exploitation 30(4): 533–551.
34
Appendix A
Codes
Source code of
35
Appendix B
Data Sheet
36
Data Sheet of 7805
Datasheet of ULN2803
37