Optimum Operation of Electrical Devices in Educational Institutions via Intelligent Agents and Renewable Energy

DOI : 10.17577/IJERTV11IS030065

Download Full-Text PDF Cite this Publication

Text Only Version

Optimum Operation of Electrical Devices in Educational Institutions via Intelligent Agents and Renewable Energy

Prof.Atta El-Alfi1, Dr.Shaymaa Khater 2, Hagar Sakr 3

1, 2, 3 Computer Science Department Faculty of Specific Education Mansoura, Egypt

Abstract Electricity is an essential factor in human life because it meets their needs in many fields or sectors such as the educational, industrial and commercial sectors … etc. It contributes to developing society and affects its growth and economy. It is generated in the traditional way from fossil fuels, thereby affecting the environment due to CO2 emissions. Given that Fossil fuel energy is non-renewable and harmful to the environment. Most countries tend to invest in renewable energy to generate electricity as much as possible. The consumption of electrical energy is affected by the wrong behavior of individuals because it leads to an increase in the consumption of electrical energy which results in higher costs, so intelligent agents are used as sensors to determine consumption. This paper aims to reduce electricity consumption thus lower the consumption bill, reducing periods of energy deficit and investing surplus energy using renewable energy and intelligent agents by providing simulations to a room in an educational institution using the LabVIEW program then practical implementation using sensors and Arduino . The results reached that simulation of renewable energy as electrical generation source and the intelligent agents reduced electrical consumption and bill, energy deficit and increased the energy surplus. Practical implementation has proven that the sensors reduce electricity consumption without human intervention.

