Abstract
This study included a practice for efficient and effective energy use when control algorithms related to energy flow of hybrid energy generation system consisting of different types of solar panels (monocrystalline, polycrystalline and thin film) and fuel cell were performed. An Arduino microcontroller–based control system was designed in order to use the energy generated efficiently and effectively in hybrid power generating systems which consist of solar panels, battery packs, fuel cell and direct current and alternating current loads. Routing of energy was performed by relays, and the processes such as monitoring and saving of data belonging to the energy generating system and manual control of the relays optionally were performed via a LabVIEW program on the computer. The electrical energy produced by each solar panel, energy demand of the load and charge–discharge conditions of the batteries were monitored through the control system designed for energy flow control. The data were analyzed and the performances of these three control algorithms were compared. It was determined which of these three different control algorithms had the most effective and efficient energy usage.
I. Introduction
The energy need has always been one of the essential requirements in the lives of human beings. It is apparent that classical energy sources are non-renewable and they have negative effects on the environment. Therefore, it has been easily observed that the interest in renewable resources has been increasing each passing day. The use of renewable energy systems has become widespread, and thus, the collaborative workspace of renewable energy systems has increased. These types of energy systems are also called hybrid energy systems. It is seen that when different energy generating resources are used collaboratively, the rates of effective and efficient use of energy increase. 1
Today, when we think of renewable energy resources, the first thing that comes to mind is solar power. The fact that the obtained energy changes depending on natural conditions creates a disadvantage for the use of solar panels. To eliminate this situation, battery systems, which supply uninterrupted and continuous energy, are needed. In addition to the batteries, they have a limited lifetime because of charge and discharge cases. They are systems that require maintenance and cost. 2
It has been seen that fuel cell systems have been the subject of many studies that are carried out to store long-term energy and to generate energy out of hydrogen.3–7 Fuel cell technology has been used to support energy generating system in many of the studies in literature.8–10 Studies about fuel cells have been mainly carried out on simulation.11–16 Studies such as the modeling of the components of hybrid energy generating systems and practices of different control algorithms on these systems take part in the literature.12,13,17 Real-time studies are rare in the related literature when compared to simulation studies. 18
Effective and efficient energy use is also as important as its generation. Therefore, energy management systems (EMS) are designed for energy generating systems. Studies related to EMS are quite common in literature.19–22 The studies that are carried out with EMS have system priorities such as providing uninterrupted energy required by the load, decreasing operational costs to minimum, increasing system efficiency and reducing oil consumption. 23
As for this study, an EMS was designed for a hybrid energy generating system consisting of three different solar panels, fuel cell and battery, and its real-time practice was performed. The EMS was designed to use the energy, which was obtained from energy sources, efficiently and effectively by feeding the consumer uninterruptedly. In the view of the batteries’ overcharge and over discharge cases, the control system was designed accordingly. A microcontroller-based control system was applied in order to control the energy flow in the hybrid energy generating system. The control processes were carried out using a microprocessor-based Arduino Mega 2560 board. Processes of reading, viewing and saving the data from the sensors constituting the energy generating systems were operated via an interface program which was created on the LabVIEW. With this control system, energy flows of three different energy generating systems were performed independently and they were made to implement three different determined algorithms. At the same time, it was ascertained which of three solar panels have the best performance.
II. Hybrid Energy Generating System Consisting of Different Solar Panels and Fuel Cell and its Components
In this study, the hybrid energy generating system consisted of three different solar panels (monocrystalline, polycrystalline and thin film), fuel cell, battery and direct current (DC) and alternating current (AC) loads. Detailed technical properties and installation processes of components of the hybrid energy system were given in the subtitles.
A. Outlook of hybrid energy generating system
Each power generating system included a solar panel, a battery, DC load and AC load as well as a fuel cell energy generating system to supply continuous energy. Each solar panel group was 100 W, and the types of the solar panels are monocrystalline, polycrystalline and thin film, respectively. There were a monocrystalline and a polycrystalline solar panel, but thin film solar panel group consists of two 50 W solar panels. There were three gel batteries (gelled electrolyte lead acid) in total; one for each power generating system and each of them had 12 V, 85 A h capability. The power of polymer electrolyte membrane (PEM) type of fuel cell was 500 W and its output voltage was 24 V. Bulbs with DC–AC load properties representing the consumer were connected to the output of power generating systems. Each DC bulb was 12 V and 10 W, and there were two DC bulbs at the output of each power generating system, that is to say, they had a 20 W of load property in total. AC bulbs representing AC consumer are used. In the case of excess energy storage or when there was no supply of energy either from solar panel or full cell energy source, in reference to the properties of applied algorithms, batteries are used to supply uninterrupted energy to the consumer. The batteries were charged with charge control devices. Converters with 19–36 V input voltage and 12 V DC–DC output voltage were used in energy generating system groups consisting of monocrystalline and polycrystalline solar panels. Moreover, input voltage 36–72 V and output voltage 12 V DC–DC converters were used in energy generating system groups consisting of thin films; 12 V DC consumers were supplied via these converters. When DC consumers have no energy demand, AC consumer was fed via an available energy inverter in order to use the energy effectively and efficiently.
Energy flow controls of hybrid power generating systems were performed with the data obtained from current and voltage sensors via microcontroller-based controller. Current and voltage data of the components of the hybrid energy generating systems were saved by the computer in intervals of 1 s and a data recording was formed. Schema of hybrid energy generating system is shown in Figure 1 .

