<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>T. Hovorushchenko, S. Aleksov, S. Talapchuk, O. Shpylyuk and V. Magdin, Overview of
the Methods and Tools for Situation Identification and Decision-Making Support in the
Cyberphysical System «Smart House», Computer Systems and Information Technologies</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.1155/2023/5749756</article-id>
      <title-group>
        <article-title>PV-driven Smart Islanded Microgrid: Intelligent I2C Arduino-based Demand Energy Management</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Dmytro Zubov</string-name>
          <email>dzubov@ieee.org</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ayman Aljarbouh</string-name>
          <email>ayman.aljarbouh@ucentralasia.org</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andrey Kupin</string-name>
          <email>kupin@knu.edu.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gainikamal Batayeva</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>ICyberPhyS-2024: 1st International Workshop on Intelligent &amp; CyberPhysical Systems</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Kryvyi Rih National University</institution>
          ,
          <addr-line>11 Vitaly Matusevich, Kryvyi Rih, 50027</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Central Asia</institution>
          ,
          <addr-line>125/1 Toktogul Street, Bishkek, 720001</addr-line>
          ,
          <country country="KG">Kyrgyzstan</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <volume>4</volume>
      <issue>2022</issue>
      <fpage>20</fpage>
      <lpage>26</lpage>
      <abstract>
        <p>This study aims to develop a PV-driven smart islanded microgrid capable of managing both critical (such as heating inside the electric panel in cold climates) and shiftable (such as LED light bulbs) loads. The main advantage of the proposed prototype is its affordability as it utilizes two Arduino Uno microcontrollers that are available worldwide, along with a photoresistor for measuring light intensity and two relays for connecting/disconnecting the shiftable load and minimizing the time without the power supply of the critical demand. The control algorithm is based on three-input hysteresis with the counter of loops in Arduino sketch with high intensity of light (over 1002 - direct sun rays; the counter is incremented if the load has a power supply on the solar charge controller) and the correcting variable that doubles once per 24h if the load is OFF on the solar charge controller: the shiftable load is ON while the counter is positive during the night time; the value of correcting variable is subtracted from the counter. Arduino Uno microcontrollers transmit data via I2C protocol. Experimental results conducted at the Naryn campus of the University of Central Asia in Kyrgyzstan have shown that the proposed microgrid prototype minimizes the time when the critical load is OFF and allows limited power supply to the shiftable load.</p>
      </abstract>
      <kwd-group>
        <kwd>Microgrid</kwd>
        <kwd>critical demand</kwd>
        <kwd>shiftable load</kwd>
        <kwd>adaptive control</kwd>
        <kwd>Arduino Uno</kwd>
        <kwd>I2C protocol 1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        The islanded microgrid (µG) driven by photovoltaic (PV) energy [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ] is one of the fundamental
components of the local smart power grid. Existing market solutions with different µG loads,
such as critical, curtailable, and shiftable, operate using various control algorithms and
soft/hardware [
        <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
        ]. With respect to the criterion of cost minimization throughout all stages of the
system design, from planning to maintenance and support, the best solution today is the IoT
(Internet of Things) Arduino-based open-source electronic prototyping platform [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ]. In this
study, a μG prototype is developed using the 100 W 12 V monocrystalline solar panel, PWM
(pulse width modulation) solar charge controller W88-C 30A / 12V / 24V, four 12V / 9.0Ah
leadacid batteries connected in parallel, two Arduino Uno microcontrollers with a photoresistor,
two relays, DC-DC step down converter, portable 5 V heater, 128 MB microSD card, and a
microSD card Arduino module. The total cost is approximately USD 100 on the Kyrgyz market,
excluding restored batteries installed as energy storage.
      </p>
      <p>
        Numerous commercial products and prototypes, such as the West Virginia Super-Circuit