KeywordsElectrical devices, Electrical load , Electrical generation, Renewable energy, Energy surplus, Energy deficit, Intelligent agents, LabVIEW, Arduino .


    Both developed and developing countries need energy for development in their various sectors. Developing countries rely heavily on electricity, as they are used in many sectors, such as the industrial, agricultural, and tourism sectors, etc. [1]. It determines the quality of life in society recently [2]. Energy consumption supports economic growth as a factor affecting capital and employment [3]. Understanding patterns of electricity consumption is an effective way to change people's behaviour in electricity consumption to provide energy [4]. Researches on thermal and gaseous cogeneration has been presented [5], however there is still a wide gap between conventional generations with each other.

    Energy impacts social and economic well-being as an important and indispensable component of defining global growth and development strategies [6]. Renewable energy sources play a major role in bridging the gap between electric load demand and electricity generation [5]. Renewable resources are essential to alleviate the current energy crisis and to provide energy independence by creating reliable and

    safe energy sources [7]. In [8] the authors showed that increasing renewable energy consumption decreases ecological footprint and raising non-renewable energy consumption increases environmental degradation. Load modelling is essential to power system analysis and planning, [9]. There is a dependency relationship between the electrical load and the renewable energy source.

    During the hours of high temperature, there is a need to operate the air conditioner. Although electrical load simulation with hourly generation may lead to a good planning, the use of smart agencies imposes itself on planning electrical generation and demand for electricity. In [10] the authors have been dealt with the problem of designing the optimum solar thermal power system that achieves minimum total cost and satisfies a required level of reliability. In [11] the authors presented A general scheme for the optimal utilization of renewable energy resources together with a fossil fuel source as an integrated system to supply, simultaneously, an integrated load demand.

    With the advancement in simulation of electricity generation and load, the representation of consumption and its visibility on the Lab view screens has become an efficient and clear process for the correlation of load with generation. In [12] the authors use the Lab VIEW software package to develop the mathematical model for sub heating so that it can work in real time using a wizard to obtain data and communicate with a programmable controller.

    There is a great development in mechatronics that help save energy especially smart agencies. In smart grid environment, demand side management is an important way for enhancing energy efficacy and power supply reliability, cost reduction and merging of renewable resources [13]. An intelligent agent is an element of artificial intelligence that realizes its environment and reacts suitably. Smart agents help in making decisions about human as computer programs [14]. Smart agency to stop lighting by electricity in public places that lasts for many periods without people working with it is already used. In [15] the authors use smart sensing network to save operational cost and energy consumed in building.

    Linear programming is used in many fields to find optimal solutions of problems. In [16] the authors came up with the best solution to save the electricity bill using linear program. In [17] the authors used Linear programming to reduce energy consumption and to reduce the daily cost of energy . In [18] the authors used linear programming to keep electrical energy consumption at low levels to reduce electricity bills. In [19] the authors used linear programming to optimize the energy

    consumption. In[20] the authors improve the economic flexibility of energy by using a linear programing model .

    There are diverse reasons with universities using so much electricity but one of the biggest problems is the number of facilities providing convenience and leisure for students. Consuming electricity on hourly basis, the number of commercial facilities on university campuses, including coffee shops and convenience stores has increased, leading to higher electricity usage.

    Apart from commercial facilities, student residence buildings also play a large part in building up the electricity bill. As there were no special restrictions in limiting the use of the air conditioners, the access to such energy consuming led universities to pay more than usual. Consequently, that electricity demand management and energy conservation programs are a competitive and feasible alternative compared to the option of constructing power plants, extending transmission lines and expanding distribution networks, but is an ideal solution to cope with the steady growth in future electrical loads.

    In this research, electrical consumption simulation of room in a university contains electrical devices is presented before and after using sensors by using LabVIEW software package. Differences in power are calculated to know surplus and deficit in power program then practical implementation using sensors and Arduino

    The paper is structured as follows. Section II proposes simulation of electrical generation. Section III proposes calculating total seasonable power every two hours. Section IV proposes electrical load simulation throughout the year per season. Section V proposes using mechatronic. Section VI proposes comparison between loads (manual, mechatronics). Section VII presents Solving technique to counter periods of deficit and surplus. Section VIII presents Practical implementation using Arduino. Section IX presents Methods of elecrical power saving. Section X presents and discusses the results.

  2. SIMULATION OF ELECTRICAL GENERATION The load curve recorded for long time periods is used in

    load statistical studies to predict electrical loads. Forecasting electrical loads is useful in developing plans for expansion of power plants, so that the increase in generation is compatible with the increase in energy demand. The demand in the university environment varies between thermal energy – ventilation – cooling – lighting – operating motors and machinery. It is determined based on operating conditions and according to the change of consumption conditions (see Fig. 2).

    Linear programming is used to find out the optimal generation of electrical energy as shown in Fig.1.

    Problem formulation of this short term optimization can be stated as follows;

    Minimize the objective cost function Z :


    Z= the cost function

    G = electrical generation

    S = four seasons (1-winter 2- spring 3- summer 4- autumn) i =ith hours in a day

    t = the four types of energy sources (1-conventional 2- wind 3- PV 4- storage)

    C = cost of energy source

    Ps,i,t = probability normal distribution of s, i, t for generation (If the cost of the generation is nonlinear it can be piece wise linearized)

    Power balance: Subjected to


    = Load

    Pls,i,t = probability normal distribution load demand of s, i, t L refers to electrical load.

    The energy balance


    A= storage power E= certain value


    PA= percentage of storage power PL= peak load

    Fig.1: Normal distribution of electrical generation of a day in seasons

    Fig. 2: Simulation of integrated power generation

    Fig. 3: Total power generation in the seasons


    Where, S = sum of renewable and non-renewable energy & W = winter & SP = spring & SU = summer & AU = autumn

    & wi = wind & PV = photovoltaic & con = conventional energy as shown in Fig. 3.



    Residential electricity consumption varies around the world, which allows reducing peak load. . In [21] the author found that energy consumption varies according to social and demographic characteristics . On the one hand, grid operators expand their network to absorb electricity during peak load. This costs a lot. On the other hand, Electricity suppliers get expensive energy to meet peak-hour consumption and cope with load changes. . In [22] the authors developed model to research the influences of normative, emotional and regular factors on employee behaviour to conserve electricity at work. In [23] the authors improved K-means clustering method with optimized initial cluster centres was proposed to extract residential electricity consumption patterns .In [24] the authors used multi-period logarithmic mean Divisi index method to decompose China's electricity consumption from 1995 to 2016. . In [25] the authors evaluated the economy of the various expansion paths and operating patterns of biogas plants in the future electricity system in Germany for the period of 2016e 2035.. In[26] the authors used the hierarchical multi-matrices Markov model which has the distinguished ability to maintain electrical consumption behaviour characteristics .

    Electric load is the appliance consuming electrical energy in the form of current and converting it into other forms such as heat and light. Among the types of electrical loads used in the educational institution are the domestic load and the commercial load. The domestic load is represented in the electrical devices used in domestic work such as lighting and fans that work for a few hours and consume very little energy. The commercial load is the electrical devices used in institutions such as shops, restaurants, and cafeterias. The shape of the electrical load varies with the type of consumer, temperature and holidays.

    Each season is represented as a day. It starts at 8:00 and ends at 20:00. The room contains on a set of electrical devices such as lamps, fans, air conditioner, printer etc. Each electrical device has a specific consumption (W/2H).

    Individuals consumption of electricity varies in seasonal seasons depending on the temperature difference, which results to operate fans, air conditioners or heating devices. By this method, the control of turning on and off electrical appliances is manual without the use of intelligent agents. The consumption data is recorded every two hours in the arrays per season as shown in Fig. 5.

    • Calculating consumption sum and cost

      These calculations are every two hours from 8:00 to 20:00 through four seasons. Consumption refers to the electricity consumption of individuals in each season

      Cost = Consumption * 0.5 (9)

      Fig .4: Block diagram of power generation, simulation of electrical load (manual, mechatronics) and comparison between loads

    • Calculating Differences in Energy

    Differences in energy and disability times are calculated per season in manual control. Once by using conventional energy as energy source and other by using total energy generation.

    1. Using Conventional power as power generation

      The assumption of electrical generation is constant value. Difference in power is the product of subtracting of electrical

      consumption from electrical generation every two hours. It shows times of deficit and energy surplus for each season. If value of differences in energy is positive, it means the energy is enough in these times and called energy surplus. If value of difference in energy is negative, it means needing of energy in these times and called energy deficit.

      Where dif = sum of differences in energy &Gi = electrical generation whether it is renewable or non- renewable energy & L = electrical load for each season & Sur = surplus energy & Def = deficit energy

    2. Assuming Increase in Generation at Rates of Increase

      Table 1 shows that the power deficit decreases with the increase in electrical generation. The level that gives the lowest percentage of disability is called the reliability scale.

    3. Using Conventional, Wind and Photovoltaic power as Power generation

    Differences in energy, surplus energy and deficit energy are calculated as showed in (10) followed by (11) and (12).

    Fig .5: Simulation of electrical load daymand

    Fig .6: Simulation of electrical load daymand using mechatronic

    Table 1: Increasing Electrical Ggeneration

    Generation in watt every two hours


    Deficit energy




























    Based on intelligent agents science to control consumption (turning on when needed), sensors are used to convert signals from one energy domain to electrical domain. PIR motion sensor is used to sense motion or to detect whether a human has moved in or out of the sensor range, DHT22 temperature sensor to measure temperature range is from -40 to +125 degrees Celsius with +-0.5 degrees and HC SR04 ultrasonic sensors to determine the distance from the target object. Eco sense 2000 uses Passive Infra Red(PIR) technology to scan the room for occupancy. When no movement is detected it will send a signal to the air conditioning (A/C) unit to switch it off (see figure6). It shows total electrical load for each season every two hours, cost and energy surplus and energy deficit.

    1. Using rules if…then

      Motion, stillness and temperature changing occur at an unknown time. In other words, they happen randomly. Thus, there is Knowledge rules system based on using if… Then… rules. Agents are simulated by using random generator in LabVIEW program. It controls on turning on and off electrical devices as it generate a set of numbers. When numbers are in a certain rang, the devices will be turned on. Other than that, the devices will be turned off as shown in Fig. 6.

    2. Calculating total consumption, cost, surplus energy and deficit energy

      Equations (8), (9), (10), (11) followed be (12) show that.


    The total electrical load, cost, energy surplus and deficit are calculated during the year for the four seasons (see Fig.7, 8)


    S = total through four seasons

    Fig. 7: Calculating total of electrical load, cost, energy surplus and energy deficit through seasons

    Fig .9: Balance network of electrical power generation

    Fig .8: Chart of comparison between electrical load


    Electricity is transferred from the power plant to consumers through transmission lines, which are affected by several natural factors such as wind and humidityetc. During the transmission of electricity, there is a loss of power due to technical and non-technical losses. Technical losses are divided into fixed losses, which are the dissipation of some electrical power by grid components and equipment such as transformers or conductors and variable losses resulting from electricity heating. Non-technical losses are the theft of electricity during transport. The loss of the national electricity grid currently ranges from 20% to 25% in most distribution companies due to current thefts and negligence of some companies in using the right of judicial

    control to reduce thefts. Loss of power as follows in (14),

    (15) and (16).

    A balance network was used to show the balance between the demand for and storing electricity as shown in Fig.9, in order to avoid periods of deficit, meets the needs of the institution of electric energy, and reduces the electricity bill. The cheapest source is used among the three sources. In this program, wind power is used to meet the needs of load and photovoltaic power is only stored .conventional power is not stored because storage is expensive and because it exists constantly. Storage has a specific amount. if photovoltaic power does not meet the needs of individuals. Conventional power is used then previous storage. As follows in (17)

    Wi = (100% – R) *Wi (14)

    PV = (100% – R) *PV (15)

    Con = (100% – R) *con (16)

    Ai = (Wi – L)i + PVi (17)

    If Ai < Z then store Z value


    R= Loss of power A= storage power

    Z=certain positive value

    Fig .10: Schematic of using intelligent agents (PIR motion-LDR-DHT22) sensors


      • The lighting poles operate during a certain period, presumably from four o'clock in the evening to eight o'clock in the evening. During this period they consume a constant amount of electricity that does not coincide with daylight, so a sensor for daylight is used. It automatically controls the lighting according to the available daylight.

      • The lighting lamps are controlled automatically without human intervention using the motion sensor. If someone is present, the lamp lights up, and if there are no people, the lamp goes out.

    • Air Heater, air conditioner and fans consume electricity. The operation of the devices varies according to the different seasons in temperature. In winter the temperature decreases and the heater device is turned on. In summer the temperature rises, the fans are turned on and if the temperature increases, the air conditioner is turned on. But the devices are turned on manually by Individuals and thus subject to the behaviour of individuals that may be right or wrong and lack of an accurate estimate of room temperature. Wrong behaviours result in a waste of electrical energy. To overcome this, an intelligent agent is used that senses temperature and human motion (DHT22-Motion sensor). Presumably, in the case of a person inside the room, and if the temperature exceeds the normal

      range, the fan will run for a certain period which is determined by reaching a normal range of temperature.

      • The microphone works when connected to an electrical source. It can be left connected to electricity without being used, which leads to electricity waste. To overcome this, a touch sensor is used when touching the microphone. It automatically conducts electricity and when left it turns off electricity automatically .see Fig. 10


    • Lights

      1. Turn off unnecessary lights or when leaving the room

      2. Use low-bay lights in places not used for reading, and other areas where bright lighting is not needed.

      3. Using LED bulbs to save electricity

      4. Avoid using halogen lamps, which waste electrical energy

      5. Clean the lamps from dust regularly so that light levels do not go down

        Reliance on natural lighting

        There is no need to turn on the lights during the day; it is preferable to rely on natural light

        Water heater

        1. The thermostat should be set between 50-60 ° C

        2. Turn on the heater about half an hour before the need for hot water

        3. Emptying the water heater to feed it with water every three or six months because impurities impede heat transfer

      • Insulation of electrical outlets

        Electrical outlets leak heat and let in cold air. Insulating electrical outlets reduces electricity consumption.

      • Desktop Computer

        1. Choose appliances with advanced cooling systems to save energy

        2. The use of modern hard drives, they are more efficient, faster, use less energy.

        3. When installing a video card, use one that consumes less power.

        4. Constantly upgrade components to enhance performance and efficiency.

        5. Turn off the device when you are not using it or use sleep mode instead of turning it off

        6. Turn the screen off completely when you are not using it, or put it into sleep mode

      • Use laptop instead of old desktop computer to save energy

      • Air conditioner

        1. Operating the air conditioner at a temperature of 25 or 26 degrees controls the level of humidity in order to preserve the efficiency of the air conditioner.

        2. Cleaning the air conditioner filters every four months so that the air conditioner works with full efficiency to reduce electricity consumption

        3. When the air conditioner is running, it starts with a temperature of 26 degrees and then gradually reduces it to reduce electricity consumption

        4. Turn off the air conditioner when leaving the house

        5. Putting blinds on the windows to prevent the sun's rays getting into the room throughout the day

      • Fridge

    1. Leave a space of 10-15 cm behind fridges and freezers to increase ventilation for cooling tubes to reduce electricity consumption.

    2. Close the refrigerator tightly to reduce the leakage of cold outside or hot air into the refrigerator.

    3. Avoid placing therefrigerator in hot spots or in the kitchen

    4. Leave hot food to cool down and then put it in the refrigerator

    5. Set the temperature «thermostat» at 2 to 4 degrees Celsius for fridges, and about (- 18 to – 20) degrees Celsius for freezers to reduce energy consumption.

    Using the microwave instead of the oven because heating in it takes place faster, which leads to good overall efficiency and thus less electricity consumption

    Update electrical devices

    Modern appliances save energy more efficiently.

    Reducing the use of the oven in the summer to reduce heat and reduce electricity consumption

    Close doors and curtains for rooms that are not used, to reduce the energy used in cooling or heating the house to prevent air leakage through them.

    Electrical appliances should be switched on only when needed

    Repairing taps that leak water

    Using solar energy to heat homes and heat water

    Unplug your second fridge


