Essay Writing Service

Hardware Architecture and its Implementation in the HILS

Chapter 5

 This chapter starts with a brief description of hardware architecture and its implementation in the HILS, there are two technologies: Bluetooth low energy 4.0 module and ultrasonic module. Section 5.1 describes the different component of HILS and there operational mode, section 5.2 describes the algorithm and software component and section 5.3 describes the hardware design and implementation.

5.1 system description

The HILS combines two technologies embedded in one system, BLE 4.0 module and ultrasonic module in order to compensate the limitations of each technology. On one hand, The BLE 4.0 provides low power consumption and have a unique ID for the area covered by the radio, but with low localization accuracy because of instability of the RSS measurement as a described previously in the chapter 4, on the other hand, the Ultrasonic technology provides very high accuracy compared to other technologies used in indoor environment but with high power consumption as described in cricket [11].

The combination of two technologies or more could be a good strategy to build an indoor location system and tracking system with increased localization accuracy and availability. The node in the HILS acts as a fixed reference nods in indoor environment, each node attached to the ceiling, and periodically broadcasting a beacon message (RF Bluetooth signal “hi I am here “) containing some unique information.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:indoorkiko.png

  1.                  Indoor location scenario

When a smartphone or smart devices (tablet, smart watch…) is within the transmission range of nodes, it could determine its location using the three access points (nodes) RF signal or more, with a highest RSS measurement by using method propagation model in the specific environment as described previously in chapter 4. When the user cannot make sure of his right location, he should use the button on App to update new location on the smartphone, it will activate only the three close nodes (which have high RSS this method was described in the previous chapter 4) in its range by asking them one by one, by transmitting three request RF signal; by default, only three nodes will respond and each node of them will transmit an ultrasound Beep which the smart device receives using its microphone and then give a feedback by using TDoA technique to calculate distance between nodes and smartphone. Trilateration algorithm helps the smartphone to determine its location in indoor environment.

5.2 HILS architecutre

HILS requires deployment of equidistant nodes consisting of the transmission units on the ceiling, as illustrated in figure 1. Each node provides ranging of about 15 m and is an access point that can communicate with smart devices within its transmission range. During the experiment, a total of 9 nodes were deployed attached on the ceiling with a distance of six meters between each node. Nodes broadcast a beacon RF signal (Bluetooth signal) carrying important information including id, temperature and battery state, in all directions every 400ms and switch to sleep mode. The Nodes can also emit an ultrasonic sound when requested by a smart device.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:Untitled-31.png

  1.                  Basic of HILS one too one

Figure 2 illustrates the basic use case of HILS one too one. In this figure Smart device  (S) could play different roles according to the usage scenario such as scanning node in indoor environment and sort it or receiving acoustic beep signal in HILS node broadcast a RF beacon message (hi I am here) each 400

ms and switch to sleep mode to save energy, While S enters into the RF range coverage of the corresponding emitting node (nodes are referred to as known fixed reference nodes (N, AP)) by clicking on the button in the App, the Smartphone send a three RF signal request to nodes which has highest RSS measurement to send acoustic Beep signal and start a internal timer in the side of S as soon as N receive Smartphone’s RF signal request, the node will generate acoustic beep as soon as Smartphone detects the acoustic beep via its microphone, the internal timer will  stop, and then give a feedback by using TDoA technique to calculate the distance between Node and Smartphone.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:one too many.png

  1.                  Basic of HILS one to many

Figure 3 illustrates the basic use case of HILS one too many. In this illustration, HILS contains many nodes attached to the celling and each one broadcasts a random RF beacon message (hi I am here) each 400

msand switch to sleep mode to save energy, While S enters into the RF range coverage of the corresponding emitting node, when the user notices that the location it is not right or want to update his new location by clicking in button in the Smartphone’s App, the Smartphone broadcasts three RF signal requests to three nodes (with three IDs which has high RSS measurement ) that send an acoustic Beep signal and start a internal timer in the side of S as soon as Nodes receive Smartphone’s RF signal request, the node will generate an acoustic beep, as soon as Smartphone detect the acoustic beep via its microphone the timer will  stop, and then gives a feedback by using TDoA technique to calculate the distance between the Node and Smartphone , then we will get three distances between  three nodes and a smartphone , it will be easy to define the relative position  via   the   Trilateration algorithm

To realize this system structure, multiple development tools were used such as IAR Embedded for written firmware, debugging and programing communication protocol; Matlab software and smart devices (such as smartphones, tablets and laptops) to analyze the data, The HILS consists of two main hardware components. Node development boards and an Android smartphone. The node supports both the advertising and scanning states of the BLE 4.0 protocol stack and sending beep sound. The minimum required Android version is Android 4.3, which is the earliest release that supports BLE 4.0 . The smartphone needs to support both BLE 4.0 scanning and advertising states in order to be fully functional.

The HILS software architecture consists of two parts each one can play one of the following roles: the firmware running on the Node, and another App, which runs in the smartphone.

  1.               Transmission Unit: (Fixed reference Nodes:)

In this role, the node transmits periodically the RF beacon and the Beep signal whenever has been requested from the user. The fixed reference node is used as the point of reference in measuring the relative distance.

