Robust Localization for Robot and IoT Using RSSI

: Node-localization technology has been supported in the wireless sensor network (WSN) environment. Node localization is based on a few access-point (AP) nodes that comprises positioning information because they are ﬁxed, and a beacon node that comprises unknown positioning information because it is moving. To determine the position of the unknown node, it must use two or three APs that comprise certain positioning information. There are a number of representative range-based methods, including time of arrival (TOA), weighted centroid locating algorithm, received signal strength intensity (RSSI), and time di ﬀ erence of arrival (TDOA) signal, that are received by the receiver. The RSSI method has its advantages. A simple device structure means that the RSSI method is easy to use. Because the structures of previous wireless local area network (LAN) technologies make them compatible with RSSI information, the RSSI method is widely used in the related area of position tracking. In addition, this algorithm has a hardware system that cannot be increased, has the advantage of the miniaturization of the node, and can wear through obstacles. This paper proposes the application of a robust ranging method that can be applied in robots and Internet of Things (IoT) using RSSI, especially in the tracing location of each nursing home patient, where the RSSI method with trilateral technique is used. This paper shows the results of the measured point from the application of the trilateral technique, and it also represents the results of the error distance between the ideal point and the measured point using computer simulation. Finally, this paper presents an estimation of localization using a real experimental device with a BLE (Bluetooth low-energy) transmitter and receiver, and beacon gateway, by applying an RSSI algorithm with the trilateral technique.

Among the IoT and robot technologies, one of the key technologies requires localization [9][10][11][12] of humans or robots by using sensors or other devices.This technique has been called "node localization" or just "localization".Generally, node localization requires real time to confirm a node's location; therefore, a real-time locating system (RTLS) that searches for node locations in real time is typically used to identify the locations of sensors, objects, robots, and humans.Most RTLSs that are released onto the market are used with wireless communication technology of a 2.45 GHz-frequency bandwidth that is applicable for an active radio-frequency-identification (RFID) system.
The node-localization technology has been supported in a WSN context.In recent years, research on node-localization problems has been more extensive, in accordance with the progress of IoT technologies.Generally, nodes are divided into beacon or access point (AP) nodes, and unknown node (beacon) and the known node (AP).Node localization is based on several AP nodes that contain Energies 2019, 12, 2212 2 of 18 positioning information because they are fixed, and a beacon node that contains unknown positioning information because it is moving.To determine the position of the unknown node, two or three APs that comprise certain positioning information must be used.
The range-based algorithm is defined by protocols that use absolute point-to-point distance estimates of the distance or angle between beacon and AP.The range-free algorithm focuses on a more cost-effective method than range-based algorithms, because it does not need to assume the availability or validity of information.The fusion algorithms consist of the integration of the range-based and range-free algorithms.However, this algorithm has the complication of having to calculate the localization, compared with the range-free or the range-based algorithms.
TOA uses the propagation time that is taken between the transmitter and the receiver.The TOA has some advantages such as having a simple algorithm, easy implementation, and accurate localization.In addition, it also has disadvantages: it has to maintain the clock synchronization between the transmitting and receiving devices, it is affected by the multipath effect, and it needs a sound wave transceiver.In order to obtain the time that is taken to transfer a signal between the tag and the AP in the TOA method, a time-synchronization match needs to occur.However, such a match is difficult to attain.To match the time synchronization, the simple network time protocol (SNTP) must typically be applied.When this protocol is applied to the TOA method, the time synchronization can be matched for the APs; however, this is impossible for tagging.Because the precision of the AP time synchronization is as low as 1 second, this method is limited to the time synchronization for the localization of short distances.
TDOA applies the flight-time difference to a radio wave.The TDOA algorithm has very accurate localization performance, especially in the outside building, and also it does not require accurate clock synchronization between a transmitting and a receiving device.However, this algorithm has some problems, for example, it is affected by multipath effects like TOA, it needs to use an ultrasonic transceiver, and it depends upon the condition of the ultrasonic wave propagation distance.Further, another disadvantage of the TDOA is that many computations are required to calculate its time differences.
To achieve a solution for the time-synchronization problem in the TOA and TDOA methods, numerous methods have been proposed by many researchers [26].These methods measure the difference between the transfer time between the tag and the AP, and transform-distance time.The TDOA requires a matching of the time synchronization only for the AP and not for the tag.However, a technique needs to be developed for the TDOA method to match the high precision of the time synchronizations for all of the APs.
The weighted centroid-locating algorithm reflects the size of the reference node's decision on the centroid coordinate, and uses the weighting factor to reflect the influence of each reference node on the position of the centroid, reflecting their intrinsic relationship.This method has some advantages such as small communication overhead, low hardware requirements, and being suitable for sensor node processing.However, it also has some disadvantages, which include the fact that connectivity to the network demand is higher than for the other algorithm, and the required density of the beacon node is very large.
The AOA and the POA apply in the angle and the phase of arrival, respectively, to a radio wave.AOA and POA algorithms also have accurate localization performances that are similar to TDOA or TOA, and they can also provide precise location information.Nevertheless, these are vulnerable to Energies 2019, 12, 2212 3 of 18 external environment influences, which require an ultrasonic transceiver.They are not suitable for a large-scale network because their power consumption is considerable.
The RSSI [27][28][29][30][31] is used to measure the strength intensity of the signal that is received by the receiver.There are also advantages to the RSSI method.A simple device structure means that the RSSI method is easy to use compared to other techniques such as TOA, TDOA, AOA, and POA.Because the structures of previous wireless local area network (LAN) technologies make them compatible with RSSI information, the RSSI method is widely used in the related area of position tracking.In addition, this algorithm has a hardware system that cannot be increased, the advantage of the miniaturization of the node, and can wear through obstacles.Regarding the disadvantages of the RSSI method, the accuracy of a position estimation that is made by using RSSI varies according to the accuracy of the RSSI measurements and the circumstances that are obtained from a real mobile device.Therefore, the stability of the measured RSSI value is dependent upon the corresponding circumstances, and the value could be unstable.For instance, when the RSSI value between a directional-antenna tag and an AP is measured, the quality of an office partition or the wall material, and any obstacles that exist between the transmitter and the receiver such as a wall, column, furniture, or human, can significantly affect the signal-loss path.An RSSI positioning estimation also provides relatively low levels of accuracy and security.
Like the RSSI method, the TOA and TDOA methods may cause errors according to the propagation environment.The main cause of an error is multipath fading, and that occurs because there is no security for the line of sight (LOS).However, this error is not larger than the RSSI error, and the method has been proposed to solve this problem [16].
Table 1 shows the comparison of root mean square (RMS) error value after this paper tested each algorithm, including the weighted centroid-locating algorithm, the RSSI locating algorithm, and the TOA-locating algorithm, with 3 nodes for 6 times and 100 times by computer simulation.Particularly, the case of the RSSI-locating algorithm used 10mW transmit power.From Table 1, we know the RMS error value of TOA-locating algorithm is the smallest.However, it is difficult to match the TOA-locating algorithm with the time synchronization, so it is not easy to implement in the field.Even though the RMS error value of RSSI is bigger than TOA, RSSI is easy to implement in the real field without increasing hardware system.Therefore, this paper proposes the application of a robust ranging method that can be applied in the robot, IoT, and especially in tracing location of each patient of a nursing home by using the RSSI method.This paper shows the result of the measured point from the application of the trilateral technique, and this paper also represents the result of the error distance between the ideal point and the measured point by computer simulation.Finally, this paper presents an estimation of localization by an experimental device with a BLE (Bluetooth low-energy) transmitter and receiver, and a beacon gateway by applying the RSSI algorithm with the trilateral technique that is presented in computer simulation.

