1. Introduction
The Internet of Things (IoT) is a model that aims to globally connect networks of physical and virtual devices, whose core is represented by the mixture both of different technologies and distributed intelligence [
1,
2]. The IoT scenarios need the scalability beyond millions of devices because it is clear that centralized solutions surely reach their bounds [
3]. In fact, in this case, if the central node collapses, then all network infrastructure is subject to the same problem because the various devices, belonging to the Network of Things, do not possibly have direct communication between those that are not coordinators. Obviously, the solution to this problem may be the implementation of network architectures where all nodes can communicate with each other and not just with the coordinator. As a consequence, the result would be a Machine-to-Machine (M2M) communication in a mesh network. In these last years, several standardized protocols and interfaces have been developed to address device heterogeneity and to enable universal access [
4]. The achievement of global connectivity was the goal. However, it is necessary to note that the resources afforded by the IoT devices not only need to be distinguished globally, but they must be addressable and discoverable [
5]. The same feature refers to services since their operation and interfaces need to also be identifiable. More in detail, the services should be loosely-coupled and must support mobility [
6], but, at the same time, maintaining the Quality of Service (QoS) constraints [
7].
Previously, wireless networks were viewed as highly unreliable and insecure [
8]. Nevertheless, over the past ten years, they have growth in reputation since clear advances have been achieved regarding the capacities of wireless connectivity, whereby, only in the last decade, wireless networks have been used by devices both with an end-user operating them actively and for transferring the network traffic. This result has been made possible since today’s wireless technologies can be considered considerably improved and matured. As a consequence, the concept of IoT has reached the forefront of wireless devices [
9]. In fact, originally, the devices that now belong to the IoT were rigidly self-sufficient and had no network aptitudes. On the contrary, now many of them can be combined with a wireless network to afford automation and data management that was not achievable previously. The result is that with the extension of the IoT, more and more devices will depend on wireless networks.
The standardization of a wireless protocol is a primary requirement to accomplish the interoperability, not only between products of various vendors but also between different solutions, applications, and domains [
10]. The latter are of particular interest to IoT and wireless networks since the universal access to devices and sensors from various application areas, leading to new cross-domain applications, is an important purpose of the IoT. Considering the aim of wireless networks in IoT scenarios to grant data transfer between “things” and applications embracing several domains, the communication and information layer standards are of central concerns, but also different application areas might use generic functions [
9]. For these reasons, several wireless protocols have been developed and presented in these last years with the aim of becoming the reference standard for IoT applications.
Nevertheless, there is a central requirement that establishes a wireless protocol ideal and suitable for use in the IoT, which is the energy consumption [
11]. In common cases, the devices are battery-powered, as a consequence, a low-power characteristic is a fundamental requirement. For instance, in few cases, a possible solution is to develop ad-hoc devices [
12]. On the contrary, in the development of devices that use a wireless protocol, several solutions can be employed to improve the energy efficiency [
13]. In fact, the goal is to achieve the lowest possible power consumption. To this end, in [
14], an algorithm for scheduling a beacon interval based on the video frame size distribution to improve the energy efficiency of wireless devices is introduced. The proposed algorithm employs the statistical distribution for the dimension of video frames and changes the lengths of awake periods in a beacon interval dynamically. However, although the proposed approach is interesting and fairly efficient, its applicability is not scalable to all wireless protocols. A smart solution for the management of battery-powered wireless device used in street lighting is proposed in [
15] and subsequently further enhanced in [
16]. The reference scenario is a smart city of the Internet of Things. The approach introduced by the authors is interesting and the results obtained are promising both for street lamp management and for energy efficiency. However, these works can be further improved by applying new techniques, such as soft computing, to maximize even more the energy efficiency of wireless devices. A new distributed topology control solution for low-power IoT wireless communications is proposed in [
17]. The authors focus on the development of asynchronous and asymmetric neighbor discovery method by mixing the concept of the combinatorial block design. The collected results show that the solution proposed by the authors discovers neighbors quickly with minimum battery power compared with other protocols. Nevertheless, this approach to prolong battery life is only applicable in distributed topology control contexts. In [
18], the authors introduce an energy-quality-balanced technique that operates in association with an energy-aware routing algorithm for wireless mesh devices. The goal is to maintain some degree of content delivery data rate trying to prolong the battery of wireless devices. The proposal is interesting and allows to obtain up to 23% energy savings. However, it is suitable only for wireless mesh networks. A new energy efficient algorithm is proposed in [
19] to maximize the lifetime of a wireless network. This algorithm takes into account the coverage and the connectivity of wireless nodes. The aim not only is to extend the life of the wireless networks but also to meet the QoS metrics. The results of simulations are promising. Nevertheless, the solution has been only simulated, so the authors did not address both the feasibility and the viability on real hardware. In addition, the kernel of the approach relies on Medium Access Control (MAC) scheduling adjustment, which is not always feasible with all devices on the market. A new approach, based on a distributed fuzzy logic control method, is proposed in [
20]. This fuzzy logic engine is developed on each wireless network node to decrease the number of message transmissions. As a consequence, the battery life can benefit from the number of transmissions reduction. The approach presented by the authors is compared with other solutions in the literature, achieving only satisfactory results, but, even in this case, it has not been tested on real hardware. In fact, its implementation could be quite complex. The authors of [
21] introduce a solution for joint duty-cycle and transmission power control management suitable for wireless networks. This approach takes into account the energy harvesting level as well as the wireless channel conditions. The authors simultaneously manage both the transmission period and the transmission power. In fact, the method introduced by the authors fits the wireless channel conditions and controls the transmission power to maintain a good link a to minimize the energy consumption. The approach is interesting, and the results are promising. However, mobile nodes are not taken into account by the authors.
It is clear that many approaches can be implemented to achieve an efficient battery management. Obviously, apart from these specific solutions, a remarkable contribution to a low energy consumption is given by the specific wireless protocol. Concerning the wireless protocols that can be employed in IoT applications, the choice is quite wide. Obviously, it is appropriate to briefly analyze only the protocols that in the last few years have received a larger agreement. Different functions can be automated in everyday life by embedding a small computer, with limited storage and communication capacities, in physical objects placed in the environment. As a consequence, these objects become smart. A possible wireless network of these smart objects employing the Internet Protocol (IP) is called 6LoWPAN [
22], or IPv6 over Low-power Wireless Personal Area Networks. As it is known, IPv6 grants a large address space to connect billions of uniquely identifiable smart objects with the Internet. 6LoWPAN could be an IoT enabling technology that should allow running the heavyweight IPv6 protocol in resource-constrained devices, by giving compression and fragmentation capacities. Unlike traditional wireless networks, 6LoWPAN networks are being deployed in environments where the users are an integral component of the system. Nevertheless, currently, this standard has not been integrated into any commonly used devices, such as smartphones, tablets, or computers.
Low-power IEEE 802.15.4 [
23] is the standard in the link and physical layers for 6LoWPAN networks. Furthermore, ZigBee [
24], another popular standard for WPANs (Wireless Personal Area Networks), is also based on the IEEE 802.15.4. It is designed to be a low-power and low-cost wireless mesh network standard originally formulated as a real alternative to Wi-Fi/Bluetooth Classic for self-organizing ad hoc digital networks. In fact, in ZigBee networks, any nodes can be the coordinator. However, the lack of native support for IEEE 802.15.4 in mobile devices (laptops, tablets, smartphones) is a real problem, mainly for mobile or temporarily mobile use cases. Even though IEEE 802.11/Wi-Fi [
25] technology looks attractive for IoT, the system developers have quickly realized that the power consumption associated with this technology is too high, leading to a short active time before recharging.
Other new technologies are emerging aiming at an energy-efficient communication. Among them, Bluetooth Low Energy (BLE) is an appealing solution. It is useful to remark that in 2003 the Bluetooth technology was supposed to be dead [
26], but, fortunately, that did not occur because Bluetooth has experienced great popularity and success in the last ten years in various application areas. Nowadays, this wireless protocol is aiming mainly to short-range wireless communication markets [
27,
28], such as the IoT and Machine-to-Machine (M2M) communications [
29]. Bluetooth Low Energy, also known as Bluetooth Smart [
30], is a lightweight alternative to Bluetooth Classic designed for low-power resource-constrained devices. The Bluetooth Special Interest Group (SIG) introduced the Bluetooth Low Energy (BLE) to attract application developers of emerging IoT. BLE was first specified in Bluetooth 4.0 [
31] and further enhanced in Bluetooth 4.1 [
32] and 4.2 [
33]. Recently, the Bluetooth SIG has presented the specifications of Bluetooth 5 [
34], whose main aim is to offer significant improvements compared to the previous specification, regarding the speed, range, and broadcasting capacity. In the twisted battle for the control over the IoT communication standards, these new advantages might help BLE to prevail and to become the ultimate standard for IoT. This article provides an overview of the new enhancements introduced by Bluetooth 5 and describes the potential benefits of each one. An analysis on how these improvements will enable current and future applications is presented, showing how Bluetooth 5 will be a very competitive technology in the envisioned IoT applications. Freshly, the Bluetooth SIG has introduced the specifications of Bluetooth 5 [
34], whose main aim is to accomplish important enhancements compared to the previous versions of the protocol, concerning the speed, range, and broadcasting capacity. In the twisted battle for the control over the IoT communication standards, these new advantages might help BLE to prevail and to become the ultimate standard for IoT.
Nevertheless, for Bluetooth to be suitable for M2M and IoT applications [
35], it must decrease the power consumption [
36], so that it can be employed in battery-powered devices for a longer period. In fact, as mentioned above, IoT devices have to be connected, but power consumption is usually a real concern. For instance, considering wearable devices, such as fitness wristbands, the time between recharging could make or break the commercial viability of a product. For this reason, the improvements introduced by Bluetooth 5 [
34] not only concern the speed, range, and broadcasting capacity but primarily aim at better energy management through the use of different communication modes. In fact, these modes can be set in the device according to its distance with the beacon node. However, the devices can be mobile, so it is not possible to use always the same communication mode when the distance to the beacon is variable.
This paper proposes a fuzzy logic based approach to coping with the choice of the best communication mode in Bluetooth 5 that allow the achievement of an efficient energy management. In the proposed smart solution, the communication mode of mobile devices is dynamically regulated, based on the transmission (TX) power, by a Fuzzy Logic Controller (FLC). In fact, the application of rule-based FLCs facilitates the implementation of multi-criteria control procedures. Fuzzy logic is capable of making real-time decisions, even with incomplete information. Additionally, a Particle Swarm Optimization (PSO) algorithm is presented in this paper to achieve the optimal values and parameters of the proposed FLC. In detail, the PSO is used to optimize the membership functions, by varying their range to reach the best results concerning the battery life of mobile nodes. PSO is an evolutionary calculation technique proposed by Kennedy and Eberhart in 1995 [
37]. It is part of Swarm Intelligent (SI) methods and is recognized as an efficient heuristic procedure for optimization problem in a continuous and multidimensional search spaces. In fact, for these optimization problems, the PSO algorithm reaches high-quality solutions through a lower computational cost, compared to other stochastic techniques such as Genetic Algorithm (GA). PSO is an all-around population-based optimization method and has its foundation in the SI algorithms. These last handle the configuration of smart multi-agent systems by receiving stimulation from the combined actions of social insects, such as termites, wasps, ants, bees and as well as from groups of animals—for instance, schools of fish or flocks of birds. In the PSO technique, the particles, which outline possible solutions, move around in the phase space with a velocity refreshed by the particle’s experience, the experience of the particle’s neighbors or the experience of the whole swarm.
PSO has been applied in many papers with the aim to optimize a FLC. For instance, in [
38], the PSO is introduced for wind turbine converters, in [
39,
40] for photovoltaic systems, in [
41] for neural networks training, in [
42] for DC/DC converter, in [
43,
44,
45] for energy management, in [
46] for Unmanned Aerial Vehicle (UAV) management and control, in [
47] for clustering, and so on. The results shown in all these works confirm that an optimization through the PSO can lead to valuable advantages regarding the performance of approaches based on a fuzzy controller. This feature is also valid in this paper because validations prove the benefits of the solution proposed in this work. Furthermore, to the best of our knowledge, there are no papers in the literature in which the PSO is applied for the optimization of a FLC to choice the communication mode in Bluetooth 5 that allow the best energy management.
This paper is organized as follows.
Section 2 provides an overview of the new enhancements introduced by Bluetooth 5 and describes the potential benefits of each one. The proposed system model is introduced in
Section 3, showing the design of the suggested intelligent FLC.
Section 4 shows how PSO works and presents the proposed PSO algorithm for FLC optimization.
Section 5 assesses the performance obtained in testbed scenarios and, finally,
Section 6 concludes the paper.
2. Overview on Bluetooth 5
Contrary preceding versions of the Bluetooth standard, published as “.0” and succeeded by updates, such as Bluetooth 4.1 and 4.2, the new standard is simply known as Bluetooth 5. The classic version of Bluetooth 5 is equal to the previous, while the innovations focus on the BLE version. It is crucial to remark that according to the specification [
34] introduced by the SIG, the hardware boards can support three types of Bluetooth connections. They are BLE 4.x, Bluetooth 5 at 2 Mbps, and Bluetooth 5 Coded. BLE 4.x is the connection model employed by the Bluetooth Low Energy spec, i.e., 4.0, 4.1 and 4.2. This connection type is identified as the BLE at 1 Mbps because that is its estimated rate at the lowest layer before protocol overheads are attached. Bluetooth 5 at 2 Mbps is the new high-speed connection that has been introduced with Bluetooth 5. In this case, at the lowest layer, its speed is 2 Mbps. Bluetooth 5 Coded is a new special connection type that comes with Bluetooth 5. Its aim is to implement long-range Bluetooth connections, but with a low bit rate. As a consequence, the main purpose is a larger range rather than speed. The specifications of Bluetooth versions are depicted in
Table 1. Moreover, an analysis of the innovations that the SIG has introduced with Bluetooth 5 is carried out in the following subsections.
2.1. Long Range
Bluetooth 4.x has a range between 50 and 100 m, which is reduced to 10/20 m in indoor environments due to walls or obstacles. Bluetooth 5 proposes to quadruple the range of BLE devices. In fact, in the worst case, this range should be 200 m outdoors and about 40 m indoors. This goal can be accomplished since Bluetooth 5 introduces a special connection type, developed for long distance communications. This operating mode aims at the IoT, where it is necessary to place low-cost nodes/devices all over a building or in an open space and collect data. These gathered data could be anything from temperature, light, humidity, traffic monitors or movement detectors, and so on. Nevertheless, these devices/sensors require to send their data to a central hub/gateway and, mainly, need a power supply. If the device is combined to the main electricity, then the power supply is not a problem. In this case, for instance, the device could use Wi-Fi to communicate. Nonetheless, the demand for energy consumption and Wi-Fi coverage restricts the scope and potential of such devices.
In this scenario, Bluetooth 5 can prove its strength. In fact, the devices that use Bluetooth do not necessarily need mains power. They could be placed with just a battery to power them. A feasible solution to increase the range without growing the energy consumption is to decrease the data rate. An awesome innovation of the PHY (physical layer) changes in Bluetooth 5 is the way for increasing the sensitivity. It is implemented only in the LE Coded connection type. Typically, in BLE, the packet headers and payloads are un-coded, i.e., 1 bit refers to 1 modulated symbol. This feature remains fixed for both 1 Mbps and 2 Mbps connection mode. However, in the LE Coded connection mode included in Bluetooth 5, two network data rates can be used, which are 500 Kbps and 125 Kbps. In these cases, the payloads have many symbols for each bit,
S = 2 for 500 Kbps and
S = 8 for 125 Kbps, where
S is the symbol/bit rate (
Table 2). As a consequence, more symbols per bit allows an extended tolerance with a poor signal to noise ratio, and still provide a recoverable data stream, whereby, a receiver can repair bit errors on the receiving side of a communication link. This mechanism happens completely in hardware in a transparent way to the developer. The coding process includes two stages. The first is the Forward Error Correction (FEC), and, subsequently, a pattern mapper outlines a bit code to the input bits. The result of these steps is a spreading of the data that provides a recovery using the FEC if bit errors occur. As a result, thanks to the mixed use of the FEC and the pattern mapping, an enhanced ability to recover the received bit stream is reached. This goal can be achieved in conditions, where the Signal-to-Noise Ratio (SNR) is lessened to a level that data recovery would be impossible without the LE Coded mode.
Concerning the range, the question focuses on the selection of the 125 Kbps or 500 Kbps data rate. It is clear that this choice is strictly related to the needs of the specific application. In fact, with 500 Kbps, it is possible to obtain about twice the range of standard BLE at 1 Mbps, while, on the contrary, with 125 Kbps twice the range of 500 Kbps can be obtained. The bit time on air is different, becoming longer from 1 Mbps to 500 Kbps and then still longer to 125 Kbps. As a consequence, 500 Kbps allow to obtain the extra range and do not spend as long on-air time as 125 Kbps. In this way, the collision with other devices is reduced, at the same time, less power is consumed. However, considering the packet structure, when LE Coded mode is used, shown in
Figure 1, a notable portion of the packet is the preamble address, and coding is at 125 Kbps all the time, even when selecting 500 Kbps, which happen in the 1 bit CI (Connection Interval) field of the packet. In fact, for quite simple sensor/actuator operations, for instance, from 4 and up to 8 bytes, it is not possible to save that much at 500 Kbps over 125 Kbps regarding collision avoidance or power consumption, while the larger range is sacrificed. Only the two following CRC (Cyclic Redundancy Check) fields (
Figure 1) are read at 500 Kbps since everything else, i.e., the majority, is at 125 Kbps. As a result, for simple sensor/actuator operations, it is preferable to use 125 Kbps to get the extra range, while, for larger data transmissions of tens of bytes or more, the data rate of 500 Kbps can be employed to obtain its advantages.
2.2. More Speed
The increase in the data transfer speed is a crucial feature. Future wearable devices will synchronize with twice the speed of the current ones. The rate of current Bluetooth standard for delivering data to the platform is sufficient, for most applications. In fact, the speed is not a huge issue in many IoT utilizations that don’t involve streaming. For instance, considering wearable devices, such as fitness wristbands, the amount of data to be transferred is almost modest, and the currently supported BLE data rate is sufficient. Nevertheless, even for such wearable devices, higher transfer speed can allow faster software and firmware updates and enhances the user experience.
It is useful to remark that, already with Bluetooth 4.2, significant improvements in network data throughput became possible. In fact, about 700 Kbps can be accomplished for the application data rate. This progress has been possible both through the extension of maximum packet size and other enhancements in the ratio between the data and the overhead. Bluetooth 5 consolidates the packet extension feature of Bluetooth 4.2. In fact, by increasing the on-air transfer speed, the achievable network data throughput is doubled, about up to 1400 Kbps. Earlier, a packet of data (actually 251 bytes) could be transported in a set time frame of 2120 microseconds. On the contrary, at present, with Bluetooth 5, the same data can be sent in 1060 microseconds. Nevertheless, a real doubling of the data rate is not achievable because the inter-frame space (the period between two consecutive packets) remains the same as with Bluetooth 4. The data is sent faster, but the gap among the packets has not been reduced. Anyhow, considering the specs and some mathematical calculations, right now Bluetooth 5 is about 1.7 times faster than BLE 4.2. In addition to opening up new application opportunities, another significant advantage of having a 2 Mbps data transfer speed is that the energy savings could be an option. For instance, assuming that both sides of the link support the 2 Mbps data transfer speed mode, it could be possible to carry out operations twice as fast as before on-air. Obviously, this feature involves being on-air half as long, i.e., using possibly half the RF (Radio Frequency) transmission energy on average. Moreover, due to less time present on-air, the risk of collision with other communicating devices can be decreased. This feature could be more helpful over time as many devices could shift to using the 2 Mbps mode for their communication activities.
2.3. Beacon Diffusion
Proximity devices and beacon systems are accessories and chipsets capable of automatically sending, to every device in the vicinity, localized information. Another important enhancement that arises with Bluetooth 5 is the extended broadcast capacity compared to previously versions. This improvement could have a meaningful result in the world of beacons and will grow the range of use cases for them. In fact, Bluetooth 5 also enhances the capability of sending special data packets, called “advertising packets”. This communication strategy enables two Bluetooth devices to transfer packets and information even if they are not synchronized with each other. In the new standard, the packets are larger, and this makes it possible to send more information also to asynchronous devices. This perspective is fundamental to the development of an IoT network.
With larger packets and LE Coded mode, it is probable that advertising channels could become overfilled with traffic. This situation can usually occur on the three advertising channels with small packets, equal to or less than 31 bytes. On the contrary, when larger packets (up to 255 bytes) are used, a new non-advertising channel is negotiated, and the longer data packet is transmitted on this non-advertising channel. Both the variation in advertising and the use of non-advertising channels for data payloads involve a synchronization to make known both to the transmitter and the receiver where exchange data. This feature is known as the Advertising Extensions (AE), which represent a technique for transmitting Periodic Advertisements (PA) on a deterministic period to establish true connectionless broadcast. The PA uses a selection algorithm for channels and intervals in the same way as a connection occurs.
2.4. Battery Life
The increased range and speed could suggest a higher energy consumption. Nevertheless, thanks to some ingenious design, such as the way in which the signal is modulated and the improvement in the use of the frequency spectrum, Bluetooth 5 can use fewer energy resources. In fact, in the best case, it can consume about two times less power than the previous version of Bluetooth. If the speed is doubled in a wired device, the direct result is doubling of energy consumption. It should be noted, however, that Bluetooth also operates at 2.4 GHz and this radio frequency commands the power consumption, not the data rate. Bluetooth 5 allows exchanging twice the amount of data, and the result is that the device consumes half the power to transfer the same data. In fact, the PHY layer of Bluetooth 5 has endured its biggest change since the presentation of Bluetooth 4.x. Until now, the on-air data rate of 1 Mbps, at up to a maximum output power of +10 dBm, was the only one available for BLE. As mentioned above, the goals of Bluetooth 5 were extended range through greater sensitivity and higher peak output power, at the same time maintaining or reducing the average power. It is necessary to note that Bluetooth needed to be as good or better than comparative IEEE 802.15.4 solutions to become a real competing technology within living environments. For this reason, new BLE output power classes have been introduced in Bluetooth 5.
3. The Proposed Fuzzy-Based Solution
Mobile devices have now matured as an integral part of people lives. For instance, they have extensively employed everywhere in the society with many applications in various sectors, which include smart cities, smart houses, irrigation systems, healthcare and much more. What differentiates Bluetooth 5 from its antecedents is the way in which it manages the beacons, i.e., packets/messages that can be sent continuously from a “presenting” device and received by nearby mobile users on their smartphones, tablets or wearable devices. A Bluetooth 5 beacon does not need the pairing that occurs with headsets, speakers, and other Bluetooth accessories. Considering that the beacon can transmit information when a mobile Bluetooth-enabled device reaches into range, site-specific content, location-enabled marketing, process updates, and other applications become feasible. For instance, a typical case may be a big shopping center, within which each store will have its Bluetooth beacon capable of sending a message, maybe related to offers or promotions, to nearby users.
The new connection modes introduced in Bluetooth 5 allow having a much larger coverage range. In this way, the beacons can reach mobile devices located at distances that were previously unreachable. There is an import requirement that Bluetooth 5 must respect to be entirely suitable for the Internet of Things that is energy efficiency. The new power classes introduced in Bluetooth 5 allow a slightly better power management than Bluetooth 4.x. On the contrary, the choice of the proper communication mode (presented in Sub
Section 2.1) can surely improve the battery life of mobile devices. Obviously, the connection mode is closely related to the transmission power to be used. In fact, the latter enables to reach a greater or lesser range. The different connection modes of Bluetooth 5 can be applied in different application scenarios, but they differ mainly in the coverage range. However, in the case of mobile devices, it is not desirable to set a connection mode statically. In fact, considering the LE Coded mode at 125 Kbps , it is true that it reaches the maximum coverage range but does not guarantee the better battery consumption. If the mobile node approaches the beacon, its connection mode should be changed, for instance in LE Coded at 500 Kbps or after at 2 Mbps or 1 Mbps. In addition, as noted above, the application of different techniques, which are not usually provided by the protocol, can significantly increase the battery life of mobile wireless devices.
A generalized illustration of the solution introduced in this paper is represented in
Figure 2. It clearly presents what are the input parameters of the FLC and also the one that returns as output. It is valuable to remark that the proposed FLC is employed to choose the communication mode in Bluetooth 5, based on the transmission power, that allow the best energy management of mobile nodes. The composition of the proposed FLC shown in
Figure 2 is quite simple because it permits both an easy implementation on real devices and especially a low computational complexity. The proposed smart system involves small data exchanges, as the data to be managed by the FLC are the distance between the mobile node and the beacon and the battery level. As a consequence, there is a lower computing power. On the contrary, other methods based on complex fuzzy controllers (such as Type-2 fuzzy or Petri net), other schemes that employ many controllers in parallel or other solutions that take into account several parameters as input to the controller, need a higher computational cost. These benefits of the proposed FLC not only yield to realize the solution presented in this paper on low-cost devices but are also expected to be beneficial concerning lower data processing times and lower control actuation times for the fuzzy logic controllers.
3.1. Distance Estimating
As revealed in
Figure 2, in the proposed method, the mobile node employs an FLC to determine the proper communication mode among those introduced in Bluetooth 5 (
Table 2) based on the required TX power. However, the mobile node defines the communication mode also based on the battery level and its distance from the beacon. Different solutions can be adopted to evaluate this distance. Generally, in radio frequency communications, the Received Signal Strength Indicator (RSSI) is a widely used parameter for assessing both the quality of a signal and the distance between wireless devices. In fact, the RSSI is a measure of how strongly a device can “hear” a signal from another one, such as an access point, a router, or a beacon. Theoretically, RSSI is inversely proportional to the square of the distance between the two devices. Another method to determine the distance is to use the Friis equation, also applied and rearranged in the model proposed in [
48]:
where
is the transmit power;
and
are the antenna gains, so the total antenna gain is
;
c is the speed of light (
m/s);
f is the central frequency (i.e., 2.44 GHz);
n is the attenuation factor (i.e., 2 in free space); and, finally,
d is the distance between transmitter and receiver (in meters). The distance
d can be calculated from Equation (
1) as follows:
Nevertheless, it is essential to note that the model shown in Equations (
1) and (
2) can only be employed in theory. In fact, the correlation between the RSSI and distance becomes slightly more complicated both due to the environment (reflection, obstacles, noise) and to antenna orientation.
Before clarifying how distance has been dealt with in this paper, further clarifications have to be made. In fact, usually, a misunderstanding can be generated when referring to dBm and RSSI. They are distinct units of measurement that, however, denote the same parameter, i.e., the signal strength. The RSSI is a relative index. On the contrary, dBm, seldom expressed as decibel-milliwatts or dBmW, is an acronym for the power ratio in decibels (dB) of the calculated power associated to 1 milliwatt (mW). The dBm value is employed as a useful measure of absolute power since of its ability to describe both quite large and quite small values in a short form. Considering that it is associated to the Watt, the dBm value is an absolute unit, used when estimating the absolute power. It is useful to note that the decibel (dB) is a non-dimensional unit, employed for determining the ratio between two values, such as signal-to-noise ratio. Regarding the RSSI, a higher value denotes a stronger signal.
Unlike the received power, the RSSI is a relative measure that is frequently established by each chip manufacturer. In fact, there is no standardized relation of each specific physical parameter to the RSSI interpretation. For instance, a manufacturer could have an RSSI range from 0 to −60 while another one will return RSSI values from 0 to −100. However, there is a certainty, that is the higher the RSSI value is, the better the signal is. Moreover, the RSSI estimation can be very helpful in the proximity applications, for instance, to obtain the trend of the RSSI values changes. In fact, this trend could provide very significant information, for instance, if the mobile device is going towards or away from the beacon. Furthermore, if the precise mapping between the RSSI and the location of the distinct receiving device is understood, it could be possible to have a quite accurate estimation of the distance, taking into account likely multipath effects. An example of the correlation between the distance and the RSSI is shown in
Figure 3. It is clear that, when the RSSI is taken into account for proximity applications, the value floats in range due to the environmental influence. For this reason, is it useful to employ a “summarizing” statistic. In this paper, a sampling algorithm which gives the “Mode” (i.e., the value that occurs most frequently) of the RSSI sample set in a period has been implemented in the mobile node to filter out the environmental influence. The “Mode” has been chosen compared to other “summarizing” statistics, such as Mean or Trimmed-Mean, since the resulting value of RSSI was surely measured by the mobile device previously. In fact, it is the value that most frequently occurs. On the contrary, considering the other mentioned approaches, the final value of RSSI is the result of a different math processing, and possibly it has never been concretely measured by the mobile device. Then, in this latter case, the resulting value of RSSI could be incorrect (flawed). The value obtained using the sampling algorithm which gives the “Mode’ can closely match the actual signal strength and filter out the noise. In addition, another characteristic that has been taken into account in the proposed solution is the Measured Power, i.e., a factory-calibrated, read-only constant on hardware, which specifies what is the expected RSSI at a distance of 1 meter to the beacon. As a consequence, combined with RSSI, the Measured Power permits estimating the distance between the mobile device and the beacon in a proper way.
3.2. Fuzzy Inference System
Following the explanation of the proposed Fuzzy Logic Controller design, it is now appropriate to focus on the fuzzy inference system that determines the TX power, and, particularly, defining briefly the membership functions considered in this paper. The proposed FLC employs three membership functions (Low, Medium, High) for each input and output variable. These functions fuzzify the crisp inputs, while their ranges are:
distance: (m);
battery level: (digital value), where 0 expresses the lowest level of battery while 1024 denotes the highest level of the battery, and it is the maximum value at the output of a 10-bit AD converter (with an appropriate electronic signal conditioning circuit);
TX power:
(dBm), where +8 dBm value is the maximum transmission power and −20 dBm is the minimum one considering the SoC (system-on-a-chip) used in this paper for performance evaluation, i.e., the nRF52840 (Nordic Semiconductor, Trondheim, Oslo, Norway) [
49]. However, this range can be adapted based on the specific SoC.
The triangular membership functions of the distance, battery level and the TX power are represented in
Figure 4, where the degree of membership is realized by normalized values
. As depicted in
Table 3 , the output value is determined through nine fuzzy rules based on the
IF-THEN statement of traditional programming languages. For instance, considering rule 6, if distance is Medium and battery level is High, the TX power will be Medium. As it is acknowledged, in an inference mechanism the outputs are fuzzy variables. For this reason, the FLC must convert its internal fuzzy output variables in crisp values, by the defuzzification method, so that the actual system can handle them. Several approaches can perform the defuzzification process. In the fuzzy solution introduced in this work, the Centroid of Area (COA) method [
50] has been preferred. In this scheme, the centroid of each membership function, for each rule, is first estimated. The final output is then estimated as the average of the individual centroid weighted by their membership values as follows:
where
is the output of rule base
i, and
is the centre of the output membership function.