*Article* **Energy Self-Sufficient Livestock Farm as the Example of Agricultural Hybrid Off-Grid System**

**Grzegorz Augustyn, Jerzy Mikulik \* , Rafał Rumin and Marta Szyba**

Department of Business Informatics and Management Engineering, AGH University of Science and Technology, 30-059 Kraków, Poland; gaugustyn@zarz.agh.edu.pl (G.A.); rrumin@zarz.agh.edu.pl (R.R.); mszyba@zarz.agh.edu.pl (M.S.)

**\*** Correspondence: jmikulik@zarz.agh.edu.pl; Tel.: +48-603-353-250

**Abstract:** Contemporary agriculture has become very energy-intensive and mainly uses electricity, which is needed for technological processes on livestock farms. Livestock faeces are burdensome for the environment due to the release of methane into the atmosphere. This article presents the concept of a self-sufficient livestock farm as an off-grid energy circuit that is a part of the agricultural process. The key idea is to obtain an energy flow using the concept of a smart valve to achieve a self-sufficient energy process based on a biogas plant, renewable energy sources, and energy storage. During the production process, a livestock farm produces large amounts of waste in the form of grey and black manure. On the one hand, these products are highly harmful to the environment, but on the other, they are valuable input products for another process, i.e., methane production. The methane becomes the fuel for cogeneration generators that produce heat and electricity. Heat and electricity are partly returned to the main farming process and partly used by residents of the area. In this way, a livestock farm and the inhabitants of a village or town can become energy self-sufficient and independent of national grids. The idea described in this paper shows the process of energy production combining a biogas plant, renewable energy sources, and an energy storage unit that enable farmland to become fully self-sufficient through the energy flow between all constituents of the energy cycle being maintained by a smart valve.

**Keywords:** biogas energy; solar energy; hybrid biogas plant; renewable energy; circular economy; off-grid systems

#### **1. Introduction**

Methane is the basic component of natural gas, the combustion of which causes less carbon dioxide emissions than is the case with other fossil fuels (coal, lignite, and peat). Methane is formed during the anaerobic digestion of organic matter. One of the major sources of methane is waste from livestock farms. Methane emitted in natural processes has a negative impact on the environment as it has a carbon dioxide equivalent of 25 times. Methane emissions can be reduced by fermenting the organic matter in biogas plants [1]. Biogas is a mixture of methane (40–85%), carbon dioxide (16–48%), and other gases present in trace amounts. The content of methane in biogas is influenced by the fat content of the substrate. Its high content results in biogas with a high methane content. The biogas yield is influenced by the fermentation temperature, retention time, substrates used, load, decomposition technology, and the pre-treatment of raw materials [2,3]. As a result of the fermentation of organic material, clean and cheap fuel in the form of biogas is produced. It can be used for heating, lighting, and powering machines [1]. Fermentation, however, is an unstable process as it may be disturbed by an increase in temperature in a fermentation chamber, overproduction of volatile fatty acids, and chemical contamination, e.g., with pesticides or heavy metals [4]. The by-product of this process is digestate, which is a valuable organic fertilizer that is a source of easily digestible nutrients for plants [3,5,6]. Biogas plants, unlike other renewable energy sources, are multi-energy systems as they

**Citation:** Augustyn, G.; Mikulik, J.; Rumin, R.; Szyba, M. Energy Self-Sufficient Livestock Farm as the Example of Agricultural Hybrid Off-Grid System. *Energies* **2021**, *14*, 7041. https://doi.org/10.3390/ en14217041

Academic Editor: Tomasz Rokicki

Received: 30 August 2021 Accepted: 14 October 2021 Published: 28 October 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

produce biomethane, which, after combustion, provides electricity and heat through the process of cogeneration [5]. Electricity is usually sold to the national grid, and heat, when distributed into the local district's heating grid, is used to heat the biogas plant's buildings and the farm [7]. Cogeneration combustion is not the only possibility for the usage of biomethane. After cleaning, it can be injected into the natural gas network. In a compressed form, it can be used as a fuel for cars with CNG installations [2,3,5,8]. It can also be converted into biohydrogen in a steam reforming process.

By utilizing organic waste, biogas plants are flexible sources of energy that reduce the amount of greenhouse gases emitted into the atmosphere as they burn fossil fuels. Therefore, they are a part of circular agriculture (circular economy) and contribute to the concept of sustainable development. This concept organizes agricultural production according to the following principle: Resources—Agricultural Products—Renewable Energy Sources, with an emphasis on recycling and reuse of waste and by-products instead of traditional and extensive production [9]. Biogas plants are popular in many countries as they have an advantage over installations producing energy from the sun and wind. The production of biogas is not affected by climate-related risks. Biogas can also be stored for later use. Producing biogas from farm waste and using it for personal use is especially popular in countries with no universal access to electricity and heating networks due to large due to large distances between buildings [6,10].

