You are on page 1of 66

POWER MANGEMENT AND MONITORING OF

SOLAR PV LOAD TROUGH SENSOR USING IoT.

A thesis submitted by

Shehriyar khan (13738)


Rafaqatullah khan (14107)
Owais Afridi (13686)

Supervisor Co-Supervisor
Engr.Shayan Tariq Jan Engr.Rashid Aleem

Submitted in the partial fulfillment of the requirements for the degree of


Bachelor of Engineering in Electrical Engineering

Department of Electrical Engineering, Iqra National University Peshawar

(June 2021)

i
CERTIFICATE
This is to certify that “POWER MANGEMENT AND MONITORING OF SOLAR
PV LOAD TROUGH SENSOR USING IoT" is submitted in partial fulfillment of the
requirement for the degree of Bachelor of Engineering in Electrical Engineering by the
following students:
Shehriyar khan (13738)
Rafaqatullah khan (14107)
Owais Afridi (13686)

______________________ ______________________
Supervisor Co-Supervisor
Engr.Shayan Tariq Jan Engr.Rashid Aleem

_____________________________________
(Chairman, Department of Electronic Engineering)

Date: __________________

ii
ACKNOWLEDGEMENT
I acknowledge that the Research work presented in this thesis is a contribution and
collaborative work of a lot of people without whom I might not have reached this
milestone in my life. First of all, I thank The Almighty and Most Merciful Allah for
granting me the skills and abilities to reach the heights of success, then my parents, who
were always there to support me through every thick and thin. I thank my supervisor for
being extremely cooperative, guiding me and helping me out in all the problems and
issues encountered during the development of the project. In the last I thank all my
friends who supported me morally. Thank you all and may Allah bless you.

iii
ABSTRACT

The power generated from solar panel is to be efficiently monitored and managed to
reduce the generation losses in solar power generation. Generally, we use solar plants to
build in the locations where people can’t reach on daily basis so this approach will help
them to virtually control their systems from faraway places. It monitors the panel load by
using the IoT technologies and the data which are received from the panels are send to
the server through the internet for the future use. It also helps the remote users to monitor
the solar power. The user can get the information about the current and previous average
parameter like voltage, current. This will facilitate the fault detection and preventive
maintenance of solar. In this paper we use the application Internet of thing (IOT) to
automatically control and monitor the solar power (renewable energy). Using this
technology, the cost of solar energy (renewable energy) generation reduces. This also
provide real time information to the user help to monitor the system. The main purpose of
this project is that the solar panel can collect or capture maximum solar radiation and
maintain the system more reliably and efficientlyand turn on and turn off the load
accordingly to battery backup. if battery backup reduced the load on solar panel also
reduces and when its restore to full backup it turns on the full load automatically and vice
versa.

Keywords: Solar Panel, Current Sensor, Wifi Module

iv
Table of Contents

ABSTRACT......................................................................................................................iv
Table of Contents...............................................................................................................v
List of Tables....................................................................................................................vii
List of Figures.................................................................................................................viii
List of Abbreviations........................................................................................................ix
List of Symbols...................................................................................................................x
1. INTRODUCTION.....................................................................................................1
1.1 Problem Statement................................................................................................2
1.2 Aims and Objectives.............................................................................................2
1.3 Thesis Layout........................................................................................................2
2. LITERATURE REVIEW.........................................................................................4
3. DESIGN AND METHODOLOGY........................................................................12
3.1 Methodology.......................................................................................................12
3.1.1 Controller.....................................................................................................12
3.1.2 Current sensor..............................................................................................13
3.1.2.1 Pinout specification..............................................................................14
3.1.3 Voltage Sensor.............................................................................................15
3.1.3.1 Voltage Sensor Module Pinout Configuration.....................................15
3.1.4 Power Supply...............................................................................................16
3.1.5 Battery..........................................................................................................16
3.1.6 Lcd Screen 16*2..........................................................................................17
3.1.6.1 Table LCD Pin with Function..............................................................18
3.1.7 Serial Convertor for LCD:...........................................................................18
3.1.8 Solar Panel...................................................................................................19
3.1.9 Wi-Fi Module..............................................................................................20
3.1.10 Relay module...............................................................................................21
3.1.11 Socket..........................................................................................................22

v
3.1.12 Buck converter.............................................................................................23
3.1.13 Loads............................................................................................................24
3.2 Design.................................................................................................................25
3.2.1 Arduino Programing IDE............................................................................25
3.2.2 Protecus Simulation.....................................................................................27
3.2.3 IoT Websitr Interface...................................................................................28
3.2.3.1 IoT Website Main Page Interface.........................................................28
3.2.3.2 Current Measurement On Iot Server....................................................29
3.3 Hardware Protype...............................................................................................30
4. RESULTS AND DISCUSSION..............................................................................31
4.1 Result..................................................................................................................31
4.1.1 Full load ON................................................................................................31
4.1.2 Midium loads on..........................................................................................32
4.1.3 Minimium Load ON....................................................................................33
4.1.4 Full Load ON After Battery Back Restore..................................................34
4.1.5 Graphically Output of Load Current............................................................35
4.2 Discussion...........................................................................................................35
5. CONCLUSION AND FUTURE RECOMMENDATIONS.................................36
5.1 Conclusion..........................................................................................................36
5.2 Future Recommendation.....................................................................................36
6. APPENDIX-A:.........................................................................................................37
6.1 Project coding.....................................................................................................37
7. REFERENCES........................................................................................................52

vi
List of Tables

Table 3.1.2-1: :Current Sensor Pin Out Specification.......................................................14


Table 3.1.3-1:Voltage Sensor Module Pinout Configuration............................................15
Table 3.1.6-1: LCD Pin with Function:.............................................................................18

vii
List of Figures

Figure 3.1.1.1: Controller in chapter 3..............................................................................13


Figure 3.1.2.1: Current Sensor in chapter 2.......................................................................14
Figure 3.1.3.1: Voltage Sensor in chapeter 3.....................................................................15
Figure 3.1.4.1: Power Supply in chapeter 3.......................................................................16
Figure 3.1.5.1: Battery in chapeter 3................................................................................17
Figure 3.1.6.1: 16X2 LCD Screen in chapeter 3...............................................................18
Figure 3.1.7.1: Serial Converter in chapter 3.....................................................................19
Figure 3.1.8.1: Solar Panel in chapter 3............................................................................20
Figure 3.1.9.1: Wi-Fi Module in chapter 3........................................................................21
Figure 3.1.10.1:Relay module in chapter 3.......................................................................22
Figure 3.1.11.1: Socket in chapter 3..................................................................................23
Figure 3.1.12.1: Buck Converter in chapter 3...................................................................24
Figure 3.1.13.1:Led loads in chapter 3.............................................................................25
Figure 3.2.1.1:Arduino IDE in chapter 3...........................................................................26
Figure 3.2.2.1:Protecus Simulation in chapter 3................................................................27
Figure 3.2.3.1: IoT website interface main page in chapter 3...........................................28
Figure 3.2.3.2: Current measurement value show on IoT server in chapter 3...................29
Figure 3.2.3.3: Lighted indication show loads status show on IoT server in chapter 3....29
Figure 3.2.3.1::Hardware Protype in chapter 3..................................................................30
Figure 4.1.1.1: : Full load on on display in chapter 4........................................................31
Figure 4.1.1.2: Full load on and showing on IoT in chapter 4..........................................31
Figure 4.1.2.1:Midium load ON and display in chapter 4.................................................32
Figure 4.1.2.3: Midium loads on IoT in chapter 4............................................................32
Figure 4.1.3.1: : Minimium load ON display in chapter 4...............................................33
Figure 4.1.3.2: Minimium load on IoT in chapter 4..........................................................33
Figure 4.1.4.1:Full Load ON After Battery Back Restore on display in chapter 4...........34
Figure 4.1.4.2:Full Load ON After Battery Back Restore on IoT display in chapter 4....34
Figure 4.1.5.1: Graphically output of load current in chapter 4........................................35

viii
List of Abbreviations

LA Lead Acid

LDR Light Dependent Resistor

LED Light Emitting Diode

LI Lithium Ion

LP Lithium Polymer

MPPT Maximum Power Point Tracking

PWM Pulse Width Modulation

P Power in Watt

lm lumen

lx lux

PIR Passive infrared Reciever

ix
List of Symbols

µ Micro

Ω Ohm

x
Chapter-1

1. INTRODUCTION