Hybrid energy generation system with monocrystalline solar panel
B. Solar panels
Photovoltaic panels are used to convert solar power to electric power. Their usage rate has increased considerably in recent years and they form an important part of energy generation. It is possible to classify solar powers by their type of production and materials. As previously stated, solar panels are classified as monocrystalline, polycrystalline and thin film solar panels ( Figure 2 ). Solar panels with three different properties were used in this study. Technical properties related to solar panels are shown in Table 1 .

Installation process of monocrystalline, polycrystalline and thin film solar panels in the hybrid energy generating system
Technical properties of solar panels
C. Fuel cell and hydrogen bottle
Proton exchange membrane fuel cell (PEMFC) is a commonly used type of fuel cell in practices. In today’s technology, it is possible to see them to be used in every part of portable energy generating systems notably in automotive technology. In this study, due to the advantages of fuel cells, PEMFC was used as the energy source which supplied the hybrid energy generating system. In this way, different types of energy sources were used collaboratively by offering variety in energy generating sources. The properties of the fuel cell used in this study are shown in Table 2 . Moreover, a hydrogen bottle having a capacity of 760 mL was used in this study and it is shown in Figure 3 .
Properties of PEMFC-500 fuel cell
Temperature between 15 and 30 °C and humidity between 30% and 90%.

Fuel cell energy generating system
D. Battery and loads
As one of the components of the hybrid power generating system, batteries were used as the additional energy source to supply the load when the energy cannot be obtained from solar power or fuel cell. There were used three 85 A h gelled batteries and each energy generating system included one battery. Technical properties of the batteries used in the system are shown in Table 3 .
Technical properties of batteries
DC and AC featured bulbs were used as consumer purpose for three different energy generating systems. Each group had two bulbs and 20 W of DC user load was obtained via these bulbs. Operation voltage of DC bulbs is 12 V. The capacity of the bulbs used as AC load was 32 W.
E. Charge regulator, DC/AC (inverter) and DC/DC converters
Over charge and discharge affect the lifetime and charge capabilities of the batteries negatively. To use the batteries more effectively, charge control devices are used. For this reason, batteries are charged by means of charge control units.
Voltage rating of the system can change depending on time, due to the energy resources that constitute the hybrid energy system. Variable voltage ratings are obtained from solar panels at different times of a day. DC–DC converters used in this study were chosen to be at a stable rate of 12 V. DC–DC converters with 19–36 V input were used for monocrystalline and polycrystalline solar panels, and 36–72 V input voltage DC–DC converter was used for thin film solar panel. All DC–DC converters’ output voltage value is 12 V. Through these converters, variable output voltage obtained from solar panels was converted into the nominal value of 12 V in accordance with the operation of energy generation systems.
A modified sinus inverter which has 12 V input and 1000 W power was used in energy generating system. When DC loads were not used, available energy was converted from DC to AC through this inverter, and by this means, AC loads were supplied. Thus, it was aimed to use the energy more effectively.
III. Energy Flow Control System and Strategy
Owing to the fact that the energy resources that constitute hybrid energy generating system have different properties, the efficiency of the systems initially depends on energy control systems and energy management strategies. 24
A. Equipment constituting the control system
To perform energy flow control of the hybrid energy generating system, a microprocessor-based Arduino Mega 2560 processor board, a 16-channel relay board, ACS-712T-ELC-30A current sensor and voltage sensors, which were formed via voltage divider resistors, were used. Three sensor cards were designed individually to perform measurement of current and voltage in each of the energy generating systems. Current, voltage and power quantities of the systems were measured via these sensor cards. Equipments used in energy flow control system are shown in Figure 4 , and designed sensor cards can be seen in Figure 5 .

