Design and realization of smart energy management system for Standalone PV system

The internet connected world demands a need for integrating the renewable energy sources and loads in the microgrid with an energy management system that is capable of monitoring, controlling and conserving energy and at the same time. This paper proposes the idea of an Internet of things (IoT) based smart Energy Management System (EMS) for a Stand-Alone Photovoltaic (SAPV) System, which acts as a closed system where all the power is generated from solar energy and either stored in batteries or utilized within the system. It has various units namely: Energy generation, Energy management and IoT. A novel constant battery operating algorithm is proposed for EMS of SAPV System. All the loads are connected through IoT and hence their status maybe monitored and controlled from remote location.

. IOT related system with edge computing is introduced for an effective energy scheduling approach with deep reinforcement learning for the suggested chassis in [5]. The combination of energy big data system and IOT based EMS is utilized for correlation and combination of energy supply-transmission-utilization energy systems in [6].
[7] presents a multi-objective optimization method related to Nonlinear Auto-Regressive Neural Network which deals with energy supplied by the photovoltaic system and utility. The suggested technique is studied utilizing 300 case studies which exhibits an enhancement in power factor and reduction in consumer bill. To interface the battery sources and photo-voltaic system to the AC grid, Decoupled d-q current control strategy is designed and applied for voltage source converters.
To increase the periodic energy production from the PV array, maximum power point tracking technique for a buck converter is applied for grid connected as well as island modes of working in [8].
The performance of TERI's (India) Retreat Facility's energy system is studied with a distributed generator to evaluate the working strategies for accomplishing the institutional load demand in correlation with the grid, PV and battery storage. The feasibility of it working as a microgrid is checked throughout the grid blackout period too in [9]. [10] presents an optimization method that fixes an objective function that comprises the data and prices concerning the electricity usage and also reduces the price by utilizing Genetic Algorithm or Mixed Integer Linear Programming. [11] presents a scheduling algorithm for its real-time application and the best working of a microgrid. The scheme proposed consists of two MILP-based optimization problems considered for grid-connected and islanded modes. [12] presents a multi-agent system construction for Day-Ahead energy management for Microgrid to decrease customers price, increase renewable energy usage as well as facilitate the integration of Renewable energy sources in distribution system. For management of loads side with incentive approach in a microgrid, an Arduino and IoT-based Hierarchical Multi Agent System is proposed in [13]. DER like PV array, battery storage system, and emergency diesel generator system supply power to the AC hybrid microgrid. An effective microgrid model is developed to maintain the multiple loads at the same time under all working conditions in [14]. Pertaining to the regulatory, practical, technical, environments of China, microgrid with an Energy-Internet-oriented EMS is designed in [15]. For sustaining low voltage and high voltage at DC bus bar at the load terminals in conjunction with a smart EMS is designed. Three distinct converters like boost, buck and bidirectional converters are utilized to accomplish the aim in [16]. [17] presents an optimization related to EMS of smart homes with microgrid. It results in cost saving and reduction of CO2 emissions. The renewable energy resources penetration and additional power generation problems is investigated in [18]. In [19] a multi-objective optimization problem is implemented as an efficient EMS for application in microgrid system and integrated building. [20]. A Smart EMS algorithm is suggested for governing the power flow among the energy storage, hybrid renewable system and the grid. It also correlates the economic effects of utilizing energy storage system as well as solar PV panels in standalone and grid connected modes. Reinforcement learning scheme and intelligent dynamic EMS for a smart microgrid is proposed to enhance the energy sent to controllable loads, and its dispatch approach prolonged the battery's life cycle in [21]. For an automatic microgrid EMS, a state machine is proposed as the key solution to increase the transient attainment throughout transition operations in [22].
A new cooperative Model Predictive Control strategy is designed for non-rural districts consisting of different microgrids distribution of various DER to address the problem of scalability of energy management in a non-rural district in [23]. A New bi-level risk constrained stochastic strategy is introduced to schedule optimally a dependent micro-grid in regular as well as contingency conditions and also to reduce the economic losses throughout emergency conditions in [24]. IOT or Big-data platform are integrated for the control of microgrid in real-time. This is performed by adjusting the response and the power demand according to the real situation is discussed in [25]. A two-level energy management system is proposed in which the outer-level is meant to interchange the power and appropriate data between the interconnected microgrids, and the inner-level is meant for energy scheduling of every on-fault microgrid in case of partition from other microgrids in [26]. To find the optimization problem considering distinct constraints and to attain the best solution for the IOP Publishing doi:10.1088/1755-1315/1026/1/012027 4 optimization dispatch problem, opposition-based learning gravitational search algorithm and hybrid particle swarm optimization is proposed in [27]. A dynamic ethernet network based EMS for microgrids is designed to investigate the networking problems like delays in transmission, reliability and data availability in [28].
The energy requirements of the customers in distant areas is met by utilizing FPGA for online monitoring of the microgrid which also consists of the communication between load controllers and source utilizing ethernet for interchange of monitored data in [29]. Correlating the performance of a general energy management of microgrid is focused to obtain an effective model for working of the microgrid. The output power prediction of wind and solar is accomplished to aid the microgrid in applying the energy management approaches in [30]. The integration of wind, PV, battery storage and fuel cell with adaptable parameters is evaluated using multi-objective particle swarm optimization. The methodology describes the objective functions for power loss probability as well as energy cost in [31]. A parametric cost function approximation based online operation approach is proposed for microgrids, taking into account the contingencies from distributed renewable energy to reduce the operational cost in [32].
A multi-agent system related to decentralized control is designed to control the complex energy. The proposed system is correlated to a centralized EMS related to parameters of power losses and efficiency in [33]. For stable integration and synchronized control of DERs, a real-time SITL simulation is developed and applied for a test microgrid in [34]. A Smart method related to Recurrent Neural Network with the help of Ant-Lion Optimizer algorithm is proposed for EMS to obtain magnitude of Demand Response, time span and minimum cost of energy in MG in [35]. A generic optimal planning strategy and model is suggested to design different energy systems. It achieves both the energy management approaches and optimal structure configuration. A mixed-integer linear programming model is designed as an optimal planning strategy with the aim to reduce the overall cost in [36]. The master-slave approach is utilized in EMS to support the stable and commercial usage of renewable energy resources and their integration to distribution systems maintains the power quality in [37]. Matrix real-coded genetic algorithm (MRC-GA) optimization technique is elucidated to achieve a real-time approach for management of the load. It consists of three distinct working strategies and generates diagrams of the Energy storage system and distributed generators in [38].
[39] explains the opportunities, solutions and future scope to obtain the objectives of energy management system utilizing different effective approaches. For energy management in different microgrids, a contemporary mathematical approach related to Lagrange function is applied to attain best operating points of microgrids. They also find the portion of every microgrid from general line capacity in [40]. The energy management is presented for renewable energy resources penetration and extra power generation problems. The cost and pollution objective functions are reduced at the same time and the effects of load, solar radiation, wind speed are investigated in [41]. The best operation of a storage battery, a solar unit, combined cooling, power and heating are considered to resolve the economic dispatch of renewable energy park of the microgrid. The proposed work is applied in General Algebraic Modelling Systems (GAMS) in [42]. A resilient EMS algorithm is suggested to enhance the strength of a decentralized small-scale microgrid by purchasing surplus power efficiently. In islanded mode, the microgrid is capable of providing electric power to emergency loads, as far as the microgrid can restore to the connected mode in [43]. An enhanced fuzzy logic EMS is suggested for a DC microgrid in standalone mode containing wind turbine, solar photovoltaic panels, fuel cell, battery energy storage, and diesel generator providing a residential load in [44]. Computational intellect techniques namely ant colony optimization and particle swarm optimization are applied to the microgrid energy management issue. They are proposed to obtain solutions immediately, aiding realtime power management. PSO is superior in terms of simplicity and faster to apply than Genetic Algorithm in [45].
[46] presents a best standard approach to recover the post-emergency distribution grid after the existence of serious interruptions producing a blackout. A Bi-level solution process is designed to reduce violations taking into account the line capacities, voltage constraints and controllable loads. A model predictive control (MPC) approach is suggested to regulate the charge or discharge current of the battery relying on generation of renewable energy sources and load utilization uncertainty in [47]. In the structure of a smart building with an energy management system, commercial advanced metering infrastructure (AMI) is presented in [48]. In [49] a systematic communication modelling related to IEC 61850 standards is proposed for a monetary microgrid controller to authenticate stable operation of systematic communication solution. [50] presents the chance of setting the energy Internet through a packetized control of loads, where adjustable loads dispatch customer appeal to an energy server. [51][52][53] elaborates about IOT based EMS in smart microgrid.
Conventionally various optimization algorithms are proposed for EMS of a smart microgrid to control power flow between renewable energy sources and energy storage unit. Conventional methods also focusses on monitoring of loads to control the use of power.
This paper proposes an IoT based EMS for a SAPV System which acts as a closed loop system where all the power that is generated from solar power is either stored in batteries or utilised by the loads effectively. If a fault occurs on the main grid or mini grid, SAPV system is able to operate as an independent unit to meet the load requirements. SAPV system has various units including Energy generation, Energy management and IoT units. The novel EMS is designed to take care of all the activities starting from energy generation up to energy storage and also serves as a closed loop system. Additionally it ensures that all the loads are connected with the IoT so that their status are monitored and controlled from any location. Section 2 discusses about the methodology incorporated in this EMS for SAPV system. Section 3 discusses about the design specification of the proposed EMS system. Section 4 discusses about results and discussions of the proposed EMS for SAPV system. Section 5 further talks about conclusion and future scope of work.