A solar monitoring system can help make you more aware of your PV system’s
performance. It offers information about energy consumption and generation, optimizing
energy usage, and damage to your solar system, among other topics. It’s important to
monitor your solar setup in some manner without monitoring, it can be difficult to figure
out if your solar panels are operating at their best or not. The Internet of things (IOT) is
an emerging technology that efficiently and effectively improving our daily life activities.
It reduces our cost of living by automating the manual processes. It integrates the
physical objects and devices via internet for synchronized communication. Here, solar
panels and solar plants are used for producing electricity in natural manner with the help
of sun light. These systems are manually operated by humans. So, there is a need of
efficient approach which automatically control and monitor the current, voltage and other
parameters of solar systems and provides real time statistics to users. Simply, the Internet
of things means the network of Physical objects. This provides us the connection of each
and every object in the world by means of wireless sensor network. Some of the devices,
buildings, vehicles and other objects embedded with the software, sensors, electronics
and network connectivity enables these objects to collect and exchange the data. This IoT
(Internet of Things) is achieved by wireless sensor networks, 2G/3G/4G networks, GSM,
GPRS, RFID, WI-FI, GPS, microcontroller, microprocessor, etc. Accepting the
information and processing that relevant data can provide an understanding which is
needed to build the “intelligence” into “things”. This is the highlighted feature which
differentiates IOT from standard internet. The system consists of a controller
incorporated with ESP32 Module, voltage sensor and current sensor. The ESP32 Module
is a controller integrated with Wi-Fi and Bluetooth support. The sensors check the
predefined conditions that are programmed and detects the output voltage and current.
The module alerts to the users or the maintenance in charge and uses the things speak
cloud to show the received data from sensor and GUI to display. By using the IoT we can
enable the machine to machine communication M2M or device to device communication

1
2

without human intervention. The Internet of Things (IoT) is a system of related


computing devices, digital and mechanical machines, objects, people with unique
identifiers and potential transfer of data over a network without human-to-human or
human-to- computer interaction. Physical objects those are no longer disconnected from
the virtual world, but can be controlled remotely through Internet services. A smart world
is nothing but Smart devices, Smartphones, Smart cars, Smart homes and Smart cities.
“Smart” objects play a key role in the vision of IoT, since embedded communication and
information technology would have the potential to revolutionize.

1.1 Problem Statement


Following are the problem statement.

 Available Charge Controller Are Load Dependent i.e 1kw,2kw and So On.
 Not Existing Any Mechanism for Monitoring and Management of load on PV
Panel.that can turn off the load according to battery backup as backup
increased full load on and if battery backup decresed it turn off the high
cureent consumping load and vice versa.
 Un availability of Notification and Updating regarding daily load.

1.2 Aims and Objectives


Our aim is to design the Intelligent system for controlling the load on pv solar
controlling in sense turn on /off of load accordingly current rating and battery backup and
send the information to server using IoT.

Our objective is make the system in which we can control the Power management and
controlling of load on solar pv and sending the information to server for moinitoring
using Internet of Things.

1.3 Thesis Layout


We organized our thesis in following manner.
3

In our thesis organization Ist chapter consists of introduction of our project and aim of
our project and objective of our project and problem statement which we face in make of
our project and thesis layout.

2nd chapter consists of literature review related to our project we study different literature
regading our project and in which we included 20 differenet literature which mostly alike
our project.

3rd chapter consists of design and methodology in which we explain hardware and
software portion of our project and design of our project means simulation and circuit
designing implementation tools.

The 4th chapter of our thesis consists of our project result and different disscution
regarding project.

The 5th chapter consists of our project in which we explain conclusions extracted from
our project and recommendation regarding our project that how we improved and get
more accuracy in future.

6th chapter consists of appendix in which explain data sheet of different components and
programming of our project and data regading our project.
Chapter-2

2. LITERATURE REVIEW

Internet of things is an emerging technology that efficiently and effectively improving


our daily life activities. It reducing the cost of living by automating the manual processes.
It integrates physical objects and devices via internet for synchronized communication.
Currently the cost of electricity is reaching the sky so we need some sources that can
produce electricity naturally without any cost. Here, solar panels and solar plants take
place for producing electricity in natural manner with sun light. Photo voltaic cells are
used in these systems that converts the sun light into electricity. Mostly the solar systems
are configured in rural or agricultural areas where electricity mediums are still not
available. These systems are manually operated by humans. So there is need of efficient
approach which automatically control and monitor the current, voltage and other
parameters of solar systems and provides real time statistics to users. This research paper
proposes an IOT based approach for solar power consumption and monitoring that allow
the users to monitor or control a solar plant their mobiles. Majorly, solar plants are built
in the locations where people cannot reach on daily basis so this approach allows the
people to virtually control their systems from faraway places[1]. : Solar photovoltaic
(PV) is one of the prominent sustainable energy sources which shares a greater
percentage of the energy generated from renewable resources. As the need for solar
energy has risen tremendously in the last few decades, monitoring technologies have
received considerable attention in relation to performance enhancement. Recently, the
solar PV monitoring system has been integrated with a wireless platform that comprises
data acquisition from various sensors and nodes through wireless data transmission.
However, several issues could affect the performance of solar PV monitoring, such as
large data management, signal interference, long-range data transmission, and security.
Therefore, this paper comprehensively reviews the progress of several solar PVbased
monitoring technologies focusing on various data processing modules and data
transmission protocols. Each module and transmission protocol-based monitoring
technology is investigated with regard to type, design, implementations, specifications,
and limitations. The critical discussion and analysis are carried out with respect to
configurations, parameters monitored, software, platform, achievements, and suggestions.
Moreover, various key issues and challenges are explored to identify the existing research
gaps. Finally, this review delivers selective proposals for future research works. All the
highlighted insights of this review will hopefully lead to increased efforts toward the

4
5

enhancement of the monitoring technologies in future sustainable solar PV


applications[2]. The environmentally clean nature of solar photovoltaic (PV) technology
causes PV power generation to be embraced by all countries across the globe.
Consequently, installation and utilization of PV power systems have seen much growth in
recent years. Although PV arrays of such systems are robust, they are not immune to
faults. To guarantee reliable power supply, economic returns, and safety of both humans
and equipment, highly accurate fault detection, diagnosis, and interruption devices are
required. In this paper, an overview of four major PV array faults and their causes are
presented. Specifically, ground fault, line-line fault, arc fault, and hot spot fault have been
covered. Next, conventional and advanced fault detection and diagnosis (FDD)
techniques for managing these faults are reviewed. Moreover, a single evaluation metric
has been proposed and utilized to evaluate the performances of the advanced FDD
techniques. Finally, based on the papers reviewed, PV array fault management future
trends and possible recommendations have been outlined[3]. We have Developed an IoT-
based real-time solar power monitoring system in this paper. It seeks an opensource IoT
solution that can collect real-time data and continuously monitor the power output and
environmental conditions of a photovoltaic panel.The Objective of this work is to
continuously monitor the status of various parameters associated with solar systems
through sensors without visiting manually, saving time and ensures efficient power
output from PV panels while monitoring for faulty solar panels, weather conditionsand
other such issues that affect solar effectiveness.Manually, the user must use a multimeter
to determine what value of measurement of the system is appropriate for appliance
consumers, which is difficult for the larger System. But the Solar Energy Monitoring
system is designed to make it easier for users to use the solar system.This system is
comprised of a microcontroller (Node MCU), a PV panel, sensors (INA219 Current
Module, Digital Temperature Sensor, LDR), a Battery Charger Module, and a battery.
The data from the PV panels and other appliances are sent to the cloud (Thingspeak) via
the internet using IoT technology and a Wi-Fi module (NodeMCU). It also allows users
in remote areas to monitor the parameters of the solar power plant using connected
devices. The user can view the current, previous, and average parameters of the solar PV
system, such as voltage, current, temperature, and light intensity using a Graphical User
Interface. This will facilitate fault detection and maintenance of the solar power plant
easier and saves time[4]. Availability of renewable energy now makes solar energy the
right choice because of its advantages and easy application compared to other renewable
energy sources. Monitoring of the output parameters of solar power plants needs to be
done to assess the performance and efficiency of a solar power plant in real
environmental conditions. The aims of research is to provide a direct and real time
6