A In this paper, electrical generation is simulated to illustrate the generation of traditional energy and renewable energy for electricity. Electrical load simulation of a room contains electronic devices through manual control and control using intelligent agents in each season separately. Total consumption is calculated throughout the year and periods of deficit and surplus in energy. The results are as follows (see table 2).

Using mechatronics reduce electrical load and cost by 32.014%

Using mechatronics reduced the energy deficit by 16.134% and increased the surplus energy by 15.88%

Renewable Energy reduced the energy deficit by 14.267% and increased the energy surplus by 17.748%

Table 2 :Comparison Between Electrical Loads (Before Using Sensors, After Using Sensors)

Electrical generation

Before using sensors

After using sensors

Electrical load


Energy surplus

Energy deficit

Electrical load


Energy surplus

Energy deficit

Conventional energy









Conventional and renewable energy






[1] N. Apergis and J. E.Payne, Renewable and non-renewable electricity consumptiongrowth nexus: evidence from emerging market economies, Applied Energy, 88,(12), pp. 5226-5230, 2011.

[2] T. Jasiski,Modeling electricity consumption using nighttime light images and artificial neural networks, Energy, 179, pp. 831-842, 2019.

[3] V. Costantini and C. Martini, The causality between energy consumption and economic growth: A multi-sectoral analysis using non-stationary cointegrated panel data, Energy Economics, 32,(3), pp. 591-603, 2010.