The global energy industry is moving towards energy storage systems and renewable energy installations placed close to end users. Such an approach fosters greater independence from imported energy sources and diversification of energy sources [2]. Balda et al. proposed in Japan a project of a self-sufficient farm, which would generate electricity, heat, and fuel to meet its own needs. The research presents a version of a self-sufficient farm that optimizes the size of a biogas plant in accordance with its specific demand for food and fuel. In such farms, crops are used to produce food or fuel, and their residues are used to generate electricity and heat through cogeneration [11].

Due to climatic conditions and long distances, renewable energy should come from autonomous, interconnected, small biogas plants. The produced electricity and heat would be used to power and heat households. In biogas plants, raw biomass and liquid waste from cattle, pig, sheep, and poultry farms would be used as substrates. Approximately 95–99% of the generated heat energy would be used to heat housing and livestock buildings for cattle and to support the fermentation processes. About 40–42% of the electricity would be used in cattle buildings for technological processes, and the rest by biogas plants and homes [10].

In Asian [2,6,12,13] and African [1,2,6] countries, small household biogas plants, in which animal droppings are used as substrate, are popular. The fermented substrate (digestate) is transported to the fields as fertilizer with a high nutrient content [14]. Crude biogas is stored and used directly for cooking, or is used in cogeneration to produce electricity and heat. It can also be used to power absorption chillers for cooling purposes. Electricity and heat are used locally, or fed into the grid [15,16]. Purified biogas is used to power cars, buses, and trucks [1].

In the EU countries, the energy transformation is carried out in order to reduce greenhouse gas emissions, improve air quality, and stop climate warming. This is the main goal of sustainable agriculture programs in many European Union countries, including Poland. Livestock farms with biogas plants generate electricity and heat from local organic substrates. The heat is used to heat the farm buildings and to support local heating networks [17]. By generating electricity and heat in a biogas plant, the use of fossil fuels and associated greenhouse gas emissions can be reduced [5].

The support of the development of biogas plants in Germany can be observed in the form of subsidies granted to biogas plant operators. In addition to such incentives, the decision to build a biogas plant can be affected by environmental, social, and economic factors. The availability of feed for farm animals is also an important part of the decision to build biogas plants, as there is a concentration of biogas plants in regions with a high density of livestock in Germany [15].

Biogas can also be produced using biodegradable municipal waste. Such waste is an important substrate and, when combined with cattle manure in a 1:1 ratio, it can generate a large amount of biogas [13]. Biogas produced from waste in rural areas around cities has great potential to meet the energy needs of cities. In the case of combined heat and power generation, there is a problem of low heat consumption by biogas plants. On average, a biogas plant uses 50% of the heat produced. In Germany, only 10% of biogas producers use more than 50% of the heat. The remaining amount could be used to heat houses and buildings in the vicinity of the biogas plant [2].

The European Union has developed a sustainable economy plan known as the European Green Deal. The activities described therein concern, inter alia, counteracting climate change and environmental degradation. This can be achieved through a sustainable climate policy that fosters the development of a modern, resource-efficient, and competitive climate-neutral economy by 2050. Economic growth will then be independent of the use of natural resources. Such sectors as energy, transport, agriculture, construction, and all industries will be transformed. The greatest emphasis is placed on the transformation of the energy sector [18,19]. Conventional coal-fired power plants will be gradually replaced by renewable energy installations [20]. There is a methane strategy in the European Green Deal which focuses on its reduction in energy, agriculture, and waste sectors, as these are the areas where methane emissions are the highest. The use of a cross-sectoral approach will help target actions in each area, exploring synergies between sectors, e.g., through the production of biomethane released in landfills or on animal farms. Biomethane produced in biogas plants from various types of biodegradable waste such as animal faeces, green and kitchen waste, and waste from the agri-food industry, can be the catalyst for energy conversion [21]. Among the European countries, Poland also has a great potential for biogas production, given the similar natural conditions to those of Germany. According to the data collected by the Energy Regulatory Office (ERO), in March of 2021, there were 120 agricultural biogas plants in Poland with a total capacity of 117.98 MW (average power 0.98 MW) and a biogas production capacity of 490,143.199 m<sup>3</sup> [22]. This constitutes approximately 10% of the estimated potential at approximately 5 billion m<sup>3</sup> [23]. The development of biogas plants was limited by the lack of local spatial development plans, which do not take into account places for the construction of installations which use renewable energy sources. This, combined with the misconception that biogas plants need to be large, meant that they were built only in voivodeships with large farms and large livestock farms [7].

