Simulated IoT Based Sustainable Power System for Smart Agriculture Environments

A R T I C L E I N F O A B S T R A C T Article history: Received: 08 January, 2021 Accepted: 11 February, 2021 Online: 16 February, 2021 In vital energy applications especially the agricultural environments, the service of adaptive power utilization plays an essential role in facilitating the usage of Internet of Things systems. Such environments are distinguished by the large range of lands where most of the region lacks the commercial power lines. Reaching some high or deep sensing points is also difficult in such environments. The adaptive power system will pave the way to make a smart service for users to create a platform for real time interaction. It can enhance the reliability, stability and sustainability of power supply, and provide more humanized and various intelligent services for the users. The usage of adaptive power can be improved effectively using IoT technology with its strong data processing and reliable communication. In this paper, an algorithm is proposed to offer a sustainable power service for smart agriculture system to guarantee continuous system operation. It mainly rely on controlling the load demands and managing the renewable energy. A model is built on Matlab that governs the proposed algorithm and the results of the simulation are discussed.


Introduction
This paper is an extension of work originally presented in 15th International Computer Engineering Conference (ICENCO) [1]. The food demand increased due to the huge growth in population so it is essential to increase the food production and try to avoid any production losses. Agriculture has a major impact on food production so monitoring the plants' performance is very important. In order to avoid any crop losses, agro systems were designed. Remote sensors were used in these systems to measure light, humidity, soil moisture and temperature. The measured data will indicate whether the plants' performance is good or not and the data will be collected and sent to the user for further action [2,3]. IoT is a new technology that is used recently in most of the smart systems. Using IoT technology in agro systems allow the plants to express its needs only when it is needed which will allow the efficient usage of resources. There are some challenges that appears in IoT systems, energy optimization is one of the main challenges that faces IoT. It is a major challenge due to the high number of devices that exist in the network which need high energy to keep it active for long time. It is essential to study this challenge as wireless sensors are commonly used in precision agriculture in remote areas and the agro systems depend mainly on sensors' power so battery drainage will cause the system to stop which isn't desired [4,5].
The life time of sensor nodes needs to be long in order for the network to be active and to avoid battery drainage. In this paper, an energy management technique based on intelligent load scheduling is introduced for agro-applications. The battery state of charging and the solar power are the main parameters used in the proposed algorithm to activate or deactivate the loads. Based on the loads' priority and the availability of power provided by the battery or solar, loads are activated for specific time. The loads' priority is standard defined as the applications that need to be operating due to criticality are defined based on the standards of agro.

Literature Review
Researchers have implemented and introduced some systems using various methods and sensors to monitor the status of plants' health. It improved the agricultural production and helped in preventing crop losses. In [6], the author illustrated the demonstration of a smart plant monitoring system. The system was enabled to discover any changes occurred in the measurements of light, moisture level and temperature. The plant received its required irrigation and illumination using a machine based curation. An Android device was used by the user in order to enable the user to override an operation which is a machine curated and in this case it is shifted to user based curation instead of machine based curation. In [7], the author explained a system that uses IoT technology in order to control and monitor an agricultural production. The sensors' data was gathered in the monitoring system from IoT devices and then stored at the database of the cloud in order to be accessible by the users. The users could control the actuators in the controlling system over the internet with the usage of IoT devices.
The main source of power for the systems presented previously is the sensors' batteries so systems that uses energy efficiently are studied. Energy plays a significant role in monitoring the environment of agriculture. Researchers presented various algorithms which assure the efficient usage of energy using energy harvesting, load scheduling and power reduction techniques. In [8], the author presented a method used in wireless sensor network for managing power efficiently. The system model consisted of three parts: sensing unit, transmitter unit , and power unit. Energy harvesting was used in the power unit as the power source used for charging the battery is the solar energy. Sending and collecting the data was the responsibility of the other two units. The microcontroller is utilized to monitor the sensed signal and if any disorder detected, it would be transmitted to the receiver.
In [9], the author concentrated on elongating the sensor nodes' life time by minimizing the consumption of energy. A solar cell was utilized to power the system to assure energy sustainability. The minimization of power consumption was achieved by proposing two methods of power reduction. Sleep/wake based on duty cycling was utilized and the second method was integrating the redundant data of the soil moisture with sleep/wake scheme. This research introduced the Sleep/wake on redundant data (SWORD).
In [10], the author presented an algorithm based on devices scheduling in order to optimize and reduce the electricity cost. Two methods were tested for load scheduling optimization either without the usage of renewable energy or with the usage of it. The results of the implementation showed that the cost is reduced up to 53% when combining the proposed algorithm with renewable energy and in case no renewable energy is combined with the algorithm, the cost is reduced up to 40%.
In [11], the author illustrated an algorithm that depends on electricity cost changes and renewable sources real time output in order to schedule the loads. The scheduling and management of energy was established according to the exchange of sensor data and control demands. It would update the real time output of the renewable sources and determine the devices' priority. After the sensed data was received, the energy management unit in the system updated the devices' priority status and the output of renewable sources. The energy management unit would transfer the devices to on or off status if required depending on the energy management and devices scheduling.
In [12], the author discussed various ways to utilize renewable energy in order to assure the efficient usage of energy, ,cost reduction, and handling loads. The scheduling of loads in the used algorithm was depending on time and overload management using multilevel priority. Based on the need of load scheduling during peak demand hour, a duration of time was determined. The loads with medium and high priorities would be activated during this time and the load with low priority would be deactivated. All load would be deactivated in case the limit was exceeded.