Signal-Propagation Model
The RSSI-based distance-measurement method involves the utilization of the signal-strength intensity of wireless mobile technology.This is a technique that connects signals to moving distances for the signal-power loss or signal-path loss between the tag and AP.
The free-space model has been utilized in WSNs as the most common signal-propagation model.This paper assumed that the receiver in the communication radius can receive the data in the free-space model; in this case, it can obtain the distance of the node from another node through the measurement of the received signal strength of the incoming radio signal.
Figure 1 shows the simplest form of the basic power transfer between a transmitter and a receiver in an antenna with distance r.

Signal-Propagation Model
The RSSI-based distance-measurement method involves the utilization of the signal-strength intensity of wireless mobile technology.This is a technique that connects signals to moving distances for the signal-power loss or signal-path loss between the tag and AP.
The free-space model has been utilized in WSNs as the most common signal-propagation model.This paper assumed that the receiver in the communication radius can receive the data in the freespace model; in this case, it can obtain the distance of the node from another node through the measurement of the received signal strength of the incoming radio signal.
Figure 1 shows the simplest form of the basic power transfer between a transmitter and a receiver in an antenna with distance r.Using Figure 1 as a basis, the relationship between the received power and the transmitted power through Equation (1) can be described, which was proposed by Friis [32], as follows: Where, PRX, PTX, GTX, and GRX are the received power at the receiver, the transmission power of the sender, transmitter gain, and the receiver for a mobile device or tag, respectively.λ is wavelength and r is the separated distance between the mobile device or the tag of the receiver and the transmitter.
This paper assumed that GTX = 1 and GRX = 1 in the embedded device.
From Equation (1), with Friis's free-space-transmission equation, it is possible to recognize that the detected signal strength in the receiver decreases in a quadratic form in accordance with the distance to the sender.