Methodology
This paper proposes an IoT Based SAPV System that is designed with respect to the needs of an off-grid system in mind where all energy is generated from solar panels and is utilised by local network. It highlights the usage of renewable energy to power an OFF-grid system as shown in Figure  1. The DC power is generated from the solar panel and then the voltage is stepped down to be utilised by DC system. It has various components catering to represent the idea of a fully functional off-grid system. This system follows the complete process of electricity generation, storage and utilization. First step of designing this SAPV system is load calculation, which includes calculation of total power requirement at the consumer end. It includes some margin by keeping the condition in mind that if load requirement gradually increases with time then the proposed system copes up with such conditions. These loads may be connected and disconnected throughout the day. There are also peak hour time when the maximum load is connected to the system during the day. The system witnesses load variations throughout the day. In Figure 1, this load variation is realized by connecting the different loads with relays. At different instant of time, different relays are switched ON and to show the operation in the peak hours all the relays are switched ON. The type of load (AC or DC load) is an important parameter to be conisdered. If DC loads are considered then the power supplied is directly connected to the battery backup unit but if load is of AC type there is an inverter unit in between loads and battery backup unit. The type of battery used in the battery unit is one of the most important parameter while designing the battery unit. The sizing of the battery is calculated using equations (1-4). Ideally Es is computed using equations (1-3) but there are some losses while charging the battery. η b is computed using equation (4). Et must be supplied by any type of source. The tubular battery efficiency is considered as 0.85. (1) Input of the battery unit and source are connected to the battery charge controller. Based on standards, Battery charge controller rating is computed using equation (5). Source in the circuit can be any type of DC source like PV panels, wind turbine, geothermal etc.