monitoring. This research has been carried out in solar power plants at Engineering
Physics Department, FTI-ITS. The design of an ATmega32 microcontroller-based system
that is integrated with Raspberry-pi as a data acquisition system. Data reading solar
power plants output parameters stored in memory can be downloaded at any time. The
analysis result shows that the efficiency of photovoltaic arrays is 10.78 %. The total
efficiency of the solar power plants system is 8.05 %[5]. Renewable energy sources are
proven to be reliable and accepted as the best alternative for fulfilling our increasing
energy needs. Solar photovoltaic energy is the emerging and enticing clean technologies
with zero carbon emission in today's world. To harness the solar power generation, it is
indeed necessary to pay serious attention to its maintenance as well as application. The
IoT based solar energy monitoring system is proposed to collect and analyzes the solar
energy parameters to predict the performance for ensuring stable power generation. The
main advantage of the system is to determine optimal performance for better maintenance
of solar PV (photovoltaic). The prime target of PV monitoring system is to offer a cost-
effective solution, which incessantly displays remote energy yields and its performance
either on the computer or through smart phones. The proposed system is tested with a
solar module of 125- watts to monitor string voltage, string current, temperature, and
irradiance. This PV monitoring system is developed by a smart Wi-Fi enabled CC3200
microcontroller with latest embedded ARM processor that communicates and uploads the
data in cloud platform with the Blynk application. Also the Wireless monitoring system
maximizes the operational reliability of a PV system with minimum system cost[6]. The
power generated from solar panel is to be efficiently monitored and managed to reduce
the generation losses in solar power generation. Generally, we use solar plants to build in
the locations where people can’t reach on daily basis so this approach will help them to
virtually control their systems from faraway places. It monitors the panel load by using
the IoT technologies and the data which are received from the panels are send to the
cloud through the internet for the future use. It also helps the remote users to monitor the
solar power plant. The user can get the information about the current and previous
average parameter like voltage, temperature and current. This will facilitate the fault
detection and preventive maintenance of solar. In this paper we use the application
Internet of thing (IOT) to control and monitor the solar power (renewable energy). This
system is designed to solve the problem occur in solar power generation like management
problem, maintenance and to reduce the time of repair. Using this technology, the cost of
solar energy (renewable energy) generation reduces. This also provide real time
information to the user help to monitor the system. The main purpose of this paper is that
the solar panel can collect or capture maximum solar radiation and maintain the system
more reliably and efficiently[7]. In this paper, we propose a power management
7

framework for solar-powered Internet of Things (IoT) devices to maximize the lifetime of
the system by adaptively changing performance of the system. Our framework balances
the energy consumption and the performance of the IoT system by monitoring energy
accumulation and battery, and ensures the minimum level of service. The framework has
been implemented in real hardware and software. Experiments with the implemented
system shows that our framework can help increase the lifetime of the solar powered IoT
system. The framework prevented the IoT device from power down due to the full
discharge of the battery at night time, by changing the execution rate based on energy
accumulation and battery status. The proposed framework has been implemented using
open hardware compatible with Arduino, so it can be used for a wide range of IoT
applications and services[8]. Occurrence of high impedance faults (HIFs) in rural
overhead power distribution networks may cause safety and economic issues for both
public and the utility. Such faults may not be detected by the conventional protection
schemes, so the development of a more sophisticated method is necessary. The
forthcoming evolution of power networks to smart grids creates opportunities for new
technologies to be implemented to that purpose. Utilities may transmit data that are
necessary for the system operation using specific frequency ranges. A novel method
utilizing these is proposed in this work. The monitoring of the network’s input impedance
in these frequency ranges can be used for detection of HIF occurrence, because such
faults impose significant changes in its value. The proposed method is applied to single
branch topologies, as well as to an existing topology of a Greek rural distribution system.
Significant conclusions are derived in both cases. Moreover, the influence of several
parameters, such as fault impedance and location and earth’s electromagnetic properties
on the method’s efficacy is examined. Also, it is shown that the implementation of the
proposed method may be drastically simplified by focusing on the monitoring of specific
frequencies rather than the entire frequency range under study[9]. The aim of this paper is
to monitor and distribute the power in the solar based power systems remotely. The
system contains multiple grids of solar panels where each grid is connected to various
sensors to measure the parameters in order to monitor the system. The output of the
sensor is fed to the mini microcontroller of this project (Arduino UNO). The output from
all the mini microcontrollers is given to the main microcontroller which is 8051
microcontroller in this case, which is in turn connected to a Bluetooth module (HC-05).
The main microcontroller (8051) processes all the received data from the mini
microcontrollers (Arduino UNO) and displays it on the LCD connected to it and also
sends this data via a Bluetooth module (HC-05) to user. The user remotely monitors the
data via a smartphone using Bluetooth Terminal application. Monitoring of power system
is implemented and tested in this manner. This paper also aims towards the distribution of
8

the power that was monitored before. The user sends a signal to another microcontroller
(Arduino Uno) wirelessly which then controls the relay on the basis of the signal sent by
the user. Now, the control signal from Arduino Uno is used for switching ON/OFF of
relay and power from the power system is distributed accordingly. This is how power is
monitored and distributed in power stations (solar power system).This paper aims to
make the existing systems more efficient and cost effective[10]. The Internet of Things
has a vision in which the internet extends into the real world, which incorporates
everyday objects. The IoT allows objects to be sensed or controlled remotely over
existing network infrastructure, creating opportunities for pure integration of the physical
world into computer-based systems, and resulting in improved efficiency, accuracy and
economic benefit in addition to reduced human intervention. This technology has many
applications like Solar cities, Smart villages, Micro grids and Solar Street lights and so
on. As Renewable energy grew at a rate faster than any other time in history during this
period. The proposed system refers to the online display of the power usage of solar
energy as a renewable energy. This monitoring is done through raspberry pi using flask
framework. Smart Monitoring displays daily usage of renewable energy. This helps the
user to analysis of energy usage. Analysis impacts on the renewable energy usage and
electricity issues[11]. Solar photovoltaic (PV) system has become the greatest attraction
in the clean, renewable electricity generation. However, the performance is varying due
to various parameters and environmental conditions. Hence, a remote and real-time
monitoring system is needed to assess its performance. Implementation of the Internet of
Things (IoT) in the monitoring of the solar PV system was proposed and its performance
was studied. The system consists of data acquisition, data gateway, and smartphone
application display. The data acquisition was successfully collect the data with 98.49%
accuracy and was uploaded to the data gateway. The data gateway was able to send the
graphical representation of the data to the smartphone application with a mean
transmission time of 52.34 seconds. The results demonstrate that the proposed monitoring
system can be a promising solution for intelligent remote and real-time monitoring of a
solar PV system[12]. Monitoring photovoltaic systems can provide useful information
about their operation and what should be done to improve performance, but if the data are
not reported properly, the effort is wasted. To be helpful, a monitoring report must
provide information on the relevant aspects of the operation in terms that are easily
understood by a third party. Appropriate performance parameters need to be selected, and
their values consistently updated with each new issue of the report. In some cases it may
be beneficial to monitor the performance of individual components in order to refine and
improve system performance, or be alerted to loss of performance in time for
preventative action. For example, monitoring battery charge/discharge profiles will signal
9

when replacement is due before downtime from system failure is experienced[13]. Solar
power is emerged as a likely supply of renewable power over the last to 3 decades. This
sun power is transformed into electric power with the aid of using the use of sun panel in
line with the precept of photovoltaic effect. Out of diverse renewable power reassets sun
power is extensively used. Because it is easy and it is straightforward to apply in family
too. Solar Trackers is a tool used for the rotation of sun panel in line with the solar’s rays.
To make use of this renewable sun power sun trackers are employed. For static sun panel,
there may be no motion withinside the panel. But the placement of the solar adjustments
in the course of growing and setting (solar rises withinside the east and units withinside
the west). Due to this reason, unmarried axis sun tracker is advanced for rotation of sun
panel in east and west direction. But because of the rotation and revolution of earth we
can not get same quantity of sunrays all through the year[14]. This paper presents a low-
cost prototype for monitoring online the maximum power produced by a domestic
photovoltaic (PV) system using Internet of Things (IoT) technology. The most common
tracking algorithms (P&O, InCond, HC, VSS InCond, and FL) were first simulated using
MATLAB/Simulink and then implemented in a low-cost microcontroller (Arduino). The
current, voltage, load current, load voltage, power at the maximum power point, duty
cycle, module temperature, and in-plane solar irradiance are monitored. Using IoT
technology, users can check in real time the change in power produced by their
installation anywhere and anytime without additional effort or cost. The designed
prototype is suitable for domestic PV applications, particularly at remote sites. It can also
help users check online whether any abnormality has happened in their system based
simply on the variation in the produced maximum power. Experimental results show that
the system performs well. Moreover, the prototype is easy to implement, low in cost,
saves time, and minimizes human effort. The developed monitoring system could be
extended by integrating fault detection and diagnosis algorithms[15]. With an enormous
range of applications, Internet of Things (IoT) has magnetized industries and
academicians from everywhere. IoT facilitates operations through ubiquitous
connectivity by providing Internet access to all the devices with computing capabilities.
With the evolution of wireless infrastructure, the focus from simple IoT has been shifted
to smart, connected and mobile IoT (M-IoT) devices and platforms, which can enable
low-complexity, low-cost and efficient computing through sensors, machines, and even
crowdsourcing. All these devices can be grouped under a common term of M-IoT. Even
though the positive impact on applications has been tremendous, security, privacy and
trust are still the major concerns for such networks and an insufficient enforcement of
these requirements introduces non-negligible threats to M-IoT devices and platforms.
Thus, it is important to understand the range of solutions which are available for
10