Proposed Architecture for Energy Efficient Agro Systems
As shown in Figure 1, the proposed architecture consists of four sensors: light sensor, color sensor, soil moisture sensor and temperature/humidity sensor. The proposed architecture is used for monitoring plants' performance in agro systems. The data measured by the soil moisture sensor and temperature/humidity sensor will be sent to Central Processing Server (CPS) to decide the proper time for irrigation after comparing it with the threshold values. Regarding the other two sensors, the user will take the action required based on the received data that were measured by these sensors in case there were any up normal values detected at the CPS. The goal is to ensure the continuous operation of this system by using energy efficiently to increase the life time of the system. Figure 2 shows a proposed architecture for sensor area network (SAN1) using energy efficient technique. It depends mainly on two parts:

Solar panel or battery used as a power source
• The source of power during day is the solar panel. It is used for supplying the loads during day as it is working and the power needed by the loads is available. Some loads will be switched off in case that the solar power isn't enough for suppling all loads and the rest will be on depending on the available solar power.
• The source of power during night is the battery. The active loads will be supplied by the battery and some loads will be off during night as these loads will not highly affect the system's operation.

The loads (sensors and actuators) which are divided into categories according to priority.
• Load 1 (High priority): the high priority loads highly affect the system's operation. This load must be on most of the time so the deactivation will be during night only in case that the state of charging of the battery is less than the threshold value.
• Load 2 (Medium priority): if the power is enough for supplying medium and high priority loads, this load will be active. It will be deactivated when the power isn't enough to supply all loads and this will occur mostly during night.
• Load 3 (Low priority): it doesn't have a huge impact on the system's operation so it can be deactivated during night. The user can activate this load upon his request if needed during night after checking the battery state of charging if it is within threshold values or not.
The soil moisture sensor is considered a high priority load due to its high criticality in precise agriculture applications as stated in [13] .The soil moisture sensor is used in the proposed system to change the concept of scheduled irrigation to be on demand irrigation as its measured values help in deciding whether plants needs to be watered or not and based on these values irrigation takes place .The light sensor is considered a medium priority load in the proposed system due to its medium criticality as it needs to be active at specific time as it is used in the proposed algorithm to indicate whether the weather is sunny or cloudy and to indicate also whether it is day or night. Accordingly, the algorithm will switch to the power source that can be used in the current situation to supply the loads. The water quality sensor is considered a low priority load as irrigation is applied mostly during day so there is no need to schedule it to work during night but in the proposed algorithm it can be activated during night if needed upon the user request.