Proposed Optimal Energy Management Algorithm
This paper proposes an optimal energy management algorithm that is employed on SAPV System to achieve the adaptive energy management system requirements. »battery is partially charged P b+ = min(Pres , P b+ max -P b ) »power supplied to battery P b = P b+ + P b else if e b ≈ e bmin »battery is almost empty P b+ = min(Pres , P b+ max) »power supplied to battery P b = P b+ else e b ≈ e b+ max »battery fully charge P b+ =0 »power supplied to battery P b = P b+ max else if Pres < 0 »PV power less than demand if max(e b > e bmin)=min(e b <e b+ max) »battery is partially charged P b-= max(Pres , P b -P bmin ) »power supplied by battery P b = P b -P belse if e b ≈ e bmin »battery is almost empty P b-= 0 »power supplied by battery P b = P bmin else e b ≈ e b+ max »battery fully charge P b-= max(Pres , P b+ max) »power supplied by battery P b = P b+ max -P belse Pres = 0 »PV power equal to demand power P b-= 0, P b+ = 0, P b = P b end if

Modules
The IoT Based Stand Alone PV System requires three major modules namely Energy Generating unit, Energy Management unit and IoT Control and State of charge Estimation unit.

Energy generating unit
The Energy generating unit is a PV panel whose specification is as in Table 1.