#### **2. Renewable Energy Solutions (RES) in On-Grid and Off-Grid Micro Networks Considerations**

The main disadvantage of renewable energy is its unreliability and the inability to work efficiently due to the intermittent and fluctuating nature of the processes, which usually leads to system oversizing, thus increasing the investment cost. For this reason, hybrid renewable energy systems (HRES) are built. Their popularity has grown due to the effectiveness of eliminating the disadvantages of RES systems based on a single source. A hybrid system consists of at least two power systems of different origins (renewable and fossil fuels), an energy storage unit, and electronic devices controlling them. The main advantages of HRES are greater reliability, better efficiency, increased energy storage capacity, lower energy costs throughout the life cycle, and minimization of greenhouse gas production [22,23]. Hybrid systems producing electricity can take a form of a microgrid. This is a locally controlled energy system that uses:


There are two types of microgrids: on-grid and off-grid. The former are connected to the national power grid, the latter are autonomous and operate outside of the national power grid. The combination of photovoltaic technology and other RES with a biogas generator can be a profitable solution that may power even the most remote and sparsely populated rural areas. Such a hybrid system is optimal and less expensive than the traditional one. In off-grid networks, energy is generated by photovoltaic panels and a biogas generator, and stored in a battery bank. The batteries should have the capacity to power buildings for a certain number of days without sun, wind, or biogas [15,24].

Developing microgrids in which renewable energy is used has many environmental benefits, such as reducing the overall energy consumption, improving energy efficiency, reliability of energy supply, reducing transmission losses, voltage control, and an increased security of the energy supply. HRES support the implementation of sustainable development with the use of renewable energy [25]. The climatic risk is the occurrence of long interruptions in the supply of electricity from the national grid caused by damage stemming from weather factors, e.g., strong wind, snowfall, or freezing rain. Its occurrence and ailments are reduced by HRES microsystems independent of the national network, which are also an energy reserve for this network [26].

In rural and sparsely populated areas, terrain and economic considerations play an important role in the planning of the power grid. Attention is paid to the production of energy from renewable sources, which are easy to install, have a higher rate of energy use, lower transmission losses, and lower operating costs [24,25]. In addition, the use of environmentally friendly renewable energy sources in rural areas can reduce environmental pollution also in surrounding towns. The use of alternative energy sources makes communication more accessible and minimizes dependence on fossil fuels, which in turn reduces the negative impact on the environment [22,26].

Ghenai et al. proposed a microgrid for the city of Sharjah in the United Arab Emirates that uses renewable energy from a hybrid solar-biogas system. It consists of photovoltaic panels, a biogas cogenerator, batteries (lithium-ion batteries), as well as inverters. In the PV—Photo Voltaic system, two-axis tracking devices have been added to maximize the system's output power. The study took into account the effect of temperature on the operation of PV systems. Its efficiency decreased with increasing ambient temperature (high summer temperatures in Sharjah) and the accumulation of dust on the solar panels (desert region). The study presented a simulation and modelling analysis for the design of energy-based microgrid systems. The results showed that the hybrid system can provide up to 14% of the total annual electricity demand in the city of Sharjah, with the percentage of energy generated by photovoltaic panels being 74%, and 26%from a biogas cogenerator [27]. Hybrid grids can be used in sparsely populated areas, where large distances between farms make the construction of traditional energy networks unprofitable. The government of India took up the challenge to provide a stable and continuous power supply to all farms. For this purpose, an integrated energy system was created consisting of a wind turbine, photovoltaic panels, and a biogas generator. The systems were connected to a control panel, which transmitted the electricity to the battery. The battery was charged when the wind turbine and solar panels produced power. It was used to cover the energy needs of households. However, the capacity of the wind turbine and the PV system was insufficient to meet the buildings' needs. To meet the demand, a biogas generator was added, which became the source component of the hybrid system [28]. In response to the challenges of rural electrification in Sub-Saharan Africa, a completely renewable off-grid energy system was developed. It included wind turbines, a photovoltaic panel, and a biogas generator installed in Djounde in the north of Cameroon. The hybrid system was optimized, and the simulation performed confirmed the cost-effectiveness and environmental benefits of the proposed system compared to the existing solutions. Electricity supplied to the agricultural sector helped solve the main problem in the area, poor agricultural productivity, through the use of electrical appliances in agricultural production and processing of agricultural products [29]. In Bangladesh, a hybrid system consisting of a photovoltaic module, a biogas