providing a secure, privacy-compliant, and trustworthy mechanism for M-IoT. There is


no direct survey available, which focuses on security, privacy, trust, secure protocols,
physical layer security and handover protections in MIoT. This paper covers such
requisites and presents comparisons of state-the-art solutions for IoT which are applicable
to security, privacy, and trust in smart and connected M-IoT networks. Apart from these,
various challenges, applications, advantages, technologies, standards, open issues, and
roadmap for security, privacy and trust are also discussed in this paper[16]. Data logger
and monitoring systems are very crucial for the efficient, robust and smooth operation of
PV solar energy system. Data logger and monitoring system enables the proper operation
and contributes to identifying system malfunctioning before any major breakdown. In this
thesis, a low-cost, user-friendly, reliable data logger and monitoring system has been
developed mainly for a pico solar home system in a rural area of a developing country.
This ESP 32 microcontroller based data logger stores all monitoring parameter in a micro
SD card and displays that on a Blynk App. Data can be downloaded directly from the
webpage to analyze and verify the system operation. The developed data logger hardware
prototype uses only four sensors for humidity, temperature, voltage, and current sensing.
An already developed Android app is use for cell phone to display all parameters in real
time basis for an efficient monitoring which can also able to give important information
to maintenance personnel for any issues in battery charging. To accomplish the task, we
have developed the hardware implementation of remote data acquisition architecture of
photovoltaic systems based on the Internet of Things. The overall cost of this prototype is
economical[17]. So far, solar energy is one of the inexhaustible and reliable energies that
are known for their low running costs and low maintenance. It has become a potential
solution for sustainable energy in the future. Since this renewable energy source has
become increasingly integrated into the electrical grid, there is a growing need to control
and monitor it in real time to optimize network performance and make it more and more
intelligent , stable and remotely controllable. This article proposes a secure architecture
for remote data acquisition from solar panels using the Internet of Things (IOT) with
voltage, current, temperature, solar irradiance sensors and other field devices. The data
will be routed to the Raspberry Pi then stored on the IOT cloud service. This data can be
accessed from a web interface on the phone. The architecture discussed in this article can
facilitate faults diagnosis, data collection for forecasting, preventive maintenance[18].
This paper addresses the Internet of Things. Main enabling factor of this promising
paradigm is the integration of several technologies and communications solutions.
Identification and tracking technologies, wired and wireless sensor and actuator
networks,enhanced communication protocols (shared with the Next Generation Internet),
and distributed intelligence for smart objects are just the most relevant. As one can easily
11

imagine,any serious contribution to the advance of the Internet of Things must


necessarily be the result of synergetic activities conducted in different fields of
knowledge, such as telecommunications, informatics, electronics and social science. In
such a complex scenario, this survey is directed to those who want to approach this
complex discipline and contribute to its development. Different visions of this Internet of
Things paradigm are reported and enabling technologies reviewed. What emerges is that
still major issues shall be faced by the research community. The most relevant among
them are addressed in details[19]. This paper describes more efficient home energy
management system to reduce power consumption in home area. We consider the room
easily controllable with an IR remote control of a home device. The room has automatic
standby power cut-off outlets, a light, and a ZigBee hub. The ZigBee hub has an IR code
learning function and educates the IR remote control signal of a home device connected
to the power outlet. Then the power outlets and the light in the room can be controlled
with an IR remote control. A typical automatic standby power cut-off outlet has a waiting
time before cutting off the electric power. It consumes standby power during that time.
To eliminate the waiting time, we turn off the home device and the power outlet
simultaneously with an IR remote control through the ZigBee hub. This method actively
reduces the standby power. The proposed HEMS provides easy way to add, delete, and
move home devices to other power outlets. When a home device is moved to the different
outlet, the energy information of the home device is kept consistently and seamlessly
regardless of location change. The proposed architecture gives more efficient energy-
saving HEMS1[20].
12

Chapter-3

3. DESIGN AND METHODOLOGY

3.1 Methodology
We used different components in our project implementation in real form which are as
following.

1. Controller 2560
2. Current Sensor
3. Voltage Sensor
4. Power Supply
5. Battery
6. Lcd Display
7. Serial Converter
8. Solar panel
9. Wifi module
10. Relay module

11. Socket

12. Buck converter

13. Loads
13

3.1.1 Controller

Arduino MEGA is one among the most recent microcontroller management boards
created by Arduino and a MEGA micro-monitoring. The Arduino board could be a
reference model of the Arduino platform. During this project, we have a tendency to used
Arizona boards to attach alphanumeric display sensors additionally as GSM initial we
have a tendency to connect the motion device of pin half-dozen and also the gas device of
pin seven and eventually we have a tendency to connect Arduino MEGA is AN
ATmega328-based mini-control board (data sheet). merely connect it to a laptop with a
USB cable or charge it with AN AC adapter or battery to induce started.

The MEGA is completely different from all the previous boards therein it doesn't use the
USB serial driver. Instead, it offers USB-connected Atmega8U2 to the serial convertor.
“MEGA” means that one in Italian and has been updated to mark the future unharness of
Arduino one.0.

MEGA and can be a reference of the Arduino going forwardly is that the latest within the
USB dashboard and reference model for the Arduino platform; for assessment to the
previous version, the Arduino Mega is AN ATmega328-based mini-control board (data
sheet). USB affiliation, a USB port, and a push button. It contains everything you wish to
take care of a microwave monitor. Basically attach it to a laptop with a USB cable or duty
it with AN AC-to-DC device to induce started. The MEGA is completely different in the
end the previous boards therein it. Instead, it's the Atmega16U2 (Atmega8U2 to R2)
code, that is about up as a USB for publishing.

The second revision of the MEGA board incorporates an electrical device that pulls AN
8U2 HWB cable to the bottom that facilitates change to DFU mode.
14

Figure 3.1.1.1: Controller in chapter 3

3.1.2 Current sensor

It is used to measure the current used by the entire circuitry. It is easy to use due to
compact size and can measure maximum 5A current. The Allegro ACS712 provides
economical and precise solutions for AC or DC current sensing in industrial, commercial,
and communications systems. The device package allows for easy implementation by the
customer. Typical applications include motor control, load detection and management,
switched-mode power supplies, and overcurrent fault protection. The device consists of a
precise, low-offset, linear Hall sensor circuit with a copper conduction path located near
the surface of the die. Applied current flowing through this copper conduction path
generates a magnetic field which is sensed by the integrated Hall IC and converted into a
proportional voltage. Device accuracy is optimized through the close proximity of the
magnetic signal to the Hall transducer. A precise, proportional voltage is provided by the
low-offset, chopper-stabilized BiCMOS Hall IC, which is programmed for accuracy after
packaging. The output of the device has a positive slope (>VIOUT(Q)) when an
increasing current flows through the primary copper conduction path (from pins 1 and 2,
to pins 3 and 4), which is the path used for current sensing. The internal resistance of this
conductive path is 1.2 mΩ typical, providing low power loss. The thickness of the copper
conductor allows survival of the device at up to 5× overcurrent conditions. The terminals
of the conductive path are electrically isolated from the sensor leads (pins 5 through 8).
This allows the ACS712 current sensor to be used in applications requiring electrical
isolation without the use of opto-isolators or other costly isolation techniques.
15

Figure 3.1.2.2: Current Sensor in chapter 2

3.1.2.1 Pinout specification

Table 3.1.2-1: :Current Sensor Pin Out Specification

Pin Number Name Description


1 And 2 1p+ Terminal For Currrent
Being Sense .
3 And 4 1p-
5 Gnd Signal Ground
6 Filter Terminal For Extrnal
Capacitor For Bandwidht
7 VIOUT Analog Output Signal
8 VCC Device Power Supply
Terminal

3.1.3 Voltage Sensor

