[image] [image] Ressource protégée - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu

[image] [image]

* Documentation

* FR
  Français (FR)

* Anglais (EN)
  Se connecter

* Portail HAL Inria

* Recherche
  Loading...

## Recherche avancée

Information de documents

Titres

○ Titres

○ Sous-titre

○ Titre de l'ouvrage

○ Titre du volume (Série)

○ Champ de recherche par défaut (multicritères) + texte intégral des PDF

○ Résumé

○ Texte intégral indexé des documents PDF

○ Mots-clés

○ Type de document

○ Sous-type de document

○ Tous les identifiants du document

○ Identifiant HAL du dépôt

○ Langue du document (texte)

○ Pays (Texte)

○ Ville

○ À paraître (true ou false)

Ajouter
<figure><img src="image_1.png" /></figure>

ifip

International Federation for Information Processing

This document is the original author manuscript of a paper submitted to an IFIP
conference proceedings or other IFIP publication by Springer Nature. As such, there
may be some differences in the official published version of the paper. Such
differences, if any, are usually due to reformatting during preparation for publication or
minor corrections made by the author(s) during final proofreading of the publication
manuscript.
## Auteur

### Auteur (multicritères)

○ Auteur (multicritères)

○ Auteur : Nom complet

○ Auteur : Nom de famille

○ Auteur : Prénom

○ Auteur : Complément de nom, deuxième prénom

○ Auteur : Organisme payeur

○ Auteur : IdHal (chaîne de caractères)

○ Auteur : Fonction

○ Auteur : personID (entier)

○ Auteur : Identifiant de l'organisme payeur

○ Auteur : Identifiant de la structure

○ Directeur de thèse

○ Éditeur

○ Éditeur scientifique

○ Éditeur de la série

## Ajouter

### Structure

### Structure (multicritères)

○ Structure (multicritères)

○ Structure : Acronyme

○ Structure : Nom

○ Structure : Code

○ Structure : Pays

○ Structure : Type

○ Structure : État dans le référentiel

○ Structure : Identifiant HAL de la structure

○ Structure/équipe de recherche : Pays

○ Structure/regroupement d'équipes : Pays

○ Structure/laboratoire : Pays

○ Structure/regroupement de laboratoires : Pays

○ Structure/institution : Pays

○ Structure/regroupement d'institutions : Pays

## Ajouter
# A Fuzzy Logic Approach for Self-Managing Energy Efficiency in IoT Nodes

Victória Melo¹[0000-0003-0025-8055], Gustavo Funchal¹[0000-0002-9691-9956],

Jonas Queiroz¹[0000-0001-5416-4762], and Paulo Leitão¹[0000-0002-2151-7944]

¹ Research Centre in Digitalization and Intelligent Robotics (CeDRI), Instituto Politécnico de Bragança,
Campus de Santa Apolónia, 5300-253 Bragança, Portugal
{victoria, gustavofunchal, jpqueiroz, pleitao}@ipb.pt

**Abstract.** The collection and analysis of data assume a crucial importance in the digital transformation era. Internet of Things (IoT) technologies allow to gather data from heterogeneous sources and make them available for data-driven systems aiming, e.g., monitoring, diagnosis, prediction and optimization. Several applications require that these IoT nodes be located remotely without connection to the electrical grid and being powered by batteries or renewable sources, thus requiring a more efficient management of the energy consumption in their operation. This paper aims to study and develop intelligent IoT nodes that embed Artificial Intelligence techniques to optimize their operation in terms of energy consumption when operating in constrained environments and powered by energy harvesting systems. For this purpose, a Fuzzy Logic system is proposed to determine the optimal operation strategy, considering the node's current resource demands, the current battery condition and the power charge expectation. The proposed approach was implemented in IoT nodes measuring environmental parameters and placed in a university campus with Wi-Fi coverage. The achieved results show the advantage of adjusting the operation mode taking into consideration the battery level and the weather forecasts to increase the energy efficiency without compromising the IoT nodes' functionalities and QoS.

**Keywords:** Internet of Things, Energy Efficiency, Fuzzy Logic.

## 1 Introduction

In the digital era, also known as Industry 4.0 [6], the collection and analysis of data assume crucial importance to support the increase of efficiency and optimization of business processes, strongly contributing for the implementation of the digital transformation. The data acquisition is carried out by smart sensors that have been leveraged by Internet of Things (IoT) technologies. Lately they have been widely applied to collect and send the huge volume and variety of data from heterogeneous sources to remote Cloud applications, where the data is stored and processed to extract information and knowledge aiming, amongst others, monitoring, diagnosis, prediction and optimization.
Autres

Champ de recherche par défaut (multicritères)

○ <u>Champ de recherche par défaut (multicritères)</u>

○

○ <u>Revues (multicritères)</u>

○ <u>Revue : Éditeur</u>

○ <u>Revue : Titre abrégé</u>

○ <u>Revue : Titre</u>

○ <u>Revue : Identifiant interne</u>

○ <u>Revue : Date de début de publication</u>

○ <u>Revue : ISSN électronique</u>