project with multiagent system architecture [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and the energy management system for office
buildings using a neuro-fuzzy forecasting model [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], use various virtual power plant (VPP) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]
techniques in µGs. These techniques can be classified based on their cost function, constraints,
soft-/hardware, centralized / decentralized architecture, and deterministic / probabilistic
control methods [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Some papers use simulation tools like Matlab / Simulink [6], while others
emphasize specific soft-/hardware for the implementation of appropriate algorithms, e.g., [
        <xref ref-type="bibr" rid="ref4">4, 7</xref>
        ].
Most µGs are usually built upon existing infrastructure and equipment to meet customer needs.
However, literature review, such as presented in [8, 9], and analysis of existing case studies
show that reasonably priced systems with worldwide available equipment, such as the
Arduinobased open-source electronic prototyping platform, and various load types [10, 11] are not
sufficiently discussed.
      </p>
      <p>This study presents the ad hoc project, the solar electric system with two power lines at the
Naryn campus of the University of Central Asia in Kyrgyzstan. The Naryn region is well-known
for its low ambient temperatures (sometimes -400C) during the cold season, and hence the
outdoor installation of the µG control equipment requires the internal heating of the electric
panel. Therefore, two power lines must be installed: one for the heater, which is critical, and
the other for the shiftable load, which in this prototype is a 12 V / 10 W light-emitting diode
(LED) light bulb. The shiftable load is turned on if there is enough power generated by the solar
panel and the photoresistor value is below the predetermined threshold value; it is turned off
otherwise, i.e., the demand side energy management [12] should be implemented. The
hysteresis switching adaptive control algorithm uses three inputs to manage the shiftable load
with the Arduino relay [13, 14]: the current light intensity from the photoresistor, the counter
of loops in the Arduino sketch with high intensity of light (direct sun rays) measured by the
photoresistor, and the solar controller discharge stop voltage. Two Arduino Uno
microcontrollers communicate via the Inter-Integrated Circuit (I2C) protocol [15, 16]. The
architecture of the proposed PV-driven smart islanded µG is shown in Figure 1: Arduino Uno
microcontrollers use 5 V relays to connect / disconnect power lines; the emergency power
supply, which is not discussed in this study, is an independent source of electrical power that
supports the critical load (the heater in this study) on the loss of normal power supply from the
solar charge controller; other equipment is discussed throughout the paper.</p>
      <p>The main contribution of this study is the development of an affordable solar electric system
with two power lines, for the critical demand (the portable heater in this study) and the shiftable
load (the LED light bulb in this study), adapted to the environment with low ambient
temperatures like the Naryn region. Analysis of existing commercial products shows that the
presented low-priced prototype of µG with the adaptive control algorithm and the hardware
based on the 100 W solar panel, 30 A solar charge controller, and two Arduino Uno boards
connected via the I2C protocol to manage critical and shiftable loads does not have analogs
under USD 100 on the market.</p>
      <sec id="sec-1-1">
        <title>Solar Panel</title>
      </sec>
      <sec id="sec-1-2">
        <title>Solar Charge</title>
      </sec>
      <sec id="sec-1-3">
        <title>Controller</title>
      </sec>
      <sec id="sec-1-4">
        <title>Battery</title>
      </sec>
      <sec id="sec-1-5">
        <title>Critical Load</title>
      </sec>
      <sec id="sec-1-6">
        <title>Shiftable Load</title>
      </sec>
      <sec id="sec-1-7">
        <title>Emergency Power</title>
      </sec>
      <sec id="sec-1-8">
        <title>Supply</title>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. Related Works</title>
      <p>The number of Web of Science papers related to µGs has significantly increased from 2010 to
2021 [10]. Many papers, such as [6, 12], discuss the design and analysis of µGs employing
simulation tools like Matlab / Simulink. However, this study focuses on the physical
implementation of μG, with the goal of improving the power supply system for critical loads
and minimizing power loss while providing electric energy to the shiftable demand. This
approach emphasizes the use of IoT soft-/hardware and control algorithms.</p>
      <p>
        The open-source Arduino-based soft-/hardware, such as Arduino Uno
[9, 11] / Mega [
        <xref ref-type="bibr" rid="ref5">5, 11</xref>
        ] / Nano and NodeMCU ESP8266 [
        <xref ref-type="bibr" rid="ref5">5, 13</xref>
        ] / ESP32 [13, 15], can be
programmed in the Arduino integrated development environment (IDE) and are widely used
for the µG automation due to their reliability, affordability, and availability around the world.
Additionally, Raspberry Pi small single-board computers [9] are employed for
highperformance operations and networking in various IoT projects, including power management.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref2 ref3">2, 3, 15</xref>
        ], control techniques are classified as follows:
1. Topology: centralized, decentralized, distributed.
2. Notable advancements in control and supervision: intelligent energy management
system, advanced management of energy storage system, grid-forming inverter control,
demand response integration, and cyber-physical security.
3. Functionality: multi-agent system deployment, model predictive control.
4. Optimization methods: deterministic, probabilistic.
      </p>
      <p>Analysis of previous studies shows that µG is built according to the existing infrastructure,
customer needs, and various load types, and hence it should be capable of operating under
varying power grid conditions. Therefore, there is no fixed cost and / or structure for µGs, but
the minimization of expenses is the priority for customers.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Methods</title>
      <sec id="sec-3-1">
        <title>3.1. µG prototype architecture</title>
        <p>Relays (HW-482 in this study) [10, 13] are commonly used to connect / disconnect DC and
AC power lines, regardless of the type of control technique. The relay 2 (see Figure 2) position,
whether ON or OFF, depends on the control algorithm, which is based on a three-input
hysteresis system in the µG prototype:
1. If the photoresistor value, i.e., the light intensity, is less than 300, then the normally
closed pin is ON. If the photoresistor value is greater than 350, then the normally closed
pin is OFF.
2. If the counter of the photoresistor values over 1002 (direct sun rays) is positive, then the
normally closed pin is ON; otherwise, it is OFF.
3. If the lead-acid battery voltage is less than 10.7 V (the discharge stop voltage measured
by the solar charge controller), then the normally closed pin is OFF; otherwise, it is ON.</p>
        <p>The third condition is implemented without the DC voltage sensor since it consumes
additional power using the voltage divider technology. When the battery voltage drops to
10.7 V, the loads are disconnected, and as a result, the Arduino Uno microcontroller (I2C
peripheral receiver) connected to the solar charge controller does not have the power supply
required to operate. Because of that, another Arduino Uno microcontroller (I2C controller
writer) is unable to send data. This setup allows the I2C controller writer to detect whether the
loads have a power supply or not. Additionally, the Arduino I2C peripheral receiver is used as
a terminal to access the data on the Arduino I2C controller writer: if the power supply is OFF
or the serial monitor starts in Arduino IDE, then the sketch is reloaded on Arduino Uno
microcontroller. After analyzing the related works and considering the prototype requirements,
the proposed bare µG wiring is presented in Figure 2.</p>
        <p>Figure 2 shows that the solar charge controller receives the power from the 100 W
monocrystalline solar panel and then distributes it between the battery and the load. The
discharge stop voltage is 10.7 V, the discharge reconnect voltage is around 11.5 V (experiments
showed that it varies between 11.2 V and 11.5 V for the controller W88-C), and the equalization
voltage is 14.4 V as four lead-acid batteries are employed in the prototype. The Arduino I2C
controller writer is powered by a 12 V power supply from the batteries, which means it is always
ON. It is connected to the Arduino I2C peripheral receiver through pins SCL (a serial clock pin),
SDA (a serial data pin), and GND (ground). The Arduino I2C peripheral receiver is powered by
a 5 V power supply from the solar charge controller USB port and is only ON when the load
has a power supply on the solar charge controller. The relays are powered by the Arduino I2C
peripheral receiver, and hence they are disconnected if the load is OFF on the solar charge
controller. Relay 1 input is the digital pin 8 on the Arduino I2C peripheral receiver. Relay 2
input is the digital pin 7 on the Arduino I2C controller writer. The shiftable load is the
12 V / 10 W LED light bulb. The critical load is the portable 5 V heater. The photoresistor
connected to the analog pin A0 on the Arduino I2C controller writer measures the light
intensity: the value over 1002 represents the direct sun rays. MicroSD card module is employed
to save the data used in calculations; its pins CS (Chip Select), MOSI (Master Out Slave In), MISO
(Master In Slave Out), and SCK (Serial Clock) are respectively connected to digital pins D4, D11,
D12, and D13 on the Arduino I2C controller writer.</p>
        <p>The research question is what heater power is needed to keep the temperature above 0 0C