It is used to measure battery voltage. Voltage sensor is a precise low-cost sensor for
measuring voltage. It is based on the principle of resistive voltage divider design. It can
make the red terminal connector input voltage to 5 times smaller.
Voltage Detection Sensor Module is a simple and very useful module that uses a potential
divider to reduce any input voltage by a factor of 5. This allows us to use the Analog
input pin of a microcontroller to monitor voltages higher than it capable of sensing. For
example, with a 0V - 5V Analog input range, you are able to measure a voltage up to
25V. This module also includes convenient screw terminals for easy and secure
16

connections of a wire. Interfacing a voltage sensor with Arduino or any


other microcontroller is pretty straight forward. Connect the VCC and GND of voltage
source whose voltage to be measured to the screw terminals of the voltage sensor.
Connect the S and – (GND) pins of voltage sensor to Analog pin and GND of Arduino
respectively.

3.1.3.1 Voltage Sensor Module Pinout Configuration

Table 3.1.3-2:Voltage Sensor Module Pinout Configuration

Pin Name Description


Vcc Positve Terminal Of External Voltage (0-
25v)

Gnd Negative Terminal Of Supply Voltage


S Out Put Analog Pin
+ Not Connected
- Ground Pin Of Controller

Figure 3.1.3.3: Voltage Sensor in chapeter 3

3.1.4 Power Supply

We used 12v 2A adaptor for wapda sourc for manngement of power sources in which we
used different sources. A DC power supply 12v is an electronic circuit that converts an ac
voltage to dc voltage. Power Adapter is basically consisting of the following elements:
transformer, rectifier, filter and regulator circuits.
17

A power supply is an electrical device that supplies electric power to an electrical load.


DC power supply 12v primary function of a power supply is to convert electric
current from a source to the correct voltage, current, and frequency to power the load. As
a result, power supplies are sometimes referred to as electric power converters. Some
power supplies are separate standalone pieces of equipment, while others are built into
the load appliances that they power

Power supplies are categorized in various ways, including by functional features. For
example, a regulated power supply is one that maintains constant output voltage or
current despite variations in load current or input voltage. Conversely, the output of
an unregulated power supply can change significantly when its input voltage or load
current changes.

Figure 3.1.4.4: Power Supply in chapeter 3

3.1.5 Battery

We used 12v 7A battery for providing power to leds and current sensor and controller.
The lead-acid battery is a type of rechargeable battery first invented in 1859 by French
physicist Gaston Planté. It is the first type of rechargeable battery ever created. Compared
to modern rechargeable batteries, lead-acid batteries have relatively low energy density.
Despite this, its ability to supply high surge currents means that the cells have a relatively
large power-to-weight ratio. These features, along with their low cost, make them
attractive for use in motor vehicles to provide the high current required by starter motors.
18

As they are inexpensive compared to newer technologies, lead-acid batteries are widely
used even when surge current is not important and other designs could provide
higher energy densities. In 1999 lead-acid battery sales accounted for 40–50% of the
value from batteries sold worldwide (excluding China and Russia), equivalent to a
manufacturing market value of about in billion.Large-format lead-acid designs are widely
used for storage in backup power supplies in cell phone towers, high-availability settings
like hospitals, and stand-alone power systems. For these roles, modified versions of the
standard cell may be used to improve storage times and reduce maintenance
requirements. Gel-cells and absorbed glass-mat batteries are common in these roles,
collectively known as VRLA (valve-regulated lead-acid) batteries.

Figure 3.1.5.5: Battery in chapeter 3

3.1.6 Lcd Screen 16*2

The LCD is an automated module and most bargain many solicitations. This is a
rudimentary unit and is mainly rummage-sale in innumerable strategies and tours. These
units are chosen finished multi-part LEDs. We use LCDs because they are easy to
program means it can spectacle every 16 letterings. Then two of these. In each
atmosphere is shown in a 5x7 pixel milieu. This LCD has two registrants: a description of
the data and a command.
19

Figure 3.1.6.6: 16X2 LCD Screen in chapeter 3

3.1.6.1 Table LCD Pin with Function

Table 3.1.6-3: LCD Pin with Function:

Pin No Function Name

1 Ground (0v) Ground

2 Supply Voltage Vcc

3 Contrast Vee

4 Select Command Register Register Select

5 Read And Write The Register Read/Write

6 Send Data To Pins When High To Low Pulse Is Given Enable

7 Data Pin 1

8 Data Pin 2

9 Data Pin 3

10 Data Pin 4

11 Data Pin 5

12 Data Pin 6

13 Data Pin 7

14 Data Pin 8

15 Led Positive

16 Led Negative

3.1.7 Serial Convertor for LCD:


20

A standard LCD adapter is used to attach a 2x16 or 4x20 LCD to your development
board or prototype. The board has a detector used to adjust the brightness of the LCD. A
16-bit MCP23S17 I / O amplifier is provided on board, thus reducing the number of
MCU pins needed to run this display. The amplifier has a SPI clock speed (tm) of up to
10 MHz for high bandwidth applications. The board is equipped with a long cable with
IDC10 female connector, which is compatible with all microwave development boards.

Figure 3.1.7.7: Serial Converter in chapter 3

3.1.8 Solar Panel

It is used for providing power to circuit for working on solar energyand also battery can
be charging from solar power. A solar panel, or photo-voltaic (PV) module, is an
assembly of photo-voltaic cells mounted in a framework for installation. Solar panels
use sunlight as a source of energy to generate direct current electricity. A collection of
PV modules is called a PV panel, and a system of PV panels is called an array. Arrays of
a photovoltaic system supply solar electricity to electrical equipment.
Photovoltaic modules use light energy (photons) from the Sun to generate electricity
through the photovoltaic effect. Most modules use wafer-based crystalline silicon cells
or thin-film cells. The structural (load carrying) member of a module can be either the top
layer or the back layer. Cells must be protected from mechanical damage and moisture.
Most modules are rigid, but semi-flexible ones based on thin-film cells are also available.
The cells are usually connected electrically in series, one to another to the desired
voltage, and then in parallel to increase current. The power (in watts) of the module is the
mathematical product of the voltage (in volts) and the current (in amperes) of the module.
The manufacture specifications on solar panels are obtained under standard condition
which is not the real operating condition the solar panels are exposed to on the
installation site.
21

A PV junction box is attached to the back of the solar panel and functions as its output
interface. External connections for most photovoltaic modules use MC4 connectors to
facilitate easy weatherproof connections to the rest of the some system. A USB power
interface can also be used.

Figure 3.1.8.8: Solar Panel in chapter 3

3.1.9 Wi-Fi Module

It is used for sending data to server through internet.it is easy to used due to compact size
and design. ESP8266 in smaller sizes of the module encapsulates Ten silica L106
integrates industry-leading ultra-low-power 32-bit MCU micro, with the 16-bit short
mode, Clock speed support 80 MHz, 160 MHz, supports the RTOS, integrated Wi-Fi
MAC/BB/RF/PA/LNA, on-board antenna. The module supports standard IEEE802.11
b/g/n agreement, complete TCP/IP protocol stack. Users can use the add modules to an
existing device networking, or building a separate network controller. ESP8266 is high
integration wireless SOCs, designed for space and power constrained mobile platform
designers. It provides unsurpassed ability to embed Wi-Fi capabilities within other
systems, or to function as a standalone application, with the lowest cost, and minimal
space requirement.
22

Figure 3.1.9.9: Wi-Fi Module in chapter 3

3.1.10 Relay module

For switching of dc fan and water system we used relay module which received
signal from controller to on /off the dc fan and water system in our project and this
relay module operate on 5v dc and switch the load up to 22ov and 10A.which shown
in figure 3.1.1.6 a. Relays consist of three pins normally open pin, normally closed
pin, common pin and coil. When coil power on magnetic field is generated, the
contacts connected to each other. As shown in relay working idea it depends on
magnetic field generated from the coil so there is power isolation between the coil
and the switching pins so coils can be easily powered from Arduino by connecting
VCC and GND bins from Arduino kit to the relay module kit after that we choose
Arduino output pins depending on the number of relays needed in project designed
and set these pins to output and make it out high (5 V) to control the coil that allow
controlling of switching process.
23

Figure 3.1.10.10:Relay module in chapter 3

3.1.11 Socket

It is used to detect day and night condition send signal to controller where controller turn
on or off the lights in hardware. AC power plugs and sockets connect electric equipment
to the alternating current (AC) power supply in buildings and at other sites. Electrical
plugs and sockets differ from one another in voltage and current rating, shape, size, and
connector type. Different standard systems of plugs and sockets are used around the
world.