Energy Management unit
The EM unit has three functions: • Convert the power generated by PV panels to lower voltage suitable for appropriate usage, i.e. from 20V generated to 13 V for charging the battery. • Store the generated power in a 12V battery and controlling the output as required.
• Monitor battery charge level and voltage to protect it from overcharging and overvoltage. The EM unit includes the following components: The Custom Buck Converter shown in Figure 2a steps down the voltage it receives to 13 volts DC by varying its firing angle. MOSFET IRF540N needs triggering pulse to act as a switch in the custom buck converter. This pulse is generated by the Arduino microcontroller but is of insufficient magnitude. TLP250 IC is used as in Figure 2b, where the magnitude is varied from 12 V to 20 V. Hence this ideal operating voltage is utilized for triggering the MOSFET as in Figure 2c. A 12V lead acid battery is used to store the excess generated power from the Buck converter. The voltage sensing unit is a resistive type unit which contains two resistances: 30KΩ and 7.5Ω and the Vout is measured by the Analog pin A0 of the Arduino. The current sensing unit ACS712 onboard the energy management unit applies the indirect Sensing method to get the value of current up to 30A. A linear, low-offset Hall Effect sensor circuit is placed in IC to sense the current. a.

IOT Control and SOC estimation unit
The proposed IOT Control and SOC estimation unit is shown in Figure 3. The objective of this module is to interface the loads to IOT via a Wi-Fi enabled IOT device so that they are turned OFF or ON as per user requirements. RemoteXY platform is incorporated to create the local web server technology to host a webserver on the ESP8266 Wi-Fi Module to which the user needs to connect through Wi-Fi and then the user interface is as in Figure 4a. The triggering of the switch in the application triggers the pin 10 to 13 of Arduino Uno which control the respective relays to each device. SOC estimation is  A 4-channel relay module is used to represent the four loads. Each relay is a physical switch which when triggered will turn ON the load. The input signal and the power supply to the relay comes from the interfaced Arduino. RemoteXY interface and configuration settings are done as in Figure 4a and

Design Approach
A hardware prototype of SAPV system is designed wherein the generated energy from the solar panel is transmitted to the battery unit and then energy is transmitted to the load unit. The generation and transmission units are connected by the battery charge controller, which helps in transferring the energy from the panel to the battery and prevents the reverse flow of the power. The power is transmitted to the load and the excess power is stored in the battery. The loads and battery are connected through different sensors and IOT modules. The voltage and current sensors are used to measure the power flow and the data is sent to the IOT platform which monitors and controls the loads.

Design of battery charging converter
The battery charging circuit consists of the three unit's buck converter, diode and potential divider. The PV panel produces power which is transferred to the battery but the voltage produced by the panel fluctuates between 16V to 18V. The battery must be protected from these fluctuations of the voltage and hence the battery charging circuit is connected between the panel and the battery. The solar panel produces 17V rated voltage and the battery is rated at 12 volts. The buck converter is a step-down DC/DC converter. T h e d esign parameters are Vin = 17 V; Vout = 12 V; f= 25 KHz. The average voltage across the inductor is zero as in (6-8). Average current across the capacitor is equal to zero as in (9)(10)(11). The ripple in output voltage for buck convertor is considered as 5% of the output voltage ripple in inductor current is considered as 25% of the output current as indicated in equations (12)(13). The ripple in inductor current is considered as 25% of the output current as in equation (14). The battery charge controller design is given in Table 2 and is derived in equations (15)(16)(17)(18)(19)(20)(21)(22)(23)(24)(25)(26)(27).  The diode with breakdown voltages of 100V and current rating near 10A with lower conduction voltage drop across diode is preferred for this design. The component specifications are indicated in Table 3. Potential divider circuit is connected at the end of the buck converter. Potential divider has two resistance in series of 30KΩ and 7.5KΩ. This potential divider reads the value of the voltage and sends it to the Arduino UNO which compares the value with the reference value and increment or decrement value of the firing angle to keep the output voltage constant. This voltage divider circuit helps to calculate the depth of discharge of the battery. It also helps to operate relays according to the operating conditions which include day and night mode operation of the system.