○ <u>Revue : ISSN</u>

○ <u>Revue : Éditeur</u>

○ <u>Revue : Couleur dans SHERPA/RoMEO</u>

○ <u>Revue : État dans le référentiel</u>

○

○ <u>Colloque (multicritères)</u>

○ <u>Colloque : Titre</u>

○ <u>Colloque : Organisateur</u>

○ <u>Colloque : date de début (Année)</u>

○ <u>Colloque : date de fin (Année)</u>

○ <u>Conférence invitée (oui/non)</u>

○

○ <u>Projets ANR (multicritères)</u>

○ <u>Projet ANR : Acronyme</u>

○ <u>Projet ANR : Acronyme du programme</u>

○ <u>Projet ANR : Code décision (référence)</u>

○ <u>Projet ANR : Nom</u>

○ <u>Projet ANR : Identifiant interne</u>

○ <u>Projet ANR : État dans le référentiel</u>

○

○ <u>Projets européens (multicritères)</u>

○ <u>Projet européen : Acronyme</u>

○ <u>Projet européen : Identifiant de l'appel à projet</u>

○ <u>Projet européen : Référence</u>

○ <u>Projet européen : Nom</u>

○ <u>Projet européen : Date de fin</u>

○ <u>Projet européen : Financement</u>

○ <u>Projet européen : Date de début</u>
Following the fast advances in IoT technologies, there is a continuous growth in the number of smart devices connected to the Internet, that, according to McKinsey reports, is expected to exceed 50 billion by 2025 [1]. Additionally, it is estimated that by 2025, IoT can generate up to $11.1 trillion of economic value each year [8].

The development of IoT devices (or nodes) imposes some important challenges in terms of security, privacy and interoperability. In some specific cases, the energy consumption and supply represents another concern. In fact, several applications require the IoT nodes to be located remotely and without the possibility to be connected to the electrical grid, thus requiring to be supplied by batteries and/or renewable energy sources. In this way, the design of IoT nodes should consider technologies and operating strategies that make the nodes energy efficient while ensuring their correct operation.

The energy efficiency can be achieved in the design phase by using low-consump-
tion technologies, e.g., controllers and communication protocols, or implementing ef-
ficient processing algorithms. As example, the use of low-energy communication net-
works, e.g., LoRa and BLE (Bluetooth Low Energy), often contributes to solve the
energy efficiency problems in such situations [2]. However, in some situations this is
not enough and requires the implementation of actions that manage the energy con-
sumption during the operational phase, e.g., reducing the sampling, transmission or
processing capabilities to save energy and increase the node lifespan and still ensuring
the QoS. For instance, Machine Learning (ML) techniques can be used to analyze the
available operational data and create models to be used by the node as a self-awareness
mechanism that can define the best conditions to perform some tasks that may require
more power resources, e.g., adapting the frequency to sample and transmit data.

Having this in mind, the objective of this work is to analyze the energy efficiency in IoT nodes located in restricted areas, isolated from the electrical grid and powered by batteries that are charged by solar panels. In particular, this work considers the development of intelligent algorithms that can be used as a self-awareness mechanism to optimize the energy consumption in IoT nodes, specially those that rely on Wi-Fi or other energy-hungry protocol. For this purpose, a Fuzzy Logic system is proposed to dynamically adjust the operating conditions of an IoT node, based on the current power resource demands, the battery condition and the power charge expectation, aiming to increase its energy efficiency. The proposed approach was implemented in a university campus with Wi-Fi coverage, where an IoT node with no access to the electrical grid, needs to collect and transmit environmental data to the Internet. The experiments focused on studying the influence of running these intelligent algorithms locally or as a service in Cloud platforms, with results showing that performing the fuzzy system locally, on the IoT node, presents less impact, in terms of the response time and energy consumption, than performing remotely on the Cloud.

The rest of the paper is organized as follows: Section 2 overviews the related work in terms of energy efficiency in IoT nodes, while Section 3 discusses the main aspects that mostly affect such efficiency. Section 4 describes the proposed Fuzzy Logic system to dynamically adapt the operating conditions to improve the energy efficiency in IoT nodes, and Section 5 presents the experimental implementation of the fuzzy decision-
○ Projet européen : État dans le référentiel

○ Projet européen : Identifiant interne

○

○ Date de production : année

○ Date de mise en ligne : année

○ Date de publication : année

○ Date d'écriture : année

○ Date de modification du dépôt : année

○ Date de dépôt : année

○ Date de publication électronique : année

○

○ Collection HAL (multicritères)

○ Collection HAL : catégorie

○ Collection HAL : Code

○ Collection HAL : Nom

○ Collection HAL : Identifiant interne

○

○ Identifiant interne du contributeur/déposant

○ Nom complet du contributeur/déposant

○

○ Domaines

○ Domaine primaire

○ Domaine racine

○ Sous-domaine niveau 1

○ Sous-domaine niveau 2

○ Sous-domaine niveau 3

○

○ Statut du document

○ Version du document

○ Type de dépôt

○ Type de document

○ ISBN

○ Numéro - référence

○ Identifiant DOI