generator, a biodiesel generator, and an energy storage device was developed. The system established a reliable energy supply, reduced environmental pollution, ensured more efficient use of energy, and reduced maintenance costs. The HOMER (Hybrid Optimization Model for Electric Renewable) software was used to evaluate the performance of the hybrid energy system. Cow manure was used as the substrate for this biogas plant. [30]. Similarly, the research described by Buragohain et al., focused on a biogas plant using cow manure as a substrate [31]. Additionally, for the Bangladeshi areas, Chowdhury et al. designed a hybrid system consisting of PV panels, a biogas generator, and batteries to store electricity. This made the system more economical, as it could generate electricity on cloudy days. Research has shown that the proposed hybrid system is more cost-effective and reliable for rural areas [24]. Oluwaseun et al. proposed an electricity generation system that, as the previous one, was also based on PV panels and a biogas plant. In this case, manure from 1000 pigs was used as a substrate for biogas production. The research showed that electricity generated in a biogas plant is more effective and reliable for rural areas than is the case with solar energy. The results also showed that burning biogas provides more energy compared to solar energy [27]. To produce biogas in a hybrid installation, apart from animal manure, other substrates constituting biodegradable waste can be used. Such a system was designed by Habiba et al., who used kitchen waste from dormitories and hostels located on the university campus to produce biogas. PV panels were installed on the roofs of these buildings [32]. In rural areas, biomass from animal manure is readily available. Its abundance makes it a viable option to use it as a potential source of substrates for electricity generation in countries with significant amounts of animal excrement [23]. On the island of Java, a hybrid system consisting of a PV plant and a biogas plant was proposed. Electricity was produced by PV panels in the dry season (April–August) when the sunlight was the most intense (123–1075 W/m<sup>2</sup> ). The energy generated in this way could be stored in batteries and used by the inhabitants of the island when energy was not produced by PV panels. In the aforementioned biogas plant, cattle manure was used as a substrate for the production of biogas and electricity, which was obtained as a result of cogeneration. The strategy behind a hybrid system is that, while PV panels produce electricity during the day, the biogas plant generates it at night. As a result, both RES systems complement one another, constituting the optimal hybrid power system for the island [29]. Furthermore, the solution creates a system of effective distribution of energy generated from renewable sources. It is possible to build hybrid energy grids parallel to the commercial grid. This solution can make electricity successfully distributed to rural and urban areas, which would solve the electricity problem [15,29].

An important role in hybrid and off-grid solutions [24,26,29,30,33–38] and systems is played by energy storage units. The evolution of the energy market towards micro production of electrical energy and heat implicates certain problems with unpredictable energy production profiles and its balancing in hybrid systems. Energy storage units are one of the solutions to be considered in this area, as they can help with momentary energy balancing and energy production fluctuations in small and medium hybrid systems [15,28,33,39]. Such energy storages are now entering the consumer market and are commonly used with photovoltaic systems. Some of the energy storage solutions include lithium-ion batteries, battery cells, or hybrid batteries based on hydrogen technology which can accumulate electrical energy to balance unstable energy sources such as photovoltaic installations during their cooperation with power grids. Small to medium capacity energy storages can be particularly helpful for small to medium installations starting from 3 kWh up to 60 kWh, or even more for commercial markets [40]. This direction shows how to properly apply and manage energy storage solutions in small and medium renewable energy production systems to achieve better balancing and comply with local energy market regulations.

#### **3. The Idea of a Hybrid Off-Grid Autonomous System**

Hybrid, off-grid, autonomous energy systems are based on renewable energy sources such as wind, solar, and biogas, as well as energy storage options to provide uninterruptible power supply to the recipients (farmlands, households, etc.) and to satisfy their energy demands. Considerations in previous chapters show that there is a need to manage energy sources in hybrid systems to render them as independent from the national power grid as possible. The electrical energy produced by a biogas plant can be used to power the grid when variable renewable energy, such as solar or wind energy, is introduced into the energy system. This is also as biogas (methane) can be easily stored and produced on demand [8]. Biogas storage tanks are connected to an installation that transfers the product to cogeneration engines, where electricity and heat are generated. A biogas storage facility makes electricity and heat production flexible, as the storage size is directly linked to the efficiency of the biogas plant [5]. Hybridization of energy sources on a farm increases the reliability of the energy system combining two or more sources of energy. Additionally, the system can include energy storage units to create an autonomous (self-sufficient) off-grid energy system. However, such a solution requires constant management and monitoring of the parameters of the system's elements.