SOC Values and Terminal Voltage
State of charge of the battery is calculated using the graphical method. In graphical method the relation between SOC and the voltage across the battery have a linear relation as shown in Figure  6. Let perimeter 'y' represent the SOC considered and perimeter 'x' represent the Terminal voltage so the line equation is given as in equation (28). Equation (29)

Design of solar panel system
The Ampere-hour rating of lead acid battery is given in equation (32).
The solar charge controller is matched to the voltage across the source terminals and also at the battery terminals and then the current rating of battery charge controller is calculated using equation (33).
Total Ampere-hours required from battery is 98.04 Ah as in equation (34), which is approximated to 100Ah. According to the requirement, the battery rating is 12V, 100Ah. Let the available batteries be of rating of 12V, 35Ah. The total number of batteries required is 100Ah/35Ah =2.86. Thus let number of batteries be considered as 3. The batteries of rating 12V, 35Ah are connected in parallel and net energy capacity is 105Ah. The size of PV panel is given in Table 5. Equations (35) and (36) are used to find the number of PV panels.
Thus numbers of PV panel required is 1.18 and hence this system should be powered by 1 100 Wp PV module. The Solar charge controller sizing is done as follows: PV module specification Pm = 100 Wp; Vm = 16.6 Vdc ; Im = 6.5 A; Voc = 20.8 A; Isc = 7.5 A. Assume 30% margin in designing the battery charge controllers. The rating of Solar charge controller= (1 strings x 7.5 A) x 1.3 = 9.75 A. So the rating of battery charge controller is 10 A at 12 V or greater. The PV Design parameters are shown in Table 6. Table 6. PV Design Parameters.

Results and Discussion
This section obtains the result theoretical and practical results of the proposed SAPV system. The hardware model of the proposed SAPV system is shown in Figure 7. The circuit diagram of the proposed SAPV system is shown in Figure 8. PV panels generates variable voltage which depends on the solar irradiation of sun. The voltage in the PV panel considered for analysis varies between 17V-18.5V but the voltage across battery is 13V. Hence the supply voltage is stepped down using Buck convertor, Buck Boost converter or Sepic converter. To deal with this variable supply voltage feedback system is employed. In this feedback system, initially the output voltage equals to 76% duty cycle of input voltage (PV panel voltage). The pulse of duty cycle 76% is generated by Arduino 1 and then voltage across the output appears. The output voltage is fed back to the Arduino 1 where the output voltage is maintained equal to the reference voltage. Arduino 2 is used to read the output voltage at the output terminal and then control the relays RL1, RL2, RL3, RL4. RL1 is connected to PV panel, RL2 is connected to the loads and RL3 and RL4 are connected to the battery. To operate at the night, the PV panel is disconnected with the help of relay (RL1). When the excess amount of current flows in the circuit than the battery charge controller then the loads are disconnected by using the relay (RL2) to prevent the damage of the battery charge controller. To prevent battery from over charging or deep discharge of the battery the battery is disconnected by using the relay (RL3 and RL4). Arduino 3 is used to control and monitor all the loads using ESP module.