Power Law Model
An embedded system cannot directly apply Equation (1), because Equation ( 1) is not considered a non-line-of sight (NLOS) environment.To apply an embedded system with empirical experience, a new path-loss formula that is modified from Equation (1) needs to made.This could derive the relationship between the path loss (PL) and the distance (r) for the signal according to the following Equation ( 2): Equation ( 2) can be represented by Equation (3), as follows: Here, coefficient A and coefficient B are decided by the environment and frequency bandwidth for the use of the system; therefore, it is important to find the propagation model by using the RSSI in a localization system or a position-tracking system.The performance of either system depends on the way that coefficient A and coefficient B are decided from the Equation (3).In some instances, iEquation (4) or Equation ( 5) can be chosen to decide the polynomial coefficients, as follows: Using Figure 1 as a basis, the relationship between the received power and the transmitted power through Equation (1) can be described, which was proposed by Friis [32], as follows: where, P RX , P TX , G TX, and G RX are the received power at the receiver, the transmission power of the sender, transmitter gain, and the receiver for a mobile device or tag, respectively.λ is wavelength and r is the separated distance between the mobile device or the tag of the receiver and the transmitter.This paper assumed that G TX = 1 and G RX = 1 in the embedded device.
From Equation (1), with Friis's free-space-transmission equation, it is possible to recognize that the detected signal strength in the receiver decreases in a quadratic form in accordance with the distance to the sender.

Power Law Model
An embedded system cannot directly apply Equation (1), because Equation ( 1) is not considered a non-line-of sight (NLOS) environment.To apply an embedded system with empirical experience, a new path-loss formula that is modified from Equation (1) needs to made.This could derive the relationship between the path loss (P L ) and the distance (r) for the signal according to the following Equation (2): Equation ( 2) can be represented by Equation (3), as follows: Here, coefficient A and coefficient B are decided by the environment and frequency bandwidth for the use of the system; therefore, it is important to find the propagation model by using the RSSI in a localization system or a position-tracking system.The performance of either system depends Energies 2019, 12, 2212 5 of 18 on the way that coefficient A and coefficient B are decided from the Equation (3).In some instances, iEquation (4) or Equation ( 5) can be chosen to decide the polynomial coefficients, as follows: Although any propagation model can be used, it is not easy to overcome the RSSI method with the variety of propagation effects that exist.

Position Estimation with Trilateral Technique
Generally, in order to find the unknown node in the sensor node of the localization process, the distance from the AP to the unknown, adjacent beacon node needs to be calculated.This paper also needs to compute the relative angle between the AP and the unknown node as a moving device.
Typically, three algorithms-the trilateral technique, the triangulation technique, and the maximum-likelihood technique-are used to calculate the distance to the unknown node, and these techniques have been used in the field.Because the triangulation technique has large angle error and the maximum-likelihood technique has complex calculation process, generally, trilateral technique is used to calculate the distance to the unknown node.Therefore, this paper only focuses on trilateral technique.
Figure 2 shows the trilateral technique [20].The coordinates of the three nodes (5) Although any propagation model can be used, it is not easy to overcome the RSSI method with the variety of propagation effects that exist.

Position Estimation with Trilateral Technique
Generally, in order to find the unknown node in the sensor node of the localization process, the distance from the AP to the unknown, adjacent beacon node needs to be calculated.This paper also needs to compute the relative angle between the AP and the unknown node as a moving device.
Typically, three algorithms-the trilateral technique, the triangulation technique, and the maximum-likelihood technique-are used to calculate the distance to the unknown node, and these techniques have been used in the field.Because the triangulation technique has large angle error and the maximum-likelihood technique has complex calculation process, generally, trilateral technique is used to calculate the distance to the unknown node.Therefore, this paper only focuses on trilateral technique.
Figure 2 shows the trilateral technique [20].The coordinates of the three nodes (A, B, and C) are known as (xa,ya), (xb,yb), and(xc,yc), respectively.da, db, and dc are shown as the distances from the three known nodes, A, B, and C, respectively, to the unknown node D.
The coordinates of the unknown node are assumed as D (x,y).It obtained three distances (da, db, and dc) from the nonlinear system of equations using Equation ( 6), Equation ( 7), and Equation ( 8), as follows: Using a linearization method, this paper obtained the coordinates of point D from Equation ( 9), as follows: The coordinates of the unknown node are assumed as D (x,y).It obtained three distances (d a , d b , and d c ) from the nonlinear system of equations using Equations ( 6)-( 8), as follows: Using a linearization method, this paper obtained the coordinates of point D from Equation ( 9), as follows: Energies 2019, 12, 2212 6 of 18