Plugs and sockets for portable appliances became available in the 1880s, to replace
connections to light sockets with wall-mounted outlets. A proliferation of types
developed for both convenience and protection from electrical injury. Today there are
about 20 types in common use around the world, and many obsolete socket types are
found in older buildings. Coordination of technical standards has allowed some types of
plug to be used across large regions to facilitate trade in electrical appliances, and for the
convenience of travellers and consumers of imported electrical goods.

Some multi-standard sockets allow use of several types of plug; improvised or


unapproved adaptors between incompatible sockets and plugs may not provide the full
safety and performance of an approved socket-plug combination.
24

Figure 3.1.11.11: Socket in chapter 3

3.1.12 Buck converter

We used led light lamp as street light which operate on 12v 3a dc. This LM2596 chip of
the Power Module is made in China Mainland. A module to adjust the power supply. The
LM2596 series of regulators are monolithic integrated circuits that provide all the active
functions for a step-down (buck) switching regulator, capable of driving a 3-A load with
excellent line and load regulation. These devices are available in fixed output voltages of
3.3 V, 5 V, 12 V, and an adjustable output version. Requiring a minimum number of
external components, these regulators are simple to use and include internal frequency
compensation, and a fixed- frequency oscillator. The LM2596 series operates at a
switching frequency of 150 kHz, thus allowing smaller sized filter components than what
would be required with lower frequency switching regulators. Available in a standard 5-
pin TO-220 package with several different lead bend options, and a 5-pin TO-263 surface
mount package. The new product, LMR33630, offers reduced BOM cost, higher
efficiency, and an 85% reduction in solution size among many other features. Start
WEBENCH Design with the LMR33630. A standard series of inductors are available
from several different manufacturers optimized for use with the LM2596 series. This
feature greatly simplifies the design of switch-mode power supplies. Other features
include a ±4% tolerance on output voltage under specified input voltage and output load
conditions, and ±15% on the oscillator frequency. External shutdown is included,
featuring typically 80 μ A standby current. Self-protection features include a two-stage
frequency reducing current limit for the output switch and an over temperature shutdown
for complete protection under fault conditions.
25

Figure 3.1.12.12: Buck Converter in chapter 3

3.1.13 Loads

It isused to detect object .it operate on 5v dc and having long range sensitivity to detect
object and its cover 360* circumference. An LED lamp or LED light bulb is an electric
light that produces light using light-emitting diodes (LEDs). LED lamps are significantly
more energy-efficient than equivalent incandescent lamps and can be significantly
more efficient than most fluorescent lamps,The most efficient commercially available
LED lamps have efficiencies of 200 lumens per watt (Lm/W).Commercial LED lamps
have a lifespan many times longer than incandescent lamps.

LED lamps require an electronic LED driver circuit to operate from mains power lines,
and losses from this circuit means that the efficiency of the lamp is lower than the
efficiency of the LED chips it uses. The driver circuit may require special features to be
compatible with lamp dimmers intended for use on incandescent lamps. Generally, the
current waveform contains some amount of distortion, depending on the luminaires’
technology. LEDs come to full brightness immediately with no warm-up delay. Frequent
switching on and off does not reduce life expectancy as with fluorescent lighting.Light
output decreases gradually over the lifetime of the LED (see Efficiency droop section).

Some LED lamps are drop-in replacements for incandescent or fluorescent lamps. LED
lamps may use multiple LED packages for improved light dispersal, heat dissipation, and
overall cost. The text on retail LED lamp packaging may show the light output in lumens,
the power consumption in watts, the color temperature in Kelvin or a color description
26

such as "warm white", "cool white" or "daylight", the operating temperature range, and
sometimes the equivalent wattage of an incandescent lamp delivering the same output in
lumens.

Figure 3.1.13.13:Led loads in chapter 3

3.2 Design
Software we used in our project development are following regarding model designing
codeing and simulation.

1. Arduino IDE
2. Protecus
3. IoT Website Interface

3.2.1 Arduino Programing IDE

For programming of our project we used arduino IDE which is eas y to used and having
buildin complier through which we modified the programming if any errors occurred in
our programming.
27

Figure 3.2.1.14:Arduino IDE in chapter 3


28

3.2.2 Protecus Simulation


29

Figure 3.2.2.15:Protecus Simulation in chapter 3

3.2.3 IoT Websitr Interface

We used Thingspeak.com for IoT first we make an account in it and than we implement
the logic for data updation and shown it on site in graph or indication for fautls and
manually override with respect to time and date. which can be seen from figure given
below.
30

3.2.3.1 IoT Website Main Page Interface

Figure 3.2.3.16: IoT website interface main page in chapter 3


31

3.2.3.2 Current Measurement On Iot Server

Figure 3.2.3.17: Current measurement value show on IoT server in chapter 3

Figure 3.2.3.18: Lighted indication show loads status show on IoT server in chapter 3
32

3.3 Hardware Protype

Figure 3.2.3.19::Hardware Protype in chapter 3


Chapter-4

4. RESULTS AND DISCUSSION

4.1 Result
Result obtained from our prototype explain are following.

4.1.1 Full load ON

when battery is fully charge from solar source its turn on the full load and in our
prototype we used 4 dc loads. And when full loads are ON controller sense the current
value with helped of current sensor and show that value on display and also send the
measured value to IoT server using wifi module. which can be seen in figure below.

Figure 4.1.1.20: : Full load on on display in chapter 4

33
34

Figure 4.1.1.21: Full load on and showing on IoT in chapter 4

4.1.2 Midium loads on

When battery backup is decresed and rached the value 12.90v controller turn off the
maximium current consuming load and when load is off controller sense the current
value with helped of current sensor and show that value on display and also send the
measured value to IoT server using wifi module. which can be seen in figure below.

Figure 4.1.2.22:Midium load ON and display in chapter 4


35

Figure 4.1.2.23: Midium loads on IoT in chapter 4

4.1.3 Minimium Load ON

When battery backup is descresed to value 12.10v on that time controller tuns off the
maximium current coinsumimg loads and when load is off controller sense the current
value with helped of current sensor and show that value on display and also send the
measured value to IoT server using wifi module. which can be seen in figure below.

Figure 4.1.3.24: : Minimium load ON display in chapter 4


36

Figure 4.1.3.25: Minimium load on IoT in chapter 4

4.1.4 Full Load ON After Battery Back Restore

Once battery is full discharge all loads are off. As battery recharged from solar panel
and battery backup achived midium and maximium charged value accordingly
controller turn ON the loads with help off current sensor and show value on display
and also send that information to server with the helped of wifi module and the
processec continue as vice versa. which can be seen in figure below.
37

Figure 4.1.4.26:Full Load ON After Battery Back Restore on display in chapter 4

Figure 4.1.4.27:Full Load ON After Battery Back Restore on IoT display in chapter 4
38

4.1.5 Graphically Output of Load Current

Figure 4.1.5.28: Graphically output of load current in chapter 4

4.2 Discussion
After getting result and after discussion on these result we come to know that our
project as achieved the objective as we disscuss it in earlier chapter. In our project we
achieved our objective but we implemented controlling of loads on dc voltage as
voltage decresed the load automatically shut down and as battery backup restord the
load will be full onand vice versa.
Chapter-5

5. CONCLUSION AND FUTURE RECOMMENDATIONS

5.1 Conclusion
Implementing Renewable Energy technologies is one of the most recommended way
of reducing the environmental impact. Because of the frequent power cut, it is
important to use the renewable energy and monitoring it. Monitoring guides the user
in analysis of the renewable energy usage. This system is cost effective and its
efficiency is about 95%.This enables the efficient use of renewable energy and also it
reduces the electricity issues. The main benefit of using IOT in solar energy is that we
can see exactly what’s happening with all your assets from one central control panel.
By connecting your devices to a network, you can identify where the problem is
originated and you can dispatch a technician to fix it before it disrupts your entire
system.

The use of power electronics is increasing exponentially across various sectors of


human life. The components used in the project, like Arduino and sensors are slowly
becoming an indispensable part of our daily routines. So, it is only fitting that we use
them to improve efficiency in every walk of life. Keeping in mind the urgent need for
energy conservation .It combines safe lighting protocols with consumption of a
minimal amount of power. The energy savings, as discussed before are
phenomenal.They will aid in further saving of energy and reduction in operational
cost.

5.2 Future Recommendation


In future we can get a better prototype with a little bit changes in hardware and design
we suggest the following changes to get better in future which are as follow.