Proposed Energy Efficient Algorithm
The proposed algorithm uses energy efficiently in agricultural applications to elongate the sensor nodes life time. The agro devices' dormant mode will be synchronized and controlled by the proposed algorithm based on the change of day/night. This algorithm doesn't depend on the marketable power supplies so it will guarantee a sustainable environment. The battery drainage issue will be solved to some extent which will enable a sustainable power system. The proposed energy efficient algorithm is dependent on the load scheduling technique and solar energy. There are two other methods for powering the system either by using battery only or by using battery along with load scheduling.
The proposed algorithm is compared with these two methods. In the first method as shown in Figure 3, there is no enough power for supplying the loads as they are active for only five consecutive hours. In the second method, load scheduling technique is used which saves more power therefore the loads are active for longer time as shown in Figure 3. However. The problem of battery drainage still exists and the battery needs to be replaced but it is not easy to replace it in agro-applications. Replacing the battery is not necessary in the proposed algorithm as the solar panel is used during day to recharge the battery. The loads are supplied by the battery only during night. The solar panel is used to supply the loads during day therefore the battery state of charging is maintained for longer time in the proposed algorithm as shown in Figure 3. As a result of using the proposed algorithm, the life time of the sensor nodes is increased due to the increase of the battery life time.
The two main parameters used in the proposed algorithm are the availability of power and the criticality index of the load. The first parameter is represented as solar irradiance or State of Charging (SoC) of the battery. The second parameter indicates whether the load is critical or not to operate in the non-scheduled time. Based on these two main parameters, the agricultural ecosystems loads are transferred to on or off state. Intelligent load Scheduling and solar power are combined in this algorithm to efficiently implement the system using IoT. Figure 4 represents a flow chart for a combined energy efficient technique using intelligent load scheduling and solar energy. The algorithm initially checks the capacity of solar power during day to decide whether to activate or deactivate the load. It is proven in the simulation that the idle duration varies based on the availability of solar power. For example, when the solar irradiance is reduced from 1000 W/m 2 to 500 W/m 2 , the idle duration is increased by Δt. The battery is the source of power during night and it takes the lead in the absence of the sun to supply all the needed loads. The loads are transferred to on or off state based on their criticality index as the loads are classified according to priority. The loads with high and medium priority are activated if SoC of battery is more than or equal to 75% and the unnecessary loads are deactivated. According to the availability of power, the loads' idle time is tuned and calculated. By time, the idle duration increases as a function of the battery drainage. If SoC is below 40%, the load with high priority is activated and the load with medium priority is deactivated and the idle duration increases based on the drainage rate of the battery. The inactive loads can be transferred to on state if needed during night based on user request.
The idle duration levels during day and night are shown in Table 1. The first level is selected during day as it is devoted for the dynamic solar irradiance scenario in which it varies during day hours from 100 W/m 2 to 1000 W/m 2 . The other levels are devoted for the battery SoC variations. According to the availability of power, the idle duration for each load changes by Δt. Table 1 shows different scenarios where the idle duration level for each load changes by Δt and according to this change, the power gain is calculated for each load. The power gain shows the state of the consumed power at the current level compared to the previous level. As shown in Figure 5, the power gain increases as the Δt increases.  It is very essential to choose the optimum sleep time (Ts) that will not affect the system operation. There are three significant parameters that must be taken into consideration while choosing Ts, State of Charging (SoC), Load current (IL) , and Load index (η). The load index (η) ranges from 0.1 to 1. The value 1 indicates high priority, 0.5 indicates medium priority and 0.1 indicates low priority. The SoC is the difference between the battery rated capacity (Crated) and the used capacity by loads (Cused) divided by the battery rated capacity. SoC can be calculated using (2): = − × 100 (2) Figure 6 represents the charging stage of the battery which shows that the battery state of charging is increasing with time. As a result the sleep duration for the loads is decreasing due to the increase of the amount of power available in the battery. Therefore the sleep duration is inversely proportional to the SoC as shown in Figure 7. Figure 8 shows that the increase in load current results in a decrease in the battery state of charging.  The active duration for each load depends on the maximum current consumed by the loads (ILmax), the current consumed by load 1 (IL1) and the load index (η). Equation (3) is used to calculate the active duration for each load then calculate the sleep duration using (4). The active and sleep durations for the three loads are shown in Figure 9 and 10. Figure 11 represents the sleep duration for each load versus the battery SoC.  The energy consumed by each load for a uniform sleep duration depends on the power consumed by the load (P), the operating time (To), Sleep time for each load (Ts) and the number of sleep durations (n). The energy consumed by each load is calculated using (5). As shown in Figure 12, the energy consumed by each load decreases by increasing the sleep duration.