inside the electric panel. The assumption is that 0 0C is the normal temperature for the prototype
hardware and that the electric panel is winterized (i.e., heat insulation is added internally and/or
externally) and has dimensions 0.5 m×0.5 m×0.3 m=0.075 m3. In general, 1000 W is suitable for
heating a space of 25 m3, and hence 4 W, the power provided by the portable 5 V / 3.5 W heater
and the hardware inside the panel, should be enough for 0.1 m3 which is larger than the
discussed volume of the electric panel (0.075 m3). Table 1 presents the approximate power
consumption of 4.3 W for two Arduino Uno microcontrollers (measured by the USB charger
tester) and other equipment inside the electric panel in the presented prototype.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Control of the µG shiftable load with hysteresis</title>
        <p>In the presence of critical and shiftable loads, the specified amount of total energy is
expanded [17], which is characterized by the following relations on each day:
 
 ,   + (1 −   
)  
, ℎ  
≤
 

≤    ,
the time step around 1.8 s at the Arduino sketch loop function resolution, critic and shift
for the demand response, and   
represent the critical and shiftable loads,</p>
        <p>= {0,1} is the decision of engagement, DR stands
is the maximum power energy that can be generated for
24h.</p>
        <p>depends on the amount of power energy received from the solar panel:
  
=
0,  24 &gt; 0;
1, 
ℎ
,
where  24 is the counter of loops in Arduino sketch with high intensity of light (over 1002
– direct sun rays; the counter is incremented if the load has a power supply on the solar charge
controller) measured by the photoresistor.</p>
        <p>The flowchart for the µG shiftable load management (i.e., relay 2 is ON or OFF) using the
hysteresis with three inputs is shown in Figure 3.  
is the correcting variable that doubles
once per 24h if the load is OFF on the solar charge controller.  
the flowchart in Figure 3, which are calculated out of the presented algorithm.
and  24
are two inputs for</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Experiment</title>
      <p>– the USB charger tester and the digital multimeter QHTITEC 830Plus. Two Arduino Uno
boards in enclosures were prepared for the outdoor installation. In future, the equipment is
going to be installed outdoors inside the electric panel, and it will work with two 330 W solar
panels (see Figure 5; the photo was taken at the Naryn campus of the University of Central Asia
in Kyrgyzstan on December 12, 2023). These solar panels will be reinstalled to change their
position on the roof of the summerhouse because they get covered with snow during snowfall.</p>
      <p>No
No
No
No</p>
      <p>Relay 2 is OFF
The photoresistor value
is less than 300</p>
      <p>Yes
respective decision elements on the right.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Results</title>
      <p>USB charger tester
Solar panel</p>
      <p>Photoresistor
Two Arduino Uno
boards in enclosures
Portable 5 V heater
(critical demand)
LED light bulb
(shiftable load)</p>
      <p>The horizontal axis represents the dates of the experiment: days 1-14 correspond with
March 6-8 and 11-21, 2024, respectively.</p>
      <p>The right vertical axis represents the maximum number per day (blue line) of
photoresistor values that are larger than 1002 (i.e., the direct sun rays).
The left vertical axis represents the battery voltage (green line), the ON (1) / OFF (0)
status of the load on the solar charge controller (red line), and the value of the correcting
variable   (black line). The measurements were taken hourly.</p>
      <p>The experimental results show that the proposed control method with hysteresis and
correcting variable   effectively minimizes the time when the critical load (red line)
is OFF and allows for the power supply of the shiftable load. The energy produced by
this prototype is sufficient to power floodlights with a passive infrared (PIR) sensor.</p>
      <p>16,0
14,0
12,0
10,0
8,0
6,0
4,0
2,0
0,0
1 1 2 2 2 3 3 4 4 4 5 5 6 6 7 7 7 8 8 9 9 9 101011111212121313141414</p>
      <p>Days</p>
    </sec>
    <sec id="sec-6">
      <title>6. Discussion</title>
      <p>In this study, a new µG prototype has been proposed for managing the critical and shiftable
loads. The control algorithm is based on hysteresis with three inputs and adaptive adjustment
of the correcting variable. Experimental results demonstrate that the approach proposed in this
study is operable. However, the selection of hardware components, software, and control
7000
6000
5000
4000
3000
2000
1000
0
s
e
u
l
a
v
r
so 002
t
i
s 1
e n
r
too tah
h r
p e</p>
      <p>g
fro lra
e
t
n
u
o
C
algorithms used in the prototype are empirical and, therefore, open to discussion. In particular,
two concerns were discussed in the Department of Computer Science at the University of
Central Asia:</p>
      <p>How the correcting variable   is changed.</p>
      <p>How the amount of the solar power energy is assessed using the counter of loops  24