RSSI Algorithm
This section discusses the computer simulation where the RSSI is used with the trilateral technique.Generally, radio signals are affected by a loss of energy intensity during the transmission from the node to the AP.A loss of energy intensity, as well as a radio-signal propagation distance, is in line with the corresponding mathematical relationship.The RSSI is the localization of the reference nodes, and takes advantage of this node of communication between the measurement distances.The radio-signal strength is reduced in accordance with the increase of the propagation distance during the transmission process; this is based on the AOA method diagram that is shown in Figure 3, as follows: Energies 2018, 11, x FOR PEER REVIEW 6 of 20

RSSI Algorithm
This section discusses the computer simulation where the RSSI is used with the trilateral technique.Generally, radio signals are affected by a loss of energy intensity during the transmission from the node to the AP.A loss of energy intensity, as well as a radio-signal propagation distance, is in line with the corresponding mathematical relationship.The RSSI is the localization of the reference nodes, and takes advantage of this node of communication between the measurement distances.The radio-signal strength is reduced in accordance with the increase of the propagation distance during the transmission process; this is based on the AOA method diagram that is shown in Figure 3, as follows: Where d is the distance between a target and a transducer, d0 is a distance between a reference and transducer, and R(d) and R(d0) are the radio-signal strength of the target and the radio-signal strength of the reference, respectively.
Using Equation (10) as a basis, it can therefore measure the signal strength of the RSSI between the target and the reference node, and then signal strength can be obtained regarding the communication distance d between the target and the reference node.
The RSSI principle is simple, and in terms of wireless transmitting, other auxiliary hardware does not need to be added to the receiving node.Furthermore, the cost is low.The RSSI is therefore used for the indoor localization for the tracing location of each nursing home patient.

Computer Simulation
Using Equation (9) and Equation (10), this paper performed a computer simulation to determine the location for the tracing location of each nursing home patient.Figure 4 shows the flow chart for computing localization process of the robot and IoT sensor.To reflect the real environment of hospital and building for computer simulation, researchers should consider the signal that can interfere with noise, signal reflection, diffraction, and so on when setting the noise factor of flow chart, as shown in Figure 4.The communication distance and the relational expression of the radio-signal strength is derived next, as shown in the following Equation ( 10): where d is the distance between a target and a transducer, d 0 is a distance between a reference and transducer, and R(d) and R(d 0 ) are the radio-signal strength of the target and the radio-signal strength of the reference, respectively.Using Equation (10) as a basis, it can therefore measure the signal strength of the RSSI between the target and the reference node, and then signal strength can be obtained regarding the communication distance d between the target and the reference node.
The RSSI principle is simple, and in terms of wireless transmitting, other auxiliary hardware does not need to be added to the receiving node.Furthermore, the cost is low.The RSSI is therefore used for the indoor localization for the tracing location of each nursing home patient.