Equipments used in energy flow control system: (a) Arduino Mega 2560, (b) Relay Board with 16 Relays and (c) ACS-712T Current Sensor

Installed energy flow control system
B. EMS
Energy obtained from three different hybrid energy generating systems was converted into 12 V DC current through DC–DC converters, and the energy demanded by the consumer was supplied. At the same time, the electrical connection of the batteries with load groups was done to supply DC consumers.
Three different algorithms were applied on the hybrid energy generating systems to use the generated power effectively and efficiently, and an interrelated effectiveness analysis of these algorithms and energy generating systems were performed. Solar panels were accepted as the main source of power in each of the three hybrid energy generating systems. The energy demanded by the consumer groups were initially supplied by solar panels. When there is no sufficient solar power, providing the batteries are full, the batteries are going to supply the necessary energy to the consumer in compliance with the designed energy flow control system. If the energy demanded by the consumer cannot be supplied either by the solar panels or by the battery, the demanded energy is going to be supplied by fuel cell as much as its capacity.
If the energy generated from solar panels in each of the three energy systems is more than the demanded energy by the consumer, this surplus energy is used to charge the batteries through energy charge regulators. There are DC and AC consumer groups. The steps to control the algorithms applied on hybrid energy generating systems are described below in detail.
Algorithm 1
According to the first algorithm, when the electric energy obtained from solar panels is not sufficient, battery cuts in this energy demand of DC consumer is supplied through batteries. When the batteries are not sufficient, fuel cell is included in the system, and DC consumer is supplied by fuel cell. If the energy is more than the demand of the consumer, not only the consumer is supplied with the energy but also the batteries are charged. The aim of this algorithm is to supply the consumer with uninterrupted energy. In line with this logic, DC consumer supply was performed in order of priority. The first algorithm applied on the hybrid energy generating systems is shown in Figure 6 .

Flow diagram belonging to first algorithm applied on energy generating systems
Algorithm 2
In the second algorithm, unlike the first one, in addition to DC consumers, AC consumers were included. DC–AC converters were also included in the system to supply energy for AC consumer. Consumer priority belongs to DC type of consumer. The main logic for the application of second algorithm is to meet the energy demand of AC consumer group with the surplus energy obtained from energy generating system and in this manner, to use the available energy in the most effective and efficient way. As in the first algorithm, if the generated energy is less than energy needed by DC consumer, DC consumer is supplied by the batteries. If the batteries cannot supply the consumer, fuel cell cuts in and the energy demanded by the consumer is supplied by fuel cell. If more energy than the need of the consumer is obtained from the solar panels, batteries are charged. When the occupancy rate of the battery exceeds 90%, AC consumer is supplied with this surplus energy. The flow diagram of the second algorithm applied on the hybrid energy generating systems is shown in Figure 7 .

Flow diagram belonging to second algorithm applied on energy generating systems
Algorithm 3
In the third algorithm, the steps to be applied are the same as in the first algorithm; providing that the energy, which is obtained from the hybrid energy generating system, is less than the energy demanded by DC consumer. The difference of this algorithm appears when the generated energy is more than the demanded energy. If the generated energy is more than the energy demanded by DC consumer, a control process is performed in the view of the fact that the occupancy rate of the batteries is more than 90%. If the occupancy rate of the battery is more than 90%, energy obtained from solar panels is directed to AC consumer. DC consumers are supplied with batteries. If the occupancy rate of the battery is less than 90%, batteries are charged. The flow diagram of the third algorithm applied on the hybrid energy generating systems is shown in Figure 8 .

Flow diagram belonging to third algorithm applied on energy generating systems
C. The control interface created on the LabVIEW
While energy flow control was performed in three different energy generating systems, the processes such as recordings of the data, monitoring of the data obtained from energy systems, and the process of controlling the relays, which are used as switching elements in the system, on the computer were performed by an interface of a control system which was created on LabVIEW, and this interface is shown in Figure 9 . The data exchange between energy generating systems and the interface program was performed based on serial communication. Current, voltage and power values belonging to each energy generating system were classified in this interface program among themselves. Using the “Save Date” button, the data recording process became active and the data can be saved as “txt” documents. The relays on control panels can be changed optionally by changing the buttons on the interface to “Typing on Serial Port is Active” mode via relay control buttons on the interface. Manual control of the relays was used to get reliable data from the system after performing the calibration procedures of sensor values. The data can be obtained from the system via sensor cards without having any errors by monitoring the serially typed data. By “STOP” button, it was possible to stop the operation of the interface and some processes such as importing and monitoring data and using manual relay control.