The idea shown in this paper combines a biogas plant and renewable energy sources, as well as an energy storage unit to create an autonomous, self-sufficient hybrid power system managing the energy flow through the use of a smart valve. The smart valve's role is to manage and provide routing between all elements of the system: the biogas plant, a renewable energy source, and the energy storage unit. Routing the correct source of energy to the recipient (households and agricultural facilities such as barns, glasshouses, and farm buildings on the farmland) as well as managing the way it is routed (directly to the recipients or to the storage device) is the key aspect of the solution.

For further considerations and simulations, our off-grid network consists of a medium size cattle farmland with 20 cows, ten households, a biogas plant, a renewable energy source using PV of 10 kWh, and an energy storage unit.

Figure 1 below presents the energy flow between all elements of the system proposed for further considerations. It is connected to the power grid. Energy and heat produced through a biogas plant are routed to the following recipients: glasshouses, farm buildings, and households. Households are connected to the system, but they do not belong to the farmland and are considered external energy loads. The biogas plant is also a direct source of energy for farmlands, as it utilizes the overproduced CH<sup>4</sup> and CO2. The photovoltaic circuits constitute additional components to produce and support the facilities and individual consumers when possible. It is noteworthy that in this solution electrical energy cannot be stored, so an additional source from the power grid network is needed should the biogas plant or PV circuits produce no energy.

**Figure 1.** Diagram of energy flow (heat, electric power, manure, and CH<sup>4</sup> )—produced on a medium-sized cattle farm with an on-grid connection.

The idea and main focus of the research is to connect all components of the system, the biogas plant, a renewable energy source, and the additional energy storage unit, in one hybrid system where the energy flow and routing are managed by a smart valve in a way that allows for autonomous off-grid functionality. This idea is shown in Figure 2.

**Figure 2.** Diagram of electric power flow produced on a medium-sized cattle farm with an off-grid solution, an energy storage unit, and a smart valve supporting energy routing.

> The smart valve plays a key role in this self-sufficient system. It manages the energy routed to/from respective elements of the system. The valve is responsible for adjusting the energy flow and the storage decisions during periods of overproduction. The operation of the valve is based on a three-way input controller with negative feedback. The energy produced by the biogas plant and a photovoltaic source is routed by the valve in two ways:


The function of the valve is to ensure that the system is balanced so that all energy loads (farmland and households) are satisfied; in other cases, it charges the energy storage device. Its functions are based on the coefficients which are adjusted to the current energy demand, production, and storage capabilities.

The valve's operation and systems are shown in Figure 3.

P ∑P − ∑Pୖ

P = [a\* P + b\* Pେ + c \* Pୋ] − Pୖ

**Figure 3.** Energy routing through a smart valve—inputs and outputs.

In this case, we can describe its functionality based on the energy balance with its main condition:

$$P\_{\rm NET} = \sum P\_{\rm OUT} - \sum P\_{\rm REAL} \tag{1}$$

Furthermore, we can expand the equation into the following form:

$$\mathbf{P\_{NET}} = \left[\mathbf{a} \ast \mathbf{P\_{PV}} + \mathbf{b} \ast \mathbf{P\_{CO}} + \mathbf{c} \ast \mathbf{P\_{MAG}}\right] - \mathbf{P\_{REAL}} \tag{2}$$

where: POUT—produced and stored electrical energy, PNET—balanced electrical energy, PPV—electrical energy from a PV source, PCO—electrical energy from a cogeneration process, PMAG—electrical energy from an energy storage unit, PREAL—electrical energy sum for all energy recipients, and **a**, **b**, **c**—regulation coefficients based on a simulation (can be defined through a prediction and optimization process with artificial intelligence calculations including prediction, distortions, and disturbances coming from local conditions, environment, and manure/CH<sup>4</sup> production fluctuations).

To achieve proper operation of the system, **a**, **b**, **c** coefficients must be set up in a way to achieve the most efficient energy routing for energy received from a biogas plant (cogeneration), a PV source, or an energy storage unit. All coefficients should have values that maintain the energy balance of the system, make it fully autonomous, and—based on the energy profile from sources and loads—provide proper values to maintain the system's functionality without using external energy from a national power grid to meet the energy demands of the farmland and households.

We can see that **a**, **b** cannot be negative, as energy cannot be returned to the source, but **c** can be positive or negative, as the energy storage unit can be the receiver or the source of energy (depending on the overall capacity of the unit). In this way, we can define coefficients' limits as (3):

$$\begin{array}{c} \text{A } \epsilon < 0, 1 > \\ \text{b } \epsilon < 0, 1 > \\ \text{c } \epsilon < -1, \; 1 > \end{array} \tag{3}$$