Computer Simulation
Using Equations ( 9) and (10), this paper performed a computer simulation to determine the location for the tracing location of each nursing home patient.Figure 4 shows the flow chart for computing localization process of the robot and IoT sensor.To reflect the real environment of hospital and building for computer simulation, researchers should consider the signal that can interfere with noise, signal reflection, diffraction, and so on when setting the noise factor of flow chart, as shown in Figure 4.
For the computer simulation using RSSI, the size of space environment assumes 30 m × 30 m.For the computer simulation using RSSI, the size of space environment assumes 30 m × 30 m. Figure 5 to Figure 12  Figure 5 depicts the result of the localization computation with respect to the three provided RSSI values of −50.0537, −55.7224, and −58.5564 (dBm), respectively.From Figure 5, we recognize that the error is 0.4438 (m) between the location point of ideal and real position.Figure 6 shows the result of the localization computation with respect to the three provided RSSI values of −43.1889, −56.8906, and −53.8736 (dBm), respectively.From Figure 6, we recognize that the error is 0.9021 (m) between the location point of ideal and real position.Figure 6 shows the result of the localization computation with respect to the three provided RSSI values of −43.1889, −56.8906, and −53.8736 (dBm), respectively.From Figure 6, we recognize that the error is 0.9021 (m) between the location point of ideal and real position.Figure 8 shows the result of the localization computation with respect to the three provided RSSI values of −50.9142, −51.1982, and −58.7488 (dBm), respectively.From Figure 8, we recognize that the error is 0.4904 (m) between the location point of ideal and real position.Figure 9 shows the result of the localization computation with respect to the three provided RSSI values of −42.3353, −49.481, and −57.7724 (dBm), respectively.From Figure 9, we recognize that the error is 0.3905 (m) between the location point of ideal and real position.Figure 12 shows the result of the localization computation with respect to the three provided RSSI values of −44.7318, −50.7564, and −54.9525 (dBm), respectively.From Figure 12, we recognize that the error is 0.4610 (m) between the location point of ideal and real position.Figure 12 shows the result of the localization computation with respect to the three provided RSSI values of −44.7318, −50.7564, and −54.9525 (dBm), respectively.From Figure 12, we recognize that the error is 0.4610 (m) between the location point of ideal and real position.2 depict the error result between the ideal point and the estimated point when this paper performs eight calculations from Figure 5 to Figure 12.From Figure 13, we recognize that the maximum error occurs in Figure 6 which is 0.9021 (m).  Figure 6 shows the result of the localization computation with respect to the three provided RSSI values of −43.1889, −56.8906, and −53.8736 (dBm), respectively.From Figure 6, we recognize that the error is 0.9021 (m) between the location point of ideal and real position.
Figure 7 shows the result of the localization computation with respect to the three provided RSSI values of −54.1075, −52.4424, and −58.2356 (dBm), respectively.From Figure 7, we recognize that the error is 0.5759 (m) between the location point of ideal and real position.
Figure 8 shows the result of the localization computation with respect to the three provided RSSI values of −50.9142, −51.1982, and −58.7488 (dBm), respectively.From Figure 8, we recognize that the error is 0.4904 (m) between the location point of ideal and real position.
Figure 9 shows the result of the localization computation with respect to the three provided RSSI values of −42.3353, −49.481, and −57.7724 (dBm), respectively.From Figure 9, we recognize that the error is 0.3905 (m) between the location point of ideal and real position.
Figure 10 shows the result of the localization computation with respect to the three provided RSSI values of −45.1862, −55.7421, and −58.1185 (dBm) for respectively.From Figure 10, we recognize that the error is 0.4123 (m) between the location point of ideal and real position.
Figure 11 shows the result of the localization computation with respect to the three provided RSSI values of −38.4322, −50.0492, and −58.5565 (dBm), respectively.From Figure 11, we recognize that the error is 0.4314 (m) between the location point of ideal and real position.
Figure 12 shows the result of the localization computation with respect to the three provided RSSI values of −44.7318, −50.7564, and −54.9525 (dBm), respectively.From Figure 12, we recognize that the error is 0.4610 (m) between the location point of ideal and real position.
Figure 13 and Table 2 depict the error result between the ideal point and the estimated point when this paper performs eight calculations from Figure 5 to Figure 12.From Figure 13, we recognize that the maximum error occurs in Figure 6 which is 0.9021 (m).From Table 2, we know the RMS error is 0.536 (m).

Experimental Device and Result
This section describes the experimental device, and this paper also shows the results for RSSI algorithm for real hardware system.In order to apply RSSI algorithm to localization to robot, IoT, and tracing location of each nursing home patient, Bluetooth low-energy (BLE) transmitter and receiver need to be activated, and beacon gateway.The BLE transmitter and receiver, and beacon gateway, are shown in Figure 14, Figure 15, and Figure 16, respectively.From Table 2, we know the RMS error is 0.536 (m).

Experimental Device and Result
This section describes the experimental device, and this paper also shows the results for RSSI algorithm for real hardware system.In order to apply RSSI algorithm to localization to robot, IoT, and tracing location of each nursing home patient, Bluetooth low-energy (BLE) transmitter and receiver need to be activated, and beacon gateway.The BLE transmitter and receiver, and beacon gateway, are shown in Figures 14-16, respectively.From Table 2, we know the RMS error is 0.536 (m).