1. AI based controlled.
2. By using inverter our protype can be used with AC loads.

39
6. APPENDIX-A:

6.1 Project coding


#include <LiquidCrystal_PCF8574.h>

#include <SoftwareSerial.h>

#include <Wire.h>

#include "ThingSpeak.h"

#include "WiFiEsp.h"

#include "secrets.h"

#define dvalue 3000

LiquidCrystal_PCF8574 lcd(0x27); // set the LCD address to 0x27 for a 16 chars and 2
line display

int relay1 = A12;

int relay2 = A13;

int relay3 = A14;

int relay4 = A15;

int keyIndex = 0; // your network key Index number (needed only for WEP)

WiFiEspClient client;

// Emulate Serial1 on pins 6/7 if not present

#ifndef HAVE_HWSERIAL1

#include "SoftwareSerial.h"

SoftwareSerial Serial1(10, 11); // RX, TX

#define ESP_BAUDRATE 19200

#else

40
41

#define ESP_BAUDRATE 115200

#endif

unsigned long myChannelNumber = "1407161";

const char * myWriteAPIKey = "BSBWHWA05BBT4N97";

// Initialize our values

String myStatus = "";

int L1, L2, L3, L4, count;

float BValue = 0.0, Sample = 0.0, AvgB = 0.0, BValueF = 0.0;uint8_t duty_cycle_1 =
127;

uint8_t duty_cycle_2 = 127;

uint8_t duty_cycle_3 = 127;

// current value for three channels

float Current1 = 0.0;

float Current2 = 0.0;

float Current3 = 0.0;

// power sources variables

// power sources thresholds

#define solar_limit 2.5

#define wind_limit 2.5

#define wapda_limit 2.5

#define battery_limit 2.5

#define ERROR_CURRENT 0.09

// Set the LCD address to 0x27 for a 16 chars and 2-line display

LiquidCrystal_I2C lcd (0x27, 16, 4);

#define ESP Serial2

// sendATcmd
42

bool sendATcmd (String AT_cmd, int aT_cmd_maxTime, char readReplay [])

int AT_cmd_time = 0;

bool AT_cmd_result = false;

Serial.print("AT command: ");

Serial.println(AT_cmd);

while (AT_cmd_time < AT_cmd_maxTime)

ESP.println(AT_cmd);

if(ESP.find(readReplay))

AT_cmd_result = true;

break;

AT_cmd_time++;

Serial.print("Result: ");

if (AT_cmd_result == true)

Serial.println("DONE");

else

Serial.println("FAILED");

}
43

return AT_cmd_result;

void config_esp01(void)

lcd. clear ();

lcd.print (“Initializing “);

lcd. setCursor (0,1);

lcd.print ("WiFi Please Wait");

delay (500);

Serial.println(F ("Initiate AT commands with ESP01"));

sendATcmd("AT",5,"OK");

sendATcmd("AT+CWMODE=1",5,"OK");

Serial.print("Connecting to WiFi:"); Serial.println(ssid);

sendATcmd ("AT+CWJAP=\""+ ssid +"\”, \""+ password +"\"",20,"OK");

lcd. clear ();

void post_data_to_server(void)

bool a =! digitalRead(OVER_RIDE1)? true: false;

bool b =! digitalRead(OVER_RIDE2)? true: false;

bool c =! digitalRead(OVER_RIDE3)? true: false;

if(fault1 || fault2 || fault3 || a || b || c) // if any error occurs