○

○ Classification

○ Audience

○ Vulgarisation

○ Comité de lecture - texte (oui ou non)

○ Actes de colloque
making system for the case study. Finally, Section 6 rounds up the paper with the conclusions and points out some future work.

## 2 Related work

The energy consumption represents a crucial problem in the operation of IoT nodes that can affect their functionalities along the time, particularly regarding the data collection, processing and transmission. This assumes an even critical importance in remote applications, where the connection to the electrical grid is not possible and the IoT nodes are powered by batteries. In such situations, the energy management assumes a crucial role to ensure the QoS and reduce the need for battery replacement, which in some cases is an extremely critical issue, e.g., when IoT nodes are placed in locations of difficult access (e.g., forests or remote areas), or operating in adverse conditions (e.g., underwater or underground) where the nodes can be discarded after the completely use of the battery [4].

For this purpose, it is important to select the most appropriate and low-energy consumption technologies and protocols to be used by IoT nodes. In terms of communication technologies, they are required to support the connectivity of each node aiming the data transmission through Internet. The selection of a low-energy consumption communication protocol, that ensures the data transmission requirements, contributes for the energy efficiency of the IoT node, but it depends of the application requirements. For instance, LoRa and BLE are suitable solutions to this purpose due to their low-energy consumption, the first is suitable for applications with long transmission range and lower transmission rate and the second for short transmission range but higher transmission rate. The use of Wi-Fi is not a low-energy consumption option, which means that it is not regularly used for IoT nodes powered by batteries, but it is widely available, provides a direct communication with the Internet, allows an easy connection and disconnection of devices, and has good features in terms of data transmission rate and security [5].

The same applies to the selection of the hardware platforms, e.g., micro- controllers and System-on-a-Chip, that should be chosen to fit the project requirements, since, as much functionalities they provide, e.g., in terms of connectivity and processing capabilities, as higher will be the power consumption.

However, in some situations, the use of proper technologies, and particularly low-energy consumption communication protocols, could be not enough and it is necessary to go one step beyond. In this case, it is important to consider Edge computing approaches to develop intelligent energy management mechanisms that can run continuously in the IoT nodes, adapting its operating conditions in a dynamic and efficient manner, for optimizing the battery usage and consequently extending its lifetime.

In this context, some research works use Artificial Intelligence (AI) techniques to manage the node's behavior. As example, a fuzzy-based optimization model is used for energy management in wireless sensor networks (WSN), aiming to maximize the lifetime of the network and minimize the traffic load [11]. In this case, the sleep and wake-up procedure of the nodes are adapted based on the classification of the nodes as good,
○ Référence interne

○ Financement

○ Collaborations

Ajouter

Lancer la recherche

Recherche experte (SolR)

Recherche experte (SolR)

Lancer la recherche
Vers la recherche avancée

• Déposer

Portail INRIA.HAL.SCIENCE
Les publications, logiciels... des scientifiques Inria

• Accueil

• Publications Inria

○ Consulter les derniers dépôts

○ Par équipe de recherche

○ Par auteur

○ Rapports de recherche et techniques

○ Livres blancs

○ Rapports d'activité des équipes

○ Statistiques

• Boite à Outils

○ X2Hal : importer par lot

○ Logiciels : créer le Codemeta.json

○ Créer mon IDHal

○ Créer mon CVHal

○ Haltools : créer ma page de publications

○ Haltools : extraire des données (réservé Inria)

○ Les bonnes pratiques

■ Comment bien s'affilier ?
normal or bad, defined according to parameters like, the degree of the node, link quality, residual energy and traffic rate. A Fuzzy Logic based mechanism is also used to determine the sleep time of IoT devices in a home automation environment based on BLE [3]. The hibernation time of IoT devices is determined according to the battery level values and the ratio of Throughput to Workload, allowing to reach a 30% increase in the device's lifetime.

An algorithm using the Long Short Term-Memory (LSTM) technique, running in Edge devices, is used to improve the energy efficiency of wearable sensors, aiming to reduce the volume of communication between devices [9]. This implementation recognizes event data and transfers them when necessary, being the majority of the computational and storage load handled away from the data source. A Fog-based system is used to minimize the energy consumption of IoT nodes in Industry 4.0 applications, using the MQTT protocol and ML algorithms, e.g., Multiple Linear Regression, Bagged Decision Tree and Artificial Neural Network, to predict future data measurements, which consequently reduces the transfer rate from the devices to the control unit [10]. This model takes into consideration the energy consumption per bit, the total number of bytes needed for communication between the broker and the IoT devices, and the predictive algorithm's degree of accuracy.

Another approach describes a power management model for a battery operated IoT-based weather station, comprising a micro-controller unit (MCU), solar panel, battery, power management circuit and sensors [12]. Algorithms are used to estimate the energy stored in the battery based on the information from the solar panel, converter, charger circuit and solar irradiance. The MCU uses this information to optimize the system's overall energy consumption, maximizing its lifespan.