LabVIEW program where control process was performed by monitoring data in hybrid energy generating systems
IV. Experimental Results and Discussion
To use the available energy efficiently and effectively is as important as the generated energy in the hybrid energy generating systems. The hybrid energy generating systems such as solar panel–fuel cell have low efficiency, and it has been stated in the previous studies that there should be much more studies on this subject. In the studies that analyzed the efficiency of solar panel–fuel cell hybrid energy systems, it is underlined that its value varies from 0.8% to 9.7%. 25
In this study, application of an energy flow control system was performed to supply uninterrupted energy to consumer groups connected to different types of the hybrid energy generating systems consisting of three different solar panels and fuel cells. It was aimed to use the energy effectively and efficiently. This aim was achieved by controlling and redirecting the obtained energy. While performing these processes using the data obtained from different types of solar panels, the analysis was done to ascertain the most suitable type of solar panel for the Afyonkarahisar region.
Solar panels were used as the main source of energy in energy generating systems established with different types of solar panels. Along with solar panels, battery packs and fuel cell were also used and three different energy systems were formed. Three different control algorithms were designed and applied to use the energy which was generated from the energy generating systems efficiently and effectively. Following that, the comparison of different types of energy generating system was performed in terms of efficiency. The data between the dates of 01 May 2014 and 30 April 2015 were used in this study.
When the amount of energy generated by three different solar panels annually was analyzed, it was seen that the least energy generation was in thin film solar panel. It is seen in Table 4 that the amount of generated energy of monocrystalline and polycrystalline solar panels is approximately at the same value. However, energy generated from polycrystalline solar panel is a little more than the energy generated from monocrystalline solar panel, and it can be understood from the graphics shown and this can be understood from Table 4 .
Monthly amount of energy that was obtained from solar panels throughout the year (Wh)
The main reason why the generated energy from solar panels is different is the type and the chemical structures of material that form the solar panels. Silicon semiconductor material is used for monocrystalline and polycrystalline solar panels. Having different efficiency values also affects the area that solar panels cover physically. Although there were not many differences in terms of dimension between monocrystalline and polycrystalline solar panels, there was a big difference with thin film panels. Even though thin film panels were at the same power value, they covered twice as much area.
Factors that affect the solar panels to generate energy are hours of sunshine and the intensity of sun rays. Values that belong to these variables reach high levels during summer months. When the data of the energy generated from solar panels are analyzed, it can be seen that generated energy in summer months is approximately six times higher than the energy generated in winter months. The reason why the amount of generated energy is so different between winter and summer is that the hours of sunshine are between 3 and 4 h in January and between 11 and 12 h in July.
Efficient usage value of the energy in the energy generating systems was obtained by comparing the amount of energy used by the consumer for energy generated from solar panels. When Figure 10 is analyzed, it is seen that the rate of efficient usage of energy generated from monocrystalline and polycrystalline solar panels decreases starting from winter months toward summer months. The reason of this decrease is that the generated energy in winter is less than the generated energy in summer and it cannot be used efficiently by the consumer. Since the generated energy in summer months is higher than the other months, the amount of surplus energy is evenly higher. The rate of efficient usage of energy is at its lowest rate value in hybrid energy generating systems in July and August, and this can be seen in Figure 10 . No significant alteration is observed in the rate of efficient usage of energy in thin film hybrid energy generating system in almost every month of the year. There is just a slight decrease in summer months. This is because the amount of energy generated from thin film solar panel is only higher than the demanded energy in July and August.

Alterations in efficient usage value of the energy after application of the first algorithm on hybrid energy generating systems
It was seen through the obtained data that the rate of efficient usage of the energy generated from hybrid energy generating systems changes as a result of applied algorithms. To increase the rate of efficient usage of energy, the second algorithm was applied. It is seen in Figure 11 that the decreased rate of efficient usage of energy generated from energy generating systems in summer months is increased by the application of the second algorithm. The reason for this increase was added AC consumer as a load to energy generating system and the energy was used efficiently by this consumer and this can be understood from the data. The increase in rate of efficient usage of energy in the monocrystalline and polycrystalline energy generating systems was almost at the same values, and the least increase was observed in the thin film energy generating systems.