in Arduino sketch with high intensity of light measured by the photoresistor.</p>
    </sec>
    <sec id="sec-7">
      <title>7. Conclusions</title>
      <p>A new PV-driven smart islanded µG is proposed in this study for managing critical and shiftable
loads. The control algorithm employs a three-input hysteresis, I2C communication between
Arduino Uno microcontrollers, analysis of solar energy using a photoresistor, and adaptive
additive adjustment of the correcting variable. This system is shown to be operable under
different weather conditions, such as cloudy or sunny.</p>
      <p>The main advantage of the developed prototype is an affordable solar electric system with
two power lines, one for the heater (critical load) and the other for the shiftable demand, adapted
to low ambient temperatures. Analysis of existing commercial products shows that the
presented low-priced prototype of µG, equipped with a 100 W solar panel, 30 A solar charge
controller, and two Arduino Uno microcontrollers, has no analogs under USD 100. Experimental
results from the Naryn campus of the University of Central Asia in Kyrgyzstan have shown that
the proposed µG prototype minimizes the time when the critical load is OFF and allows limited
power supply to the shiftable load. In this soft-/hardware configuration, the prototype can
provide power to floodlights, equipped with a PIR sensor, which serves as the shiftable load.</p>
      <p>The most likely prospect in developing this study is to design a box solution that is ready
for outdoor installation.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>O.N.</given-names>
            <surname>Onsomu</surname>
          </string-name>
          and
          <string-name>
            <given-names>B.</given-names>
            <surname>Yeşilata</surname>
          </string-name>
          ,
          <article-title>Review of Microgrid Energy Management Techniques on Virtual Power Plant System</article-title>
          ,
          <source>Journal of Optimization &amp; Decision-Making 2.2</source>
          (
          <year>2023</year>
          )
          <fpage>381</fpage>
          -
          <lpage>388</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>L.</given-names>
            <surname>Ahmethodžić</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Musić</surname>
          </string-name>
          and
          <string-name>
            <given-names>S.</given-names>
            <surname>Huseinbegović</surname>
          </string-name>
          , Microgrid Energy Management:
          <article-title>Classification, Review and Challenges</article-title>
          ,
          <source>CSEE Journal of Power and Energy Systems 9.4</source>
          (
          <year>2023</year>
          )
          <fpage>1425</fpage>
          -
          <lpage>1438</lpage>
          . doi:
          <volume>10</volume>
          .17775/CSEEJPES.
          <year>2021</year>
          .
          <volume>09150</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>S.</given-names>
            <surname>Parhizi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Lotfi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Khodaei</surname>
          </string-name>
          and
          <string-name>
            <given-names>S.</given-names>
            <surname>Bahramirad</surname>
          </string-name>
          ,
          <article-title>State of the Art in Research on Microgrids: A Review, IEEE Access 3 (</article-title>
          <year>2015</year>
          )
          <fpage>890</fpage>
          -
          <lpage>925</lpage>
          . doi:
          <volume>10</volume>
          .1109/ACCESS.
          <year>2015</year>
          .
          <volume>2443119</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>D.</given-names>
            <surname>Zubov</surname>
          </string-name>
          ,
          <article-title>An IoT Concept of the Small Virtual Power Plant Based on Arduino Platform and MQTT Protocol</article-title>
          ,
          <source>in: Proceedings of the International Conference on Applied Internet and Information Technologies</source>
          , Ohrid, Macedonia,
          <year>2016</year>
          , pp.
          <fpage>95</fpage>
          -
          <lpage>103</lpage>
          . doi:
          <volume>10</volume>
          .20544/AIIT2016.13.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>M.T.</given-names>
            <surname>Adkhar</surname>
          </string-name>
          and
          <string-name>
            <given-names>H.</given-names>
            <surname>Afanti</surname>
          </string-name>
          ,
          <article-title>Monitoring System of Parallel Loads Electricity Consumption Based on IoT</article-title>
          ,
          <source>Journal of Electrical Engineering and Computer Sciences 8.1</source>
          (
          <year>2023</year>
          )
          <fpage>63</fpage>
          -
          <lpage>70</lpage>
          . doi:
          <volume>10</volume>
          .54732/jeecs.v8i1.8.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>