[4] Y. Wang, Q. Chen , C. Kang and Q. Xia, Clustering of electricity consumption behavior dynamics toward big data applications, IEEE transactions on smart grid, 7, (5), pp. 2437-2447, 2016.

[5] S. A. Farghal , R. M. El-Dewieny and A. M. Riad, Optimum operation of cogeneration plants with energy purchase facilities, In IEE Proceedings C (Generation, Transmission and Distribution), (Vol. 134, No. 5, pp. 313-319). IET Digital Library, September,1987.

[6] G. N. Yücenur, . Çaylak, , G.Gönül and M. Postalcolu, An integrated solution with SWARA&COPRAS methods in renewable energy production: City selection for biogas facility, Renewable Energy, 145, pp.2587-2597, 2020.

[7] R. Poudyal, , P. Loskot, , R.Nepal , R.Parajuli and S. K. Khadka, Mitigating the current energy crisis in Nepal with renewable energy sources, Renewable and Sustainable Energy Reviews, 116,pp. 109388,2019.

[8] M. A. Destek and A. Sinha, Renewable, non-renewable energy consumption, economic growth, trade openness and ecological footprint: Evidence from organisation for economic Co-operation and development countries, Journal of Cleaner Production, 242, pp.118537, 2020.

[9] P. Kundur , Power system stability, Power system stability and control, 7-1, 2007.