Simulation Model Results
An agro environment is simulated on a Matlab Model that is designed using one node consisting of battery, three loads and solar panel. The designed model is used to test the algorithm by testing it at different scenarios that are shown in Tables 2 and 3. The solar irradiance and the state of charging must be checked first to enable the model to select the optimal scenario based on these two parameters. This scenario selection will guarantee the efficient use of energy which will increase the battery life time. The current and power of the solar panel is affected by solar irradiance so a decrease in solar irradiance causes a decrease in the current and power as shown in Figure 13. Low solar irradiance occurs as a result of the small amount of solar energy absorbed by the solar panel which results in a decrease in power and current. Due to the change in climatic conditions as shown in Table 2, solar irradiance changes. The solar power is affected by these changes and it will have an effect during day on deciding whether to switch loads on or off.  Table 2 and 3 show the different scenarios that are designed depending on the battery state of charging and the changes in solar irradiance during day. The loads are activated or deactivated based on the availability of energy provided by battery or solar panel. High priority load is represented as load 1, medium priority load is represented as load 2 and low priority load is represented as load 3. Table 2 shows the four scenarios that are used usually during night. These scenarios are designed depending on the state of charging of the battery. During night, load 1 and load 2 are active for specific hours based on priority while load 3 is deactivated. Off 0 Figure 14 shows the battery state of charging as it decreases with time. It is essential to monitor the battery state in order to select the best scenario for supplying loads during night based on amount of power remained. The solar irradiance is divided into two types static and dynamic. Static solar irradiance is represented in the first three scenarios that are shown in Table 3. These scenarios are designed for various cases that might occur during day in case of static solar irradiance. The duration is constant for the first three scenarios as it is estimated to be 12 hours.
In case the solar irradiance is dynamic during day, this is represented in the fourth scenario shown in Table 3. Scenario 4 is designed due to the change of solar irradiance during day hours. The values of solar irradiance in the previous scenarios might happen in one scenario at different hours. The first scenario in Table 2 and the fourth scenario in Table 3 are simulated and shown in Figure 16 and 17. Figure 15 shows the changes in solar irradiance during day while during night the loads are supplied by the battery. These variations have an effect on solar power provided to the loads which will decide the status of the load.  The loads' status shown in Figure 16 has an effect on its total consumed energy as it changes due to the change in loads' status during day and night. The compensation factor (CF) is shown in Figure 22 as it is calculated for the eight scenarios. It is defined as the ratio between the loads' consumed energy and the energy supplied. During day hours, the solar irradiance changes and at noon, it reaches the maximum point. The solar power at the maximum point will be enough to supply all the loads as shown in Table 3 for specific hours.  Table 2 and Scenario 4 in Table 3) Figure 16(a) shows the status of load 1 during day and night. During day hours, load 1 is supplied by solar and in this case the load is active. While during night, it is supplied by the battery.  The calculation of load's consumed energy is according to the status of loads shown in Figure 16. The supplied energy either by solar or battery is efficiently consumed using the load scheduling scenarios to provide a sustainable system as shown in Figure 17.  Table 2 and Scenario 4 in Table 3) Scenario 2 in Table 2 along with scenario 4 in Table 3 are tested and shown in Figure 18 and 19. Figure 18 shows the loads on/off status during day and night. The total consumed energy by the loads is calculated based on the status of loads as shown in Figure  19. Figure 18(a) shows that during day hours, load 1 is activated as the power is provided by solar in this case while at night, the load is still activated and supplied by the battery. Figure 18(b) shows that during day, load 2 is activated for only 5 hours and it is activated for 4 hours at night. Figure 18(c) shows that during day, load 3 is activated for only 4 hours but at night it is deactivated.  Table 2 and Scenario 4 in Table 3) The efficient usage of energy during day and night will provide a sustainable system. The total consumed energy by the loads during day and night in accordance to the loads' status is shown in Figure 19.  Table 2 and Scenario 4 in Table 3) Scenario 3 in Table 2 along with scenario 4 in Table 3 are simulated and represented in Figure 20 and 21. Figure 20 shows the status of the loads which indicates whether it is on or off during day and night. Figure 21 shows the total consumed energy by the loads during day and night based on the status of the loads. During night, it is activated for only 6 hours as it is supplied by the battery. Figure 20(b) shows the status of load 2 during day and night. During day, load 2 is activated for only 5 hours and at night it is inactive. Figure 20(c) shows the status of load 3 during day and night. During day, load 3 is activated for only 4 hours and at night it is inactive. The supplied energy is consumed efficiently by the loads using the designed scenarios of load scheduling. The total consumed energy by the loads during day and night is shown in Figure 21.  Table 2 and Scenario 4 in Table 3)  Table 2 and Scenario 4 in Table 3) Figure 22: Compensation Factor (CF) versus Load Scenarios Figure 22 represents the compensation factor (CF) which is calculated for all the designed scenarios. It is the consumed energy by the loads relative to the energy supplied by solar or battery. The compensation factor (CF) is used to show whether there will be an amount of remaining energy that can be used for battery charging or all the supplied energy is fully consumed by the loads.

Discussion
The proposed algorithm was simulated and its results are shown in Table 4. The main source that was used for supplying power to the loads during day is the solar panel. During day, there are four designed scenarios for load scheduling. In scenario 1, the three loads will be activated based on priority for a certain time and the energy consumed by the loads is 671.94 mWh at 1000 W/m 2 . When the solar irradiance changes to 500 W/m 2 , the solar power in this case isn't enough for supplying all loads so scenario 1 isn't suitable for this case as the loads activation period must be reduced.
In this case, scenario 2 is chosen as load 1 (highest priority) is activated for 6 hours while load 2 (medium priority) is activated for 4 hours and load 3 (lowest priority) is activated for 2 hours. In this scenario, the energy consumed by the loads is 184.32 mWh, the battery can be recharged during day using the remaining solar power. At 100 W/m 2 , scenario 3 is selected as the loads are supplied by the battery because the solar power is not enough for supplying the loads in this case. The three solar irradiances 1000, 500 and 100 W/m 2 can vary during day so they are combined and represented in scenario 4. In scenario 4, the solar irradiance is 100 W/m 2 for 3 hours, 500 W/m 2 for 5 hours, and 1000 W/m 2 for 6 hours.