The existing approaches to minimize the energy consumption on IoT nodes typically use the intrinsic parameters to the local IoT node, e.g., the battery status and the transmission rate. In order to achieve more adaptable solutions, these intelligent algorithms should also consider other parameters, e.g., weather forecasts when considering renewable power sources, to obtain the best mode of operation of an IoT node, e.g., sleep and wake-up times, sampling frequency and data transmission, according to the power supply conditions that keep the node running for longer while maintaining the QoS.

## 3 Energy Consumption in IoT Nodes

The energy management is an essential task in battery-operated systems, e.g., IoT nodes that operates without connection to the main grid. In this context, the energy management in an IoT node depends on several factors related to the characteristics of hardware and software elements, as illustrated in Fig. 1.

In this sense, the development of such IoT nodes requires that both hardware and software are optimized for the application scenario. However, this is not a simple task in dynamic environments, where the demands of the node resources can vary along the time.
■ Quelle version puis-je déposer ?

■ Choisir le bon « type de document »

■ Mettre en valeur ses publications

○ Les tutos IES Inria

■ Lier les notices dans HAL

■ Umbrhal Inria pour l'accessibilité

■ Personnaliser son CVHAL

■ Créer et Personnaliser sa collection

• Documentation

○ Aide en ligne HAL

○ Aide en ligne Haltools

○ Aide en ligne X2hal

○ Tutoriels video HAL

○ Documentation API HAL

○ Ajouter des vignettes

○ Identifiant auteur IdHAL et CV

○ Compléter son dossier ORCID avec ses dépôts HAL

○ Inria et la Science Ouverte

X

X

X

Loading...

X

Le document que vous demandez est en access restreint
jusqu'au 2025-01-01 !

Revenir a la notice

Retourner à l'accueil

Contact

•

Ressources
<figure><img src="image_2.png" /><figcaption>**Fig. 1.** Factors that influence the operation of an IoT node.</figcaption></figure>

In such environments, the power source is one of the main aspects that should be considered. It is related to two factors: the battery capacity and the power energy harvesting system. The first determines the life span of the node if the battery is not rechargeable, otherwise the time the node can last disconnected from the power source. The second is mostly based on renewable energy sources, usually solar, that are known by instabilities caused by weather conditions.

Other important parameters are the consumption of the hardware platform, particularly the processor, and the communication platform (technology and protocol). In this case, powerful processors allow to run advanced processing algorithms but implies a higher energy consumption. Similarly, communication technologies that allow higher bandwidth have a higher energy consumption, and the same for robust protocols. The energy consumption also increases with the number and characteristics of connected sensors, the sampling rate, and the data transmission (frequency and volume).

Many of these factors cannot be dynamically adapted, instead should be chosen at the design time. On the other hand, some of them can be dynamically tuned by software procedures, aiming to control the energy consumption, e.g., reducing the data transmission frequency or volume. In this context, being aware of the battery level and the prediction of the weather conditions can help to save energy to overcome long periods of lack of renewable power supply (e.g., rainy days). Note that, the knowledge of the battery voltage requires a dedicated sensor embedded in the IoT node, while the weather conditions can be provided by external services. Although this will cost extra energy consumption with the extra communication, these values do not need to be updated constantly, given their low variability over time.

In this way, IoT nodes should be able to manage their operating conditions over time aiming to save energy to extend its lifespan without degrading the QoS. Note that in these cases, the QoS refers to the capability of the node to fulfil its goals, specially in critical situations in which the variables monitored by the sensors of the IoT nodes indicate alarming situations, requiring greater performance by the monitoring system. For instance, a node designed to monitor a given environmental condition needs to work with its full resources when the monitored condition reaches critical levels. In this
* Documentation

* FAQ

* API

* OAI-PMH

* AuréHAL

## Informations

* À propos

* Données personnelles

* Mentions légales

* Accessibilité

* Conformité RGAA

## Questions juridiques

* Je publie, quels sont mes droits ?

* Loi pour une République numérique

* Stratégie de non-cession des droits

* SHERPA/RoMEO

## Portails

* Portails institutionnels

* HAL

* HAL SHS

* HAL Thèses

* MédiHAL

## CCSD

* CCSD

* Episciences

* Sciencesconf
sense, the node can operate using less resources during the periods that the monitored conditions are stable, e.g., work with lower sample or transmission rate.

AI-based algorithms can be considered to develop such intelligent and self-awareness mechanisms to perform efficient energy management. Such algorithms should run continuously or periodically, analyzing the operating and power conditions in order to optimize QoS and lifespan. The output of the algorithm should consider the parameters that strongly influence the energy consumption, and adjust them properly during its operation, mainly the:

- Data acquisition - determined by the sampling rate (volume, e.g., different frame rate of a camera) and measurement granularity (quality, e.g., picture size of camera). For both parameters, higher values implies more energy consumption. Besides the energy required by the sensing interfaces, it indirectly affects the energy required by the processing unit.

- Data transmission - determined by the volume (package size, e.g., multiple samples can be transmitted in the same message) and frequency (messages per second) that data is sent to other systems. The energy consumption is determined by the communication interfaces. Although for both parameters, higher values generally implies more energy consumption, in the cases that the data size is lower than the package metadata, sending more data per package can contribute to reduce the energy consumption. These cases must also consider the energy required to setup the transmission (e.g., connect to the network and then to the server/application).