Each node is a small hardware platform contains two modules developed under microcontroller CC2540, Both the BLE 4.0 and the ultrasonic technology runs in cheap CC2540 (Bluetooth technology 4.0). The cc2540 has also an internal temperature sensor, which can be used to measure ambient temperature at the node. As illustrated in block diagram figure 4 and 5, the essential component in block diagram CC2540, 20 kHz ultrasonic transduces and power supply. The Node consists of 6 parts:

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:Block digram of  HILS.png

  1.                  Block diagram of the proposed node architecture.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch4:HILS.png

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:Untitled-12.png

  1.                  Is a Picture of a HILS node. The regions identified by dashed line shows the hardware components of the Bluetooth low energy and the signal conditioning modules for transmission of ultrasonic signal.

The nodes for indoor localization application are implemented on the TI CC2540 and CC2541 platforms. The CC2540 and CC2541 combine an excellent RF transceiver with an industry-standard enhanced 8051 MCU. The system is highly suited for ultra-low power energy consumption. The TI CC2540 and CC2541 is a true System On Chip (SOC) for Bluetooth low energy solutions.

Power supply: Each node is powered by batteries with a 5v and a typical capacity of 2000mAh, so that the battery life would be approximately 160 days. Since beacons periodically transmit location information, they need a power source that can last for a sufficiently long time. In real life scenario the life will depend on the application implemented by the system.

LED (indicator): led indicate the stat commination of the nodes.

Ultrasonic transmitter: The ultrasonic transmitter we have been using to generate beeps in our research called piezo sound or piezo transducer, which is similar to speakers that applied voltages drive the piezo crystal to move and make a sound. This sub module generates ultrasonic pulses of duration 0.5 µs. In order to get ultrasonic beeps, we need to generate tones with a square wave from the pin of cc2540 microcontroller. The use of the Pulse Width Modulation (PWM) functionality of the pin of cc2540 allows the piezo transducer to generate ultrasonic beeps. To create a piezo transducer to generate 20 kHz, the PWM runs at 5

μs, so it will produce ultrasonic beeps. We use the Piezo Transducer Type W-06A, the table shows its features.

W-06A Features: 

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:Ultrsonic .png

  1.                  Piezo transducer
Min. Sound Pressure Level (dB) 90/22±1KHz/2.83VRMS Sinewave/50cm
Power supply 3.3 to 5 V
Maximum measured error Less than ±1.5 in
Resonant Frequency Range (kHz) 22±1.0
Frequency Range (kHz) 4 ~ 50
Operating Temperature ºC -20 ~ +70
 Weight (g) 6.5
Case Material/Color Fire-resistance ABS/Black
Max. Consumption (mA) Less than 1.8 mA at 5 V

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:graph.png

  1.                  Characteristic Response:

Temperature sensor.By enabling the internal temperature sensor of cc2540 the node can measure the ambient temperature and send it to smart phone to compensate variations in the speed of sound with temperature.

Power Amplifier: used to amplify the signal before being sent to the piezo transducer in order to increase the signal power and improve the range of the system

Microcontroller: Uses a CC2540 microcontroller operating at 32 Mhz.

Each node periodically broadcasting a beacon protocol RF message which contains an iBeacon prefix, UUID identifier, Major, Minor, Measured Power, temperature, and battery sate. Fig 1 shows the beacon packet structure as shown in example of frame figure 8, the total amount of data is 30 bytes, which fits very well the 31 bytes’ limit that means the consumption of the power is low,

iBeacon prefix(9 bytes) UUID 

(16 bytes)




(2 bytes)

TX Power 

(2 bytes)





  1.                  The beacon protocol forma

A node is capable of broadcasting a short RF frame each 400ms, for instance, “Hi, I am here” and beep acoustic high-frequency signal (20 KHz) when it’s requested by user, Each node has its own ID. The Flowchart in The figure 9 illustrator the function of firmware in the node side.


  1.                  Flowchart of AP Online broadcasting
  1.                  Receiver Unit (Smart device):

The Smart device can play different roles according to the usage scenario; it can act as a receiver for both RF signal and ultrasonic signals through its microphone, which doesn’t require carrying any extra hardware. The smartphones used in the experiment were: phones I (the Android 4.3 Developer Samsung Galaxy note 2), and Phone II (the iOS iphone5). Both devices have a Bluetooth 4.0 (BLE) module and both have a microphone. The majority of commercial-off-the-shelf (COTS) smartphones now are quite capable of receiving ultrasonic tones between 20 Hz~22kHz. The Flowchart in The figure 10 illustrator the basic localization system.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:samarnode flowshart copy.png

  1.                Flowchart of the Simplified application on the smart device
  • The smart device can also broadcast an RF signal as shown in figure 10 flowchart. When a smart device measures the RSS and finds there is no logic between the actual measurement and the previous reference measurements, the Smart device will broadcast three times a RF signal, with each time being associated to a particular AP. Each broadcasting will activate a timer to get timestamps at the AP, which will then produce, accept and generate an acoustic signal (beep). The use of TDoA technique to calculate the distance between the smart device and each of the three APs, and by using the trilateration technique to find the right location, and the correction of the user’s location by averaging the logical results of two technologies creates an improved and precise location system.
    1.   Chapter summary