They can change over time, depending on the resolution of the data, which means that their values fluctuate within the limits based on the predictions and optimization of the energy usage and production. If there is no energy demand, all energy production is routed to the energy storage unit, which will be expressed as: **a = 0**, **b = 0**, **c = 1**, and the unit will be charged for future use to meet the momentary energy demands and requirements. It is noteworthy that when coefficient **c** is positive, the energy storage unit is charged, and when negative it becomes the power source. This is why we can balance the circuit knowing the **a**, **b** coefficients (based on the source profile) and by providing the charging profile based on coefficient **c**.

The coefficients depend on the time instance, and are connected with the biogas plant's energy production profile over time and PV energy production profile over time.

It is also a part of the process to predict and select the proper capacity of the energy storage unit to cover the energy demand of the system when energy is not produced. This will be explained and estimated during the simulation in the following chapter. When the energy production is greater than the system can accept and surpasses the capacity of the energy storage unit, energy can be routed to the power grid to be retrieved later during, e.g., service and conservation works.

Based on the considerations above, we can define the following conditions for balancing the process for an autonomous off-grid process with a smart valve as:

$$
\Delta \mathbf{P}\_{\text{NET}} = \mathbf{0} \tag{4}
$$

which means a fully independent, self-sufficient energy system in an off-grid state. When PNET > 0:



This idea can be proposed to, e.g., medium or small farmlands and a certain number of households to keep the system off-grid by the efficient management using a smart valve. In this way, there is also no need for the households to use a backup power source (such as a fossil fuel based one). The following simulation will show how the process can be described based on certain values and data.

#### **4. Simulation**

The simulation will be processed using the following assumptions and based on the calculations for a specific size of farmland and number of cows:


Table 1 shows that 20 cows can generate a substantial amount of biogas which can be turned into a heat and power process very efficiently.


**Table 1.** Energy products from manures for a specific number of cattle.

Own study based on Source: [41].

Considering data from Table 2, the carbon equivalent (eq.) [42–47] for manure was defined as the amount of coal that needs to be burned to generate 42,184.8 kWh of electricity for the same amount of electricity produced by a manure-powered biogas plant. The carbon equivalent (eq.) for slurry was defined as the amount of carbon that needs to be burned to generate 19,530.0 kWh of electricity for the same amount of electricity produced by a slurry-powered biogas plant.



Own study based on Source: [41].

Table 2 shows that the amount of CO<sup>2</sup> released to the atmosphere during the coal burning process is greater than in the respective biogas burning process. For example, biogas from manure released 23.7 Mg CO<sup>2</sup> into the atmosphere, while coal combustion

released 39.6 Mg CO2, both generating the same amount of electricity, amounting to 42,184.8 kWh.

On the other hand, the biogas burning process from the slurry released 10.9 Mg CO<sup>2</sup> into the atmosphere, and the coal combustion equivalent produced 18.3 Mg CO2. Moreover, if we assume that 1 g of methane released into the atmosphere has an equivalent of 25 g CO2, the combustion of methane from manure generating 42,184.8 kWh will release 23.7 Mg CO<sup>2</sup> into the atmosphere. In this process, 12,960 m3/year of biomethane, which corresponds to about 226 Mg CO2, does not reach the atmosphere. Thus, in total, for manure biogas we obtain a negative CO<sup>2</sup> equivalent of approximately −203 Mg CO2. If we consider the case of biogas from slurry generating 19,530 kWh, which releases 10.9 Mg CO2, the process prevents 6000 m3/year of biomethane, which corresponds to about 105 Mg CO2, from being released into the atmosphere. This amounts to the negative CO<sup>2</sup> equivalent from slurry biogas to stand at about −94 Mg CO2. This shows the possible net reduction in biogas' impact on the environment and is based on the literature examples [48–51] of such negative values of the CO<sup>2</sup> equivalents through the usage of biogas plants or biomass itself.

Table 3 shows the possibilities of biogas production from different types of substrates of agricultural and food origin [52–54]. Manure and slurry were selected for considerations and simulations, as they are the most commonly generated waste in cattle breeding in our geographic region and are significantly harmful to the environment. For this reason, they are the primary source of methane emission into the atmosphere, but can be utilized for the production of biogas as a fuel for biogas plants (Figures 4 and 5).


**Table 3.** Production of biogas, biomethane, electricity, and thermal energy from selected substrates.

Own study based on Source: [41].

Drawing from the assumptions above, we were able to define and use the profiles of energy production by a biogas plant and a photovoltaic installation during a 24 h cycle, which is shown in Figures 6 and 7 with a trend line. We also show the comparison of electrical energy production profiles from these sources combined during one day.

The energy production profile depends on the supply of substrate for cogeneration and the further combustion of biogas in the cogeneration process. Therefore, the energy generation process is not constant and depends on the daily operating mode of the farm (milking hours, feeding hours, and maintenance hours).