- Operating mode - determined by the hardware management capabilities of the device (e.g., some devices can have different operating modes/states, like active, stand-by, or sleep) that define the energy consumption of the hardware units, components and interfaces (like the I/Os, CPU and communication). The operating modes can be set according to internal conditions of the device (e.g., a device can be active during the daytime and be in stand-by/sleep mode during the night).

These algorithms can be embedded directly in the IoT nodes, using Edge computing, or made available as services in the Cloud. This design option is dependent on the local processing capacity, the type of intelligent mechanism to be executed, and desirable response time. The execution of such algorithms is another concern, since they require extra energy from the IoT node. This trade-off should be analyzed during the design of the IoT node and algorithms.

## 4 Fuzzy Logic System for Energy Efficiency

A Fuzzy Logic approach is proposed to introduce intelligence in IoT nodes, regarding mechanisms to self-regulate its operation and to manage the energy efficiency overtime, keeping the QoS requirements. The Fuzzy Logic technique was selected, mainly because it is a rule-based system that does not require complex mathematical models and can map imprecision and subjective aspects through linguistic terms. Furthermore, when compared with some ML techniques, it has a deterministic behavior, and does not need training data sets and powerful computational hardware platforms.
This approach considers IoT nodes powered by a photovoltaic system, comprising a battery and a photovoltaic panel. Fig. 2 illustrates the proposed Fuzzy Logic approach, which considers 5 input variables, combined in two Fuzzy inference systems. The first variable, called resource demand, indicates the node demand of power resource. It is computed based on the operating conditions and the QoS requirements. This variable can be defined by a single or multiple parameters, e.g., based on the value of a temperature sensor, or the combination with the humidity value. In the second case, another fuzzy system can be used to define the resource operating condition.

<figure><img src="image_3.png" /><figcaption>**Fig. 2.** Fuzzy logic approach, including the fuzzy sets, their membership functions and the fuzzy rules.</figcaption></figure>

The second input variable, called battery level, also represents an internal measurement of the node, and defines the current status of the battery charge and together with the previous variable, plays an important role in the definition of the power saving modes.

The other 3 input variables represent the conditions that affect the power supply, being responsible to define the battery charging factor. This value is obtained by a fuzzy inference system that combines the input of these variables. Different from the other 2
variables, their values should be obtained from external systems and represent short-
term predictions, e.g., for the next hour interval. In particular, they represent the time
of day that provides a perspective of the power supply (e.g., if it is morning there will
be plenty of sun light to charge the battery, and the opposite for the afternoon). The
solar irradiance has a similar role for charging the battery, where its value presents a
characteristic behavior along the day, slightly varying along the seasons of the year.
Different from the previous variables, the cloudy conditions has a more dynamic be-
havior, affected by the weather conditions, and is also essential to determine the expec-
tation of power supply to charge the battery.

In this approach, the fuzzy sets and membership functions (MFs) for the input and
output variables were defined by using trapezoidal functions (see Fig. 2). They were
chosen based on the performance observed during the preliminary tests, and their low
computational cost requirements.

In this context, the resource demand is defined by its level (0 to 100%), comprising 3 Fuzzy sets (Low, Medium, High). The battery level is based on its battery voltage value, where, according to the type of the battery used, should be mapped to the charge percentage level (0 to 100%). This variable has 3 Fuzzy sets: Low, Medium and High. The time of day has four Fuzzy sets covering a 24 hours period: Dawn, Morning, Afternoon and Night. The cloudy conditions was defined based on a scale from 0 to 100%, and three Fuzzy sets: Low, Medium and High. The solar irradiance was defined based on a scale from 0 to 1kW/m² and three Fuzzy sets: Low, Medium and High. While the value of the cloudy conditions is usually provided by the weather services in percentage, the min/max values of the solar irradiance varies according to the earth geolocation and the photovoltaic panel orientation, requiring to be properly mapped to this percentage level.

The output of the Fuzzy system was defined in terms of the power saving levels. In
this case, three Fuzzy sets, representing the power saving operating modes for the IoT
node were defined, namely Regular, Saving and Critical modes. The Regular mode
relates to the condition where the node must operate with its full resources, thus con-
suming more energy. In the Saving mode, the node can take actions, e.g., disabling or
reducing some capabilities, in order to save some energy. On the other hand, the Critical
mode is related to the situation when the node must save as much power as possible.

The power saving modes is just a label for specific operating settings, such those
listed in Section 3, e.g., regarding data transmission frequency/volume or sleep time
interval. In this case, a particular assumption to be considered in this mechanism is the
context-aware, which reflects the DoFs (Degrees of Freedom) of some operating pa-
rameters, e.g., the frequency and volume of data transmission (default and minimum
values). These DoFs are used by the Fuzzy Logic system as the boundaries to adjust the
operation mode of the IoT node, and the minimal values are considered the minimum
values of operation without degrading the QoS.