Experimental Device and Result
This section describes the experimental device, and this paper also shows the results for RSSI algorithm for real hardware system.In order to apply RSSI algorithm to localization to robot, IoT, and tracing location of each nursing home patient, Bluetooth low-energy (BLE) transmitter and receiver need to be activated, and beacon gateway.The BLE transmitter and receiver, and beacon gateway, are shown in Figure 14, Figure 15, and Figure 16, respectively.To test for communication between using BLE transmitter and receiver, beacon gateway, and, notebook, this paper has to establish configuration of testing system.The testing system consists of BLE transmitter and receiver; beacon gateway; notebook; and communication equipment such as USB-RS232 converter (CI-202US/ALL, Centos, Taiwan) and RS 485 converter (TCC-80, MOXA, Taiwan), as shown in Figure 18.To test for communication between using BLE transmitter and receiver, beacon gateway, and, notebook, this paper has to establish configuration of testing system.The testing system consists of BLE transmitter and receiver; beacon gateway; notebook; and communication equipment such as USB-RS232 converter (CI-202US/ALL, Centos, Taiwan) and RS 485 converter (TCC-80, MOXA, Taiwan), as shown in Figure 18.To test for communication between using BLE transmitter and receiver, beacon gateway, and, notebook, this paper has to establish configuration of testing system.The testing system consists of BLE transmitter and receiver; beacon gateway; notebook; and communication equipment such as USB-RS232 converter (CI-202US/ALL, Centos, Taiwan) and RS 485 converter (TCC-80, MOXA, Taiwan), as shown in Figure 18.To test for communication between using BLE transmitter and receiver, beacon gateway, and, notebook, this paper has to establish configuration of testing system.The testing system consists of BLE transmitter and receiver; beacon gateway; notebook; and communication equipment such as USB-RS232 converter (CI-202US/ALL, Centos, Taiwan) and RS 485 converter (TCC-80, MOXA, Taiwan), as shown in Figure 18.To apply RSSI algorithm in real space, this paper configures BLE receiver, as shown in Figure 19.The BLE receiver designed one receiver that could receive eight signals from hand-held BLE transmitter.From Figure 18 and Figure 19, the localization of robot, IoT, and tracing location of each patient by using RSSI algorithm can be tested, which are proposed in Section 3. Section 3 deals with computer simulation, and it assumes the area size is 30 m × 30 m.However, the experimental device applies in 20 m × 20 m because it cannot find such a size indoors.Figure 20 depicts the attached receivers in various places such as wall and ceiling.To apply RSSI algorithm in real space, this paper configures BLE receiver, as shown in Figure 19.
The BLE receiver designed one receiver that could receive eight signals from hand-held BLE transmitter.To apply RSSI algorithm in real space, this paper configures BLE receiver, as shown in Figure 19.The BLE receiver designed one receiver that could receive eight signals from hand-held BLE transmitter.From Figure 18 and Figure 19, the localization of robot, IoT, and tracing location of each patient by using RSSI algorithm can be tested, which are proposed in Section 3. Section 3 deals with computer simulation, and it assumes the area size is 30 m × 30 m.However, the experimental device applies in 20 m × 20 m because it cannot find such a size indoors.Figure 20 depicts the attached receivers in various places such as wall and ceiling.From Figures 18 and 19, the localization of robot, IoT, and tracing location of each patient by using RSSI algorithm can be tested, which are proposed in Section 3. Section 3 deals with computer simulation, and it assumes the area size is 30 m × 30 m.However, the experimental device applies in 20 m × 20 m because it cannot find such a size indoors.Figure 20 depicts the attached receivers in various places such as wall and ceiling.
Figures 18-20 show the test access (response) speed between hand-held BLE transmitter and server, hand-held BLE transmitter and beacon gateway, and DB server, respectively.Throughout these tests, the results were 60 (ms), 50 (ms) and maximum 16 (ms) for access (response) speed between hand-held BLE transmitter and server, hand-held BLE transmitter, and beacon gateway, and DB server, respectively.Table 3 represents the test items, references, and their results.Figure 18, Figure 19, and Figure 20 show the test access (response) speed between hand-held BLE transmitter and server, hand-held BLE transmitter and beacon gateway, and DB server, respectively.Throughout these tests, the results were 60 (ms), 50 (ms) and maximum 16 (ms) for access (response) speed between hand-held BLE transmitter and server, hand-held BLE transmitter, and beacon gateway, and DB server, respectively.Table 3 represents the test items, references, and their results.This paper estimates the localization and localization error between BLE transmitter and receiver by using RSSI algorithm that is presented in Section 3. In this paper, transmitter and receiver are set at laboratory with coordinate values for x-axis and y-axis as pixels.Here, one pixel is 1.5 × 10 (m).

Case 1
This paper sets at A and R2 for the transmitter and receiver, respectively, and measures the length between A and R2 by using a tapeline, which is 1.89 (m), as shown in Figure 21.This paper estimates the localization and localization error between BLE transmitter and receiver by using RSSI algorithm that is presented in Section 3. In this paper, transmitter and receiver are set at laboratory with coordinate values for x-axis and y-axis as pixels.Here, one pixel is 1.5 × 10 −2 (m).

Case 1
This paper sets at A and R2 for the transmitter and receiver, respectively, and measures the length between A and R2 by using a tapeline, which is 1.89 (m), as shown in Figure 21.Coordination of A point and R2 point as pixels results in (807, 698) and (787, 614), as shown in Figure 22.Coordination of A point and R2 point as pixels results in (807, 698) and (787, 614), as shown in Figure 22.Coordination of A point and R2 point as pixels results in (807, 698) and (787, 614), as shown in Figure 22.

Case 2
This paper sets B and R4 as transmitter and receiver.It performs the testing with same method of case1 and gets 2.50 (m), as shown in Figure 23.