Alterations in efficient usage value of the energy after application of the second algorithm on hybrid energy generating systems
It has been seen in Figure 12 that the rate of efficient usage of the energy generated from the hybrid energy generating systems increases as a result of the application of the third algorithm. The highest increase was observed in polycrystalline energy generating system. When the first algorithm was applied, the rate of efficient usage of energy in polycrystalline energy generating system was 22%. However, when the third algorithm was applied, this rate increased to 54%. The decrease in the rate of efficient usage of the lowest energy was observed in thin film energy generating system. While the rate of efficient usage of energy was 23% in thin film energy generating system as a result of the first algorithm, it increased to 26% when the third algorithm was applied. When the rate of efficient usage of energy in monocrystalline energy generating system was observed, it was 23% as a result of the first algorithm. However, it increased to 54% when the third algorithm was applied.

Alterations in efficient usage value of the energy after application of the third algorithm on hybrid energy generating systems
The comparison between the rates of effective usage of energy belonging to three algorithms is seen in Figure 13 . It can be understood from the diagram that the highest rate of efficient usage of energy is obtained when the third algorithm is applied on the energy generating system. An increase was obtained in the general rate of efficient usage of energy by improving the decreased rates of efficient usage of the energy in winter by applying different algorithms.

The comparison of rate of effective usage of energy as a result of the application of the first, second and third algorithms to monocrystalline hybrid energy generating system
When the rate of efficient usage of energy as a result of the application of the algorithms on polycrystalline energy generating system was analyzed, it was seen that there was an increase in the rates from the first algorithm toward the third algorithm. The highest rate of efficient usage of energy was obtained when the third algorithm was applied on polycrystalline energy generating system. The biggest factor that affected the increase in the rate of efficient usage of energy was that the surplus energy was used more.
It was seen that due to the amount of surplus energy in winter as a result of the application of the first algorithm to energy generating system, the rate of efficient usage of energy was low. In the second algorithm, along with the inclusion of AC consumer, low rates of efficient usage of energy increased a bit. When the proportional values of applied algorithms in July were analyzed, the rate of efficient usage of energy was 22%. When the first algorithm was applied, it increased to 39% as a result of the application of the second algorithm and it became 55% when the third algorithm was applied. The comparison of three algorithms is seen in Figure 14 .

The comparison of rate of effective usage of energy as a result of the application of the first, second and third algorithms to polycrystalline energy generating system
As a result of the application of the first, second and third algorithms to thin film energy generating system seen in Figure 15 , the rate of efficient usage of energy just changed in July and August. The highest increase in rate was 2% in the third algorithm and it was almost 1% in the application of the second algorithm.

The comparison of rate of effective usage of energy as a result of the application of the first, second and third algorithms to thin film hybrid energy generating system
V. Conclusion
In this study, three different types of control algorithm were designed and practices were performed in order to use efficient and effective energy, which has been generated from three different hybrid energy generating system. As a result of the applied algorithms, the rate of efficient use of energy in polycrystalline energy generating system increased from 22% in the first algorithm to 54% after the application of the third algorithm. The rate of efficient use of energy in monocrystalline energy generating system increased from 23% to 53% after the application of third algorithm. The least rate of increase was in thin film hybrid energy generating system and it increased from 23% to 25%.
The percentages in total annually generated energy of hybrid energy generating and energy flow control systems and monocrystalline, polycrystalline and thin film solar systems, which constitute these energy generating systems, were also determined. It is normally known that the efficiency rate of monocrystalline type of solar panels is higher than polycrystalline solar panel. 26 In accordance with this knowledge, it is possible to think that the highest rate of energy will be generated from monocrystalline solar panels. However, according to the data, which was obtained from different types of solar power generating systems as a part of this study conducted in Afyonkarahisar, the highest percentage belonged to polycrystalline solar panels with 41% and the least percentage belonged to thin film solar panels with 20%. Monocrystalline solar panels had the second place in terms of the amount of total generated energy with 39%. Along with the increase in the hours of sunshine and amount of radiation in summer months, the energy generated from solar panels was also high.
In the future studies, the most effective controller method can be determined by applying advanced types of controllers such as Fuzzy Logic, Fuzzy PID, Neuro-Fuzzy and Neuro-Fuzzy PID instead of microprocessor-based controllers on hybrid energy generating systems.
Footnotes
Funding
This research has been supported by grant number 13.TEKNOLOJI.02 from Afyon Kocatepe University Scientific Research Projects Coordination Unit.