This chapter describes the architecture of the hybrid indoor location system. Different flowchart has been used to explain the functionalities of the system, its hardware implantation and the technics adopted to obtain the distance estimation.

Chapter 6

This chapter, describes in details the proposed HILS, it starts by describing the HILS overview, followed by the implementation of the hardware, software, techniques and algorithms used in HILS to get an accurate location  to Smartphone distances. The section describes the use of time difference of arrival (TDOA) of RF and ultrasonic (US) signal to calculate relative distances estimation between fixed reference node and smartphone. This chapter describes also in more details the generation and detection process of beep sound signal from the captured signal to be analyzed afterwards. Finally this section will describe how various environmental factors affect the relative distance measurements, and examines distance measurement accuracy between node and smartphone.

6.1 Distance estimation in HILS (system architecture)

The HILS uses the Time Difference of Arrival (TDoA) of RF (BLE 4.0) signal and sound wave (ultrasonic signal) to measure the distance between nodes and smartphone (user), each node periodically broadcasting a beacon message(RF), which contained a unique id, coordinator, and temperature ambient measurement (the temperature impact gradually to sound wave).

We use smartphone to determine the location in indoor environment. When the position is not right, We click on the APP’s button, then the Smart device will broadcast three times RF signals which contain three IDs of the closest smart device (described at the previous chapter 5), only three right nodes will generate a narrow ultrasonic signal beep, and by using TDoA technique the smart device can get the time

δΤof travel of two signals (US, RF) and to be able to calculate the distance between the smart device and each of the three fixed reference nodes, the figure 11 shows the way of the communication between three nodes and smartphone. To reduce the power consumption and to keep the system simple, the node only generates a short beacon message ( RF signal) and an ultrasonic beep pulse, which does not carry any data.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:21.png

  1.                The signal generation timings in the transmitter and receiver unit

6.1.1 Acoustic Ranging

In this section, we show how to use the audio technology, i.e. microphones and Ultrasonic transmitter, in order to implement a meter for smartphones, which measures the distance between smartphones and known fixed reference node. We can use the characteristics of sound waves to determine the traveled distance. There are various methods to do it, but broadly speaking we can distinguish between two types, time based and power based methods (attenuation). We summarize the most used time based ones here. The propagation time of sound waves between two nodes is a measure that tells us information about the distance. If we have information about speed of a wave in an environment, it will be easy to find the propagation time, which can be translated, into distance equation (2). For the sound waves, the propagation speed depends on the properties of the substance through which the wave is traveling.