[10] S. A. Farghal, M. A. Tantawy and A. E. El-Alfy, Optimum design of stand alone solar thermal power system with reliability constraint. IEEE transactions on energy conversion,(2), 215-221,1987.

[11] M. S. Kandil, S. A. Farghal and A. E. El-Alfy, Optimum operation of an autonomous energy system suitable for new communities in developing countries, Electric Power Systems Research, 21(2), 137- 146,1991 .

[12] L. Wang, Y. Y. Tan and X. L. Cui, The application of Lab VIEW in data acquisition system of solar absorption refrigerator, In Advanced Materials Research, (Vol. 532, pp. 581-585). Trans Tech PublicationsLtd, 2012.

[13] C. C. Liang, W. Y. Liang and T. L. Tseng, Evaluation of intelligent agents in consumer-to-business e-Commerce, Computer Standards & Interfaces, 65, pp.122-131., 2019.

[14] H. Wang, Y. Tong, X. Zhao, Q. Tang, and Y. Liu, Flexible, high- sensitive, and wearable strain sensor based on organic crystal for human motion detection, Organic Electronics, 61, pp.304-311, 2018.

[15] K. Han and J. Zhang, Energy-saving building system integration with a smart and low-cost sensing/control network for sustainable and healthy living environments: Demonstration case study, Energy and Buildings, 214, 109861, 2020.