The Fuzzy inference engine requires the definition of IF-THEN rules that associate
the linguistic values of the input variables to the output variables. The decision tables,
also illustrated in Fig. 2, presents the rules defined for this approach, where the two
Fuzzy inference systems, the Charging Factor and Operation mode, have 36 and 27
rules, respectively. Each cell of the tables represents the output of the AND combina-
tion of the input variables (rows and columns). Considering the two Fuzzy inference
systems, the fuzzy rules can be interpreted as in the following example: IF the next
period will be “Dawn” (e.g., 3AM), AND with "High" cloudy conditions (e.g., 90%),
AND "Low" solar irradiance (e.g., 0.1), THEN the charging factor (output of the first
inference system), is “Low”, indicating that the conditions are not good to recharge the
battery. In this condition and applying the second Fuzzy inference system, it is possible
to determine the operation mode for this scenario example, illustrated in Fig. 3.

<figure><img src="image_4.png" /><figcaption>Fig. 3. Result of the operation mode Fuzzy inference for the given example.</figcaption></figure>

In this case, IF a “Low” charging factor is present AND the battery level is “Low” (e.g., 25%), AND the resource demand is “Low” (e.g., 28%), THEN the power saving operation mode is “Critical”, meaning that the IoT node must adopt the procedures defined to save as much energy as possible.

5 Fuzzy Logic System for Energy Efficiency

The proposed Fuzzy Logic approach was implemented and tested in a real case study, comprising an IoT node, based on an ESP8266 micro-controller, that collects environmental measurements in a university campus by using sensors that measure the temperature and humidity (SI7021), the light intensity (BH1750), the UV index (VEML6070) and the soil moisture (resistive sensor). These data are measured every 10 seconds in the intermediary operating condition (i.e. power saving mode) and transmitted at the same rate in a package of 118 bytes.

The node is powered by a Li-ion battery (3.7V) that is charged by an external energy harvesting system based on a small PV panel (110x60x2.5mm - 6V/1W). The IoT node uses Wi-Fi to connect to the Internet and the publish-subscribe MQTT (Message Queuing Telemetry Transport) protocol to send the measured data to a Cloud application implemented using the Node-RED platform. The data can be visualized in real-time in a dashboard, it is stored in an InfluxDB database and analyzed to detect anomalies or trends.

In this paper, the objective of the experiment was to test the performance and trade-
offs when the Fuzzy Logic was deployed on the node (Edge) as a mechanism for self-
regulation of energy consumption, or performed on the Cloud, as a service. In the first
configuration the node request the information required to perform the Fuzzy system to a Cloud service, while in the second configuration, the IoT node sends its information to a Cloud service, that executes the Fuzzy Logic system and sends back the indication about the operating mode that should be adopted. The implemented algorithms to execute the Fuzzy Logic system at the Edge or at the Cloud are illustrated in Fig. 4 and 5, respectively.

<figure><img src="image_5.png" /><figcaption>Fig. 4. Algorithm to run the energy efficiency method locally at the edge.</figcaption></figure>

## 5.1 Application of the Fuzzy Logic System

The Fuzzy system was implemented in the Edge and Cloud computing layers, in order to verify the required response time and energy consumption. The Edge computational platform is the ESP8266 that is a low-cost computing platform that has constrained computational resources. For this reason, the lightweight eFLL library [7] was used, while for the Cloud the python skfuzzy library was used. In spite of the different implementation of the Fuzzy Logic algorithm by the two libraries, they were tested with
the same configuration (Mamdani Fuzzy type and centroid defuzzyfication method), and for the same set of values, presenting extremely small differences in the outputs. The output space of the Fuzzy system for the proposed approach is illustrated in the charts of the Fig. 2.

<figure><img src="image_6.png" /><figcaption>**Fig. 5.** Algorithm to run the energy efficiency method as a service in the cloud.</figcaption></figure>

The value of the resource demand is based on the measured data and can be obtained by several means (e.g., from simple rules to Fuzzy systems or ML-based algorithms). For the case study, the values of temperature and humidity were considered, in which the temperature was mapped from 20°C to 40°C (corresponding to the range of 0 to 100%). The values are combined to determine critical conditions, e.g. temperature above 30°C and humidity below 30%, indicating a high risk of fire and consequently greater demand for resources. The cloudy conditions is already provided by the weather services in percentage and the solar irradiance parameter can vary from 0 (night) to 1kW/m² (summer day, solar noon, no cloud). For the battery parameter, the actual behavior was considered to implement a linear model for the voltage level drop. The voltage range considered for the operation of the system was 3.3V (minimum voltage required for the operation of the system) and 4.1V (maximum voltage obtained from the battery), mapped from 0 to 100% in the fuzzy variable.
The optimization of the IoT node's energy efficiency comprises the regulation of the frequency in which the node measures and publishes data, that in this case is based on the sleep time between the measurements. The operating modes are defined according to the battery level, resource demand and charging conditions of the solar panel.