Case 2
This paper sets B and R4 as transmitter and receiver.It performs the testing with same method of case1 and gets 2.50 (m), as shown in Figure 23.Table 4 shows that RMS error is 0.541 (m), calculated 8 times.However, when it applies 100 times, RMS error is 0.545 (m).Thus, the difference of RMS error between computer simulation and real experimental data is very small.Additionally, the RMS error of computer simulation and real experimental data implemented in this paper is smaller than other RSSI method presented in Table 1.The difference of RMS errors for RSSI method between results of Table 1 [19] shown by computer simulation and proposed method by real experimental environment, is due to strength of power, different interference status, and application a slightly different calculation method of distance between BLE transmitter and receiver.

Conclusion
This paper proposed the application of a robust ranging method that can be applied in robots, IoT, and especially in the tracing location of each nursing home patient where the RSSI method is used.This paper shows the results of the measured point from the application of the trilateral technique, and it also represents the results of the error distance between the ideal point and the measured point.The error between the ideal point and the estimated point occurs when this paper performs eight calculations.The computer simulation result represents the RMS error that is less than 0.536 (m).This paper presents a real experimental system with a hardware system and its results of measuring an RMS error that is less than 0.545 (m).Therefore, when this paper applies the BLE system that applies RSSI in robots and IoT to estimate localization, it can apply the presented system with an error within 0.55 (m).
The main difference of the RMS error between computer simulation and the experimental system is due to the difference of the wireless electric wave environment.Even though this study considers the exact wireless electric wave environment in the computer simulation, it is not difficult to reflect upon the tracing location of each patient in real wireless electric wave environments in the real fields such as hospital and nursing homes.

Figure 1 .
Figure 1.Basic power transfer between transmitter and receiver of antenna.