[16] C. Y.Chen and C. J. Liao, A linear programming approach to the electricity contract capacity problem, Applied mathematical modelling, 35, (8), pp. 4077-4082, 2011.

[17] F. Moazeni and J. Khazaei, Optimal operation of water-energy micro grids; a mixed integer linear programming formulation, Journal of Cleaner Production, 275, p.122776,2020 .

[18] G. S. Georgiou, P.Christodoulides and S. A. Kalogirou, Optimizing the energy storage schedule of a battery in a PV grid-connected nZEB using linear programming, Energy, 208, p. 118177, 2020.

[19] C. Divya and N. Pai, A linear programming approach towards individuation lighting system with optimal energy consumption, Materials Today: Proceedings, 17, pp.168-175, 2019.

[20] P. He, T. S. Ng and B. Su, Energy-economic recovery resilience with Input-Output linear programming models, Energy Economics, 68, pp. 177-191, 2017 .

[21] M. J. Kim, Characteristics and determinants by electricity consumption level of households in Korea, Energy Reports, 4, pp.70- 76,2018.

[22] S. Wang, J. Wang, X. Ru, J. Li, and D. Zhao, Understanding employees electricity conservation behavior in workplace: Do normative, emotional and habitual factors matter?, Journal of cleaner production, 215, pp. 1070-1077, 2019.

[23] L. Wen, K. Zhou and S. Yang,A shape-based clustering method for pattern recognition of residential electricity consumption, Journal of cleaner production, 212, pp. 475-488, 2019.

[24] D. Fang, P. Hao and J. Hao, Study of the influence mechanism of China's electricity consumption based on multi-period ST-LMDI model, Energy, 170, pp. 730-743, 2019.

[25] M.Lauer, U.Leprich and D.Thrän, Economic assessment of flexible power generation from biogas plants in Germany's future electricity system, Renewable Energy, 146, pp. 1471-1485, 2020.

[26] Y. Huang, J.Zhan, C.Luo, L.Wang, N.Wang, D.Zheng, and R. Ren, An electricity consumption model for synthesizing scalable electricity load curves, Energy, 169, pp. 674-683, 2019.

Leave a Reply