The next step in our simulation was to calculate the total of electrical energy produced over 24 h to define a 24 h profile of electrical power that can be retrieved from all power sources (Figure 8). These values are required as inputs to our virtual regulation valve.

**Figure 5.** Heat and electric power production from 20 cows on farmland. Own study based on Source: [41].

**Figure 6.** Biogas plant's electrical energy production profile during a 24 h cycle for farmland with 20 cows. Own study based on source [55].

**Figure 7.** The 10-kW photovoltaic installation's electrical energy production profile during a 24 h cycle. Own study based on source [55].

As a next step, we needed to define the energy requirement profile for the recipients over 24 h. Our recipients were:


The average size of the household is 150 m<sup>2</sup> . These profiles (Table 4) are taken from the literature [31,55] and available sources.


**Table 4.** Daily electricity and electricity demand.


**Table 4.** *Cont.*

\* RES—Renewable Energy Systems. Own study based on source [55].

The calculations are based on regular usage during a working week (Monday–Friday). These data series are shown in Figures 9–11, where we can see separate energy usage profiles for the farmland and individual recipients, as well as the summary of energy demand which will be the input for our smart valve.

We have defined all inputs for the simulation to outline the amount of energy needed to charge the energy storage unit and to cover the energy demands at times when energy production is unable to fulfil the recipients' needs. To properly calculate the value of the energy loading or discharging the energy storage unit, we needed to take into account the loading process of the energy storage unit.

Our idea was based on the rule that an energy surplus can be used to charge the energy storage unit in an hourly cycle. In this way, we were able to recharge and prepare the unit for a high energy demand when no energy was produced by a biogas plant or photovoltaic installation (e.g., during the night).

This can be expressed through the formula below:

$$\mathbf{C\_{n}} = \frac{\mathbf{P\_{MAG\_{init}}}}{\mathbf{P\_{MAC\_{init}}} + \sum\_{n=1}^{24} \left(\mathbf{P\_{MAC\_{init}}} + \dots + \mathbf{P\_{MAC\_{n-1}}}\right)} \tag{5}$$

where PMAGinit—the initial energy storage value at the beginning of the cycle, n—following hour of the daily cycle from 1 to 24, and Cn—the regulation coefficient for the energy storage unit's management function of the valve.

**Figure 10.** Electrical energy requirement/consumption profile for farmland and individual recipients and a summary of the energy usage for the analysed energy flow circuit. Own study based on source [55].

Our simulation, based on the input data, is shown in Figure 12 below. The energy storage accumulates energy when its surplus allows, and returns it to the system when the recipients need it. In the previous chapter, we mentioned that the energy storage unit's capacity selection would be estimated, and now we can see that as we store more than 40 kWh, and the storage unit needs to release energy at almost 30 kWh over 24 h, a reasonable size of the unit is twice the maximum of the energy stored or used by it. In this case, it would mean more than 80 kWh. Using the common commercial size of the storage unit, the practical approach would be to use distributed consumer size units with, e.g., a 10-kWh capacity for each recipient (household), which would grant 100 kWh of storage in total. Energy storage units with a 10-kWh capacity can be built-in in every home as a part of the system. We also need to consider the case when we start our simulation and operation with a given initial value of the energy storage unit to avoid energy shortages caused by an empty storage unit. We assume in the simulation that the initial value of the unit should be half of its full capacity, which amounts to 50 kWh. This is also included in the above formula (5).

191

**Figure 11.** Electrical energy requirement/consumption profile components for farmland and individual recipients and a summary of the energy usage for the analysed energy flow circuit. Own study based on source [55].

The energy storage grid management based on the distributed 10 kWh storage network in each of the 10 homes is to be examined further, but our goal was to calculate the coefficients for the smart valve to define its operation over the 24 h cycle. This simulation of **a**, **b**, **c** coefficients is shown in Figure 13.

In our simulation, all energy from the biogas plant and photovoltaic installation is used in the system once produced, therefore the **a** and **b** coefficients are 1 or 0 in given instances. Coefficient **c** changes over time and takes values from a = [−1; 1] range, as stated before. This set of coefficients can be adjusted over time using, e.g., artificial intelligence or prediction and optimization based on profiles of usage over time for specified farmlands and the number and types of recipients. However, it is now visible that these coefficients can manage the smart valve's operation, rendering the proposed system independent from the power grid and keeping it self-sufficient in terms of energy production and consumption.