Figure 1 .
Figure 1.Basic power transfer between transmitter and receiver of antenna.
(A, B, and C) are known as (x a ,y a ), (x b ,y b ), and (x c ,y c ), respectively.d a , d b , and d c are shown as the distances from the three known nodes, A, B, and C, respectively, to the unknown node D. Energies 2018, 11, x FOR PEER REVIEW 5 of 20  =  • log ( +  •  +  (dBm) (4)  =  •  +  •  +  •  +  (dBm)

Figures 5 -
12 are shown in the results of computer simulation for localization of robot or IoT sensors.The red, blue, and green line with circle ( ) represents base point 1, base point 2, and base point 3, respectively.The black and red line with asterisk (*) displays location point of ideal and real position, respectively.

Figure 4 .
Figure 4. Flow chart for computing the localization of robot or internet of things (IOT) sensor.
are shown in the results of computer simulation for localization of robot or IoT sensors.The red, blue, and green line with circle (○) represents base point 1, base point 2, and base point 3, respectively.The black and red line with asterisk (*) displays location point of ideal and real position, respectively.

Figure 4 . 20 Figure 5 .
Figure 4. Flow chart for computing the localization of robot or internet of things (IOT) sensor.Energies 2018, 11, x FOR PEER REVIEW 8 of 20

Figure 7
Figure7shows the result of the localization computation with respect to the three provided RSSI values of −54.1075, −52.4424, and −58.2356 (dBm), respectively.From Figure7, we recognize that the error is 0.5759 (m) between the location point of ideal and real position.

Figure 8
Figure 8 shows the result of the localization computation with respect to the three provided RSSI values of −50.9142, −51.1982, and −58.7488 (dBm), respectively.From Figure 8, we recognize that the error is 0.4904 (m) between the location point of ideal and real position.

Figure 10
Figure 10 shows the result of the localization computation with respect to the three provided RSSI values of −45.1862, −55.7421, and −58.1185 (dBm) for respectively.From Figure 10, we recognize that the error is 0.4123 (m) between the location point of ideal and real position.

Figure 11
Figure 11 shows the result of the localization computation with respect to the three provided RSSI values of −38.4322, −50.0492, and −58.5565 (dBm), respectively.From Figure 11, we recognize that the error is 0.4314 (m) between the location point of ideal and real position.

Figure 10
Figure 10 shows the result of the localization computation with respect to the three provided RSSI values of −45.1862, −55.7421, and −58.1185 (dBm) for respectively.From Figure 10, we recognize that the error is 0.4123 (m) between the location point of ideal and real position.

Figure 11
Figure 11 shows the result of the localization computation with respect to the three provided RSSI values of −38.4322, −50.0492, and −58.5565 (dBm), respectively.From Figure 11, we recognize that the error is 0.4314 (m) between the location point of ideal and real position.
three points (a, b, and c).

Figure 13
Figure13and Table2depict the error result between the ideal point and the estimated point when this paper performs eight calculations from Figure5to Figure12.From Figure13, we recognize that the maximum error occurs in Figure6which is 0.9021 (m).

Figure 5
Figure5depicts the result of the localization computation with respect to the three provided RSSI values of −50.0537, −55.7224, and −58.5564 (dBm), respectively.From Figure5, we recognize that the error is 0.4438 (m) between the location point of ideal and real position.Figure6shows the result of the localization computation with respect to the three provided RSSI values of −43.1889, −56.8906, and −53.8736 (dBm), respectively.From Figure6, we recognize that the error is 0.9021 (m) between the location point of ideal and real position.Figure7shows the result of the localization computation with respect to the three provided RSSI values of −54.1075, −52.4424, and −58.2356 (dBm), respectively.From Figure7, we recognize that the error is 0.5759 (m) between the location point of ideal and real position.Figure8shows the result of the localization computation with respect to the three provided RSSI values of −50.9142, −51.1982, and −58.7488 (dBm), respectively.From Figure8, we recognize that the error is 0.4904 (m) between the location point of ideal and real position.Figure9shows the result of the localization computation with respect to the three provided RSSI values of −42.3353, −49.481, and −57.7724 (dBm), respectively.From Figure9, we recognize that the error is 0.3905 (m) between the location point of ideal and real position.Figure10shows the result of the localization computation with respect to the three provided RSSI values of −45.1862, −55.7421, and −58.1185 (dBm) for respectively.From Figure10, we recognize that the error is 0.4123 (m) between the location point of ideal and real position.Figure11shows the result of the localization computation with respect to the three provided RSSI values of −38.4322, −50.0492, and −58.5565 (dBm), respectively.From Figure11, we recognize that the error is 0.4314 (m) between the location point of ideal and real position.Figure12shows the result of the localization computation with respect to the three provided RSSI values of −44.7318, −50.7564, and −54.9525 (dBm), respectively.From Figure12, we recognize that the error is 0.4610 (m) between the location point of ideal and real position.Figure13and Table2depict the error result between the ideal point and the estimated point when this paper performs eight calculations from Figure5to Figure12.From Figure13, we recognize that the maximum error occurs in Figure6which is 0.9021 (m).

Figure 13 .
Figure 13.Error result between the ideal point and the measured (computed) point.

Figure 13 .
Figure 13.Error result between the ideal point and the measured (computed) point.Table 2. RMS error result between the ideal point and the measured (computed) point.Number RSSI A (dBm) RSSI B (dBm) RSSI C (dBm) RMS Error (m) Figure 5 −50.0537 −55.7224 −58.5564

Energies 2018 , 20 Figure 13 .
Figure 13.Error result between the ideal point and the measured (computed) point.

Figure 15 .
Figure 15.Hardware of BLE receiver, and beacon gateway.

Figure 17
Figure17shows the concept of communication of BLE transmitter and receiver, the beacon gateway, received data transmission, and echo data transmission path.

Figure 17 .
Figure 17.Concept of configuration for hardware communication.

Figure 15 .
Figure 15.Hardware of BLE receiver, and beacon gateway.

Figure 17
Figure17shows the concept of communication of BLE transmitter and receiver, the beacon gateway, received data transmission, and echo data transmission path.

Figure 17 .
Figure 17.Concept of configuration for hardware communication.

Figure 17 20 Figure 15 .
Figure17shows the concept of communication of BLE transmitter and receiver, the beacon gateway, received data transmission, and echo data transmission path.

Figure 17
Figure17shows the concept of communication of BLE transmitter and receiver, the beacon gateway, received data transmission, and echo data transmission path.

Figure 17 .
Figure 17.Concept of configuration for hardware communication.

Figure 17 .
Figure 17.Concept of configuration for hardware communication.

Figure 18 .
Figure 18.Configuration of testing device for RSSI.

Figure 19 .
Figure 19.Configuration of testing device for BLE receiver.

Figure 18 .
Figure 18.Configuration of testing device for RSSI.

Figure 19 .
Figure 19.Configuration of testing device for BLE receiver.

Figure 19 .
Figure 19.Configuration of testing device for BLE receiver.

Energies 2018 , 20 Figure 21 .
Figure 21.Location A and R2, and real distance between A and R2.

Figure 21 .
Figure 21.Location A and R2, and real distance between A and R2.

Figure 21 .
Figure 21.Location A and R2, and real distance between A and R2.

Figure 22 .
Figure 22.Coordination of A and R2.

Energies 2018 , 20 Figure 23 .
Figure 23.Location B and R4, and real distance between B and R4.

Figure 23 .
Figure 23.Location B and R4, and real distance between B and R4.

Table 1 .
Comparison with root mean square (RMS) error value for the weighted centroid-locating algorithm, received signal strength intensity (RSSI), and time of arrival (TOA)-locating algorithm.

Table 3 .
Test item, reference, and their results.

Table 3 .
Test item, reference, and their results.