Simulation Results
The battery charging controlling circuit is simulated as shown in the Figure 9a. The voltage source consist of variable DC source. Under loading condition of the System, the panel is supplying power to the load and the battery. The output voltage of the battery is always kept constant, so constant current flows through the load. In this case, a resistance value of 4.4Ω is connected in parallel with the battery and hence constant voltage appears on the load. Figure 9b shows that the DC current flowing through load is 2.745A.
The voltage across the battery is always constant which is equal to the reference value. If any deviation from the reference value occurs then it will be compensated by the feedback system and  Figure 10a shows the voltage across the battery that is measured at two instants of time which is 13.17V. It is observed that the voltage remains constant even if the load is connected or disconnected from the system. Charging current flowing to the battery is shown in the above Figure 10b. Initially the battery charging current increases and reaches the steady state value and hence the battery charging current is not ripple free. In the conventional buck converter design, the ripple in the battery current is usually 25% of the inductor current. As in Figure 10b the current at two instants (1) & (2) of time is different and having ripple in it. As instant 1 shows transient current which is equal to 1.36A and instant 2 shows steady state current whose value is 2.616A. Figure 10c shows the triggering signal applied to the MOSFET. Initially the firing angle is set at the default value of 70% duty cycle. Then the firing angle varies according to the output voltage. If output voltage differs from the reference voltage, then the deviation in the output voltage is calculated and the firing angle is altered such that the output value reaches the reference value.   Figure 11a shows the TLP250 Circuit for triggering that is soldered and prepared to use. It is seen successfully giving output pulse with 14.2V output in Figure 11b. At the beginning the firing angle has a default value of 70%, as the 70% of input supply voltage is less than reference voltage then firing angle is incremented by one unit and if it is greater than the reference then firing angle is decreased by one unit. This process is continuing till the output voltage reaches the reference value or it reaches the minimum or maximum firing angle limit. In the above case 70% of the input is less than the reference voltage (12V) so firing angle increases by one unit. This process continues till it reaches the reference value but in this case before reaching the reference value it reaches maximum firing angle limit. Figure 11b in CRO represents the triggering pulse of the MOSFET and the below signal represents the charging current flowing inside the battery. From the figure it is clear that the system is operated at the 25kHz, current flowing in the battery is 2.47A as obtained from the hardware result. Charging current showing steady state current flowing inside the battery.  Figure 11a shows the TLP250 Circuit for triggering that is soldered and prepared to use. You can see it successfully giving output pulse with 14.2V output in Figure 11b. At the beginning the firing angle has a default value of 70%, as the 70% of input supply voltage is less than reference voltage then firing angle is incremented by one unit and if it is greater than the reference then firing angle is IOP Publishing doi:10.1088/1755-1315/1026/1/012027 14 decreased by one unit. This process is continuing till the output voltage reaches the reference value or it reaches the minimum or maximum firing angle limit. In the above case 70% of the input is less than the reference voltage (12V) so firing angle increases by one unit. This process continues till it reaches the reference value but in this case before reaching the reference value it reaches maximum firing angle limit. Figure 11b in CRO represents the triggering pulse of the MOSFET and the below signal represents the charging current flowing inside the battery. From the figure it is clear that the system is operated at the 25kHz, current flowing in the battery is 2.47A as obtained from the hardware result. Charging current showing steady state current flowing inside the battery.

With Load
The circuit diagram of with load condition is shown in Figure 12a. In Table 7 the output power is equal to the power consumed by load. Output power is equal to the load power which is equal to 8.65 Watt. Input power is 8.84 Watt which is almost equal to the output power 8.65 Watt. Table 7. Power calculation with load.

With battery
The circuit diagram of with battery condition is shown in Figure 12b. Table 8 shows only the battery connected to the circuit. Battery is connected at the output terminal so the total output power is equal to the power absorbed by battery. Output power is equal to the Battery power which is equal to 27.14 Watt. Input power is 27.14 Watt which is almost equal to the output power 28.05 Watt.

With battery and Load
The circuit diagram of with battery and load condition is shown in Figure 12c. The Table 9 shows both load and battery are connected at the output terminal, so the total output power is equal to the total power consumed by the load and battery.
a. b.    Total output power = Load power + Battery Power POut = PLoad + PBattery POut =14.87Watt +24Watt POut =38.87Watt Output power is almost equal to the input power which is equal to 39.95Watt. Output power is equal to the Battery power and load power. Where Battery power is equal to the 24Watt and Load power is equal to 14.87Watt. Total output power is 38.87Watt Input power is 39.95 Watt which is almost equal to the output power 38.87 Watt.

Conclusion
In this paper an IoT based Energy Management System is realised for a SAPV System via the RemoteXY platform. This system can be installed at the remote location where the availability of power is very difficult to reach (Mountain regions, desert, islands or even space), even it can be installed at places where having sufficient power is available to reduce the dependency on the main grid. It helps by reducing the load on the main grid during peak hour time. If a fault occurs on the main grid or the mini grid it is easily isolated from each other. If the fault occurs at the main grid then the mini grid is able to operate independently without facing any type of blackout and time required to rectify the faulty part. Standalone PV systems also help by supplying power to the main grid if the excess energy is produced, which not only helps by reducing the load on the grid but also supplies some amount of power to the loads nearby to reduce its availability.