C<sup>୬</sup> = Pୋ౪ Pୋ౪ + ሺPୋ౪ +⋯+Pୋషభሻ ଶସ ୬ୀଵ We can also notice that if we observe 2 days (48 h) as the simulation interval using the same input data, the coefficient **c** becomes stabilized, and the daily cycle repeats its profile (Figure 14). It is to be further investigated how to optimize the system and apply or adjust prediction algorithms to achieve a better match to the loads' profile and the energy storage unit's capacity.

**Figure 12.** Electrical energy values simulation for all participants of the circuits on the virtual valve including the energy storage management.

193

−

A complimentary result of the implementation of the smart valve concept to achieve an off-grid, autonomous, self-sufficient hybrid system presented above is that we can estimate the reduction in CO<sup>2</sup> emissions as compared to the electrical energy produced by a conventional fossil fuel powered plant covering the power requirements of the recipients in the system—the farmland buildings during operation and 10 households. The comparison of these values is shown in Table 2. As the fossil fuel powered plant, we used heat and power plant in Kielce located in the southern part of Poland, with an installed electrical power of 17.6 MW and annual electrical energy production of 91,508 MWh (as per 2020, based on data published on the website).

#### **5. Conclusions**

The idea of an off-grid, self-sufficient, autonomous hybrid system for the agricultural area with a biogas plant, supported with renewable energy PV circuits and an energy storage unit managed by a smart valve, allows for efficient energy management and nearly full usage of the biogas and biofuel production for cattle farming, and can satisfy the energy consumption needs of individual consumers (households) in the area. Even considering that it cannot be a fully off-grid solution, and an electric power network is still used as a backup for the system, proper management enabled by the smart valve capable of managing the energy flow and its distribution grants a possibility to efficiently manage the energy. The calculation and set up of the valve's coefficients, taking time into consideration, allows the system to be independent of the national power grid and ensures the full usage of the energy produced by the biogas plant and renewable energy sources. There is also no

need to use additional fossil fuel sources as complementary energy sources for households or farmland buildings.

Our simulation showed that, with proper energy storage values and calculation of coefficients for the smart valve, we could achieve a self-sufficient, off-grid system that could power external recipients such as individual homes, satisfying the energy demands of farmland at the same time.

As the smart valve management plays a key role in the system, further examination and investigation are necessary to research the possibility to apply more advanced algorithms (e.g., prediction or optimization). The proposed system and calculation method for the smart valve's operation can be adapted to on-site or off-site solutions.

Renewable energy sources give a great chance not only for the creation of autonomous hybrid systems in small village areas, but also to minimize environmental pollution by removing conventional power sources based on fossil fuels, utilizing the waste produced by farmlands at the same time.

The idea of an autonomous, self-sufficient, hybrid energy system based on agricultural farmland can be extended to other types of farmlands and villages. It allows for the application of artificial intelligence to maintain energy routing and storage by applying the smart valve concept. This also allows for the addition of alternative renewable energy sources, such as wind plants or water plants, to the system. The smart valve, with its coefficients, can be used to control the process of energy routing and balancing in modern automation and control systems to provide energy management for such systems and their future versions. The idea also allows more control over balancing the process of unstable energy production from a biogas plant and renewable energy sources to supply electrical energy to the local loads (households and farmlands) to achieve a self-sufficient system with a hybrid architecture and energy storage options.

The biogas-based process additionally allows for a significant reduction in CO<sup>2</sup> emissions in comparison to coal combustion emissions. When we take methane's equivalent of CO<sup>2</sup> emissions coefficient which is released into the atmosphere, we can observe a possibility to additionally reduce the impact of methane's influence on the environment. It is clearly visible, when we use a formula where 1 g of CH<sup>4</sup> greenhouse gas is equal to 25 g of CO<sup>2</sup> greenhouse gas emissions, that the reduction in methane greenhouse gas emissions constitutes a significant reduction in a CO<sup>2</sup> equivalent, even considering the amount of CO<sup>2</sup> burned in a cogeneration process. The result of the process reduces greenhouse gas emissions, and can lead to negative CO<sup>2</sup> emissions equivalent.

**Author Contributions:** Conceptualization, G.A., J.M., R.R. and M.S.; methodology, G.A., J.M. and R.R.; software, G.A. and R.R.; validation, G.A., R.R. and M.S.; formal analysis, G.A. and J.M.; investigation, J.M.; resources, R.R. and M.S.; data curation, J.M. and M.S.; writing—original draft preparation, G.A., J.M., R.R. and M.S.; writing—review and editing, J.M.; visualization, R.R. and M.S.; supervision, J.M.; project administration, J.M.; and funding acquisition, J.M. All authors have read and agreed to the published version of the manuscript.

**Funding:** The study was carried out as part of a research project financed by the statutory grant of the AGH University of Science and Technology in Krakow for the maintenance of research potential.

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

#### **References**