{
44

if (! send_once)

send_once = true;

// Create the URL for the request

String url = "GET http://api.thingspeak.com/update?api_key=";

url += apiKeyIn;

url += (! digitalRead(OVER_RIDE1))? "&field1=1”:"&field1=0";

url += (! digitalRead(OVER_RIDE2))? "&field2=1”:"&field2=0";

url += (! digitalRead(OVER_RIDE3))? "&field3=1”:"&field3=0";

url += fault1? "&field4=1”: "&field4=0";

url += fault2? "&field5=1”: "&field5=0";

url += fault3? "&field6=1”: "&field6=0";

url += "&field7=" + String (Current1, 2);

url += "&field8=" + String (Current2, 2);

Serial.println(F ("Open TCP connection"));

sendATcmd ("AT+CIPMUX=1", 10, "OK");

sendATcmd ("AT+CIPSTART=0, \"TCP\”, \"" + host +"\"," + port, 20, "OK");

sendATcmd ("AT+CIPSEND=0," + String (url. length () + 2), 10, ">");

Serial.print(F ("requesting URL: "));

Serial.println(url);

ESP.println(url);

delay (2000);

sendATcmd ("AT+CIPCLOSE=0", 10, "OK");

Serial.println(F ("Close TCP Connection"));


45

else send_once = false;

void Title(void)

lcd. clear ();

lcd. setCursor (0,0);

lcd.print (F (“Multi Source “));

lcd. setCursor (0,1);

lcd.print (F ("Managment System"));

lcd. setCursor (0,2);

lcd.print (F (" Supervised by “));

lcd. setCursor (0,3);

lcd.print (F ("Sir.Sajid Nawaz "));

delay (2000);

lcd. clear ();

lcd. setCursor (0,0);

lcd.print (F ("Group Members "));

lcd. setCursor (0,1);

lcd.print (F ("Waqar Ahmad "));

lcd. setCursor (0,2);

lcd.print (F ("Bakyhzaman “));

lcd. setCursor (0,3);

lcd.print (F ("Hamza "));

delay (2000);
46

lcd. clear ();

float map_f (float x, float in_min, float in_max, float out_min, float out_max)

return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;

void append_zero (int v)

if (v < 10) lcd.print (F ("00"));

else if (v < 100) lcd.print (F ("0"));

void Power_Source(void)

float solar_v = map_f(solar,0.0,5.0,0.0,16.0);

float wind_v = map_f(wind,0.0,5.0,0.0,13.0);

float wapda_v = map_f(wapda,0.0,5.0,0.0,230.0);

float battery_v = map_f(battery,0.0,5.0,0.0,14.0);

lcd.print (F ("Source: Battery"));

lcd. setCursor (0,1);

lcd.print (F ("Batt: "));

append_zero(solar_v);

lcd.print(solar_v,1);

lcd.print (F (" V "));

source = BATTERY;
47

else

else

lcd. setCursor (0,0);

lcd.print (F (" Source: “));

lcd. setCursor (0,1);

lcd.print (F (": "));

append_zero(_v);

lcd.print(wind_v,1);

lcd.print (F (" V "));

source =;

else

lcd. setCursor (0,0);

lcd.print (F (" Source: "));

lcd. setCursor (0,1);

lcd.print (F (": "));

append_zero(_v);

lcd.print(solar_v,1);

lcd.print (F (" V "));


48

source =;

float read_I (int ch)

float AcsValue = 0.0, Samples = 0.0, AvgAcs = 0.0, AcsValueF = 0.0;

for (int x = 0; x < 50; x++)

// Get 50 samples

AcsValue = analogRead(ch);/ Read current sensor values

Samples = Samples + AcsValue; // Add samples together

delay (1); let ADC settle before next sample 3ms

AvgAcs = Samples / 50.0; // Taking Average of Samples

// ((AvgAcs * (5.0 / 1024.0)) is converitng the read voltage in 0-5 volts

// 2.5 is offset (I assumed that arduino is working on 5v so the viout at no current comes

// out to be 2.5 which is out offset. If your arduino is working on different voltage than

// you must change the offset according to the input voltage)

// 0.185v (185mV) is rise in output voltage when 1A current flows at input

AcsValueF = (2.5 - (AvgAcs * (5.0 / 1024.0))) / VperAmp;

AcsValueF = abs(AcsValueF);

if (ch == I1) Serial.print("I1: ");

if (ch == I2) Serial.print("I2: ");

if (ch == I3) Serial.print("I3: ");


49

Serial.println(AcsValueF); Print the read current on Serial monitor

return AcsValueF;

void Get_Currents(void)

Current1 = read_I(I1);

Current2 = read_I(I2);

Current3 = read_I(I3);

lcd. setCursor (0,2);

lcd.print (F ("I: "));

lcd.print(Current1,1);

lcd.print (F (" "));

lcd.print(Current2,1);

lcd.print (F (" "));

lcd.print(Current3,1);

lcd.print (F (" A"));

void generate_pwm(void)

analogWrite (PWM1, duty_cycle_1);

analogWrite (PWM2, duty_cycle_2);

analogWrite (PWM3, duty_cycle_3);

duty_cycle_1 = 127;
50

duty_cycle_2 = 127;

duty_cycle_3 = 127;

duty_cycle_1 = 255;

lcd. setCursor (10,3);

lcd.print (F ("MOR 1"));

if (! digitalRead ())

duty_cycle_2 = 255;

lcd. setCursor (10,3);

lcd.print (F ("MOR 2"));

if (! digitalRead ())

duty_cycle_3 = 255;

lcd. setCursor (10,3);

lcd.print (F ("MOR 3"));

if (duty_cycle_1 == 127 && duty_cycle_2 == 127 && duty_cycle_3 == 127)

lcd. setCursor (10,3);

lcd.print (F (" "));


51

// low = day

// high = night

if (! digitalRead(as) // low signal

duty_cycle_1 = 0;

duty_cycle_2 = 0;

duty_cycle_3 = 0;

generate_pwm ();

void Show_Fault(void)

if (duty_cycle_1 > 0 && Current1 < ERROR_CURRENT)

lcd. setCursor (0,3);

lcd.print(F("F1"));

fault1 = 1;

else

fault1 = 0;

lcd.print (F (" b"));

}
52

if (duty_cycle_2 > 0 && Current2 < ERROR_CURRENT)

lcd. setCursor (2,3);

lcd.print(F("F2"));

fault2 = 2;

else

fault2 = 0;

lcd.print (F (“ a“));

if (duty_cycle_3 > 0 && Current3 < ERROR_CURRENT)

lcd. setCursor (4,3);

lcd.print(F("F3"));

fault3 = 3;

else

fault3 = 0;

lcd.print (F (“c"));

void setup ()

{
53

// put your setup code here, to run once:

Serial.begin(9600);

ESP.begin(115200)

// initialize the LCD

lcd.print(" Solar Energy Based ");

lcd.setCursor(0, 1);

lcd.print(" Loads Management ");

lcd. setCursor (0, 2);

lcd.print(" System Through ");

lcd. setCursor (0, 3);

lcd.print(" Internet of Things ");

delay(dvalue);

lcd.clear();

lcd.print(" By: Rafaqat Khan ");

lcd.setCursor(0, 1);

lcd.print(" By: Shehriyar khan");

lcd.setCursor(0, 2);

lcd.print(" By: Owais Khan ");

lcd.setCursor(0, 3);

lcd.print(" ");

delay(dvalue);

lcd.clear();

lcd.print(" Supervised By: ");

lcd.setCursor(0, 1);

lcd.print("Engr Shayan Tariq Jan");

lcd. setCursor (0, 2);


54

lcd.print(" Dpt of Elect Engr ");

lcd.setCursor(0, 3);

lcd.print(" INU University ");

delay(dvalue);

lcd.clear();

lcd.print(" Connecting to ");

lcd. setCursor (0, 1);

lcd.print(" Wi-Fi ");

lcd.print(ssid);

delay(2000);

lcd. begin ();

// Turn on the blacklight and print a message.

lcd. backlight ();

// generate pwm signal

generate_pwm ();

Title ();

config_esp01();

void loop ()

Power_Source ();

Get_Currents ();

OverRide_PIR ();

Show_Fault ();

post_data_to_server ();
55

7. REFERENCES

[1] M. Ali and M. K. Paracha, “an Iot Based Approach for Monitoring Solar Power
Consumption With Adafruit Cloud,” Int. J. Eng. Appl. Sci. Technol., vol. 04, no.
09, pp. 335–341, 2020, doi: 10.33564/ijeast.2020.v04i09.042.
[2] S. Ansari, A. Ayob, M. S. Hossain Lipu, M. H. Md Saad, and A. Hussain, “A
review of monitoring technologies for solar pv systems using data processing
modules and transmission protocols: Progress, challenges and prospects,” Sustain.,
vol. 13, no. 15, 2021, doi: 10.3390/su13158120.
[3] A. Y. Appiah, X. Zhang, B. B. K. Ayawli, and F. Kyeremeh, “Review and
performance evaluation of photovoltaic array fault detection and diagnosis
techniques,” Int. J. Photoenergy, vol. 2019, 2019, doi: 10.1155/2019/6953530.
[4] J. O. F. Geology, “a S Tudy of,” vol. 9, no. 3, pp. 2777–2780, 1901.
[5] R. Hantoro et al., “Design and Implementation of Real-Time Monitoring System
for Solar Power Plant in Surabaya, Indonesia,” E3S Web Conf., vol. 190, 2020,
doi: 10.1051/e3sconf/202019000034.
[6] V. Kavitha and V. Malathi, “A Smart Solar PV Monitoring System Using IoT,”
pp. 19–33, 2019, doi: 10.5121/csit.2019.91502.
[7] R. L.R. Lokesh Babu, D. Rambabu, A. Rajesh Naidu, R. D. Prasad, and P. Gopi
Krishna, “Solar Power Monitoring System using IOT,” J. Eng. Technol., vol. 7,
no. 3.12, p. 526, 2018.
[8] Y. Lee and M. Park, “Energy management for solar-powered IoT devices with
performance adjustment,” Int. J. Smart Grid Clean Energy, vol. 8, no. 1, pp. 22–
30, 2019, doi: 10.12720/sgce.8.1.22-30.
[9] A. N. Milioudis, G. T. Andreou, and D. P. Labridis, “Enhanced protection scheme
for smart grids using power line communications techniques - Part I: Detection of
high impedance fault occurrence,” IEEE Trans. Smart Grid, vol. 3, no. 4, pp.
1621–1630, 2012, doi: 10.1109/TSG.2012.2208987.
[10] S. Mohapatra, M. Aggarwal, and S. K. Jindal, “Remote Power Monitoring and
Distribution System of a Solar Based Power Plant,” SSRN Electron. J., no. June
2019, 2018, doi: 10.2139/ssrn.3170182.
[11] S. Patil, M. Vijayalashmi, and R. Tapaskar, “SOLAR ENERGY MONITORING
SYSTEM USING IoT,” Indian J.Sci.Res, vol. 15, no. 2, pp. 149–155, 2017,
[Online]. Available: https://www.ijsr.in/upload/1455558654Chapter_26.pdf
%0Ahttps://www.mendeley.com/catalogue/solar-energy-monitoring-system-using-
iot/.
56

[12] W. Priharti, A. F. K. Rosmawati, and I. P. D. Wibawa, “IoT based photovoltaic


monitoring system application,” J. Phys. Conf. Ser., vol. 1367, no. 1, 2019, doi:
10.1088/1742-6596/1367/1/012069.
[13] I. E. A. Pvps, “Guidelines for Monitoring Stand-Alone Photovoltaic Power
Systems Report IEA PVPS T3-13 : 2003,” October, 2003.
[14] N. Rani, “Monitoring system for Solar panel using IoT,” vol. 9, no. 8, pp. 69–77,
2021.
[15] N. Rouibah, L. Barazane, M. Benghanem, and A. Mellit, “IoT-based low-cost
prototype for online monitoring of maximum output power of domestic
photovoltaic systems,” ETRI J., vol. 43, no. 3, pp. 459–470, 2021, doi:
10.4218/etrij.2019-0537.
[16] V. Sharma, I. You, K. Andersson, F. Palmieri, M. H. Rehmani, and J. Lim,
“Security, privacy and trust for smart mobile-Internet of Things (M-IoT): A
survey,” IEEE Access, vol. 8, pp. 167123–167163, 2020, doi:
10.1109/ACCESS.2020.3022661.
[17] M. P. Tellawar, “An IOT based Smart Solar Photovoltaic Remote Monitoring
System,” Int. J. Eng. Res. Technol., vol. 8, no. 09, pp. 235–240, 2019.
[18] C. Zedak, A. Lekbich, A. Belfqih, J. Boukherouaa, T. Haidi, and F. El Mariami,
“A proposed secure remote data acquisition architecture of photovoltaic systems
based on the Internet of Things,” Int. Conf. Multimed. Comput. Syst. -Proceedings,
vol. 2018-May, pp. 1–5, 2018, doi: 10.1109/ICMCS.2018.8525902.
[19] L. Atzori, A. Iera, and G. Morabito, “The Internet of Things: A survey,” Comput.
Networks, vol. 54, no. 15, pp. 2787–2805, 2010, doi:
10.1016/j.comnet.2010.05.010.
[20] J. Han, C. S. Choi, and I. Lee, “More efficient home energy management system
based on ZigBee communication and infrared remote controls,” IEEE Trans.
Consum. Electron., vol. 57, no. 1, pp. 85–89, 2011, doi:
10.1109/TCE.2011.5735485.

You might also like