d = V.∆t  (2


HILS is based on the TDoA technique that utilizes the relative speed of two different signals, RF signal and acoustic signal. Figure 12 gives an overview of HILS and shows the time line of timestamps corresponding to different events at both the node and the smartphone. The TDOA technique need two nodes (fixed reference node and smartphone) to be able to find the relative distance between smartphone and node, first we will define a model based on one fixed reference node and smartphone as shown in figure 12

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:pic:TRIPOD.png

  1.                TOF measurement

Note that, all time in table 2 are measured in milliseconds. These time are summarized in the following table:

Time Parameters
t1 Time when the smartphone puts the RF beacon into the transmission buffer of the RF driver.
t2 Time when the Node receives the last bit of the RF beacon.
t3 Time when the speaker starts to generate the Beep sound from the Node
t4 Time when the smartphone detects the starting of the Beep sound from the captured audio samples.

1 TDoA technique

In HILS, the smartphone only receives both the RF beacon and the Beep signal in which it does not require to share any information with the node. Such flexibility enables the smartphone to calculate the relative distance to the fixed reference node. The HILS does not require any time synchronization between the nodes. A typical TDoA uses the propagation speed of the two signals to infer the distance between the transmitter and the receiver. The precision in determining the travel time is proportional to the propagation speed of the two signals.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:beepdetection.png

  1.                Communication between node and smartphone

The simplest thing to do is to calculate TDoA using the arrival and departure time of a RF signal and sound signal. Suppose smartphone send a RF message at time of arrival

t1and node receives signal at time


TOF1 = t2 – t1, as soon as node receive the request RF signal the node will transmit beep signal at time

t3and smartphone detects the starting of the Beep sound from the captured audio samples at


TOF2=t4-t3. One important aspect of measuring a time difference is to have unable an internal timer clocks in smartphone to determine


t4. In theory, can be done through a faster signal than sound like radio signals. To estimate the distance between the node and smartphone, we use the method Time Difference of Arrival technique to calculate distance between given two points (node and smartphone) using two signals with different velocity which cross the same path between the two points, so we can write the following equation used in the figure 13




At normal close space temperature and humidity the wave sound propagation velocity in the air is in approximation at 25C

Vus≈345m/s, and the RF propagation velocity is equal to speed of light C in the air,

C≈VRF≈3x108m/s, the speed of the sound has lower propagation speed compare to RF signal then the velocity of the sound wave neglected in front of the speed of RF. Thereby the timestamp of the received signal is easier to determine

VUS≪VRFthe distance between a node and a smartphone, are same  it can write the following equation used in the figure 13.



δΤ=d(1VUS-1 VRF)

Then the velocity of sound wave neglected in front of the velocity of light.


d=δΤ.Vus  (s)

Therefore, the distance between nodes and the smart device can be calculated by multiplying the time with the velocity of ultrasonic signal, as shown in equation (s).

The smart device computes the times

δΤbetween the signal RF and US. The distance measurement accuracy depends on measuring the interval

δΤ. δT accuracy in turn depends on the system parameters such as the microphone band in the smartphone  and the.  Environmental impact.

6.1.2 Environmental impact on the sound wave propagation velocity

The sound wave propagation velocity changes depends, in the air ,to some physical parameters such as ambient temperature, humidity, types of gas, atmospheric pressure, air currents air turbulence. At the room or close space with normal temperature, the humidity has no influence on the velocity of sound wave. However, at high temperatures, the velocity of sound wave increases as humidity increase.

Also, the velocity of the sound wave between the sea level and 3,000 m altitude decrease only by less than 1%. The air presser can be ignored for location at regular air currents indoor environment, which also has no effect at the propagation velocity of the sound wave measurement. However, the temperature in indoor environment relatively has an influence on the velocity of sound wave measuring accuracy. After the transit time of the reflected ultrasonic pulse has been measured. In practical if air temperature changes, the velocity propagation of sound wave changes by 0.18%. The velocity of the sound has a large variable sensitivity to temperature. In indoor, temperature can change easily every 10°C within close space. We use internal temperature sensors on the Nodes which can measure the ambient temperature and send it to the smartphone to compensate the change of the velocity propagation of the sound wave in indoor environment, and when a smartphone compute the distances between the three nodes, it will receive three values of the ambient temperature measures



θ3, and it will use the average of

(θ1+θ2+θ33)to represent the close space the ambient temperature measures and compute the correspond velocity of the sound. The nodes can measure the ambient temperature with an accuracy of


In the dry air with less humidity, the ultrasonic velocity is affected only on the absolute temperature; hence, it is calculated as follows [58]


The propagation time of the sound wave between two nodes is a measure that provides information about the distance, but if we have information about the velocity propagation of sound wave and temperature in an indoor environment, the propagation time can be translated into distance.



θis the temperature in degrees Celsius.

This simplified model depends only of the environment temperature

θin degrees Celsius. Therefore, by the giving model and the propagation time

δΤ, it’s possible to calculate the distance between two nodes. In this work, we may use the approach proposed by [26], where only the influence of temperature is considered. The speed of sound (in m/s) is estimated as:


  1.                  Beep signal generation

To generate an ultrasonic beep via nodes speakers, we primarily consider two challenges: Frequency Selection of the sound and length of beep signal.

1.1Frequency Selection of the sound

We choose a high frequency beep at the edge of the COTS smartphone microphone frequency response curve, because this makes it both easy to filter out noise and make the signal sound inaudible for most human ear of any age even pets animal.

The majority of the typical indoor environment noise sources are in lower frequency bands. For example, the noise from air conditioner, washing machine, water closet, refrigerator, ventilation fan, exhaust fan, television, water heater, pump and wind are mainly located in the low frequency bands below 1 kHz [17], whereas that conversation ranges from approximately between 300 Hz to 3400 Hz [37]. The music for example spans the frequency range from 50 Hz to 15,000 Hz, which covers almost all sounds that occur naturally. Although the noise separation can be difficult in the time domain, we enable the separation directly in the frequency domain by setting our signal above 18 kHz.

1.2Length of beep signal

The length of the beep signal impacts gradually the overall detection time as well as the reliability of recording the beep. The microphone does not pick up too tiny beeps. On the other hand, too long beeps will add delay to the system and will be more susceptible to multi-path distortions and need more memory, because it needs long recording. We found empirically that a beep length of 100 samples (i.e., 5ms) represents a good tradeoff.

  1.              Beep detection algorithm

Most of COTS smartphone now, along with huge progress in audio signal processing and Bluetooth protocol, Provides more flexibility to combine both Bluetooth interface and acoustic at kernel level in smartphones, and have given us algorithm developers the ability to recognize sound, by capturing a beep and give a fingerprint for record sample beep. Smartphone can theoretically record sounds with a peak frequency as high as 22 KHz. In general there are two techniques are being used to detect the beep signal hidden in the sound recorder  [13], [22].

The first one is correlation based which computes the correlation function of an emitted beep signal and a recorder signal. The first sharp peak in this function is considered with a high probability to be corresponding to the arrival time. The second method is energy based or RSS of sound signal, it generates beep signals with strong energy than the background noise. Thereby, the point before and after witch the energy distribution differs significantly is regarded as the arrival point of beep signal through extensive experiment by Mustafa Udine and Jie yang [s] [x], which have employed the first method due to its higher accuracy.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:Untitled-6.png

  1.                architecture of smart phone

Figure 14 illustrates different modules of smartphone along with the standard modules of the sound driver and Bluetooth driver. Most kernels of smartphones now have an advanced Linux sound architecture (e.g. ALASA, OSS, custom driver), the ALSA SoC contains three main companions: platform driver, codec driver and machine driver. Among them, the platform driver which is responsible for Direct Memory Access (DMA) data transfer between the audio hardware and the sound driver.

In figure 14 The Beep receiving (BR) module is the main kernel module in HILS. This module is responsible of processing the captured sound signal from the platform driver for detecting the beep signal.

Whenever the user wants to request an exact location, the user click on the APP button The Bluetooth interface transmits a RF beacon frame to request the nodes, a notification signal is sent to the BR module to power up the capture stream and starts recording the audio samples in the allocated buffer also power up the internal timer, as soon as the Beep receiving module detects the starting event of the Beep signal from the captured acoustic samples and immediately stops the internal timer, therefore we get the timestamp and it transfers all the timestamps information to the Estimation module, the location of the smart phone is calculated by TDoA trilateration method.

The accurate detection of the beep signal on the receiving side is critical for accurate distance estimation. Our detection mechanism must meet the following two attributes: a precise identification of the first sample of the Beep sound signal and Lightweight implementation. Figure 15 illustrates different steps to detect the Beep signal.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:Screenshot_2014-08-11-15-43-13.pngMacintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:microphone.png

  1.                Beep signal detection mechanism

(Block diagram of the receiver with signal processing)

To detect the beep sound at side of smartphone it is important for accurate distance estimation, our detection technique should respect 2 features: first step it is precise identification of the first sample of the Beep sound and second step is implement the light Wight.

We apply a high pass filter over the sample data to dispose of all ambient background noises. Following the high pass filter, we apply L-2 norm cross correlation over the filtered signal which detects the point of maximum correlation between a received signal and a known transmitted signal. The correlation values that exceed a certain threshold indicate the existence of the Beep signal. We use a lightweight filtering method in the time domain to satisfy the second feature mentioned above. In defining the high-pass filter in the time domain, we label the input signal to the system as

xiand output signal as

y[i]. In general, the mathematical representation of the first order filter [28] can be expressed as:


y[i]=x[i]-y[i] (3)



fsis the sampling frequency of the capture event in Hz, and

fcis the cutoff frequency for the high pass filter. From the equation 3, we can establish a higher order high pass filter in the time domain. In our implementation, we use 4th order high pass filter which embed 4 samples delay in detecting the starting event of the Beep signal.

This delay can lead up to

40cmof error, which is negligible in our scenarios. In order to use the L-2 cross-correlation, we use a short duration sinusoidal signal that consists of only 10 samples with the same frequency as the Beep signal. We select the duration length of the sinusoidal signal empirically we found the beep signals with length of 2205 samples, which is equivalent to

5 msduration given the sampling rate of

44.1KHz. The correlation is done between the short sinusoidal signal and the filtered signal in a sliding window fashion with one sample increment. We identify the beginning of the Beep sound as the first index number of the captured sample that has: a correlation value above the specified threshold, and the correlation values of the next captured 10 samples or more are above the threshold too. In the implementation, we set the threshold value to 0.6 to detect the beep signal. In an indoor environment, reflections from the surrounding walls and pillar might create multipath signals that overlap with the direct Line of Sight (LoS) signal. Although the combination of multipath signals may cause stronger signal than the direct path signal at the smartphone ‘microphone, the direct path signal always comes earlier than the other multipath signals. Therefore, we detect the beep.

  1. Result and dissection

This chapter starts by describing the test environment. The calibration steps for the different algorithms are described. The result of the test regarding RSS distance estimation and localization accuracy are presented.

4.1 Test Environment Setup

The designed localization system is implemented on node hardware and CTOS smartphone as described in the previous chapter. The system designed has been deployed in our lab and this chapter describes the layout of the test area, to how the system is calibrated and the criteria utilized for system performance evaluation.

4.1.1 Test Area

The HILS is tested in four scenarios: in the first Scenario, we had a trial at a small open office area in the Laboratory, by using one node and one smartphone being hold on tripods as shown in the figure 8. In the second scenario, we deployed four nodes on ceiling in the same office area as shown in the figure x. And for the third scenario we deployed nine nodes on the ceiling in the office with different sections blocked by walls, and for the last one, we deployed twenty-one nodes in ceiling of larger area with corridors and different sections blocked by walls. The Maps of the small and the large area are presented in figure 4.1 and figure 4.2 respectively.


In order to estimate the accuracy of the system in the distance measurement, we used a smartphone and a known fixed reference node separated into a certain known distance. Figure 16 illustrate the test-bed used in the distance measurements. The smartphone was configured into transmitting an RF signal to request the fixed reference node as soon as the node receives it, the node sends an ultrasonic Beep of

5 msduration via its speaker. As soon as the smartphone detects the start of the beep sound from the node. The distance between the smartphone and the node was inferred from the TOF measurement by only using the speed of sound from equation (S). Since the average temperature was 25.2 °C, the speed of sound was estimated to be 345.52 m/s. The smartphone was separated from the fixed reference node in steps of 1 m in the range from 1 to 9 m. A total of 20 TOF measurements were taken for each distance. A commercial laser meter of precision was used to measure the distance between nodes at Figure 8. The illustration of the test-bed was used in the distance measurements. A smartphone and a receiver fixed reference node are placed in front of each other with a tripod at a height of 1.4 m above the ground. The difference of distances in the range of 1–9 m are considered. The distance between nodes is set by using a commercial laser precision ±1.5 mm. The fixed reference node sends an ultrasound Beep of 5ms, 20 kHz.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:pic:TRIPOD.png

  1.                Test bed in the distance measurement

In this scenario, we conducted the experiments in an indoor environment. Noted that, during these experiments we have only used one smartphone and one node to estimate the distance between the smartphone and the fixed reference node. The phone was held on TRIPOD with five different angle: the microphone was placed at different angles of 0 degree, 45 degrees, 90 degrees, 135 degrees, and 180 degrees. For each of the five angles, 20 tests were made. For each check angle was chosen in such a way that the smartphone’s microphone with a different angle in order to improve overall beep signal detection. The Figure 17, illustrate five different angles in which the smartphone was tested.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:smartphone1.png

  1.                Five different angles in which phone was tested

We have developed an Android software application (App), which can be used at any COTS smartphone. Fundamentally our designed application has two functionalities: (I) scanning the node via BLE 4.0, (II) sending a request via BLE 4.0 to the node and (III) detecting the beep sound. The figure 18 shows the visualization of the current distance between the smartphone and a fixed reference node and the ambient temperature of the node on the screen.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:HILS.png

  1.                The application main screen

All 10 readings collected at the five different angles at each checkpoint were treated as one sample. For each sample the estimation distance between the smartphone and the node was calculated. The difference between the estimated distance and the true distance of the checkpoint as well as its different angle can be found in Tables[ 1,2,3,4 and 5]. From the average of all 10 checkpoints it appears that the accuracy steadily decreases as the smartphone is rotated from  horizontal to upward orientation.

A total of 10 positioning measurement were obtained at each position. The distances between the smartphone and the nodes were calculated by assuming an average temperature ambient of 24.3 °C, which is gotten from the temperature sensor in the node with a speed of sound of 345m/s. The nodes were configured to transmit a beep of 5 ms. the distance measurement was calculated considering the average value of the office temperature recorded in diverse positions, which was used to estimate the  propagation velocity of the sound in the air. The measured distance is calculated on basic of travel time, the formulate to calculate the distance is shown below (2)

D=20.05T.θ (2)

The experimental results at Angles 0°~180° between smartphone’s microphone and the node’s speaker are presented in table1. First column contains the checkpoint number, the second Column contains temperature ambient close to the node, Column 3 contains actual distance measured by laser meterColumn 4 contains travel time of beep signal from node ‘speaker to smartphone’s microphone’, Column 5 contains measured distance via smartphone and column 6 contain the error between the actual distance and measured distance.

Table 1: experimental results at Angles 0° between smartphone’s microphone and the node

Chk Pt Temperature Ambient 


Actual distance 



Traveled time (uSec) Measured distance 





1 24.3 1 3.56 1.23 0.23
2 24.2 2 6.745 2.33 0.33
3 24.2 3 9.851 3.40 0.40
4 24.4 4 13.48 4.66 0.66
5 24.3 5 16.02 5.54 0.54
6 24.2 6 19.2 6.63 0.63
7 24.4 7 22.2 7.67 0.67
8 24.2 8 25.3 8.74 0.74
9 24.2 9 28.1 9.71 0.71

  1.                Graph between actual distance and measured distance at 0° angle.

The distances measured with the laser meter are plotted on the X-axis, while the averaged distances measured obtained from the TOF measurements are plotted on the Y-axis.

Table 2: experimental results at Angles 45° between smartphone’s microphone and node

Chk Pt Temperature Ambient
Actual distance
Traveled time (uSec) Measured distance
Error     (m)
1 24.3 1 3.8 1.31 0.31
2 24.2 2 7.1 2.45 0.45
3 24.2 3 9.9 3.42 0.42
4 24.4 4 13.48 4.66 0.66
5 24.3 5 16.02 5.54 0.54
6 24.2 6 19.5 6.74 0.74
7 24.4 7 22.2 7.67 0.67
8 24.2 8 25.3 8.74 0.74
9 24.2 9 28.2 9.74 0.74

  1.                Graph between actual distance and measured distance at 45° angle

Table 3: experimental results at Angles 90° between smartphone’s microphone and node

Temperature Ambient
Actual distance
Traveled time (uSec) Measured distance
Error     (m)
24.3 1 3.65 1.26 0.26
24.2 2 6.87 2.37 0.37
24.2 3 9.45 3.27 0.27
24.4 4 13.48 4.66 0.66
24.3 5 15.8 5.46 0.46
24.2 6 19.2 6.63 0.63
24.4 7 22.6 7.81 0.81
24.2 8 25.7 8.88 0.88
24.2 9 28.2 9.74 0.74

  1.                Graph between actual distance and measured distance at 90° angle

Table 4: experimental results at Angles 135° between smartphone microphone and node 

Chk Pt Temperature Ambient
Actual distance
Traveled time (uSec) Measured distance
Error     (m)
1 24.3 1 5.1 1.76 0.76
2 24.2 2 8.2 2.83 0.83
3 24.2 3 10.2 3.52 0.52
4 24.4 4 14.5 5.01 1.01
5 24.3 5 17.02 5.88 0.88
6 24.2 6 21.8 7.53 1.53
7 24.4 7 22.4 7.74 0.74
8 24.2 8 32.2 11.13 3.13
9 24.2 9 29.5 10.19 1.19

  1.                Graph between actual distance and measured distance at 135° angle

Table 5: experimental results at Angles 180° between smartphone microphone and node 

Chk Pt Temperature Ambient
Actual distance
Traveled time (uSec) Measured distance
Error     (m)
1 24.3 1 5.1 1.76 0.76
2 24.2 2 28.8 9.95 7.95
3 24.2 3 14.1 4.87 1.87
4 24.4 4 13.5 4.66 0.66
5 24.3 5 18.7 6.46 1.46
6 24.2 6 22 7.60 1.60
7 24.4 7 40 13.82 6.82
8 24.2 8 27.2 9.40 1.40
9 24.2 9 30 10.37 1.37

  1.                Graph between actual distance and measured distance at 180° angle

The angles between 0° and 90°(upward) are the only smartphone’s microphone angles that have 100% detection. However, 90° has a huge spread in accuracy from some of the worst results to results on par with downward orientation. Interestingly, accuracies for tilt angle 90° tend to be either very good or very bad, which illustrates the importance of direction when dealing with sound waves. Average results for 0° the smartphone exist within the radius circle about 0.3 m because the smartphone’s microphone was a direct line of sight and less multipath. Probably due to a real user holding the smartphone instead of placing the smartphone on a tripod. Holding the smartphone in hand makes exact placement of the smartphone over the checkpoint less accurate and the user’s body could also interfere with the direct line of sight of the signal. Accuracies for some checkpoints at 180° may appear misleading. For example checkpoint 1 and 4, which has an acceptable accuracy (0.6m), however, the detection rate for this point and the angle is only 10%. The angle of 90° has a much better detection rate than angles 135°~ 180°, 135°~ 180° because the user prefer to hold the smartphone in such an awkward orientation through normal usage. In terms of accuracy, detection rate, and consistency, smartphone angle of 0° degree is undoubtedly the most reliable orientation. The accuracy of measured distance is increased for longer distance. We observe that there is a considerable error measurement in the measured distance as compared to actual distance error, which becomes small for measured distance above 4 m. The error especially large at lower distance has occurred in the long distance of 6 m (when the microphone close to node).

In order to limit the interference or redundancy problems of the signal, a time maximum from node to smartphone (timeout) is defined, if the ultrasonic signal has delayed after the Bluetooth request from the smartphone, the smartphone will be canceled to listing the sound and send again the RF signal request to the same node which was field to detect the beep.

On the other hand, it is known that signal propagation delay is approximately 2.8

msfor a typical sound speed of 345

m/s. Assuming the maximum distance between nodes is 9 m (

τmax= 26

ms), a beep duration is Tb = 5

ms. After 35

msThe smartphone will cancel the listing to the sound and send again the RF signal request to the same node which field to detect the beep, as shown in the Figure x.

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:Untitled-13r.png

  • The orientation of the phone: Ultrasound is very directional and the orientation of the smartphone’s microphone in relation to a node’s speaker has a significant effect on reception quality. Unless the smartphone’s microphone is pointing directly downward or upward, its orientation is going to impact reception quality at each of the four nodes’ speaker. This in turn can affect the detection of the beep sound and therefore trilateration accuracy.
  • User obstructing direct Line of sight between smartphone and known fixed reference nodes: In contrast low frequency sounds waves has a long wavelength, sound with high frequency has poor absorber by wall (poor obstacle penetration), This means that maintaining a direct Line of sight between the smartphone’s microphones and four node’s speaker is important in order to achieve the best accuracy. Blocking direct line of sight to one of the speaker’s node can negatively impact signal detection on smartphone’s microphone and introduce lag due to the signal arriving via multipath. Both poor reception and lag can reduce trilateration accuracy. The most likely scenario where one of the node’s speakers would be blocked is when the user himself is standing in the path of the signal. Although node’s speaker were placed on the ceiling to mitigate this problem, in some cases direct line-of-sight can still be blocked
  • Scenario 2:

In this scenario, the experiment is done in an office (7th floor of faculty of electronic and information engineering, Tongji University (Shanghai, china) ) the chosen building is a common office with complicated structure, we have deployed four  known  fixed references nodes  position (AP1, AP2, AP3, and AP4) arranged at the corners of the ceiling of an open space which is smaller to a free space n=2, Figure 3-2, With the distance between each node is nine meters(9x9m) and the height of 4m, this deployment of the nodes avoids possible reflection of the beep  signal on nearby walls (multipath effect)

All the Nodes (AP1, AP2, AP3, and AP4) are of the same type, so they have the same hardware (CC2540 radio chip, Antenna, battery 3.7V, Ultrasonic transmitter and firmware) and they have similar message broadcasting under the same conditions. For the localization method, the nodes broadcasting each time beacon a message (hi I am here) by using App which is installed in the smartphone can gather the RSS from each node, and by using the propagation model we can know the distance between the transmitter and the receiver, and by using trilateration algorithm, to demine number of iteration (correct the position of user and visual it in screen of the smartphone as shown in the fig d), by clicking at app button the smartphone will request a RF signal from each node and each node will response by sending a beep signal thorough the travel of the beep signal, hence the smartphone can calculate four distance, by consequent we can know the estimated location as showed in table II.

fig d

Figure 12 is an illustration of the known fixed reference node position in the tree dimension space. The red dots show the position of the known fixed reference node. And the positioning measurements are taken by user holding smartphone in its displacement on the indoor environment.

We used a laser measurement to calculate the real position of several random positions of the user holding the smartphone and compare the results to their actual position in fig (m).

After taking trials we found that the error is not that much as shown in table 2

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:Untitled-3.png

  1.                TDoA trilateration experiment with four nodes and smartphone position in the two-dimension space.  N1, N2, N3 and N4 are nodes , S is smartphone

Figure 24 Illustration of the node position in the two dimension space. The red dots are the position of the known fixed reference nodes projected into the xy-plane. The bleu dots are the positions of the user holding smartphone in its displacement on indoor environment

Regarding input data for testing the trilateration algorithm, the locations of AP1 (0,0), AP2 (0,9), AP3 (9,9), AP4 (9,0) were used and the initial distances between the fixed reference nodes and the various smartphone positions were measured manually by using laser distance meter (see fig 3).

The following table shows the output result, it contains the comparison between the actual coordinates of the smartphone as calculated by trilateration method with a number of iteration. By using the two technologies the number of iteration will be decreased, which cause the precision more accurate than chapter 4, in which we used only one technology.

N Actual location Trilateration Number of iteration
1 (5,4) (5.3,4.6) 4
2 (8,3) (8.6,2.5) 3
3 (4,4) (4.4,4.5) 4
4 (6,6) (6.5,5.6) 2

We have developed an Android software application (app), which can use any COTS smartphone. Fundamentally our designed application has three functionalities: (I) scanning four fixed nodes in indoor environment via BLE 4.0, (II) RSS measurement, (II) sending request via BLE 4.0, (III) beep sound detection, (IV) and visualization of the current position on the map as shown in the figure b.

The position of the user is displayed on the screen of the smart phone in context to the environment, with a map and surrounding items. Figure 11 shows an example of the software application on a smart phone screen. The current position of the user is shown with a dark red point with minimal transparency. Depending on the detection of the beep sound, the positions of the user are provided in real time from the nodes, displaying the current position on the smartphone has a time latency of approximately 100ms to 500ms. This is due to the window size of the signal processing, the calculation (30~50ms).

• Scenario 3: In this scenario, we conduct our experiments inside our office. Figure 10a shows the locations of the 11 fixed reference node (The black dots the position of the fixed reference node) and the positions where we estimate the locations. In these experiments, we estimate the user location using RSS measurement and beep ultrasonic signals.

During experimentation more than 30 test points were chosen randomly, the experiments took place in the company Shanghai Yong Chang Information Technology Co, Ltd close to Tongji university. The floor plan of the experiment area is shown in fig 13 a total of 11 nodes were deployed and used as reference points for map generation on the smartphone as well as location estimation. The HILS, was able to determine the locations of the smart phones within an 80 cm error between actual location and estimated location

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:map1.png

  1.                Fig. 13. Map of the experimental measurement of only based on RSS measurement of BLE

Macintosh HD:Users:MoYida:Desktop:thies:OneDrive:templet:ch5:map3 2.png

  1.                Fig. 13. Map of the experimental measurement of HILS


Scenario 4

The test environments in our experiment are done in the 7th floor of faculty of electronic and information engineering, Tongji University (Shanghai, china) as shown in Fig.4. It is a common office building with complicated structure. There are already many nodes based BLE 4.0 deployed in different office rooms, so we do not need to deploy more infrastructure. The chosen fixed reference nodes are indicated as blue points, Fig.4. They are placed about 3~6 meters apart. The smartphone we used for RSS measurement is HTC. In the data collection stage, RSS below -90dBm is ignored because the signal is unstable at that level.

Macintosh HD:Users:MoYida:Desktop:Screen Shot 2017-03-31 at 2.36.00 AM.png

Based on the RSS measurement our positioning system is shown in Fig.7. The result shows that the performance of the system can meet the requirement of indoor environment. It can be adapted to a large indoor place.

Macintosh HD:Users:MoYida:Desktop:Screen Shot 2017-03-31 at 2.36.56 AM.png

3.6 Chapter Summary

These Experimental operations were conducted on one of the spaces in our lab. We presented the characteristic of the HILS, based on BLE 4.0, ultrasonic technology and trilateration algorithm, our approach is oriented to provide a new architecture for low power consumption, accuracy, and a reduced computational cost.

The main purpose of this experiment is to observe the precision of user’s position based on raw RSS measurement of the BLE 4.0 and detection of the Beep signals received. In order to achieve a better result, the experiment is conducted with less human activities within the space to reduce the interference that could affect the RSS signals and beep detection. Total eleven nodes are configured as reference nodes and attached on the ceiling with position known to the user.

With Our Resume Writing Help, You Will Land Your Dream Job
Resume Writing Service, Resume101
Trust your assignments to an essay writing service with the fastest delivery time and fully original content.
Essay Writing Service, EssayPro
Nowadays, the PaperHelp website is a place where you can easily find fast and effective solutions to virtually all academic needs
Universal Writing Solution, PaperHelp
Professional Custom
Professional Custom Essay Writing Services
In need of qualified essay help online or professional assistance with your research paper?
Browsing the web for a reliable custom writing service to give you a hand with college assignment?
Out of time and require quick and moreover effective support with your term paper or dissertation?