When in “Regular” mode, the IoT node must operate continuously (i.e. no sleep), measuring and sending data at highest frequency (every second). In the “Saving” mode, it must adapt to reduce the power consumption, entering in the deep sleep mode for 10 seconds after the measurements. Similarly, when the operation mode is “Critical”, the battery savings need to be even greater, thus the IoT node goes into deep sleep mode for 30 seconds. This mode is used in situations where the battery level and the demand for resources is not high, since this approach prioritizes the QoS over the battery lifespan.

## 5.2 Analysis of Results

The experiments were conducted in order to analyse the trade-offs, regarding the response time and the energy consumption, when performing the Fuzzy locally on the Edge or as a service on the Cloud. Table 1 presents the response time required for the data acquisition, transmission and processing at the Edge (ESP8266/12E) and Cloud (Virtual Machine - Ubuntu 18 i5-8400).

<table><caption>**Table 1.** Execution time of Fuzzy Logic system running locally at the Edge and as a service at the Cloud (ms).</caption><thead><tr><td></td><td>Measurement</td><td>Preparing</td><td>Execution</td><td>Total</td></tr></thead><tbody><tr><td>Locally at</td><td>277,5</td><td>5,3</td><td>13,4</td><td>296,2</td></tr><tr><td>Service in</td><td>277,5</td><td>5,3</td><td>89,9</td><td>372,7</td></tr></tbody></table>

The measurement time refers to the time required to acquire data from all sensors in the node, and the preparation time refers to the time taken to serialize the collected data in JSON format to be sent to the Cloud application. The main difference between the two approaches is related to the execution time of the Fuzzy Logic system: 13,4 ms if processed locally in the IoT node and 89,9 ms (i.e. 86,6 ms for the data transmission and 3,3 ms for the processing of the algorithm). This clearly shows that running the Fuzzy Logic system directly in the IoT node allows to get a fast response time. Mapping the achieved results in terms of energy consumption, and considering that the Fuzzy algorithm runs 24 times a day (once an hour), and that the IoT node has an average consumption of 81,13mAh, the consumption for executing the Fuzzy Logic system at the Edge is 13,2µA, and for accessing as a service in the cloud is 50,9µA. The achieved values highlight the advantage of running the Fuzzy Logic system directly in the ESP8266 since less energy is required to execute the intelligent mechanism.

The previous results were related to a scenario where the Fuzzy Logic system is running once a hour and the weather forecast information is retrieved once a day since its variability is low (i.e. forecast values for the next 24 hours are saved in ESP's RTC memory). In case, the weather forecast information needs to be retrieved more often
from a Cloud application, then the Edge approach starts to lose advantage related to the
Cloud since in this case it is necessary to add the time (and consumption) associated to
request the forecasting data from the Cloud. As example, in the extreme case that the
frequency to retrieve weather forecast data is equal to the frequency to run the Fuzzy
Logic system, then the execution time is 234 ms at the edge and the same 89,9 ms at
the Cloud. It is noteworthy that in this case, the cloud is connected to the same network
and, due to this, it will present low latency (quick response). However, if the cloud is
connected to another network, it would present a higher latency and, consequently, a
higher response time (increasing the consumption of the IoT node).

Thus, these results allow to conclude that if light intelligent algorithms are used com-
bined with reduced external forecast data requests (due to its inertia), the best option is
to run them directly on the IoT nodes; otherwise, it is preferable to run complex algo-
rithms in Cloud platforms.

The IoT node was also tested to analyze the benefits of using the proposed approach, considering a scenario with good solar radiation conditions, but also some cloudy periods. The energy management in the IoT nodes was analyzed considering the normal operation and the use of the proposed Fuzzy Logic system, with the achieved results being illustrated Fig. 6.

As mentioned before, in normal operation, the IoT node has an average consumption of 81,13mAh, causing the IoT node to operate for approximately 5 hours without recharge by the solar panel. Using the Fuzzy Logic system embedded directly in the IoT node, depending on the input variables, the system suggests changing the operating mode when it is identified that according to weather conditions, there would be no way to recharge the battery and it would be more advantageous to save energy and operate with a lower QoS. This allows to save energy since a much smaller number of readings are performed by the IoT node, increasing the lifespan to approximately 12 hours. Note that the percentage of improvement is strongly dependent of the values for the sleep modes established for saving and critical operation modes.

It is noteworthy that for this test the solar panel was not used, allowing to observe
the lifetime gain of the IoT node only with the fuzzy approach applied. However, when
using the solar panel, the system will always have priority in the regular mode as it
presents a source of energy for the node whenever the weather conditions are favorable,
allowing the node to operate for much longer and without the need for replacement of
batteries.
<figure><img src="image_7.png" /><figcaption>Fig. 6. Analysis of system operation in normal operation and with fuzzy logic management.</figcaption></figure>

# 6 Conclusions

The operation of IoT nodes in constrained environments, without connection to the electrical grid and being powered by a battery, requires the use of technologies and operating strategies that make the nodes energy efficient while ensuring their correct operation. In some situations, the use of proper hardware and technologies, and particularly low energy consumption communication protocols, could not be enough or attend the application requirements, being necessary to consider intelligent mechanisms to optimize their operation.

This paper presents a Fuzzy Logic system to dynamically self-manage the local energy consumption by self-adjusting some operation parameters, namely the sleep time and frequency of transmission, to increase the energy autonomy of the IoT node without compromising its QoS. The proposed Fuzzy approach considers the node's resource demands, the battery level and the charging factor to determine the most suitable operation mode. This approach was implemented in an ESP8266 that has connected sensors to measure the temperature, humidity, luminosity, UV index and soil moisture, transmitted to the Cloud using Wi-Fi.

The experimental results show that the proposed approach was able to dynamically adjust the operating conditions to maintain the QoS, efficiently extending the battery lifespan for an extremely long time when compared to the standard operation of the IoT node. In addition, the experimental tests allowed to analyze the influence of running the Fuzzy Logic system locally in the IoT node or as a service in cloud platforms. The achieved results show the advantage of running locally in the IoT node in case that the update of the weather forecast is reduced when compared with the frequency to run the Fuzzy Logic algorithm.
Future work is devoted to analyze the effects of running intelligent mechanisms for energy efficiency in the overall energy consumption, as well as to analyze the dependency of the number of sensors, processing workload and ML technique in the energy efficiency.

## Acknowledgments.

This work has been supported by FCT - Fundação para a Ciência e Tecnologia within the Project Scope: UIDB/05757/2020. This work has been also partially conducted under the project "BIOMA - Bioeconomy integrated solutions for the mobilization of the Agro-food market" (POCI-01-0247-FEDER-046112), by "BIOMA" Consortium, and financed by European Regional Development Fund (ERDF), through the Incentive System to Research and Technological development, within the Portugal2020 Competitiveness and Internationalization Operational Program.

## References

1. Behm, S., Deetjen, U., Kaniyar, S., Methner, N., Münstermann, B.: Digital ecosystems for insurers: Opportunities through the internet of things (2019), https://www.mckinsey.com/industries/financial-services/our-insights/digital-ecosystems-for-insurers-opportunities-through-the-internet-of-things

2. Cerchecci, M., Luti, F., Mecocci, A., Parrino, S., Peruzzi, G., Pozzebon, A.: A low power IoT sensor node architecture for waste management within smart cities context. Sensors 18(4), 1282 (apr 2018). https://doi.org/10.3390/s18041282

3. Collotta, M., Pau, G.: Bluetooth for internet of things: A fuzzy approach to improve power management in smart homes. Computers & Electrical Engineering 44, 137–152 (may 2015). https://doi.org/10.1016/j.compeleceng.2015.01.005

4. Dehkordi, S.A., Farajzadeh, K., Rezazadeh, J., Farahbakhsh, R., Sandrasegaran, K., Dehkordi, M.A.: A survey on data aggregation techniques in IoT sensor networks. Wireless Networks 26(2), 1243–1263 (sep 2019). https://doi.org/10.1007/s11276-019-02142-z

5. Feng, X., Yan, F., Liu, X.: Study of Wireless Communication Technologies on Internet of Things for Precision Agriculture. Wireless Personal Communications 108(3), 1785–1802 (2019). https://doi.org/10.1007/s11277-019-06496-7; https://doi.org/10.1007/s11277-019-06496-7

6. Kagermann, H., Wahlster, W., Helbig, J.: Securing the Future of German Manufacturing Industry: Recommendations for Implementing the Strategic Initiative INDUSTRIE 4.0. Tech. rep., ACATECH (2013)

7. Kridi, D., Alves, A., Lemos, M., Rabelo, R.: Desenvolvimento de uma biblioteca fuzzy para o controle autônomo de um robô móvel em ambiente desconhecido (12 2011)

8. Manyika, J., Chui, M., Bisson, P., Woetzel, J., Dobbs, R., Bughin, J., Aharon, D.: Unlocking the potential of the internet of things (2015), https://www.mckinsey.com/business-functions/mckinsey-digital/our-insights/the-internet-of-things-the-value-of-digitizing-the-physical-world

9. Mengistu, D., Frisk, F.: Edge machine learning for energy efficiency of resource constrained iot devices. In: SPWID 2019: The Fifth International Conference on Smart Portable, Wearable, Implantable and Disability-oriented Devices and Systems (2019)
10. Peralta, G., Iglesias-Urkia, M., Barcelo, M., Gomez, R., Moran, A., Bilbao, J.: Fog computing based efficient IoT scheme for the industry 4.0. In: 2017 IEEE International Workshop of Electronics, Control, Measurement, Signals and their Application to Mechatronics (ECMSM). IEEE (may 2017). https://doi.org/10.1109/ecmsm.2017.7945879

11. Rani, K.S., N.Devarajan: Fuzzy based optimization for power management in wire- less sensor networks. International Journal of Computer Applications (0975 – 888) 48(4) (Jun 2012)

12. Turos, L., Csernáth, G., Csenteri, B.: Power management in iot weather station. In: 2018 International Conference and Exposition on Electrical And Power Engineering (EPE). pp. 0133-0138 (2018). https://doi.org/10.1109/ICEPE.2018.8559865