SlideShare a Scribd company logo
1 of 66
Download to read offline
Department of Electronic and Electrical Engineering
UNIVERSITY COLLEGE LONDON
TORRINGTON PLACE LLONDON WC1E 7JE
UK Future Care/Cities Unlocked Hardware
Triangulation
MEng Project
Final Report
Mohamed Yahia Al Kahf
Salman Mian
Jenq Yao, Lim
Supervisor: Dr. Benn Thomsen
Second Assessor: Prof Paul Brennan
April 2016
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 1
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 2
Description of the work division
Jenq has been responsible for the following:
 Entire band (This includes the design, testing and implementation).
 Safety precaution for the ADC of CC3200 microprocessor.
 Transmitter circuitry
Salman has been responsible for the following:
 Wi-Fi connectivity and communications of the nodes and band
 Generation of the ultrasound frequency for transmitting nodes
 The android phone application
 Tracking algorithm
 Triggering technique for synchronising the nodes and band for transmitting & receiving
ultrasound
Yahia has been responsible for the following:
 Node receiver circuitry design and building
 Node and band ADCs
 Hub coordinator program
The report writing was divided amongst us describe as follows:
Jenq Salman Yahia
Abstract
1. Introduction
2. System overview 2. System overview
3. Role in the wider project
4. Application use cases
5.2 Bluetooth 5.4 Ultrasound 5.1 GPS & 5.3 Wi-Fi
6.1.1.3 Node transmitter circuitry 6.1.3 Enabling Wi-Fi
Communications
6.1.1 Node receiver circuitry &
6.1.3 Node ADC
6.2 Band
6.3 Android Application
6.4.2 Tracking algorithm 6.4.1 Coordinator program
7. Conclusion
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 3
Abstract
As part of the Microsoft-UK Future Care group whose target is to eliminate the need for close supervision
of an elderly person, we have developed an indoor positioning system (IPS) to locate a person of interest
to a resolution of 0.5m. Such accuracy is needed to precisely track that person.
GPS was not considered because its signals are unable to penetrate through building obstacles such as
walls. Other designs were also discarded such as the ZigBee-based system developed by (Sugano, 2006)
[1]
. A system that was implemented to achieve indoor tracking of a person by measuring the RSSI of the
signal emitted by the system’s ZigBee devices. The reason why this particular technique was overlooked
was because its special resolution error of 1.5m-2m was deemed unsuitable for our application.
The aim of this project is to design and build a portable IPS that can be used for monitoring the
movements of people indoors, achieving a high level of spatial accuracy (an accuracy of at least 50 cm)
while being powered by off-the-shelf batteries.
The technology that was proven to achieve the best spatial resolution is ultrasound. According to (Holms,
2012) [2]
that resolution can be expected to be in the sub-centimetre levels. The system utilises the Time-
Difference-Of-Arrival (TDOA) technique as it saves on power: the ultrasound emitter only transmits and
the target only receives.
The system design makes use of custom-built nodes as ultrasound emitters which are placed in the
corners of the celling, a custom-built band as a receiver worn around the wrist of a person that is to be
tracked, a phone application serving as the user interface to the system and a computer coordinating the
devices known as the Hub.
Each component of the system has been successfully built and tested. A system test was also achieved
and yielded a satisfactory spatial resolution of 27 cm.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 4
TABLE OF CONTENTS
1 Introduction ............................................................................................................................................6
2 System Overview.....................................................................................................................................7
3 Role in the wider project.......................................................................................................................10
3.1 UKFC project..................................................................................................................................10
3.2 Cities unlocked project..................................................................................................................11
4 Application use cases ............................................................................................................................11
4.1 UKFC relevant use cases................................................................................................................11
4.1.1 Finding Deirdre’s location .....................................................................................................11
4.1.2 Reading values from relevant sensors ..................................................................................12
4.2 Cities unlocked relevant use case .................................................................................................12
5 Potential localisation enabling techniques ...........................................................................................12
5.1 GPS ................................................................................................................................................12
5.2 Bluetooth.......................................................................................................................................12
5.3 WI-FI ..............................................................................................................................................13
5.3.1 RSSI based triangulation........................................................................................................13
5.3.2 Time-of-flight triangulation...................................................................................................14
5.4 Ultrasound.....................................................................................................................................14
5.4.1 Time of flight (ToF)................................................................................................................14
5.4.2 Time-difference of arrival (TDOA)[19]
....................................................................................15
5.4.3 RSS (Received signal strength) [2]
...........................................................................................15
5.4.4 Related work .........................................................................................................................15
6 System design........................................................................................................................................16
6.1 Node..............................................................................................................................................16
6.1.1 Node circuitry........................................................................................................................16
6.1.2 Signal generation...................................................................................................................23
6.1.3 Node ADC ..............................................................................................................................23
6.1.4 Enabling Wi-Fi Communication.............................................................................................24
6.2 Band ..............................................................................................................................................31
6.2.1 Introduction (Band Functionality).........................................................................................31
6.2.2 Design & Specification...........................................................................................................32
6.2.3 Testing and Results................................................................................................................34
6.2.4 Band’s ADC and differences with node’s ADC.......................................................................37
6.3 Android Application ......................................................................................................................38
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 5
6.3.1 Requirements........................................................................................................................38
6.3.2 Design & tests........................................................................................................................38
6.3.3 Evaluation..............................................................................................................................50
6.4 Hub program .................................................................................................................................50
6.4.1 Coordinator program ............................................................................................................50
6.4.2 Tracking algorithm.................................................................................................................55
7 Conclusion.............................................................................................................................................63
References.....................................................................................................................................................64
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 6
1 INTRODUCTION
We are part of projects called UK Future Care (UKFC) and Cities Unlocked (CU) which are faced with the
challenge of coming up with systems that either monitor a person’s health (in the UKFC case) or guide a
visually impaired person (in the CU case).
The UKFC project is to combine data from environmental sensors and from a Microsoft Band to perform
predictive analytics to allow monitoring a person from a distance. And the CU project developed a sound-
based technology to assist and enable people with sight loss as they plan and undertake journeys in the
city.
Both of these projects require location data to be provided as one uses that data to allow other people to
track them and the other uses it to direct the person of interest. Therefore, the main role of our team in
these projects is to provide the ability of locating a person’s position indoors by supplying an Indoor
Positioning System (IPS).
Today GPS is the go-to technology for tracking the position of an object or a person. It however does not
perform well indoors because its signals are not able to penetrate physical barriers. For that reason IPS
are used instead for indoor tracking applications.
Approaches demonstrated to date for IPS include: using Radio frequency techniques such as Wi-Fi or
ZigBee. (Vasisht, Kumar and Katabi, 2015) [3]
developed a system using three Wi-Fi emitters and a single
receiver (Vasisht, Kumar and Katabi, 2015) exploited the relationship between the time-of-flight of
electromagnetic signals and their spectral phase. The evaluation of three signals’ time-of-flight led to a
median localisation error of 35cm and 62cm when in line of sight and not in line of sight respectively.
(Sugano, 2006) demonstrated, built and tested a ZigBee-based system which boasts both a ZigBee emitter
and receiver. Localisation of the receiver was made possible by evaluating the strength of the signal
generated by the emitter. This achieved a spatial resolution of 1.5m-2m.
The solution proposed by (Vasisht, Kumar and Katabi, 2015) achieved a very high special resolution
however this came at the expense of a very complex system. (Sugano, 2006) prioritised simplicity and
inexpensiveness yet the achieved resolution was very poor.
(Holms, 2012) shows that an ultrasound-based IPS making use of ultrasound Time-Difference-Of-Arrival
(TDOA) can achieve a spatial resolution of sub-centimetres to a few centimetres which is already better
than both resolutions obtained by the ZigBee and Wi-Fi inspired systems. This advantage is the reason
why our solution employs ultrasound to perform positioning based on Time-Difference-Of-Arrival (TDOA)
technique.
The overall system consists mainly of ultrasonic transducers, a coordinating unit called Hub, a mobile
phone and a band. In addition, the main mechanisms used in our IPS system are grouping and
triangulation. The system utilises the captured ultrasonic signals as the sensory information to
unambiguously triangulate the position of a person.
We first introduce the system then we discuss our involvement in UKFC and CU further which are then
illustrated with application use cases. Following this, we discuss the potential localisation enabling
technologies and the associated techniques to demonstrate why ultrasound was chosen and lastly, we
describe our system and its subsystems in detail by providing requirements, design, tests and evaluation.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 7
2 SYSTEM OVERVIEW
This section describes our solution to the aforementioned problem. The overall system is illustrated in
figure 1.
Figure 1: Overall system design [4][5][6]
Responsible for the generation of ultrasonic signals are devices we call nodes. Capturing the emitted
signals is an ultrasound-receiving device called band. Both node and band also boast Wi-Fi capabilities
enabling then to communicate with the Hub, which in this case is a computer and will later become a
Raspberry Pi 2. The hub acts as the system’s coordinator as it controls the operations of nodes and bands.
It is controlled by the system’s user via the phone application.
The devices that enable band triangulation, i.e. the nodes, are grouped such that each group is formed by
the devices located in a single room. This allows the Hub to only trigger a single cluster of devices instead
of them all which saves battery life. The grouping of these devices which are oblivious to their location
within the house is now possible by using ultrasound: one device in each room is a master (Hardcoded
and is known by the colour of the node) and is told by the Hub to send out an ultrasonic pulse towards
the other nodes (the slaves). Ultrasonic signals can only travel within a single room therefore, only the
nodes that share the same room hear that pulse and report back to the Hub. The Hub can now group the
slaves with the master they heard. The user gives a name to this newly formed group via the android
based phone application. This interaction is illustrated in figure 2.
Master
Bedroom
Living room
Hub
Slave
Kitchen
Ultrasound
BandSmartphone
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 8
Figure 2: Flow diagram describing the system setup and grouping protocol.
Once the grouping protocol is completed the next step would be to register a person into the system. This
is done by adding our custom-built that they would wear around their wrist. In order to accommodate
multiple persons within the system bands would be given unique names. This process is shown inn figure
3.
User
Install Smart
Config or Android
App
Specify AP
settings
Initialise Smart
Config
Initialise Grouping
Protocol
Give name to
group
Phone
Connect to AP
Send
Broadcast
Store Hub’s IP
Address
Smart Config App
Trigger to hub to start
Waiting user of
completion
Forward name to group
HUB
Connect to AP to
declare database
Receive phone’s IP
address
Trigger masters to
send ultrasound(one
by one)
Update database
with groups
Send completion message
Assign name to group
Nodes
Connect to AP
Masters send
ultrasound
Slaves that have
heard
IP
Send ACK
Update database
Send Broadcast
Store Hub IP
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 9
Figure 3: Flow diagram describing the addition of a band to the system.
The user then initiates the localisation protocol via the phone application which forwards that command
to the hub. The latter triggers the band to listen to the ultrasonic pulses emitted by the synchronised
master and slaves. Once the ultrasound pulse is captured, the band sends it to the Hub which uses a
TDOA based algorithm to compute the band’s position. This is shown in figure 4.
Figure 4: Flow diagram describing the triangulation protocol.
User Phone Hub Band
Push Button on
Band
Give name to band
Ask for
Communicat
e name to
Hub
Store IP
Associate IP
with name
Broadcast
IP
Stores Hub’s IP
Confirmation
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 10
3 ROLE IN THE WIDER PROJECT
We are the UKFC/Cities Unlocked Hardware Triangulation group and a part of a wider group that consists
of software engineers, system software engineers & electronic engineers. In particular, we are a part of
the UK future care (UKFC) group and the Cities Unlocked group in collaboration with Microsoft. This
section primarily aims to specify the context of our project within the wider project.
3.1 UKFC PROJECT
The UKFC consists of our group and another group called the UKFC/365Agile team. In order to understand
their role, consider the following scenario which describes the goal of the project:
“Deirdre, an elderly mother collapsed on the floor whilst Alfie, her husband was playing golf at his golf
club. Her sons Sam & Nigel, live far away from the house and so, there is no one looking her at home.
Sam & Nigel decided that they would like to monitor her whilst they are away for peace of mind. They
contacted KCC (Kent county council) and they were sign-posted to a service that they can purchase and
install for themselves.”
At the moment, Deirdre would wear a pendant alarm around her neck that has a big red button which
when pressed, would alert someone to help her. The device is both unattractive and doesn’t work outside
of the home. This leads to the requirements of a service that doesn’t bind mum & dad to the home and to
not force them to wear an unattractive device.
An external company called 365 Agile can provide home monitoring services but using it as a standalone
system wouldn’t be sufficient as personal health data such as the heart rate of a person would be crucial
to determining the physical wellbeing of a person E.G. wasn’t breathing. The UKFC/365Agile group were
therefore, tasked with combining data from the home monitoring services provided by 365 Agile and
from the Microsoft band in order to perform predictive analytics. This would enable Sam & Nigel to take
preventative measures to support mum & dad from afar.
Figure 5: The architectural diagram of the overall system
Figure 5 illustrates the system for the entire UKFC project which comprises of the data gathering layer,
cloud services layer and the application layer. We specifically fit into the data gathering layer of the
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 11
project where we provide location data but also in the boundary between the data gathering layer and
the cloud service layer where we provide data filtering based on that location.
3.2 CITIES UNLOCKED PROJECT
The Cities Unlocked Umbrella is faced with enabling a blind person to find their way inside buildings.
Here, we fit in the same role as that in the UKFC group whereby providing location data of the blind
person to facilitate movement inside buildings.
4 APPLICATION USE CASES
This section describes the relevant use cases to the UKFC project and to the Cities Unlocked project.
Figure 6: Several rooms inside the house is shown. Each room has several sensors. Deirdre is marked with
a cross and is in the bedroom.
4.1 UKFC RELEVANT USE CASES
4.1.1 Finding Deirdre’s location
When Deirdre falls, an alert is sent to Sam/Nigel that the fall occurred. If Sam/Nigel is within range then
their phone will receive her location inside the house. This would enable Sam/Nigel to immediately locate
her within the premises where in figure 6, her location is in the bedroom. In addition, Sam/Nigel can act
swiftly to the fall without wasting time of searching for her inside the house which may have significant
number of rooms.
For future deployment, this may not be limited to Deirdre’s home and may extend to infrastructures away
from the home E.G. Library. By implementing it away from the home, this enables further use cases such
as locating a lost person within the supermarket.
Bedroom Kitchen
Living room Bathroom
S1
S2S0
S3
S5S4
S6
S8S7
S9
S11S10
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 12
4.1.2 Reading values from relevant sensors
Once we know Deirdre’s location inside the house and if there are sensors in every room of the house, it
may be unnecessary to read data from every sensor. It may be better to read the values of the sensors
that are close to Deirdre’s position inside the house such as sensors S1 & S3 as shown in figure 6. By
reducing the range of sensors whose values are read, less processing is required in terms of the amount
of data but also, more relevant data is used in calculations.
These use cases requires our IPS to have a high spatial resolution as to correctly define the seriousness of
the fall E.G. If she has fallen on the stairs as opposed to falling on the couch in which falling on the stairs is
more serious. Additionally, to define Deirdre’s location correctly inside a house would require sufficiently
high resolution as to minimise the chance of false location.
4.2 CITIES UNLOCKED RELEVANT USE CASE
The use case for cities unlocked project is similar to that described in section 4.1.1 whereby we would still
find the position of a person but for the purpose of directing a visually impaired person within other
infrastructures such as departmental stores oblivious to them.
5 POTENTIAL LOCALISATION ENABLING TECHNIQUES
This section describes how GPS, Bluetooth and Ultrasound technologies are used in positioning a person,
what techniques are used with each technology and discuss the disadvantages & advantages each
scheme.
5.1 GPS
The global positioning system is the most utilised localisation method today, and for that reason further
investigation into GPS was performed to see whether it can be used to achieve the goals of the project.
However it was decided that GPS was not suitable for the following reasons:
 It does not provide accurate results indoors for the GPS signal gets heavily attenuated when
travelling through walls [7]
.
 Time to first fix or TTFF is the time it takes for the GPS receiver to calculate its first position using
data sent by GPS satellites. This may take a minute or more [8]
.
 GPS receivers are huge power consumers and this is because they must remain in their active
mode during the entire acquisition [9]
, they usually come with rechargeable batteries. Some
models can only work for up to 3 hours when powered by 4 AA batteries while most require even
more power [10]
.
5.2 BLUETOOTH
In wireless sensor networks, nodes can be static or mobile, depending on the application requirements.
Dealing with mobility can pose some formidable challenges in protocol design, particularly, at the link and
network layers. These difficulties require mobility adaption algorithms to efficiently localise mobile nodes
and predict the quality of link that can be established with these nodes.
An off-the-shelf development platform that uses Radio Signal Strength Indication (RSSI) is mostly selected
as the sensor localisation method, especially in the indoor environment. A series of experiments have
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 13
been carried out to calibrate and map RSSI to distance. Despite this, research work has failed to prove the
reliability of RSSI for indoor localisation.
Based on previous work, results show that the RSSI method gives an unacceptable resolution and thus is
not reliable for the indoor sensor localisation [11]
. This is firstly because even in line-of-sight RSSI doesn’t
give a consistent behaviour, so in a more realistic environment the performance of RSSI can be much
more unreliable because of the presence of confounding factors like interference from other objects and
attenuation caused by obstacles. Secondly, as the distance between the two motes increases, the error in
measured RSSI values increases. Therefore RSSI gives extremely unreliable results and in conclusion,
standalone RSSI cannot be used as a method for distance measurements in localisation algorithms.
Bluetooth fingerprinting is an adaptation of RSSI for indoor positioning system [12]
. Bluetooth Low Energy
was deployed in this approach because it has a low power consumption. The fundamental idea of how
this method is done is to match access point in a database to a particular signal strength fingerprints in an
area. For this reason, Bluetooth class 3 is suitable for indoor usage as it produces a resolution of around 5
cm.
This approach is carried out by two stages namely the training stage and the online positioning stage. In
the training stage, the radio map is created based on the reference points within the area of interest. The
radio map implicitly characterises the RSSI-Position relationship through the training measurements at
the reference points with known coordinates. In the online positioning phase, the mobile device
measures the RSSI, and the positioning system uses the radio map to obtain an estimate of the mobile’s
position.
The fingerprinting method has been widely discussed for indoor positioning. A method called Bayesian
fusion was engaged to carry out the field test for indoor positioning by combining the posterior
estimation from the RSSI measurements and the prior information from a motion model [13]
. Through this
investigation, a total of 13 long-range access points were deployed in the area of interest. The results
showed that the method was effective and achieved a good enough resolution for the purposes of this
project.
5.3 WI-FI
Wi-Fi is another means of achieving localisation, and there are two main methods:
● RSSI (received signal strength indicator) where a Wi-Fi signal is transmitted from a source of known
position. The location of the target is determined by the strength of the signal that the target picks
up.
● Time-of-flight where a set of nodes serving as references of known location are used to find the
location of a target. Each node tries to find how far the target is from itself. This is done by detecting
the time it took a Wi-Fi signal to either reach the target (if the node was emitting Wi-Fi) or the
reference node (if the target was emitting Wi-Fi).
Wi-Fi based triangulation is preferred to Bluetooth based triangulation because it relies on hardware that
has already been deployed (a house would already be equipped with a Wi-Fi router for example) so it
does not require the deployment of anything extra.
5.3.1 RSSI based triangulation
Triangulation by means of RSSI generally outputs results that are not very reliable and this is because Wi-
Fi signal strength depends on the environment in which Wi-Fi finds itself. The environment may be the
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 14
source of reflections, among other phenomena that affect the propagation of electromagnetic waves,
leading to significant fluctuations in the detected signal strength heavy signal strength fluctuations. This
means that results obtained may be many meters off the mark. Therefore taking multiple RSSI
measurements instead of a single one will help reduce the margin of error. Studies on standard deviation
of results obtained by RSSI methods show that these yield a triangulation resolution of 2.5 m [14]
which for
the purposes of the project is too high.
Attempts at improving the results obtained by using the RSSI method have been attempted and one in
particular has been able to greatly improve the RSSI resolution to a more respectable 0.8 m [15]
by using a
gyroscope in tandem with Wi-Fi: It was found that signal strength experiences minimum variation when
the target device is in line of sight of the Wi-Fi source, so the proposal uses a gyroscope to only take
strength measurements when this condition is true. This approach is not suitable for the purposes of the
project because it requires at least three access points in the vicinity of the target and because
Wi-Fi fingerprinting is a method that expands on the RSSI idea: a map is created and cut into sections that
are associated with a signal strength value, the expected value that a device would measure if it was
inside that section. This method requires a large number of cooperative access points in order to attain a
good enough resolution. In (Navarro, Peuker and Quan, 2010)[16]
a mean resolution of 0.37 m was
achieved using six access points 18 meters far from one another without having their signals suffer from
attenuation due to the presence of obstacles such as walls.
5.3.2 Time-of-flight triangulation
The time-of-flight concept is not generally used in Wi-Fi triangulation and this is because the nature of the
signal is electromagnetic, therefore it travels at the speed of light, making its detection very tricky. Clock
frequency is the key to achieving a good resolution: as detection is achieved on the rising edge of a clock
cycle, the clock period must be small enough to not translate into meaningful delay. Therefore only
dedicated devices can actually be used to get a resolution that is acceptable for the purposes of the
project as they have a very high clock frequency (close to 1 GHz) and these devices are usually very
expensive, too expensive for time-of-flight to be considered as a triangulation candidate.
One method of avoiding the clock problem has been proposed by (Vasisht, Kumar and Katabi, 2015)[3]
where it was noticed that the spectral phase of the Wi-Fi signal was in a direct relation with that signal’s
flight time. Taking phase measurements on different Wi-Fi frequency bands yielded impressive results: a
resolution of no more than 20 cm. If the resolution obtained from a single band (the 2.412-2.462 band) is
comparable to that then this method may well be a method that can fulfil the project’s goal.
5.4 ULTRASOUND
This chapter describes the ultrasound wave, its suitability to the application of triangulation and its
deployment in both the grouping protocol and in the triangulation protocol.
Ultrasound is a sound wave of any frequency above 20 KHz[17]
. It cannot be heard by humans as humans
hearing is between 20 Hz – 20 kHz[18]
.
There are three main techniques for deploying ultrasound based triangulation. These are time of flight,
time difference of arrival & received signal strength.
5.4.1 Time of flight (ToF)
To measure time of flight, the point of reference is taken from one point and so, does not require clock
synchronisation between two nodes.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 15
5.4.2 Time-difference of arrival (TDOA)[19]
Time difference of arrival is measuring the time of arrival of a signal in one direction. There are multiple
implementation techniques for TDOA:
1. One way time of arrival
2. One way time of arrival with multiple receivers OR multiple time of arrival with one receiver
First method requires precise synchronisation of clocks whereas, the second method requires
synchronisation of clocks between the multiple transmitters/receivers.
5.4.3 RSS (Received signal strength) [2]
There are three different RSS based techniques:
1. Binary Signal Strength: it involves two nodes, one transmitter and one receiver. This method
simply measures the amplitude of the receiver and outputs whether the transmitter is within
range of the receiver.
2. Relative Signal Strength: it involves a transmitter array which sends ultrasound in different
directions, each at different times with different codes. Multiple receivers is then used to obtain
the RSS and then compares each one to each other to find which sector that the receiver was
located in.
3. Absolute Signal Strength: it involves measuring the RSS and obtain range directly from an accurate
propagation model. From (Holm, 2012), the accuracy that was obtained was in order of 10 cm.
5.4.4 Related work
(Holm, 2012) describes ultrasound based systems but does not deploy the system. The paper describes
that for locating objects in a room that TOF is better due to accuracies in the cm or sub-cm range. This can
be enhanced using spread spectrum coding. For locating people in large institutions, binary RSSI is
sufficient.
(Segers, L., Bavegem, D., Winne, S., Braeken, A., Touhafi, A and Steenhaut, K. 2015)[20]
describes an TDOA
based approach to localisation whereby, using frequency hopping spread spectrum (FHSS) to modulate
the data sequence with field programmable gate arrays (FPGAs) acting as the transmitters & receivers of
ultrasound pulses. They directly wire the transmitter and receiver to synchronise the sending and
receiving of ultrasound. The system does achieve a very good spatial resolution of <5cm.
This approach and like any spread spectrum based system, they encounter the near-far problem which is
well-known to these systems but not solved very easily. The problem is described as follows: At particular
positions where at least one node is much closer to the receiver than the rest of the nodes, the closer
node would result in the receiver receiving a signal power that dominates those that are further away.
This leads to the correlation being saturated and therefore, unusable for determining position
Although the accuracy is very good, due to the transmitting nodes and receiving nodes being
synchronised by a wire, this wouldn’t suit our application requirement of being portable.
(Medina, C., Segura, J and Torre, Á, 2013)[21]
describes a TOF based system which consist of ZigBee based
wireless nodes and emits ultrasound at a single frequency of 40 kHz. The synchronisation in this system is
achieved by time division multiple access (TDMA). The nodes are divided into a single master node and
end nodes (Termed slave nodes).
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 16
The master node is connected to a PC where it acts as the coordinator of the system i.e. the interface
between the user application and the slave nodes. The slave nodes simply receive or transmit ultrasound
as they have transducers and their operation is controlled by the master node.
This approach does report a very good error in distance measurements of less than 2mm and a root mean
squared error of 9.5mm for positioning. It does specify low power however, it doesn’t give any values to
show evidence for this. The problem with implementing this approach is that ZigBee isn’t readily found in
infrastructures such as homes and typical buildings which is why this system uses a master node attached
to a computer in order to achieve positioning. This wouldn’t be convenient to the user in our application
as they may not have a spare laptop lying around or they may simply not want their personal laptop to be
on all the time due to power consumption or other considerations.
6 SYSTEM DESIGN
This section of the report covers the individual subsystems that interact in the grouping and triangulation
protocols shown in the figures shown in the system overview section.
6.1 NODE
6.1.1 Node circuitry
Figure 7: A node’s block diagram.
Figure 7 above illustrates the different components at play enabling the node to both transmit and
receive ultrasound signals.
Since nodes are responsible for sending ultrasonic signals used in the triangulation of band’s position,
they are therefore equipped with ultrasonic transmitters (transmitters were chosen instead of
transducers because they output signals with better sound-pressure levels). As ultrasound signals
experience attenuation when propagating, as seen in figure 8, amplification of signals captured by the
receiver as well as the amplification of signals sent to the transmitters becomes necessary.
Microcontroller
Wi-Fi
ADC
PWM
Receiver
Active
Bandpass Filter
Smoothing circuit
Speaker
Amplifier
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 17
Figure 8: Attenuation of ultrasound signals versus distance travelled. Results were obtained by using
400ST/R120 ultrasonic transmitters and receivers. Transmitters were powered at 9V p-p, provided by a
signal generator.
In order to eliminate added noise form the amplifier a band-pass filter stage has been integrated as well.
Its frequency response will only passes along the bandwidth of interest, which ranges from 39.5 to 40.5
kHz for the 400ST/R120 devices.
In order to simplify signal detection the design includes a smoothing circuit; a combination of a precision
rectifier and a smoothing capacitor. This transforms the AC nature of the signal to a DC component which
simplifies the operation of the ADC for it will only need to read the voltage level of its input.
A microcontroller is also fitted into each node in order to:
1. Generate the electrical signal fed into the ultrasound speaker. A task performed by taking
advantage of the Pulse-Width modulator module.
2. Process these signals.
3. Communicate with hub via Wi-Fi.
The microcontroller chosen to accomplish the task mentioned above is Texas Instruments’ CC3200. This
microcontroller has Wi-Fi capabilities, suitable ADC and PWM modules and is power efficient.
6.1.1.1 Requirements
Six main requirements have been identified as needed to obtain an acceptable node circuit design:
1. Ultrasonic transmitters and receivers
The nodes are envisaged to be placed in the upper corners of a room of interest therefore they will
need receivers that can detect signals coming from all directions. This means that there angle of
detection will need to be of 90 degrees both vertically and horizontally. In order to further signal
0
200
400
600
800
1000
1200
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Vp-p(mV)
Distance (m)
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 18
reception the transmitter chosen will need to have an acceptable sound-pressure level (SPL); one that
can cover a decent distance, chosen for the purposes of this project to be of 10 meters The receiver
on the other hand will need to have a good sensitivity so to allow it to capture faint ultrasound signals
that travelled those 10 meters.
2. Impedance matching
An impedance matching stage will need to be accounted for to allow maximum power transfer between
the ultrasound receiver and the rest of the circuitry.
3. Battery-suited design
The active components that will contribute to signal conditioning will be powered by 9V batteries
therefore will need to draw as little current as possible to prolong battery life.
4. Gain stage
Both the transmitter and receiver circuits will require one. The CC3200 will be powered at 3.6 V which
signifies that the output of the PWM module will be much smaller than the supply level (it was
measured in fact to be of 2.7 V). To take advantage of the full voltage swing of the supply and ensure
that transmitter output the loudest possible ultrasound (which increases the distance theses signal
can travel) a gain stage of 11 dB amplification is required.
A gain stage will also be needed to make sure that the signal remains detectable at long distances
which means that the signal-to-noise ratio will need to be set as a factor of 2 at least when the
distance between the transmitter and the receiver is of 10 m. The exact value of the received signal
when the distance is 10 m was not found because noise levels are too high for it to be detectable
however it can be estimated by knowing that sound attenuation follows an inverse-square law and be
extrapolating the plot in figure 2 by following that law. The estimation found is a detected signal of
amplitude 1.8mV p-p. In order to respect the SNR level chosen the amplifier gain will need to be set at
21 dB according to equation 1.
= 20 ×
×
≈ 21 Equation 1
5. Filtering
As a gain stage was found to be required this led to the need for filtering added noise (which accounts
for resistor thermal noise and operational amplifiers’ input referred voltage noise).
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 19
6.1.1.2 Transmitter’s Development
Figure 9: Circuit diagram of transmitter.
The schematic design of transmitter circuitry is presented above in figure 9. It is a non-inverting op amp
with a gain of 3.3 V/V. The purpose of implementing this circuitry is to amplify the signal generated from
the microcontroller. As a result of that, this enables the ultrasonic transmitter to generate the required
ultrasonic signals at 9Vpkpk.
6.1.1.3 Receiver’s development
To achieve the functionalities outlined in figure 7 a circuit diagram was designed. It can be seen in figure
10.
Figure 10: Circuit diagram that achieves the functionalities illustrated in the receiver block diagram, part
of figure 7.
What follows describes the steps taken that lead to the development and building of the circuit diagram.
First two key parameters of the ultrasound receiver were put to the test: its directionality and its
sensitivity versus distance. These parameters were needed in order to choose the right amplification gain.
To test directionality a receiver was connected to an oscilloscope; a transmitter was placed 5 cm away
while being powered by an 8V peak-to-peak sine wave. The transmitter was moved at increments of 20°
around the receiver while maintain a distance of 5 cm, due to the symmetry of the directionality, its
measurement were only performed on the right hand side of the receiver. The output of the receiver was
recorded and plotted in figure 11. It confirms that the receiver, just like the transmitter, has a
directionality angle of 85°.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 20
Figure 11:
On the left, 400ST120 (transmitter) signal attenuation (in dB) versus ultrasound incident angle (in °) [22]
On the right, 400SR120 (receiver) signal attenuation (in dB) versus ultrasound incident angle (in °)
As for sensitivity versus distance the receiver was placed in line of sight of the transmitter while the latter
was still powered by the 9V sine wave. The distance between the devices was increased accordingly and
measurements were taken for each distance. These results for the plot seen in figure 8. It was deduced
that the plot follows an inverse-square law which was expected since sound attenuation resulting from
propagation also follows that same law.
Once the transmitter and receiver were proven to be satisfactory their internal impedance had to be
found. This was done by observing the output voltage of the receiver when varying matching impedance
values. The impedance was tested by having a transmitter sending a constant 40 kHz signal in the
direction of a receiver connected to the impedance matching resistor and the oscilloscope. The 100 kΩ
resistance at which the output was found to be at a maximum was chosen as the impedance matching
resistance.
The filter and amplifier were designed simultaneously for it quickly became clear that an active filter
circuit could simply combine the two. Figure 12 shows the frequency response of the ultrasound receiver.
It shows that the drop-off offered is very sharp. This implies that the filter will not require a sharp
frequency response because it has already been achieved. Instead the filter will need to deal with noise
sources that influence the rest of the circuitry. These will come in the form of thermal noise generated by
the use of resistors in the circuit and input-referred voltage noise generated by the usage of op-amps.
Figure 12: Frequency characteristics of the 400ST/R120 ultrasound devices [22]
.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 21
The proposed design is an active bandpass filter combining a low-pass filter and a high-pass filter. It uses
TL084BCN operational amplifiers because these, according to their datasheet[23]
, have:
1. A good slew rate (13V/µs) to deal with frequencies in the tens of kHz.
2. A good Gain-Bandwidth product to enable the amplifier to provide a gain of 21 dB.
3. Low input referred voltage noise: 18 /√
= × 18 × 10 × ℎ = 0.2 Equation 2
According to equation 2 even ultrasound signals that have travelled 10 m and have been
attenuated to 1.8 mV can be amplified without being drowned by noise.
Since the receiver’s bandwidth must be within the pass band of the filter, a second order Butterworth
filter design based on the Sallen-Key topology was chosen. This filter design, unlike the Chebyshev version
presents no attenuation in the passband; attenuation that can limit detection of very small input signals.
The filter’s high pass corner frequency was set to 33.8 kHz according to equation 3 and the low pass
corner frequency at 49.8 according to equation 4. The total gain of the circuit amounts to 27.6 dB, given
by equation 5. The reason for the disparity between this gain and the gain set in the requirements section
is because while the 1 kHz bandwidth falls within the passband it does get slightly attenuated; the extra
gain boosts the signal further, eliminating this attenuation.
= × × ×
= 33.8 Equation 3
= × × ×
= 49.8 Equation 4
= 2 × 20 × 1 +
.
= 27.6 Equation 5
A smoothing circuit was added to the design and acts as an AC-to-DC converter. It is needed because it
simplifies the operation of the ADC which requires constantly positive inputs, therefore it eliminates the
need for an additional offset stage. Further detail on why this topology was chosen are given in the
section that covers ADC operation. This stage comprises of a precision rectifier and a smoothing
capacitor. The precision rectifier topology was chosen because the output signals of the amplifier may not
be large enough to drive a simple diode. This circuit eliminates the negative swing of the signal and the
smoothing capacitor, which was chosen to be 1µF in order to have a large enough charge/discharge
period, completes the signal conversion.
6.1.1.4 Testing and results
The active filter’s frequency response was tested first. A simulation of the circuit was run on Multisim in
order to compare its results with the actual design. The circuit itself was tested by having a signal
generator generating a 100 mV p-p sine wave as an input signal. The results of the simulation and
experiment have been grouped in figure 13.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 22
Figure 13: Plots of the simulated and measured receiver frequency response.
The result of that experiment shows that the built active filter does achieve the required gain however its
frequency response is steeper than expected. It even looks as though the built high pass filter is of a
higher order than the simulated one yet they are both, in fact, second order filters. This difference does
not have any undesirable effects, quite on the contrary, it allows for better filtering.
The smoothing circuit was then added to the filter and the active filter-smoothing circuit combination was
also tested first using an input sourced from a signal generator outputting a 100 mV 40 kHz sine wave.
The tests’ purpose was to verify that integration of the two circuits went smoothly, without impedance
mismatches. The result of these tests are shown in figure 14.
Figure 14: Output of smoothing circuit.
It can be deduced that the smoothing of the AC signal has been successful, the output of the smoothing
capacitor can be directly connected to the ADC module with no expected issues.
Finally one last test was performed in which the input was connected to the ultrasonic receiver instead. A
transmitter was placed 1 m from the receiver and was powered by a signal generator outputting a 9 Vp-p
sine wave. The results of this test in accordance with the results obtained in figure 14.
-15
-10
-5
0
5
10
15
20
25
1 10 100 1000
Gain(indB)
Frequency (in kHz)
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 23
6.1.2 Signal generation
Nodes need to be distinguished in the triangulation protocol in order to compute positioning. In previous
works, there were two main techniques in enabling this:
 Transmit a sequence of bits unique to each node (Which spreads the signal across some
bandwidth)
 Do either time division multiple access (TDMA) where each node sends one at a time or
frequency-division multiple access (FDM) where each node has a different carrier frequency
We use FDM as this is simpler to implement & less power consuming than transmitting a sequence of bits.
In comparison to TDMA, it would again use less power as TDMA would result in the receiver listening
multiple times.
Pulse width modulation is used to generate a finite square wave pulse at a particular frequency with 50%
duty cycle. The filter of the ultrasound transmitter eliminates all but the fundamental frequency which
converts the square wave into a sine wave.
6.1.3 Node ADC
Upon detection of ultrasound, the receiver will convert it to an electronic signal which then goes through
the signal conditioning unit. The output is an amplified and filtered version of the input. The processing unit,
which in this project is the CC3200, is still not aware that ultrasound has been detected and therefore
cannot react accordingly. So for the microcontroller to know of the presence of ultrasound it will need to
have an interface with its analogue surrounding. This interface will come in the form of analogue-to-digital
converters (ADC) and will have the output of the signal conditioning unit as its input.
6.1.3.1 Requirements
The ADC required will need to be able to:
1. Sample the 39.5 to 40.5 kHz ultrasonic signals, and therefore will need to have a sampling rate of
at least 81 kHz as per the Nyquist rate.
2. Detect 1.8 Vp-p signals as these are the received ultrasonic signals that have travelled a distance of
10 m. For the ADC present on the CC3200 unit, which has a maximum input level set at 1.4V, this
translates into an ADC resolution of 10 bits according to equation 6.
= log . ×
= log
.
. ×
= 9.6 Equation 6
6.1.3.2 Development
One of the reasons why Texas Instruments’ CC3200 microcontroller was chosen was because it met both
requirements:
1. It has 4 ADC input channels with a sampling rate of 62.5 kHz per channel. So combining channels
leads to increased sampling frequency: 125 kHz for two channels and 250 kHz when using all four.
2. Its resolution is of 12 bits, allowing digitisation of signals as small as 0.3mV.
The ADC proposed by the CC3200 microcontroller cannot accept voltages that either are negative or
exceed 1.8 V. To deal with negative voltages the node circuits convert the alternating current voltage
outputted from the ultrasonic receiver to a direct current voltage.
The ADC of the nodes had its sampling frequency set to 125 kHz (this was achieved by having the ADC
continuously switch between two input channels, as can be seen in figure 15. Once called upon it
captures 85 ms worth of samples (a duration chosen to guarantee capture of ultrasound signal if one was
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 24
sent). It is first called upon as the device boots up to establish a noise baseline (it does this by averaging
sampled data collected when no ultrasound has been emitted). The microcontroller then compares that
baseline level to the average of samples captured when ultrasound is being emitted. If the average is
found to be more than double the baseline the microcontroller concludes that ultrasound has been
detected.
Figure 15: State diagram of the ADC when set to sample at 125 kS/s.
6.1.3.3 Testing and Results
For testing purposes, the ADC was initially fed a 40 kHz signal of amplitude 0.2 V with an offset of 0.1 V
from the signal generator. This is a generic signal that can be reproduced by the receiver hence why this
configuration was chosen. The node’s ADC was tested by having one of the LEDs on the CC3200
Launchpad flash once the average of the signal samples was found to be more than twice as large as the
baseline.
The node’s ADC test was a success when either the 0.2V generic signal or the actual ultrasound
transmitter and receiver were used as inputs: The LED only flashed when the input signal was at least
twice the amplitude of the noise baseline.
6.1.4 Enabling Wi-Fi Communication
This section describes the algorithms used to:
 Enable the WIFI connectivity,
 The communication between the hub and the microcontrollers
 The transmission of ultrasound pulses
 The capture of those pulses
6.1.4.1 Overview
WIFI connectivity
 The setup of connecting to the WIFI access point is done via an app named Smart Config which is
installed on an android or IPhone device.
 The user must ensure that the phone is connected to the desired WIFI access point
 He/she will enter their network security key via the app
Switch to
channel
1
Switch to
channel
2
Sampling on channel 1
Sampling on channel 2
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 25
 These secure packets are scoured across the network and only recognised by the CC3200.
 The CC3200s will now be able to automatically connect to the WIFI access point as it stores the
password locally.
Communication between the Hub & the microcontrollers
Obtaining the hub IP
 The nodes initially sends out a broadcast of its IP address onto the network it’s currently
connected to.
 The hub responds directly back (i.e. unicast) with its IP address
Responding to grouping
 The hub sends to all “Slave” nodes (i.e. nodes with both ultrasound transmitters & receivers) a
command where those nodes will immediately start listening for ultrasound.
 Next, the hub sends a command which initiate transmission of ultrasound to individual “Master”
nodes.
 For those slaves that listen to the ultrasound pulse, they tell the hub that they have heard the
ultrasound.
Responding to triangulation
The hub sends a code word that enables transmission of ultrasound and to capture ultrasound in a
particular room
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 26
6.1.4.2 Algorithms
Figure 16: The activity diagram of the main
Figure 16 shows the main operation of a node and a band whereby initialising the microcontroller,
connecting to WIFI and then entering an infinite while loop to listen for WIFI messages. Only the nodes
will broadcast its address initially to make the hub aware of its existence whereas the bands would
broadcast upon pressing a button on the band.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 27
Figure 17: The activity diagram of the WIFI connection process
Figure 17 shows how the microcontroller connects to a WIFI access point whereby it allows the user to
use the smart config app on the phone to connect it to WIFI or use WPS by pressing SW2 button on the
microcontroller.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 28
Figure 18: The activity diagram of actions that are taken as a result of recognised WIFI messages
Figure 18 shows the recognised WIFI messages and what action the microcontroller will take as a result
of the message.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 29
Figure 19: The activity diagram of naming a band or room process
Figure 19 shows the process that the microcontroller takes in adding (and naming) a band but also how
a room is added. For a room to be added, a microcontroller would alert the hub of its presence by
sending the command “State Button_Pressed” whereas a band would send “Store Band <IP Address>”
to add it to the system & to alert the hub (and phone) of its presence.
There is one other process which is that when an error has occurred, the microcontroller enters an
infinite loop and the green LED would stay alight.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 30
6.1.4.3 Testing
6.1.4.3.1 Unit testing
Test
no
Operation under test Expected result Actual result Fail/Pass
1 Check if LEDs toggle Red and green LED
flashes
Same as expected Pass
2 Check if smart config work
using the application on the
phone
uC connects to
WIFI and the red
LED switches on to
indicate
connection
Same as expected
but note
sometimes as it
depends on
configuration of
WIFI network
Pass
3 Check if WPS works uC connects to
WIFI and the red
LED switches on to
indicate
connection
Same as expected Pass
4 Check if microcontroller can
receive WIFI messages
Receive “ABCD”
and print it to the
console
Same as expected Pass
5 Check if microcontroller can
send WIFI messages
Send “ABCD” to
MATLAB after
connecting to WIFI
and see it printed
on MATLAB
Same as expected Pass
6 Check if it can generate a 40
kHz signal
10 Cycles at 40
kHz is shown on
the oscilloscope
whose input is
attached to the
output pin of the
uC
Same as expected Pass
6.1.4.3.2 Integration testing
Test
no
Operation under test Expected result Actual result Fail/Pass
7 Check if the command “Store
Hub <IP Address>” causes the
microcontroller to send only
to hub
Sends “ABCD” in
response to the
store to MATLAB
via WIFI but not to
another MATLAB
on another
computer
Same as expected Pass
8 Check if the command “State
Ultrasound_Tx <Timer Interval
Reload>” causes the
microcontroller to transmit
the corresponding frequency
See 10 cycles at 40
kHz on
oscilloscope when
MATLAB sends the
Same as expected Pass
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 31
appropriate
command
9 Check if the command “State
Ultrasound_Rx <Timer Interval
Reload>” causes the
microcontroller to capture
ultrasound and transmit the
sampled values via WIFI
In response to the
appropriate
command,
MATLAB sees the
entire sample
sequence sent
from the band
Same as expected Pass
10 Check if the command “End”
causes the microcontroller to
enter the error state
In response to the
appropriate
command sent
from MATLAB,
show the green
LED
Same as expected Pass
11 Check that other commands
do not do anything
In response to
“ABCD” sent from
MATLAB, do
nothing
Same as expected Pass
6.1.4.3.3 System testing
Test
no
Operation under test Expected result Actual result Fail/Pass
11 Check if the entire program
operate as required
Yes Yes Pass
6.1.4.4 Evaluation
The program has met all pre-requirements of a node and of a band and therefore succeeds as a result.
6.2 BAND
6.2.1 Introduction (Band Functionality)
The main functionality of the band is to uniquely identify a person by means of ultrasonic detection.
Figure 20: Block diagram of the band
The band consists of three main functional components: Filtering stage, amplification stage & an offset
stage as shown figure 20.
Amplification
(Gain)
Bandpass
Filter
Level
Shifter (DC
offset)
Analogue-to-
Digital Converter
(CC3200)
Clipper
diode
Ultrasonic
Receiver
Precision
Rectifier
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 32
The filtering stage consists of a 2nd
order Butterworth band-pass filter based on the Sallen-Key topology.
Its purpose is to remove noise induced by the internal circuitry and to provide additional filtering to the
already narrow passband of the ultrasound receiver.
Following this stage is the amplification stage. This consists of a non-inverting operational amplifier which
applies a constant gain to the signal inputted to this stage. The purpose of this stage is to amplify the
input receiving signal from the ultrasonic receiver when the band is located relatively far from the
ultrasonic transmitter and produce a high SNR to the ADC.
As the ADC only accepts input voltages in the range of 0V to 1.4V inclusive, the output of the filtering
stage needs to be shifted to the appropriate levels. This is accomplished in the offset stage which consists
of a summing non-inverting op-amp and adds the necessary DC offset voltage.
Finally, as a safety mechanism, a precision rectifier has been added in order to protect the ADC from
voltages that is beyond the bounds of the ADC.
6.2.2 Design & Specification
Figure 21: The circuit schematic of the band
Figure 21 shows the circuit schematic of the band where the input signal is Vin and the output is taken
after the precision rectifier. Before the main stages in the band, impedance matching with the ultrasonic
receiver is first required to maximise the power transfer from the ultrasonic receiver to the rest of the
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 33
circuit. This consists of the single resistor R9 (As seen in figure 21) and has a value of 100kOhms as this is
based on the impedance response of the ultrasonic receiver which is found in the technical datasheet. [22]
The justification of equipping TL084CN as the proposed dual sided op-amp is because of its specification
that meets most of the criteria listed. For example, it has a good slew rate of 13V/µs, good gain-
bandwidth product, low harmonic distortion with typically 0.001% and lastly it accepts 3V supply. The
dual sided op-amp will be positively and negatively supplied by two cell batteries with voltage of 3V.
The first stage of the circuit is the filtering stage which is based on the Sallen-Key topology and consists of
a 2nd
order Butterworth low pass filter & a 2nd
order Butterworth high pass filter with respective cut-off
frequencies of 86.2 kHz and 14.6 kHz and with respective gains of 2 V/V and 2.2 V/V. These parameters
were achieved based on the specified bandwidth of the 2nd
order Sallen-Key Butterworth Band-pass filter
between the range of 10kHz to 90kHz and values of the resistors R & capacitors C were chosen to obtain
the desired frequencies from Equation 7 and Equation 8 below.
As a result, the combination of the low pass and high pass filters therefore, forms a 2nd
order Butterworth
band-pass filter with an overall gain of 4.4 V/V and lower & upper cut-off frequencies of 14.6kHz and
86.2kHz respectively. In addition, any input receiving signals that are out of range of the bandwidth will
be attenuated which serves the purpose of smoothing the input signals through eliminating the unwanted
noise signal. [24]
= (Equation 7)
= 1 + (Equation 8)
Onto the next stage of the circuit which is the amplification stage. This consists of a non-inverting
operational amplifier whose gain is 2.8 V/V based on Equation 2. This means that the overall gain of the
band is 12.32 V/V.
Following this stage is the offset stage which is performed by the level shifter part [25]
. A potential divider,
consisting of two resistors 1kOhms (R13) & 3.3kOhms (R18), is used to obtain approximately 0.7V (Exact
value obtained was 0.69V) from a single 3V coin battery cell to supply to the non-inverting positive input
of the dual-sided op amp and provide the DC offset. The formula used to calculate this value is shown in
Equation 9. Moreover, this stage has an unity gain since the output which is halved due to the setup of
two parallel connected 100kOhms resistors is amplified by the gain of 2 before moving on to the next
part. Therefore, the resulting signal is shifted up by the DC offset value of 0.7V and this required as the
input supply range of the ADC is between 0 to 1.4V.
= × (Equation 9)
Lastly, the remaining part of the circuit is a safety protection for the ADC. This consists of a clipper diode
clipping at approximately 1.4V (Achieved 1.39V) which is the maximum voltage that the ADC can handle
[26]
. This is achieved by placing a resistor (R16) in parallel with 3 diodes in series resulting a forward bias
voltage of 1.39V. A precision rectifier is placed at the end part of the circuit which has a direct function of
eliminating any unwanted negative signal [27]
. The precision rectifier is designed based on using a
MCP6281 dual-sided op amp and place a forward biased diode (D4) and a resistor (R4) to the output. The
purpose of implementing this part as a precautionary measure is essential because according to technical
specification of the CC3200 microprocessor, it only allows an acceptance input signal ranging from 0V to
1.4V.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 34
6.2.3 Testing and Results
This section describes the testing of the band, the results that the band achieves and an evaluation of the
performance.
The first test involves testing the frequency response of the 4th
Order Butterworth Band-pass filter circuit
to have the desired cut-off frequencies that were described previously.
The method is as follows:
 Supply an input AC signal of 100mVp-p at 40 kHz by a signal generator
 Observe and record the output voltage of the circuit between frequencies of 5 kHz and 200 kHz.
The results is shown in the plot of gain (dB) vs frequency and comparison between actual results and
simulated results in figure 22.
Figure 22: The graph of the voltage gain is shown against the input frequency
The actual results taken from the experimental test have shown that the bandwidth of the 2nd
order
Sallen-Key Butterworth Band-pass filter is between 12 kHz and 85 kHz. To compare the simulated and
actual plotted graphs, the achieved bandwidth is approximately close to the simulated bandwidth within
5% of percentage error.
In comparison with the calculated cut-off frequencies which are 86.12 kHz and 14.6 kHz, the low-pass cut-
off and high-pass cut-off frequencies have a percentage error of 1.3% and 17% respectively were
calculated using equation 10.
= 100 (Equation 10)
As a result, the frequency response of the 4th
order Butterworth Band-pass filter is achieved and valid in
accordance with the simulated results.
The next stage of testing is assessing the overall gain of the band. The method is as follows:
0
5
10
15
20
25
30
1 10 100 1000
Gain(dB)
Frequency(kHz)
Frequency Response of the Band
Actual Results
Simulated Results
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 35
 Using a signal generator, supply an AC input signal ranging from 50mVp-p to 250mVp-p with an
increment of 10mV and at a constant frequency of 40 kHz.
 Measure the output voltage of the band
The results of the test is shown in figure 23. The results below have shown that the band circuitry has a
constant gain of approximately 12 and based on the designated specification, the circuit is able to achieve
at the calculated gain of 11.76 which approximates to 12. However, the output voltage is constant at
2.92V with any input above 240mV because the double-sided op amp is supplied with 3.0V positively and
negatively and therefore the output voltage would clip at 3V.
Figure 23: The output voltage of the band is plotted against the supplied input voltage
The next series of tests involve testing the full adder, clipper diode and precision rectifier to ensure
ensure each sub unit works fine. The left figure in figure 24 shows the output signal of the circuit supplied
by an input signal of 100mVp-p in the absence of the aforementioned sub units i.e. The input to the offset
stage. The right figure of figure 24 shows the output signal of the full adder circuit when it is added to the
previous circuit i.e. without the aforementioned sub units. It shows that it was able to shift the level of
output signal upwards by 0.7V.
The left figure in figure 25 depicts that the clipper diode is capable of clipping the output signal at 1.4V
when the input signal is supplied at 250mVp-p which without the clipper diode, would output 3Vp-
p.Lastly, it can be observed from the right figure in figure 25 that the precision rectifier’s functionality of
eliminating any unwanted negative part of the signal in the circuit is working.
0
0.5
1
1.5
2
2.5
3
3.5
0 50 100 150 200 250 300
OutputVoltage(Vp-p)
Input Voltage(Vp-p)
Overall Gain of Band Circuitry
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 36
Figure 24: The input to the offset stage is shown on the left and the output of the offset stage is shown
on the right
Figure 25: The output of the clipper diode is shown on the left and the output of the precision rectifier
is shown on the right
Finally, the last test that was carried out was the system testing of the band. This was carried out to
ensure that it is performing correctly when all stages are placed together as a whole. The method of
testing is as follows:
 Connect an ultrasonic receiver to the input of the band circuitry
 Connect an ultrasonic transmitter to the signal generator and set a sine wave of frequency 40 kHz
and amplitude of 9Vp-p
 Record the output voltage for distances between 1m to 10m with an increment of 1m
The results of the test are shown as a plot of output voltage vs distance in figure 26. Overall, the analysis
of the results from the system testing has indicated that the band is functioning in accordance with the
specified requirements of band design.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 37
Figure 26: Graph of output power against distance of separation between the ultrasonic receiver and the
ultrasonic transmitter
6.2.4 Band’s ADC and differences with node’s ADC
The Band will also be making use of a CC3200 in order to have Wi-Fi capabilities as well as an appropriate
ADC module. The latter shares the same requirements as the ADC designed for the node:
1. It needs to have a sampling rate of at least 81 kHz.
2. It needs to have a minimum resolution of 10 bit.
However unlike the node a band is supposed to use its ADC to register input signals and send them back
to the hub for processing. The smoothing circuit that was designed to enable the nodes to determine
whether they heard ultrasonic signals becomes obsolete here. Introducing the 0.7 V offset instead allows
the signal to remain positive at all times, which enables the CC3200’s ADC to capture the actual AC signal
detected by the ultrasound receiver.
Once activated, the ADC of the band continuously samples for the duration of 85 ms at a sampling rate of
125 kS/s. The 85 ms duration, just like the node’s ADC insures that all ultrasonic signals sent at the moment
of activation have been captured and sampled. 85 ms worth of data equates to 10640 captured samples,
each two bytes long and all stored inside an array in preparation for W-Fi transmission. The hub awaiting
these samples can only receive 140 at a time because it can only scan for one packet at a time, so to ensure
full sample transmission the ADC program running on the CC3200 microcontroller sends 140 elements of
the sample array at a time which in total comes to 76 transmissions.
The band’s ADC was tested by having the ADC continuously sample a 0.2V p-p 40 kHz signal generated
signal sourced from a signal generator. Once sampling was complete the sample array were sent to the hub
program via Wi-Fi. The result of that experiment is shown in figure 27.
0
10
20
30
40
50
60
0 2 4 6 8 10 12
Outputpower(dB)
Distance between Ultrasonic receiver and transmitter(m)
Plot of System Testing for Band
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 38
Figure 27: Data captured by the ADC and the Fast Fourier Transform of that data.
The result shows that the expected frequency component has been successfully captured by the ADC and
received by the hub.
Then the input of the band’s ADC was set as the ultrasound receiver capturing ultrasonic signals sent by a
transmitter 1 meter away powered at 9V p-p. This test was done to prove that the ADC can integrate with
the ultrasonic equipment. Its result mimic the one shown in figure 27 proving the success of the ADC
integration.
6.3 ANDROID APPLICATION
The android application acts as the user interface between the system and the user in which he/she will
be able to control the operations that occur in the system E.G. Choosing a person to track. This section
describes the functionality & develop of this application.
6.3.1 Requirements
 The user should be able to initiate the grouping of nodes
 The user should be able to provide a name to a room & also remove a name provided to a room
 He/ She should be able to add a band, provide a name for that band and be able to remove a
band
 He/ She should be able to select a band to triangulate
 He/ She should be able to get an up-to-date list of the current bands and rooms in the system
6.3.2 Design & tests
The design and tests are structured to show & test a particular sequence of interfaces that would occur
sequentially when run with the entire system.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 39
6.3.2.1 Grouping interfaces
Algorithm:
 When the user presses Group Nodes on the main menu, transmit “Group Nodes” via WIFI to
the hub directly if its IP is set or broadcast it if unknown.
 Wait for a response from the hub for 10 seconds and then timeout if no response.
 If “Group Formed” received, inform the user that the group was successfully grouped.
Otherwise, output an error screen
Unit testing:
Test no Operation under
test
Expected Result Actual Result Pass/Fail
1 Check “Group
Nodes” is sent
successfully
MATLAB should
receive the
command and print
it out
Same as expected Pass
2 Check if timer is
working
The timer counts
down in 1 second
intervals and when
timer expires, it
stops
Same as expected Pass
3 Check if “Group
Formed” is received
successfully
The message
received by the
android phone
should output it to
logcat
Same as expected Pass
Integration testing:
4 Check if pressing on
Group Nodes
button in the main
activity causes a
transition to the
appropriate waiting
activity
Should see the next
screen titled
“Forming Group”
Same as expected Pass
5 Check if after
receiving the
command “Group
Formed” during the
waiting activity
Should see the next
screen titled
“Completed
Grouping Protocol”
Same as expected Pass
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 40
causes a transition
to the appropriate
completed activity
6 Check if receiving
any different
command causes
an error screen
Should see next
screen being the
error screen and a
detail of the error
Same as expected Pass
Algorithm:
 When the user presses “Obtain Hub IP” on the main menu, broadcast “Discover Hub” via WIFI
 Wait for a response from the hub for 10 seconds and then timeout if no response.
 If “Store Hub <IP Address” is received, store the IP address and output to the user that the hub
IP was successfully obtained. Otherwise, output an error screen.
Unit testing:
Test no Operation under
test
Expected Result Actual Result Pass/Fail
1 Check “Discover
Hub” is sent
successfully
MATLAB should
receive the
command and
print it out (Logcat
should also show
it received its own
message as it is a
broadcast)
Same as expected Pass
2 Check if “Store
Hub <IP Address>”
is received
successfully
The message
received by the
android phone
should output it to
logcat
Same as expected Pass
3 Check if the hub IP
address is stored
and used for
future
communications
Repeat Group
Nodes operation
but now logcat
shouldn’t show its
own message as
not a broadcast
Same as expected Pass
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 41
Integration testing:
4 Check if pressing on
“Obtain Hub IP”
button in the main
activity causes a
transition to the
appropriate waiting
activity
Should see the next
screen titled
“Obtaining hub IP”
Same as expected Pass
5 Check if after
receiving the
command “Store
Hub <IP Address>”
during the waiting
activity causes a
transition to the
appropriate
completed activity
Should see the next
screen titled
“Successfully
obtained HUB IP
Address!”
Same as expected Pass
6 Check if receiving
any different
command causes
an error screen
Should see next
screen being the
error screen and a
detail of the error
Same as expected Pass
Algorithm:
 When the user presses “Manage Rooms” on the main menu, show “Add Room” & “Remove
Room” options to the user
 If the user selects “Add Room”, send “Expect Node_Button” to hub and Inform the user to
press a button on a node inside the room they wish to name
 Wait for a response from the hub for 10 seconds and then timeout if no response.
 If “Discover Room_Name” is received, show a screen for retrieving the name for the room.
Otherwise, output an error screen.
 Get the room name entered when the user presses the confirmation button and send “Store
Room_Name <Room name>” to the hub
 Wait for a response from the hub for 10 seconds and then timeout if no response.
 If “Group Named” is received, inform the user that the room was named successfully.
Otherwise, output an error screen.
Unit Testing:
Test no Operation under test Expected Result Actual Result Pass/Fail
1 Check “Expect
Node_Button” is sent
successfully
MATLAB should receive
the command and print
it out
Same as
expected
Pass
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 42
2 Check if “Discover
Room_Name” is received
successfully
The message received
by the android phone
should output it to
logcat
Same as
expected
Pass
3 Check if the room name
entered by the user is
retrieved successfully and
is validated to ensure
uniqueness
Logcat should output
the name after the
confirmation button is
pressed. If the name
entered is the same a
name in the room list,
the activity should not
finish and a toast
should appear to alert
the user.
Same as
expected
Pass
4 Check “Store Room_Name
<Room name>” is sent
successfully
MATLAB should receive
the command and print
it out
Same as
expected
Pass
5 Check if “Group Named”
is received successfully
The message received
by the android phone
should output it to
logcat
Same as
expected
Pass
Integration testing:
6 Check if pressing on
“Manage Rooms” button
in the main activity causes
a transition to the
appropriate setting menu
activity
Should see the next
screen titled “Choose
an option”
Same as
expected
Pass
7 Check if pressing on the
“Add Room” causes a
transition to the
appropriate waiting
activity
Should see the next
screen titled “Press a
button on any node in
the room you wish to
name”
Same as
expected
Pass
8 Check if after receiving
the command “Discover
Room_Name” during the
waiting activity causes a
transition to the
appropriate naming
activity
Should see the next
screen titled
“Provide a unique
name to this room”
with a text field and a
confirmation button
Same as
expected
Pass
9 Check if after receiving
the command “Group
Named” during the
waiting activity causes a
transition to the
appropriate completed
activity
Should see the next
screen titled
“Successfully named
group!”
Same as
expected
Pass
10 Check if the room name
that was submitted is
Go through Manage
Rooms -> Remove
Same as
expected
Pass
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 43
stored in the local list of
room names
Room and the name
that was submitted
should be in the list
11 Check if receiving any
different command during
the waiting screens
causes an error screen
Should see next screen
being the error screen
and a detail of the error
Same as
expected
Pass
Algorithm:
 When the user presses “Manage Rooms” on the main menu, show “Add Room” & “Remove
Room” options to the user
 If the user selects “Remove Room”, show a list of all rooms that they can remove
 For the option that they select, send “Remove Room <Room selected>” to the hub
 Wait for a response from the hub for 10 seconds and then timeout if no response
 If “Room Deleted” is received, inform to the user that the room was successfully deleted.
Otherwise, output an error screen.
Unit Testing:
Test no Operation under test Expected Result Actual Result Pass/Fail
1 Check if reading and
outputting a list as a
set of radio buttons
works
Using a predefined list called
“roomnames.txt” with 1
name in each line, the list
should be seen in the screen
Same as
expected
Pass
2 Check “Remove
Room <Room
name>” is sent
successfully
MATLAB should receive the
command and print it out
Same as
expected
Pass
3 Check if “Room
Deleted” is received
successfully
The message received by the
android phone should output
it to logcat
Same as
expected
Pass
Integration testing:
4 Check if pressing on
“Manage Rooms”
button in the main
activity causes a
transition to the
appropriate setting
menu activity
Should see the next screen
titled “Choose an option”
with two buttons, “Add
Room” & “Remove Room”
Same as
expected
Pass
5 Check if pressing on
the “Remove Room”
Should see the next screen
titled “Check the button for
Same as
expected
Pass
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 44
causes a transition to
the appropriate list
activity
which room you wish to
remove”
6 Check if after
selecting a room
from the list that this
causes a transition to
the appropriate
waiting activity
Should see the next screen
titled “Deleting room ‘<Room
name>’”
Same as
expected
Pass
7 Check if after
receiving the
command “Room
Deleted” during the
waiting activity
causes a transition to
the appropriate
completed activity
Should see the next screen
titled
“Successfully deleted room!”
Same as
expected
Pass
8 Check if the room
name that was
submitted is deleted
from the local list of
room names
Go through Manage Rooms ->
Remove Room and the name
that was submitted should
either not be there or a pop
up appears if that was the
only name in the list
Same as
expected
Pass
9 Check if receiving
any different
command during the
waiting screens
causes an error
screen
Should see next screen being
the error screen and a detail
of the error
Same as
expected
Pass
6.3.2.2 Triangulation related interfaces
Algorithm:
 When the user presses “Manage Bands” on the main menu, show “Add Band” & “Remove
Band” options to the user
 If the user selects “Add Band”, Inform the user to press a button on the band they wish to add
 Wait for a response from the band for 10 seconds and then timeout if no response
 If “Store Band <IP Address>” is received, show a screen for retrieving the name for the band.
Otherwise, output an error screen.
 Get the band name entered when the user presses the confirmation button and send “Store
Band_Name <Band name> <Band IP_Address>” to the hub
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 45
 Wait for a response from the hub for 10 seconds and then timeout if no response.
 If “Band Named” is received, inform the user that the band was named successfully. Otherwise,
output an error screen.
Unit Testing:
Test
no
Operation under test Expected Result Actual Result Pass/Fai
l
1 Check if “Store Band <IP
Address>” is received successfully
The message received by the
android phone should output
it to logcat
Same as
expected
Pass
2 Check if the band name entered
by the user is retrieved
successfully and validated
Logcat should output the
name after the confirmation
button is pressed. If the
name is the same as one in
the local band list then a
toast will pop up and not
allow the activity to finish
Same as
expected
Pass
3 Check “Store Band_Name <Band
name><Band IP Address>” is sent
successfully
MATLAB should receive the
command and print it out
Same as
expected
Pass
4 Check if “Band Named” is received
successfully
The message received by the
android phone should output
it to logcat
Same as
expected
Pass
Integration Testing:
5 Check if pressing on “Manage
Bands” button in the main activity
causes a transition to the
appropriate setting menu activity
Should see the next screen
titled “Choose an option”
Same as
expected
Pass
6 Check if pressing on the “Add
Band” causes a transition to the
appropriate waiting activity
Should see the next screen
titled “Press a button on the
band you wish to setup”
Same as
expected
Pass
7 Check if after receiving the
command “Store Band <IP
Address>” during the waiting
activity causes a transition to the
appropriate naming activity
Should see the next screen
titled
“Provide a unique name to
this band” with a text field
and a confirmation button
Same as
expected
Pass
8 Check if after receiving the
command “Band Named” during
the waiting activity causes a
transition to the appropriate
completed activity
Should see the next screen
titled
“Successfully named band!”
Same as
expected
Pass
9 Check if the band name that was
submitted is stored in the local list
of band names
Go through Manage Bands ->
Remove Band and the name
that was submitted should
be in the list
Same as
expected
Pass
10 Check if receiving any different
command during the waiting
screens causes an error screen
Should see next screen being
the error screen and a detail
of the error
Same as
expected
Pass
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 46
Algorithm:
 When the user presses “Manage Bands” on the main menu, show “Add Band” & “Remove
Band” options to the user
 If the user selects “Remove Band”, show a list of all bands that they can remove
 For the option that they select, send “Remove Band <Band name selected>” to the hub
 Wait for a response from the hub for 10 seconds and then timeout if no response
 If “Band Deleted” is received, inform to the user that the band was successfully deleted.
Otherwise, output an error screen.
Unit Testing:
Test no Operation under test Expected Result Actual Result Pass/Fail
1 Check if reading and
outputting a list as a
set of radio buttons
works
Using a predefined list called
“bandnames.txt” with 1
name in each line, the list
should be seen in the screen
Same as
expected
Pass
2 Check “Remove
Band <Band name>”
is sent successfully
MATLAB should receive the
command and print it out
Same as
expected
Pass
3 Check if “Band
Deleted” is received
successfully
The message received by the
android phone should
output it to logcat
Same as
expected
Pass
Integration Testing:
4 Check if pressing on
“Manage Bands”
button in the main
activity causes a
transition to the
appropriate setting
menu activity
Should see the next screen
titled “Choose an option”
with buttons “Add Band” &
“Remove Band”
Same as
expected
Pass
5 Check if pressing on
the “Remove Band”
causes a transition
to the appropriate
list activity
Should see the next screen
titled “Check the button for
which band you wish to
remove”
Same as
expected
Pass
6 Check if after
selecting a room
from the list that this
causes a transition
to the appropriate
waiting activity
Should see the next screen
titled “Deleting band ‘<Band
name>’”
Same as
expected
Pass
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 47
7 Check if after
receiving the
command “Band
Deleted” during the
waiting activity
causes a transition
to the appropriate
completed activity
Should see the next screen
titled
“Successfully deleted band!”
Same as
expected
Pass
8 Check if the band
name that was
submitted is deleted
from the local list of
band names
Go through Manage Band ->
Remove Band and the name
that was submitted should
either not be there or a pop
up appears if that was the
only name in the list
Same as
expected
Pass
9 Check if receiving
any different
command during the
waiting screens
causes an error
screen
Should see next screen being
the error screen and a detail
of the error
Same as
expected
Pass
Algorithm:
 When the user presses “Triangulate” on the main menu, show a list of all objects that can be
tracked
 For the object that is chosen, send “Triangulate Band <Object name>” to the hub via WIFI
 Wait a response from the hub for 10 seconds and then timeout if no response.
 If “Triangulate <Object name> <Room name>” is received, output the location of the object to
the user. Otherwise, output an error screen.
Unit Testing:
Test no Operation under test Expected Result Actual Result Pass/Fail
1 Check “Triangulate
Band <Object name>”
is sent successfully
MATLAB should receive the
command and print it out
Same as
expected
Pass
2 Check if reading and
outputting a list as a
radio button set works
Using a predefined list called
“bandnames.txt” with 1
Same as
expected
Pass
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 48
name in each line, the list
should be seen in the screen
3 Check if “Triangulate
<Object name> <Room
name>” is received
successfully
The message received by the
android phone should
output it to logcat
Same as
expected
Pass
Integration tests:
4 Check if pressing on
“Triangulate” button
in the main activity
causes a transition to
the appropriate list
activity
Should see the next screen
titled “Check the button for
which band you wish to
track”
Same as
expected
Pass
5 Check if selecting a
band on the list
activity causes a
transition to the
appropriate waiting
activity
Should see the next screen
titled “Triangulating <Band
name>”
Same as
expected
Pass
6 Check if after receiving
the command
“Triangulate <Object
name> <Room
name>” during the
waiting activity causes
a transition to the
appropriate
completed activity
Should see the next screen
titled
“Successfully tracked band”
with the body of the GUI
showing <Room name>
Same as
expected
Pass
7 Check if receiving any
different command
causes an error screen
Should see next screen
being the error screen and a
detail of the error
Same as
expected
Pass
6.3.2.3 Other important interfaces
Algorithm:
 When the user presses “Synchronise Data” on the main menu, send “Sync Room_List” to hub
 Wait for a response from the hub for 10 seconds and then timeout if no response
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 49
 If “Sync Room_List <Hub’s Room List separated by spaces>” is received, update local room list
and send “Sync Band_List” to the hub. Otherwise, output an error screen.
 Wait for a response from the hub for 10 seconds and then timeout if no response
 If “Sync Band_List <Hub’s Band List separated by spaces>” is received, update local band list
and inform to the user that the data was successfully synched. Otherwise, output an error
screen.
Unit testing:
Test no Operation under test Expected Result Actual Result Pass/Fail
1 Check “Sync Room_List” is
sent successfully
MATLAB should receive
the command and print
it out
Same as
expected
Pass
2 Check if “Sync Room_List
<Roomname1>
<Roomname2>…” is received
successfully
The message received
by the android phone
should output it to
logcat
Same as
expected
Pass
3 Check “Sync Band_List” is
sent successfully
MATLAB should receive
the command and print
it out
Same as
expected
Pass
4 Check if “Sync Band_List
<Bandname1>
<Bandname2>…” is received
successfully
The message received
by the android phone
should output it to
logcat
Same as
expected
Pass
Integration testing:
5 Check if pressing on
“Synchronise Data” button in
the main activity causes a
transition to the appropriate
waiting activity
Should see the next
screen titled
“Synchronising Room
List”
Same as
expected
Pass
6 Check if after receiving the
command “Sync Room_List
<Roomname1>
<Roomname2>…” during the
waiting activity causes a
transition to the next waiting
activity
Should see the next
screen titled
“Synchronising Band
List”
Same as
expected
Pass
7 Check if after receiving the
command “Sync Band_List
<Bandname1>
<Bandname2>…” during the
waiting activity causes a
transition to the appropriate
completion screen
Should see the next
screen titled
“Successfully
synchronised data”
Same as
expected
Pass
8 Check if data was
synchronised
Open Manage Rooms -
>Remove Room and
see if the list is as
expected
Open Manage Bands -
>Remove Band and see
if the list is as expected
Same as
expected
Pass
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 50
9 Check if receiving any
different command causes
an error screen
Should see next screen
being the error screen
and a detail of the
error
Same as
expected
Pass
These interfaces are shown when either an error occurred that wasn’t due to the sender not
responding (Left interface) or when a response was not received (Right interface).
6.3.3 Evaluation
The program meets all pre-requirements and passes every test.
6.4 HUB PROGRAM
6.4.1 Coordinator program
In order to achieve band triangulation, some level of coordination between the devices participating in
the process is required. To this purpose the hub serves as the glue that holds all other system devices into
place. Every device communicates with it to access information and it is at the hub stage that
triangulation of the band’s position is performed, as will be further discussed in the section covering the
TDOA algorithm.
The diagram presented in figure 28 describes the functionalities that were programmed to enable the hub
to control the nodes & band(s) and communicate with the phone. A combination of these functionalities
is used to perform either the grouping or triangulation protocols described previously.
UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION
REPORT
APRIL 29, 2016
BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 51
Figure 28: Class diagram of the hub coordinator program.
6.4.1.1 Requirements
1. The most important aspect of the hub is its accessibility: it should entertain all Wi-Fi connection
attempts made. For this reason the hub will need to continuously listen on an input port for
messages sent to it.
2. A transport protocol with broadcasting capacities will be needed because the only way for the
hub to initiate a communication with unknown devices will be through broadcasts.
3. The hub will also need to store the IP addresses of the devices that are part of the system. This
allows the hub to communicate with them whenever required without the need to broadcast any
messages.
4. It will need to coordinate between the different devices
6.4.1.2 Development
In the grand scheme of things, TDOA would not be possible if the nodes present in the same room were
not triggered to emit ultrasound at the same time. A way to avoid this issue is to ask all the nodes to
transmit ultrasonic signals. This approach raises a problem: due to the limited available bandwidth
afforded by the ultrasonic equipment, nodes will then need to share emitting frequencies; the signal
picked up by the band will present the assigned frequencies however their origin becomes a mystery as
they could have been emitted by multiple nodes. In conclusion, frequency sharing was not considered
which led to the development of a new idea, based on the finding that ultrasound happens to be well
contained within a room, that enables both the identification of the source of ultrasound based on the
frequency of the emission and the triggering of these devices at the same time: the grouping protocol.
This protocol encapsulates:
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System
4th Year Project - Indoor Positioning System

More Related Content

What's hot

Wi-Vi Technology
Wi-Vi TechnologyWi-Vi Technology
Wi-Vi TechnologyAnandhuas
 
6g wireless communication systems
6g wireless communication systems6g wireless communication systems
6g wireless communication systemsSAIALEKHYACHITTURI
 
Wi-Fi based indoor positioning
Wi-Fi based indoor positioningWi-Fi based indoor positioning
Wi-Fi based indoor positioningSherwin Rodrigues
 
5G Mobile Technology-By TAHMID RONGON
5G Mobile Technology-By TAHMID RONGON5G Mobile Technology-By TAHMID RONGON
5G Mobile Technology-By TAHMID RONGONTahmid Rongon
 
5g wireless systems
5g wireless systems5g wireless systems
5g wireless systemsAmar
 
Indoor localization using wifi fingerprinting
Indoor localization using wifi fingerprintingIndoor localization using wifi fingerprinting
Indoor localization using wifi fingerprintingChaitali Bose Roy
 
Introduction to 6G, prepare now training
Introduction to 6G, prepare now trainingIntroduction to 6G, prepare now training
Introduction to 6G, prepare now trainingTonex
 
5G and 6G.pptx
5G and 6G.pptx5G and 6G.pptx
5G and 6G.pptxnassmah
 
C01- introduction
C01- introductionC01- introduction
C01- introductions35prabha
 
Ppt presentation
Ppt presentationPpt presentation
Ppt presentationvishal4799
 
Wireless communication
Wireless communicationWireless communication
Wireless communicationLiton Ahmed
 
Computer science seminar topics
Computer science seminar topicsComputer science seminar topics
Computer science seminar topics123seminarsonly
 

What's hot (20)

Seminar presentation on 5G
Seminar presentation on 5GSeminar presentation on 5G
Seminar presentation on 5G
 
Gi fi Technology
Gi fi TechnologyGi fi Technology
Gi fi Technology
 
Zigbee Presentation
Zigbee PresentationZigbee Presentation
Zigbee Presentation
 
Wi-Vi Technology
Wi-Vi TechnologyWi-Vi Technology
Wi-Vi Technology
 
presentation on 4g technology
presentation on 4g technologypresentation on 4g technology
presentation on 4g technology
 
6g wireless communication systems
6g wireless communication systems6g wireless communication systems
6g wireless communication systems
 
Wi-Fi based indoor positioning
Wi-Fi based indoor positioningWi-Fi based indoor positioning
Wi-Fi based indoor positioning
 
5G Mobile Technology-By TAHMID RONGON
5G Mobile Technology-By TAHMID RONGON5G Mobile Technology-By TAHMID RONGON
5G Mobile Technology-By TAHMID RONGON
 
6 g tecnology
6 g tecnology6 g tecnology
6 g tecnology
 
5g wireless systems
5g wireless systems5g wireless systems
5g wireless systems
 
Indoor localization using wifi fingerprinting
Indoor localization using wifi fingerprintingIndoor localization using wifi fingerprinting
Indoor localization using wifi fingerprinting
 
Introduction to 6G, prepare now training
Introduction to 6G, prepare now trainingIntroduction to 6G, prepare now training
Introduction to 6G, prepare now training
 
5G and 6G.pptx
5G and 6G.pptx5G and 6G.pptx
5G and 6G.pptx
 
C01- introduction
C01- introductionC01- introduction
C01- introduction
 
Ppt presentation
Ppt presentationPpt presentation
Ppt presentation
 
Wireless communication
Wireless communicationWireless communication
Wireless communication
 
Computer science seminar topics
Computer science seminar topicsComputer science seminar topics
Computer science seminar topics
 
5G TECHNOLOGY
5G TECHNOLOGY5G TECHNOLOGY
5G TECHNOLOGY
 
5G applications
5G applications5G applications
5G applications
 
5g technology ppt
5g technology ppt5g technology ppt
5g technology ppt
 

Similar to 4th Year Project - Indoor Positioning System

Analysis of Obstacle Detection Using Ultrasonic Sensor
Analysis of Obstacle Detection Using Ultrasonic SensorAnalysis of Obstacle Detection Using Ultrasonic Sensor
Analysis of Obstacle Detection Using Ultrasonic SensorIRJET Journal
 
ULTRA WIDE BAND RADAR SYSTEM FOR THROUGH WALL HUMAN VITAL SIGNS DETECTION
ULTRA WIDE BAND RADAR SYSTEM FOR THROUGH WALL HUMAN VITAL SIGNS DETECTIONULTRA WIDE BAND RADAR SYSTEM FOR THROUGH WALL HUMAN VITAL SIGNS DETECTION
ULTRA WIDE BAND RADAR SYSTEM FOR THROUGH WALL HUMAN VITAL SIGNS DETECTIONIRJET Journal
 
IRJET- Virtual Eye for Visually Blind People
IRJET-  	  Virtual Eye for Visually Blind PeopleIRJET-  	  Virtual Eye for Visually Blind People
IRJET- Virtual Eye for Visually Blind PeopleIRJET Journal
 
Smart Sound Measurement and Control System for Smart City
Smart Sound Measurement and Control System for Smart CitySmart Sound Measurement and Control System for Smart City
Smart Sound Measurement and Control System for Smart CityIRJET Journal
 
LIGHTWEIGHT INDOOR POSITIONING IN A REAL ENVIRONMENT BASED ON WIFI FINGERPRIN...
LIGHTWEIGHT INDOOR POSITIONING IN A REAL ENVIRONMENT BASED ON WIFI FINGERPRIN...LIGHTWEIGHT INDOOR POSITIONING IN A REAL ENVIRONMENT BASED ON WIFI FINGERPRIN...
LIGHTWEIGHT INDOOR POSITIONING IN A REAL ENVIRONMENT BASED ON WIFI FINGERPRIN...IRJET Journal
 
GPS and GSM enabled Smart Blind Stick.pdf
GPS and GSM enabled Smart Blind Stick.pdfGPS and GSM enabled Smart Blind Stick.pdf
GPS and GSM enabled Smart Blind Stick.pdfssuserbfa471
 
Intelligent travelling and home automation aid, for visually impaired
Intelligent travelling and home  automation aid, for visually impairedIntelligent travelling and home  automation aid, for visually impaired
Intelligent travelling and home automation aid, for visually impairedUmar Shuaib
 
Design and development of intelligent electronics travelling aid for visually...
Design and development of intelligent electronics travelling aid for visually...Design and development of intelligent electronics travelling aid for visually...
Design and development of intelligent electronics travelling aid for visually...eSAT Journals
 
A Survey on Smart Devices for Object and Fall Detection
A Survey on Smart Devices for Object and Fall DetectionA Survey on Smart Devices for Object and Fall Detection
A Survey on Smart Devices for Object and Fall DetectionIRJET Journal
 
IRJET- Review: Autonomous Detection and Shooting of Moving Objects at Borders...
IRJET- Review: Autonomous Detection and Shooting of Moving Objects at Borders...IRJET- Review: Autonomous Detection and Shooting of Moving Objects at Borders...
IRJET- Review: Autonomous Detection and Shooting of Moving Objects at Borders...IRJET Journal
 
A Survey on Ultrasound Beamforming Strategies
A Survey on Ultrasound Beamforming StrategiesA Survey on Ultrasound Beamforming Strategies
A Survey on Ultrasound Beamforming StrategiesIRJET Journal
 
Ieeepro techno solutions 2013 ieee embedded project - analysis of an indoo...
Ieeepro techno solutions   2013 ieee embedded project  - analysis of an indoo...Ieeepro techno solutions   2013 ieee embedded project  - analysis of an indoo...
Ieeepro techno solutions 2013 ieee embedded project - analysis of an indoo...srinivasanece7
 
Literature on safety module for vehicular driver assistance
Literature on safety module for vehicular driver assistance Literature on safety module for vehicular driver assistance
Literature on safety module for vehicular driver assistance IOSR Journals
 
Blind Stick Using Ultrasonic Sensor with Voice announcement and GPS tracking
Blind Stick Using Ultrasonic Sensor with Voice announcement and GPS trackingBlind Stick Using Ultrasonic Sensor with Voice announcement and GPS tracking
Blind Stick Using Ultrasonic Sensor with Voice announcement and GPS trackingvivatechijri
 
Design and implementation of an sms based robotic system for hole- detection ...
Design and implementation of an sms based robotic system for hole- detection ...Design and implementation of an sms based robotic system for hole- detection ...
Design and implementation of an sms based robotic system for hole- detection ...eSAT Journals
 
IRJET- Emergency Navigation System using Mobile Computing
IRJET-  	  Emergency Navigation System using Mobile ComputingIRJET-  	  Emergency Navigation System using Mobile Computing
IRJET- Emergency Navigation System using Mobile ComputingIRJET Journal
 
Nuzzer algorithm based Human Tracking and Security System for Device-Free Pas...
Nuzzer algorithm based Human Tracking and Security System for Device-Free Pas...Nuzzer algorithm based Human Tracking and Security System for Device-Free Pas...
Nuzzer algorithm based Human Tracking and Security System for Device-Free Pas...Eswar Publications
 
IRJET- Smart Accident Detection and Emergency Notification System using IoT a...
IRJET- Smart Accident Detection and Emergency Notification System using IoT a...IRJET- Smart Accident Detection and Emergency Notification System using IoT a...
IRJET- Smart Accident Detection and Emergency Notification System using IoT a...IRJET Journal
 

Similar to 4th Year Project - Indoor Positioning System (20)

Analysis of Obstacle Detection Using Ultrasonic Sensor
Analysis of Obstacle Detection Using Ultrasonic SensorAnalysis of Obstacle Detection Using Ultrasonic Sensor
Analysis of Obstacle Detection Using Ultrasonic Sensor
 
ULTRA WIDE BAND RADAR SYSTEM FOR THROUGH WALL HUMAN VITAL SIGNS DETECTION
ULTRA WIDE BAND RADAR SYSTEM FOR THROUGH WALL HUMAN VITAL SIGNS DETECTIONULTRA WIDE BAND RADAR SYSTEM FOR THROUGH WALL HUMAN VITAL SIGNS DETECTION
ULTRA WIDE BAND RADAR SYSTEM FOR THROUGH WALL HUMAN VITAL SIGNS DETECTION
 
IRJET- Virtual Eye for Visually Blind People
IRJET-  	  Virtual Eye for Visually Blind PeopleIRJET-  	  Virtual Eye for Visually Blind People
IRJET- Virtual Eye for Visually Blind People
 
Smart Sound Measurement and Control System for Smart City
Smart Sound Measurement and Control System for Smart CitySmart Sound Measurement and Control System for Smart City
Smart Sound Measurement and Control System for Smart City
 
LIGHTWEIGHT INDOOR POSITIONING IN A REAL ENVIRONMENT BASED ON WIFI FINGERPRIN...
LIGHTWEIGHT INDOOR POSITIONING IN A REAL ENVIRONMENT BASED ON WIFI FINGERPRIN...LIGHTWEIGHT INDOOR POSITIONING IN A REAL ENVIRONMENT BASED ON WIFI FINGERPRIN...
LIGHTWEIGHT INDOOR POSITIONING IN A REAL ENVIRONMENT BASED ON WIFI FINGERPRIN...
 
An internet of things-based touchless parking system using ESP32-CAM
An internet of things-based touchless parking system using  ESP32-CAMAn internet of things-based touchless parking system using  ESP32-CAM
An internet of things-based touchless parking system using ESP32-CAM
 
GPS and GSM enabled Smart Blind Stick.pdf
GPS and GSM enabled Smart Blind Stick.pdfGPS and GSM enabled Smart Blind Stick.pdf
GPS and GSM enabled Smart Blind Stick.pdf
 
Intelligent travelling and home automation aid, for visually impaired
Intelligent travelling and home  automation aid, for visually impairedIntelligent travelling and home  automation aid, for visually impaired
Intelligent travelling and home automation aid, for visually impaired
 
Design and development of intelligent electronics travelling aid for visually...
Design and development of intelligent electronics travelling aid for visually...Design and development of intelligent electronics travelling aid for visually...
Design and development of intelligent electronics travelling aid for visually...
 
A Survey on Smart Devices for Object and Fall Detection
A Survey on Smart Devices for Object and Fall DetectionA Survey on Smart Devices for Object and Fall Detection
A Survey on Smart Devices for Object and Fall Detection
 
IRJET- Review: Autonomous Detection and Shooting of Moving Objects at Borders...
IRJET- Review: Autonomous Detection and Shooting of Moving Objects at Borders...IRJET- Review: Autonomous Detection and Shooting of Moving Objects at Borders...
IRJET- Review: Autonomous Detection and Shooting of Moving Objects at Borders...
 
A Survey on Ultrasound Beamforming Strategies
A Survey on Ultrasound Beamforming StrategiesA Survey on Ultrasound Beamforming Strategies
A Survey on Ultrasound Beamforming Strategies
 
Ieeepro techno solutions 2013 ieee embedded project - analysis of an indoo...
Ieeepro techno solutions   2013 ieee embedded project  - analysis of an indoo...Ieeepro techno solutions   2013 ieee embedded project  - analysis of an indoo...
Ieeepro techno solutions 2013 ieee embedded project - analysis of an indoo...
 
L010127579
L010127579L010127579
L010127579
 
Literature on safety module for vehicular driver assistance
Literature on safety module for vehicular driver assistance Literature on safety module for vehicular driver assistance
Literature on safety module for vehicular driver assistance
 
Blind Stick Using Ultrasonic Sensor with Voice announcement and GPS tracking
Blind Stick Using Ultrasonic Sensor with Voice announcement and GPS trackingBlind Stick Using Ultrasonic Sensor with Voice announcement and GPS tracking
Blind Stick Using Ultrasonic Sensor with Voice announcement and GPS tracking
 
Design and implementation of an sms based robotic system for hole- detection ...
Design and implementation of an sms based robotic system for hole- detection ...Design and implementation of an sms based robotic system for hole- detection ...
Design and implementation of an sms based robotic system for hole- detection ...
 
IRJET- Emergency Navigation System using Mobile Computing
IRJET-  	  Emergency Navigation System using Mobile ComputingIRJET-  	  Emergency Navigation System using Mobile Computing
IRJET- Emergency Navigation System using Mobile Computing
 
Nuzzer algorithm based Human Tracking and Security System for Device-Free Pas...
Nuzzer algorithm based Human Tracking and Security System for Device-Free Pas...Nuzzer algorithm based Human Tracking and Security System for Device-Free Pas...
Nuzzer algorithm based Human Tracking and Security System for Device-Free Pas...
 
IRJET- Smart Accident Detection and Emergency Notification System using IoT a...
IRJET- Smart Accident Detection and Emergency Notification System using IoT a...IRJET- Smart Accident Detection and Emergency Notification System using IoT a...
IRJET- Smart Accident Detection and Emergency Notification System using IoT a...
 

4th Year Project - Indoor Positioning System

  • 1. Department of Electronic and Electrical Engineering UNIVERSITY COLLEGE LONDON TORRINGTON PLACE LLONDON WC1E 7JE UK Future Care/Cities Unlocked Hardware Triangulation MEng Project Final Report Mohamed Yahia Al Kahf Salman Mian Jenq Yao, Lim Supervisor: Dr. Benn Thomsen Second Assessor: Prof Paul Brennan April 2016
  • 2. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 1
  • 3. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 2 Description of the work division Jenq has been responsible for the following:  Entire band (This includes the design, testing and implementation).  Safety precaution for the ADC of CC3200 microprocessor.  Transmitter circuitry Salman has been responsible for the following:  Wi-Fi connectivity and communications of the nodes and band  Generation of the ultrasound frequency for transmitting nodes  The android phone application  Tracking algorithm  Triggering technique for synchronising the nodes and band for transmitting & receiving ultrasound Yahia has been responsible for the following:  Node receiver circuitry design and building  Node and band ADCs  Hub coordinator program The report writing was divided amongst us describe as follows: Jenq Salman Yahia Abstract 1. Introduction 2. System overview 2. System overview 3. Role in the wider project 4. Application use cases 5.2 Bluetooth 5.4 Ultrasound 5.1 GPS & 5.3 Wi-Fi 6.1.1.3 Node transmitter circuitry 6.1.3 Enabling Wi-Fi Communications 6.1.1 Node receiver circuitry & 6.1.3 Node ADC 6.2 Band 6.3 Android Application 6.4.2 Tracking algorithm 6.4.1 Coordinator program 7. Conclusion
  • 4. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 3 Abstract As part of the Microsoft-UK Future Care group whose target is to eliminate the need for close supervision of an elderly person, we have developed an indoor positioning system (IPS) to locate a person of interest to a resolution of 0.5m. Such accuracy is needed to precisely track that person. GPS was not considered because its signals are unable to penetrate through building obstacles such as walls. Other designs were also discarded such as the ZigBee-based system developed by (Sugano, 2006) [1] . A system that was implemented to achieve indoor tracking of a person by measuring the RSSI of the signal emitted by the system’s ZigBee devices. The reason why this particular technique was overlooked was because its special resolution error of 1.5m-2m was deemed unsuitable for our application. The aim of this project is to design and build a portable IPS that can be used for monitoring the movements of people indoors, achieving a high level of spatial accuracy (an accuracy of at least 50 cm) while being powered by off-the-shelf batteries. The technology that was proven to achieve the best spatial resolution is ultrasound. According to (Holms, 2012) [2] that resolution can be expected to be in the sub-centimetre levels. The system utilises the Time- Difference-Of-Arrival (TDOA) technique as it saves on power: the ultrasound emitter only transmits and the target only receives. The system design makes use of custom-built nodes as ultrasound emitters which are placed in the corners of the celling, a custom-built band as a receiver worn around the wrist of a person that is to be tracked, a phone application serving as the user interface to the system and a computer coordinating the devices known as the Hub. Each component of the system has been successfully built and tested. A system test was also achieved and yielded a satisfactory spatial resolution of 27 cm.
  • 5. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 4 TABLE OF CONTENTS 1 Introduction ............................................................................................................................................6 2 System Overview.....................................................................................................................................7 3 Role in the wider project.......................................................................................................................10 3.1 UKFC project..................................................................................................................................10 3.2 Cities unlocked project..................................................................................................................11 4 Application use cases ............................................................................................................................11 4.1 UKFC relevant use cases................................................................................................................11 4.1.1 Finding Deirdre’s location .....................................................................................................11 4.1.2 Reading values from relevant sensors ..................................................................................12 4.2 Cities unlocked relevant use case .................................................................................................12 5 Potential localisation enabling techniques ...........................................................................................12 5.1 GPS ................................................................................................................................................12 5.2 Bluetooth.......................................................................................................................................12 5.3 WI-FI ..............................................................................................................................................13 5.3.1 RSSI based triangulation........................................................................................................13 5.3.2 Time-of-flight triangulation...................................................................................................14 5.4 Ultrasound.....................................................................................................................................14 5.4.1 Time of flight (ToF)................................................................................................................14 5.4.2 Time-difference of arrival (TDOA)[19] ....................................................................................15 5.4.3 RSS (Received signal strength) [2] ...........................................................................................15 5.4.4 Related work .........................................................................................................................15 6 System design........................................................................................................................................16 6.1 Node..............................................................................................................................................16 6.1.1 Node circuitry........................................................................................................................16 6.1.2 Signal generation...................................................................................................................23 6.1.3 Node ADC ..............................................................................................................................23 6.1.4 Enabling Wi-Fi Communication.............................................................................................24 6.2 Band ..............................................................................................................................................31 6.2.1 Introduction (Band Functionality).........................................................................................31 6.2.2 Design & Specification...........................................................................................................32 6.2.3 Testing and Results................................................................................................................34 6.2.4 Band’s ADC and differences with node’s ADC.......................................................................37 6.3 Android Application ......................................................................................................................38
  • 6. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 5 6.3.1 Requirements........................................................................................................................38 6.3.2 Design & tests........................................................................................................................38 6.3.3 Evaluation..............................................................................................................................50 6.4 Hub program .................................................................................................................................50 6.4.1 Coordinator program ............................................................................................................50 6.4.2 Tracking algorithm.................................................................................................................55 7 Conclusion.............................................................................................................................................63 References.....................................................................................................................................................64
  • 7. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 6 1 INTRODUCTION We are part of projects called UK Future Care (UKFC) and Cities Unlocked (CU) which are faced with the challenge of coming up with systems that either monitor a person’s health (in the UKFC case) or guide a visually impaired person (in the CU case). The UKFC project is to combine data from environmental sensors and from a Microsoft Band to perform predictive analytics to allow monitoring a person from a distance. And the CU project developed a sound- based technology to assist and enable people with sight loss as they plan and undertake journeys in the city. Both of these projects require location data to be provided as one uses that data to allow other people to track them and the other uses it to direct the person of interest. Therefore, the main role of our team in these projects is to provide the ability of locating a person’s position indoors by supplying an Indoor Positioning System (IPS). Today GPS is the go-to technology for tracking the position of an object or a person. It however does not perform well indoors because its signals are not able to penetrate physical barriers. For that reason IPS are used instead for indoor tracking applications. Approaches demonstrated to date for IPS include: using Radio frequency techniques such as Wi-Fi or ZigBee. (Vasisht, Kumar and Katabi, 2015) [3] developed a system using three Wi-Fi emitters and a single receiver (Vasisht, Kumar and Katabi, 2015) exploited the relationship between the time-of-flight of electromagnetic signals and their spectral phase. The evaluation of three signals’ time-of-flight led to a median localisation error of 35cm and 62cm when in line of sight and not in line of sight respectively. (Sugano, 2006) demonstrated, built and tested a ZigBee-based system which boasts both a ZigBee emitter and receiver. Localisation of the receiver was made possible by evaluating the strength of the signal generated by the emitter. This achieved a spatial resolution of 1.5m-2m. The solution proposed by (Vasisht, Kumar and Katabi, 2015) achieved a very high special resolution however this came at the expense of a very complex system. (Sugano, 2006) prioritised simplicity and inexpensiveness yet the achieved resolution was very poor. (Holms, 2012) shows that an ultrasound-based IPS making use of ultrasound Time-Difference-Of-Arrival (TDOA) can achieve a spatial resolution of sub-centimetres to a few centimetres which is already better than both resolutions obtained by the ZigBee and Wi-Fi inspired systems. This advantage is the reason why our solution employs ultrasound to perform positioning based on Time-Difference-Of-Arrival (TDOA) technique. The overall system consists mainly of ultrasonic transducers, a coordinating unit called Hub, a mobile phone and a band. In addition, the main mechanisms used in our IPS system are grouping and triangulation. The system utilises the captured ultrasonic signals as the sensory information to unambiguously triangulate the position of a person. We first introduce the system then we discuss our involvement in UKFC and CU further which are then illustrated with application use cases. Following this, we discuss the potential localisation enabling technologies and the associated techniques to demonstrate why ultrasound was chosen and lastly, we describe our system and its subsystems in detail by providing requirements, design, tests and evaluation.
  • 8. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 7 2 SYSTEM OVERVIEW This section describes our solution to the aforementioned problem. The overall system is illustrated in figure 1. Figure 1: Overall system design [4][5][6] Responsible for the generation of ultrasonic signals are devices we call nodes. Capturing the emitted signals is an ultrasound-receiving device called band. Both node and band also boast Wi-Fi capabilities enabling then to communicate with the Hub, which in this case is a computer and will later become a Raspberry Pi 2. The hub acts as the system’s coordinator as it controls the operations of nodes and bands. It is controlled by the system’s user via the phone application. The devices that enable band triangulation, i.e. the nodes, are grouped such that each group is formed by the devices located in a single room. This allows the Hub to only trigger a single cluster of devices instead of them all which saves battery life. The grouping of these devices which are oblivious to their location within the house is now possible by using ultrasound: one device in each room is a master (Hardcoded and is known by the colour of the node) and is told by the Hub to send out an ultrasonic pulse towards the other nodes (the slaves). Ultrasonic signals can only travel within a single room therefore, only the nodes that share the same room hear that pulse and report back to the Hub. The Hub can now group the slaves with the master they heard. The user gives a name to this newly formed group via the android based phone application. This interaction is illustrated in figure 2. Master Bedroom Living room Hub Slave Kitchen Ultrasound BandSmartphone
  • 9. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 8 Figure 2: Flow diagram describing the system setup and grouping protocol. Once the grouping protocol is completed the next step would be to register a person into the system. This is done by adding our custom-built that they would wear around their wrist. In order to accommodate multiple persons within the system bands would be given unique names. This process is shown inn figure 3. User Install Smart Config or Android App Specify AP settings Initialise Smart Config Initialise Grouping Protocol Give name to group Phone Connect to AP Send Broadcast Store Hub’s IP Address Smart Config App Trigger to hub to start Waiting user of completion Forward name to group HUB Connect to AP to declare database Receive phone’s IP address Trigger masters to send ultrasound(one by one) Update database with groups Send completion message Assign name to group Nodes Connect to AP Masters send ultrasound Slaves that have heard IP Send ACK Update database Send Broadcast Store Hub IP
  • 10. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 9 Figure 3: Flow diagram describing the addition of a band to the system. The user then initiates the localisation protocol via the phone application which forwards that command to the hub. The latter triggers the band to listen to the ultrasonic pulses emitted by the synchronised master and slaves. Once the ultrasound pulse is captured, the band sends it to the Hub which uses a TDOA based algorithm to compute the band’s position. This is shown in figure 4. Figure 4: Flow diagram describing the triangulation protocol. User Phone Hub Band Push Button on Band Give name to band Ask for Communicat e name to Hub Store IP Associate IP with name Broadcast IP Stores Hub’s IP Confirmation
  • 11. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 10 3 ROLE IN THE WIDER PROJECT We are the UKFC/Cities Unlocked Hardware Triangulation group and a part of a wider group that consists of software engineers, system software engineers & electronic engineers. In particular, we are a part of the UK future care (UKFC) group and the Cities Unlocked group in collaboration with Microsoft. This section primarily aims to specify the context of our project within the wider project. 3.1 UKFC PROJECT The UKFC consists of our group and another group called the UKFC/365Agile team. In order to understand their role, consider the following scenario which describes the goal of the project: “Deirdre, an elderly mother collapsed on the floor whilst Alfie, her husband was playing golf at his golf club. Her sons Sam & Nigel, live far away from the house and so, there is no one looking her at home. Sam & Nigel decided that they would like to monitor her whilst they are away for peace of mind. They contacted KCC (Kent county council) and they were sign-posted to a service that they can purchase and install for themselves.” At the moment, Deirdre would wear a pendant alarm around her neck that has a big red button which when pressed, would alert someone to help her. The device is both unattractive and doesn’t work outside of the home. This leads to the requirements of a service that doesn’t bind mum & dad to the home and to not force them to wear an unattractive device. An external company called 365 Agile can provide home monitoring services but using it as a standalone system wouldn’t be sufficient as personal health data such as the heart rate of a person would be crucial to determining the physical wellbeing of a person E.G. wasn’t breathing. The UKFC/365Agile group were therefore, tasked with combining data from the home monitoring services provided by 365 Agile and from the Microsoft band in order to perform predictive analytics. This would enable Sam & Nigel to take preventative measures to support mum & dad from afar. Figure 5: The architectural diagram of the overall system Figure 5 illustrates the system for the entire UKFC project which comprises of the data gathering layer, cloud services layer and the application layer. We specifically fit into the data gathering layer of the
  • 12. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 11 project where we provide location data but also in the boundary between the data gathering layer and the cloud service layer where we provide data filtering based on that location. 3.2 CITIES UNLOCKED PROJECT The Cities Unlocked Umbrella is faced with enabling a blind person to find their way inside buildings. Here, we fit in the same role as that in the UKFC group whereby providing location data of the blind person to facilitate movement inside buildings. 4 APPLICATION USE CASES This section describes the relevant use cases to the UKFC project and to the Cities Unlocked project. Figure 6: Several rooms inside the house is shown. Each room has several sensors. Deirdre is marked with a cross and is in the bedroom. 4.1 UKFC RELEVANT USE CASES 4.1.1 Finding Deirdre’s location When Deirdre falls, an alert is sent to Sam/Nigel that the fall occurred. If Sam/Nigel is within range then their phone will receive her location inside the house. This would enable Sam/Nigel to immediately locate her within the premises where in figure 6, her location is in the bedroom. In addition, Sam/Nigel can act swiftly to the fall without wasting time of searching for her inside the house which may have significant number of rooms. For future deployment, this may not be limited to Deirdre’s home and may extend to infrastructures away from the home E.G. Library. By implementing it away from the home, this enables further use cases such as locating a lost person within the supermarket. Bedroom Kitchen Living room Bathroom S1 S2S0 S3 S5S4 S6 S8S7 S9 S11S10
  • 13. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 12 4.1.2 Reading values from relevant sensors Once we know Deirdre’s location inside the house and if there are sensors in every room of the house, it may be unnecessary to read data from every sensor. It may be better to read the values of the sensors that are close to Deirdre’s position inside the house such as sensors S1 & S3 as shown in figure 6. By reducing the range of sensors whose values are read, less processing is required in terms of the amount of data but also, more relevant data is used in calculations. These use cases requires our IPS to have a high spatial resolution as to correctly define the seriousness of the fall E.G. If she has fallen on the stairs as opposed to falling on the couch in which falling on the stairs is more serious. Additionally, to define Deirdre’s location correctly inside a house would require sufficiently high resolution as to minimise the chance of false location. 4.2 CITIES UNLOCKED RELEVANT USE CASE The use case for cities unlocked project is similar to that described in section 4.1.1 whereby we would still find the position of a person but for the purpose of directing a visually impaired person within other infrastructures such as departmental stores oblivious to them. 5 POTENTIAL LOCALISATION ENABLING TECHNIQUES This section describes how GPS, Bluetooth and Ultrasound technologies are used in positioning a person, what techniques are used with each technology and discuss the disadvantages & advantages each scheme. 5.1 GPS The global positioning system is the most utilised localisation method today, and for that reason further investigation into GPS was performed to see whether it can be used to achieve the goals of the project. However it was decided that GPS was not suitable for the following reasons:  It does not provide accurate results indoors for the GPS signal gets heavily attenuated when travelling through walls [7] .  Time to first fix or TTFF is the time it takes for the GPS receiver to calculate its first position using data sent by GPS satellites. This may take a minute or more [8] .  GPS receivers are huge power consumers and this is because they must remain in their active mode during the entire acquisition [9] , they usually come with rechargeable batteries. Some models can only work for up to 3 hours when powered by 4 AA batteries while most require even more power [10] . 5.2 BLUETOOTH In wireless sensor networks, nodes can be static or mobile, depending on the application requirements. Dealing with mobility can pose some formidable challenges in protocol design, particularly, at the link and network layers. These difficulties require mobility adaption algorithms to efficiently localise mobile nodes and predict the quality of link that can be established with these nodes. An off-the-shelf development platform that uses Radio Signal Strength Indication (RSSI) is mostly selected as the sensor localisation method, especially in the indoor environment. A series of experiments have
  • 14. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 13 been carried out to calibrate and map RSSI to distance. Despite this, research work has failed to prove the reliability of RSSI for indoor localisation. Based on previous work, results show that the RSSI method gives an unacceptable resolution and thus is not reliable for the indoor sensor localisation [11] . This is firstly because even in line-of-sight RSSI doesn’t give a consistent behaviour, so in a more realistic environment the performance of RSSI can be much more unreliable because of the presence of confounding factors like interference from other objects and attenuation caused by obstacles. Secondly, as the distance between the two motes increases, the error in measured RSSI values increases. Therefore RSSI gives extremely unreliable results and in conclusion, standalone RSSI cannot be used as a method for distance measurements in localisation algorithms. Bluetooth fingerprinting is an adaptation of RSSI for indoor positioning system [12] . Bluetooth Low Energy was deployed in this approach because it has a low power consumption. The fundamental idea of how this method is done is to match access point in a database to a particular signal strength fingerprints in an area. For this reason, Bluetooth class 3 is suitable for indoor usage as it produces a resolution of around 5 cm. This approach is carried out by two stages namely the training stage and the online positioning stage. In the training stage, the radio map is created based on the reference points within the area of interest. The radio map implicitly characterises the RSSI-Position relationship through the training measurements at the reference points with known coordinates. In the online positioning phase, the mobile device measures the RSSI, and the positioning system uses the radio map to obtain an estimate of the mobile’s position. The fingerprinting method has been widely discussed for indoor positioning. A method called Bayesian fusion was engaged to carry out the field test for indoor positioning by combining the posterior estimation from the RSSI measurements and the prior information from a motion model [13] . Through this investigation, a total of 13 long-range access points were deployed in the area of interest. The results showed that the method was effective and achieved a good enough resolution for the purposes of this project. 5.3 WI-FI Wi-Fi is another means of achieving localisation, and there are two main methods: ● RSSI (received signal strength indicator) where a Wi-Fi signal is transmitted from a source of known position. The location of the target is determined by the strength of the signal that the target picks up. ● Time-of-flight where a set of nodes serving as references of known location are used to find the location of a target. Each node tries to find how far the target is from itself. This is done by detecting the time it took a Wi-Fi signal to either reach the target (if the node was emitting Wi-Fi) or the reference node (if the target was emitting Wi-Fi). Wi-Fi based triangulation is preferred to Bluetooth based triangulation because it relies on hardware that has already been deployed (a house would already be equipped with a Wi-Fi router for example) so it does not require the deployment of anything extra. 5.3.1 RSSI based triangulation Triangulation by means of RSSI generally outputs results that are not very reliable and this is because Wi- Fi signal strength depends on the environment in which Wi-Fi finds itself. The environment may be the
  • 15. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 14 source of reflections, among other phenomena that affect the propagation of electromagnetic waves, leading to significant fluctuations in the detected signal strength heavy signal strength fluctuations. This means that results obtained may be many meters off the mark. Therefore taking multiple RSSI measurements instead of a single one will help reduce the margin of error. Studies on standard deviation of results obtained by RSSI methods show that these yield a triangulation resolution of 2.5 m [14] which for the purposes of the project is too high. Attempts at improving the results obtained by using the RSSI method have been attempted and one in particular has been able to greatly improve the RSSI resolution to a more respectable 0.8 m [15] by using a gyroscope in tandem with Wi-Fi: It was found that signal strength experiences minimum variation when the target device is in line of sight of the Wi-Fi source, so the proposal uses a gyroscope to only take strength measurements when this condition is true. This approach is not suitable for the purposes of the project because it requires at least three access points in the vicinity of the target and because Wi-Fi fingerprinting is a method that expands on the RSSI idea: a map is created and cut into sections that are associated with a signal strength value, the expected value that a device would measure if it was inside that section. This method requires a large number of cooperative access points in order to attain a good enough resolution. In (Navarro, Peuker and Quan, 2010)[16] a mean resolution of 0.37 m was achieved using six access points 18 meters far from one another without having their signals suffer from attenuation due to the presence of obstacles such as walls. 5.3.2 Time-of-flight triangulation The time-of-flight concept is not generally used in Wi-Fi triangulation and this is because the nature of the signal is electromagnetic, therefore it travels at the speed of light, making its detection very tricky. Clock frequency is the key to achieving a good resolution: as detection is achieved on the rising edge of a clock cycle, the clock period must be small enough to not translate into meaningful delay. Therefore only dedicated devices can actually be used to get a resolution that is acceptable for the purposes of the project as they have a very high clock frequency (close to 1 GHz) and these devices are usually very expensive, too expensive for time-of-flight to be considered as a triangulation candidate. One method of avoiding the clock problem has been proposed by (Vasisht, Kumar and Katabi, 2015)[3] where it was noticed that the spectral phase of the Wi-Fi signal was in a direct relation with that signal’s flight time. Taking phase measurements on different Wi-Fi frequency bands yielded impressive results: a resolution of no more than 20 cm. If the resolution obtained from a single band (the 2.412-2.462 band) is comparable to that then this method may well be a method that can fulfil the project’s goal. 5.4 ULTRASOUND This chapter describes the ultrasound wave, its suitability to the application of triangulation and its deployment in both the grouping protocol and in the triangulation protocol. Ultrasound is a sound wave of any frequency above 20 KHz[17] . It cannot be heard by humans as humans hearing is between 20 Hz – 20 kHz[18] . There are three main techniques for deploying ultrasound based triangulation. These are time of flight, time difference of arrival & received signal strength. 5.4.1 Time of flight (ToF) To measure time of flight, the point of reference is taken from one point and so, does not require clock synchronisation between two nodes.
  • 16. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 15 5.4.2 Time-difference of arrival (TDOA)[19] Time difference of arrival is measuring the time of arrival of a signal in one direction. There are multiple implementation techniques for TDOA: 1. One way time of arrival 2. One way time of arrival with multiple receivers OR multiple time of arrival with one receiver First method requires precise synchronisation of clocks whereas, the second method requires synchronisation of clocks between the multiple transmitters/receivers. 5.4.3 RSS (Received signal strength) [2] There are three different RSS based techniques: 1. Binary Signal Strength: it involves two nodes, one transmitter and one receiver. This method simply measures the amplitude of the receiver and outputs whether the transmitter is within range of the receiver. 2. Relative Signal Strength: it involves a transmitter array which sends ultrasound in different directions, each at different times with different codes. Multiple receivers is then used to obtain the RSS and then compares each one to each other to find which sector that the receiver was located in. 3. Absolute Signal Strength: it involves measuring the RSS and obtain range directly from an accurate propagation model. From (Holm, 2012), the accuracy that was obtained was in order of 10 cm. 5.4.4 Related work (Holm, 2012) describes ultrasound based systems but does not deploy the system. The paper describes that for locating objects in a room that TOF is better due to accuracies in the cm or sub-cm range. This can be enhanced using spread spectrum coding. For locating people in large institutions, binary RSSI is sufficient. (Segers, L., Bavegem, D., Winne, S., Braeken, A., Touhafi, A and Steenhaut, K. 2015)[20] describes an TDOA based approach to localisation whereby, using frequency hopping spread spectrum (FHSS) to modulate the data sequence with field programmable gate arrays (FPGAs) acting as the transmitters & receivers of ultrasound pulses. They directly wire the transmitter and receiver to synchronise the sending and receiving of ultrasound. The system does achieve a very good spatial resolution of <5cm. This approach and like any spread spectrum based system, they encounter the near-far problem which is well-known to these systems but not solved very easily. The problem is described as follows: At particular positions where at least one node is much closer to the receiver than the rest of the nodes, the closer node would result in the receiver receiving a signal power that dominates those that are further away. This leads to the correlation being saturated and therefore, unusable for determining position Although the accuracy is very good, due to the transmitting nodes and receiving nodes being synchronised by a wire, this wouldn’t suit our application requirement of being portable. (Medina, C., Segura, J and Torre, Á, 2013)[21] describes a TOF based system which consist of ZigBee based wireless nodes and emits ultrasound at a single frequency of 40 kHz. The synchronisation in this system is achieved by time division multiple access (TDMA). The nodes are divided into a single master node and end nodes (Termed slave nodes).
  • 17. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 16 The master node is connected to a PC where it acts as the coordinator of the system i.e. the interface between the user application and the slave nodes. The slave nodes simply receive or transmit ultrasound as they have transducers and their operation is controlled by the master node. This approach does report a very good error in distance measurements of less than 2mm and a root mean squared error of 9.5mm for positioning. It does specify low power however, it doesn’t give any values to show evidence for this. The problem with implementing this approach is that ZigBee isn’t readily found in infrastructures such as homes and typical buildings which is why this system uses a master node attached to a computer in order to achieve positioning. This wouldn’t be convenient to the user in our application as they may not have a spare laptop lying around or they may simply not want their personal laptop to be on all the time due to power consumption or other considerations. 6 SYSTEM DESIGN This section of the report covers the individual subsystems that interact in the grouping and triangulation protocols shown in the figures shown in the system overview section. 6.1 NODE 6.1.1 Node circuitry Figure 7: A node’s block diagram. Figure 7 above illustrates the different components at play enabling the node to both transmit and receive ultrasound signals. Since nodes are responsible for sending ultrasonic signals used in the triangulation of band’s position, they are therefore equipped with ultrasonic transmitters (transmitters were chosen instead of transducers because they output signals with better sound-pressure levels). As ultrasound signals experience attenuation when propagating, as seen in figure 8, amplification of signals captured by the receiver as well as the amplification of signals sent to the transmitters becomes necessary. Microcontroller Wi-Fi ADC PWM Receiver Active Bandpass Filter Smoothing circuit Speaker Amplifier
  • 18. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 17 Figure 8: Attenuation of ultrasound signals versus distance travelled. Results were obtained by using 400ST/R120 ultrasonic transmitters and receivers. Transmitters were powered at 9V p-p, provided by a signal generator. In order to eliminate added noise form the amplifier a band-pass filter stage has been integrated as well. Its frequency response will only passes along the bandwidth of interest, which ranges from 39.5 to 40.5 kHz for the 400ST/R120 devices. In order to simplify signal detection the design includes a smoothing circuit; a combination of a precision rectifier and a smoothing capacitor. This transforms the AC nature of the signal to a DC component which simplifies the operation of the ADC for it will only need to read the voltage level of its input. A microcontroller is also fitted into each node in order to: 1. Generate the electrical signal fed into the ultrasound speaker. A task performed by taking advantage of the Pulse-Width modulator module. 2. Process these signals. 3. Communicate with hub via Wi-Fi. The microcontroller chosen to accomplish the task mentioned above is Texas Instruments’ CC3200. This microcontroller has Wi-Fi capabilities, suitable ADC and PWM modules and is power efficient. 6.1.1.1 Requirements Six main requirements have been identified as needed to obtain an acceptable node circuit design: 1. Ultrasonic transmitters and receivers The nodes are envisaged to be placed in the upper corners of a room of interest therefore they will need receivers that can detect signals coming from all directions. This means that there angle of detection will need to be of 90 degrees both vertically and horizontally. In order to further signal 0 200 400 600 800 1000 1200 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Vp-p(mV) Distance (m)
  • 19. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 18 reception the transmitter chosen will need to have an acceptable sound-pressure level (SPL); one that can cover a decent distance, chosen for the purposes of this project to be of 10 meters The receiver on the other hand will need to have a good sensitivity so to allow it to capture faint ultrasound signals that travelled those 10 meters. 2. Impedance matching An impedance matching stage will need to be accounted for to allow maximum power transfer between the ultrasound receiver and the rest of the circuitry. 3. Battery-suited design The active components that will contribute to signal conditioning will be powered by 9V batteries therefore will need to draw as little current as possible to prolong battery life. 4. Gain stage Both the transmitter and receiver circuits will require one. The CC3200 will be powered at 3.6 V which signifies that the output of the PWM module will be much smaller than the supply level (it was measured in fact to be of 2.7 V). To take advantage of the full voltage swing of the supply and ensure that transmitter output the loudest possible ultrasound (which increases the distance theses signal can travel) a gain stage of 11 dB amplification is required. A gain stage will also be needed to make sure that the signal remains detectable at long distances which means that the signal-to-noise ratio will need to be set as a factor of 2 at least when the distance between the transmitter and the receiver is of 10 m. The exact value of the received signal when the distance is 10 m was not found because noise levels are too high for it to be detectable however it can be estimated by knowing that sound attenuation follows an inverse-square law and be extrapolating the plot in figure 2 by following that law. The estimation found is a detected signal of amplitude 1.8mV p-p. In order to respect the SNR level chosen the amplifier gain will need to be set at 21 dB according to equation 1. = 20 × × ≈ 21 Equation 1 5. Filtering As a gain stage was found to be required this led to the need for filtering added noise (which accounts for resistor thermal noise and operational amplifiers’ input referred voltage noise).
  • 20. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 19 6.1.1.2 Transmitter’s Development Figure 9: Circuit diagram of transmitter. The schematic design of transmitter circuitry is presented above in figure 9. It is a non-inverting op amp with a gain of 3.3 V/V. The purpose of implementing this circuitry is to amplify the signal generated from the microcontroller. As a result of that, this enables the ultrasonic transmitter to generate the required ultrasonic signals at 9Vpkpk. 6.1.1.3 Receiver’s development To achieve the functionalities outlined in figure 7 a circuit diagram was designed. It can be seen in figure 10. Figure 10: Circuit diagram that achieves the functionalities illustrated in the receiver block diagram, part of figure 7. What follows describes the steps taken that lead to the development and building of the circuit diagram. First two key parameters of the ultrasound receiver were put to the test: its directionality and its sensitivity versus distance. These parameters were needed in order to choose the right amplification gain. To test directionality a receiver was connected to an oscilloscope; a transmitter was placed 5 cm away while being powered by an 8V peak-to-peak sine wave. The transmitter was moved at increments of 20° around the receiver while maintain a distance of 5 cm, due to the symmetry of the directionality, its measurement were only performed on the right hand side of the receiver. The output of the receiver was recorded and plotted in figure 11. It confirms that the receiver, just like the transmitter, has a directionality angle of 85°.
  • 21. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 20 Figure 11: On the left, 400ST120 (transmitter) signal attenuation (in dB) versus ultrasound incident angle (in °) [22] On the right, 400SR120 (receiver) signal attenuation (in dB) versus ultrasound incident angle (in °) As for sensitivity versus distance the receiver was placed in line of sight of the transmitter while the latter was still powered by the 9V sine wave. The distance between the devices was increased accordingly and measurements were taken for each distance. These results for the plot seen in figure 8. It was deduced that the plot follows an inverse-square law which was expected since sound attenuation resulting from propagation also follows that same law. Once the transmitter and receiver were proven to be satisfactory their internal impedance had to be found. This was done by observing the output voltage of the receiver when varying matching impedance values. The impedance was tested by having a transmitter sending a constant 40 kHz signal in the direction of a receiver connected to the impedance matching resistor and the oscilloscope. The 100 kΩ resistance at which the output was found to be at a maximum was chosen as the impedance matching resistance. The filter and amplifier were designed simultaneously for it quickly became clear that an active filter circuit could simply combine the two. Figure 12 shows the frequency response of the ultrasound receiver. It shows that the drop-off offered is very sharp. This implies that the filter will not require a sharp frequency response because it has already been achieved. Instead the filter will need to deal with noise sources that influence the rest of the circuitry. These will come in the form of thermal noise generated by the use of resistors in the circuit and input-referred voltage noise generated by the usage of op-amps. Figure 12: Frequency characteristics of the 400ST/R120 ultrasound devices [22] .
  • 22. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 21 The proposed design is an active bandpass filter combining a low-pass filter and a high-pass filter. It uses TL084BCN operational amplifiers because these, according to their datasheet[23] , have: 1. A good slew rate (13V/µs) to deal with frequencies in the tens of kHz. 2. A good Gain-Bandwidth product to enable the amplifier to provide a gain of 21 dB. 3. Low input referred voltage noise: 18 /√ = × 18 × 10 × ℎ = 0.2 Equation 2 According to equation 2 even ultrasound signals that have travelled 10 m and have been attenuated to 1.8 mV can be amplified without being drowned by noise. Since the receiver’s bandwidth must be within the pass band of the filter, a second order Butterworth filter design based on the Sallen-Key topology was chosen. This filter design, unlike the Chebyshev version presents no attenuation in the passband; attenuation that can limit detection of very small input signals. The filter’s high pass corner frequency was set to 33.8 kHz according to equation 3 and the low pass corner frequency at 49.8 according to equation 4. The total gain of the circuit amounts to 27.6 dB, given by equation 5. The reason for the disparity between this gain and the gain set in the requirements section is because while the 1 kHz bandwidth falls within the passband it does get slightly attenuated; the extra gain boosts the signal further, eliminating this attenuation. = × × × = 33.8 Equation 3 = × × × = 49.8 Equation 4 = 2 × 20 × 1 + . = 27.6 Equation 5 A smoothing circuit was added to the design and acts as an AC-to-DC converter. It is needed because it simplifies the operation of the ADC which requires constantly positive inputs, therefore it eliminates the need for an additional offset stage. Further detail on why this topology was chosen are given in the section that covers ADC operation. This stage comprises of a precision rectifier and a smoothing capacitor. The precision rectifier topology was chosen because the output signals of the amplifier may not be large enough to drive a simple diode. This circuit eliminates the negative swing of the signal and the smoothing capacitor, which was chosen to be 1µF in order to have a large enough charge/discharge period, completes the signal conversion. 6.1.1.4 Testing and results The active filter’s frequency response was tested first. A simulation of the circuit was run on Multisim in order to compare its results with the actual design. The circuit itself was tested by having a signal generator generating a 100 mV p-p sine wave as an input signal. The results of the simulation and experiment have been grouped in figure 13.
  • 23. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 22 Figure 13: Plots of the simulated and measured receiver frequency response. The result of that experiment shows that the built active filter does achieve the required gain however its frequency response is steeper than expected. It even looks as though the built high pass filter is of a higher order than the simulated one yet they are both, in fact, second order filters. This difference does not have any undesirable effects, quite on the contrary, it allows for better filtering. The smoothing circuit was then added to the filter and the active filter-smoothing circuit combination was also tested first using an input sourced from a signal generator outputting a 100 mV 40 kHz sine wave. The tests’ purpose was to verify that integration of the two circuits went smoothly, without impedance mismatches. The result of these tests are shown in figure 14. Figure 14: Output of smoothing circuit. It can be deduced that the smoothing of the AC signal has been successful, the output of the smoothing capacitor can be directly connected to the ADC module with no expected issues. Finally one last test was performed in which the input was connected to the ultrasonic receiver instead. A transmitter was placed 1 m from the receiver and was powered by a signal generator outputting a 9 Vp-p sine wave. The results of this test in accordance with the results obtained in figure 14. -15 -10 -5 0 5 10 15 20 25 1 10 100 1000 Gain(indB) Frequency (in kHz)
  • 24. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 23 6.1.2 Signal generation Nodes need to be distinguished in the triangulation protocol in order to compute positioning. In previous works, there were two main techniques in enabling this:  Transmit a sequence of bits unique to each node (Which spreads the signal across some bandwidth)  Do either time division multiple access (TDMA) where each node sends one at a time or frequency-division multiple access (FDM) where each node has a different carrier frequency We use FDM as this is simpler to implement & less power consuming than transmitting a sequence of bits. In comparison to TDMA, it would again use less power as TDMA would result in the receiver listening multiple times. Pulse width modulation is used to generate a finite square wave pulse at a particular frequency with 50% duty cycle. The filter of the ultrasound transmitter eliminates all but the fundamental frequency which converts the square wave into a sine wave. 6.1.3 Node ADC Upon detection of ultrasound, the receiver will convert it to an electronic signal which then goes through the signal conditioning unit. The output is an amplified and filtered version of the input. The processing unit, which in this project is the CC3200, is still not aware that ultrasound has been detected and therefore cannot react accordingly. So for the microcontroller to know of the presence of ultrasound it will need to have an interface with its analogue surrounding. This interface will come in the form of analogue-to-digital converters (ADC) and will have the output of the signal conditioning unit as its input. 6.1.3.1 Requirements The ADC required will need to be able to: 1. Sample the 39.5 to 40.5 kHz ultrasonic signals, and therefore will need to have a sampling rate of at least 81 kHz as per the Nyquist rate. 2. Detect 1.8 Vp-p signals as these are the received ultrasonic signals that have travelled a distance of 10 m. For the ADC present on the CC3200 unit, which has a maximum input level set at 1.4V, this translates into an ADC resolution of 10 bits according to equation 6. = log . × = log . . × = 9.6 Equation 6 6.1.3.2 Development One of the reasons why Texas Instruments’ CC3200 microcontroller was chosen was because it met both requirements: 1. It has 4 ADC input channels with a sampling rate of 62.5 kHz per channel. So combining channels leads to increased sampling frequency: 125 kHz for two channels and 250 kHz when using all four. 2. Its resolution is of 12 bits, allowing digitisation of signals as small as 0.3mV. The ADC proposed by the CC3200 microcontroller cannot accept voltages that either are negative or exceed 1.8 V. To deal with negative voltages the node circuits convert the alternating current voltage outputted from the ultrasonic receiver to a direct current voltage. The ADC of the nodes had its sampling frequency set to 125 kHz (this was achieved by having the ADC continuously switch between two input channels, as can be seen in figure 15. Once called upon it captures 85 ms worth of samples (a duration chosen to guarantee capture of ultrasound signal if one was
  • 25. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 24 sent). It is first called upon as the device boots up to establish a noise baseline (it does this by averaging sampled data collected when no ultrasound has been emitted). The microcontroller then compares that baseline level to the average of samples captured when ultrasound is being emitted. If the average is found to be more than double the baseline the microcontroller concludes that ultrasound has been detected. Figure 15: State diagram of the ADC when set to sample at 125 kS/s. 6.1.3.3 Testing and Results For testing purposes, the ADC was initially fed a 40 kHz signal of amplitude 0.2 V with an offset of 0.1 V from the signal generator. This is a generic signal that can be reproduced by the receiver hence why this configuration was chosen. The node’s ADC was tested by having one of the LEDs on the CC3200 Launchpad flash once the average of the signal samples was found to be more than twice as large as the baseline. The node’s ADC test was a success when either the 0.2V generic signal or the actual ultrasound transmitter and receiver were used as inputs: The LED only flashed when the input signal was at least twice the amplitude of the noise baseline. 6.1.4 Enabling Wi-Fi Communication This section describes the algorithms used to:  Enable the WIFI connectivity,  The communication between the hub and the microcontrollers  The transmission of ultrasound pulses  The capture of those pulses 6.1.4.1 Overview WIFI connectivity  The setup of connecting to the WIFI access point is done via an app named Smart Config which is installed on an android or IPhone device.  The user must ensure that the phone is connected to the desired WIFI access point  He/she will enter their network security key via the app Switch to channel 1 Switch to channel 2 Sampling on channel 1 Sampling on channel 2
  • 26. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 25  These secure packets are scoured across the network and only recognised by the CC3200.  The CC3200s will now be able to automatically connect to the WIFI access point as it stores the password locally. Communication between the Hub & the microcontrollers Obtaining the hub IP  The nodes initially sends out a broadcast of its IP address onto the network it’s currently connected to.  The hub responds directly back (i.e. unicast) with its IP address Responding to grouping  The hub sends to all “Slave” nodes (i.e. nodes with both ultrasound transmitters & receivers) a command where those nodes will immediately start listening for ultrasound.  Next, the hub sends a command which initiate transmission of ultrasound to individual “Master” nodes.  For those slaves that listen to the ultrasound pulse, they tell the hub that they have heard the ultrasound. Responding to triangulation The hub sends a code word that enables transmission of ultrasound and to capture ultrasound in a particular room
  • 27. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 26 6.1.4.2 Algorithms Figure 16: The activity diagram of the main Figure 16 shows the main operation of a node and a band whereby initialising the microcontroller, connecting to WIFI and then entering an infinite while loop to listen for WIFI messages. Only the nodes will broadcast its address initially to make the hub aware of its existence whereas the bands would broadcast upon pressing a button on the band.
  • 28. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 27 Figure 17: The activity diagram of the WIFI connection process Figure 17 shows how the microcontroller connects to a WIFI access point whereby it allows the user to use the smart config app on the phone to connect it to WIFI or use WPS by pressing SW2 button on the microcontroller.
  • 29. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 28 Figure 18: The activity diagram of actions that are taken as a result of recognised WIFI messages Figure 18 shows the recognised WIFI messages and what action the microcontroller will take as a result of the message.
  • 30. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 29 Figure 19: The activity diagram of naming a band or room process Figure 19 shows the process that the microcontroller takes in adding (and naming) a band but also how a room is added. For a room to be added, a microcontroller would alert the hub of its presence by sending the command “State Button_Pressed” whereas a band would send “Store Band <IP Address>” to add it to the system & to alert the hub (and phone) of its presence. There is one other process which is that when an error has occurred, the microcontroller enters an infinite loop and the green LED would stay alight.
  • 31. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 30 6.1.4.3 Testing 6.1.4.3.1 Unit testing Test no Operation under test Expected result Actual result Fail/Pass 1 Check if LEDs toggle Red and green LED flashes Same as expected Pass 2 Check if smart config work using the application on the phone uC connects to WIFI and the red LED switches on to indicate connection Same as expected but note sometimes as it depends on configuration of WIFI network Pass 3 Check if WPS works uC connects to WIFI and the red LED switches on to indicate connection Same as expected Pass 4 Check if microcontroller can receive WIFI messages Receive “ABCD” and print it to the console Same as expected Pass 5 Check if microcontroller can send WIFI messages Send “ABCD” to MATLAB after connecting to WIFI and see it printed on MATLAB Same as expected Pass 6 Check if it can generate a 40 kHz signal 10 Cycles at 40 kHz is shown on the oscilloscope whose input is attached to the output pin of the uC Same as expected Pass 6.1.4.3.2 Integration testing Test no Operation under test Expected result Actual result Fail/Pass 7 Check if the command “Store Hub <IP Address>” causes the microcontroller to send only to hub Sends “ABCD” in response to the store to MATLAB via WIFI but not to another MATLAB on another computer Same as expected Pass 8 Check if the command “State Ultrasound_Tx <Timer Interval Reload>” causes the microcontroller to transmit the corresponding frequency See 10 cycles at 40 kHz on oscilloscope when MATLAB sends the Same as expected Pass
  • 32. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 31 appropriate command 9 Check if the command “State Ultrasound_Rx <Timer Interval Reload>” causes the microcontroller to capture ultrasound and transmit the sampled values via WIFI In response to the appropriate command, MATLAB sees the entire sample sequence sent from the band Same as expected Pass 10 Check if the command “End” causes the microcontroller to enter the error state In response to the appropriate command sent from MATLAB, show the green LED Same as expected Pass 11 Check that other commands do not do anything In response to “ABCD” sent from MATLAB, do nothing Same as expected Pass 6.1.4.3.3 System testing Test no Operation under test Expected result Actual result Fail/Pass 11 Check if the entire program operate as required Yes Yes Pass 6.1.4.4 Evaluation The program has met all pre-requirements of a node and of a band and therefore succeeds as a result. 6.2 BAND 6.2.1 Introduction (Band Functionality) The main functionality of the band is to uniquely identify a person by means of ultrasonic detection. Figure 20: Block diagram of the band The band consists of three main functional components: Filtering stage, amplification stage & an offset stage as shown figure 20. Amplification (Gain) Bandpass Filter Level Shifter (DC offset) Analogue-to- Digital Converter (CC3200) Clipper diode Ultrasonic Receiver Precision Rectifier
  • 33. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 32 The filtering stage consists of a 2nd order Butterworth band-pass filter based on the Sallen-Key topology. Its purpose is to remove noise induced by the internal circuitry and to provide additional filtering to the already narrow passband of the ultrasound receiver. Following this stage is the amplification stage. This consists of a non-inverting operational amplifier which applies a constant gain to the signal inputted to this stage. The purpose of this stage is to amplify the input receiving signal from the ultrasonic receiver when the band is located relatively far from the ultrasonic transmitter and produce a high SNR to the ADC. As the ADC only accepts input voltages in the range of 0V to 1.4V inclusive, the output of the filtering stage needs to be shifted to the appropriate levels. This is accomplished in the offset stage which consists of a summing non-inverting op-amp and adds the necessary DC offset voltage. Finally, as a safety mechanism, a precision rectifier has been added in order to protect the ADC from voltages that is beyond the bounds of the ADC. 6.2.2 Design & Specification Figure 21: The circuit schematic of the band Figure 21 shows the circuit schematic of the band where the input signal is Vin and the output is taken after the precision rectifier. Before the main stages in the band, impedance matching with the ultrasonic receiver is first required to maximise the power transfer from the ultrasonic receiver to the rest of the
  • 34. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 33 circuit. This consists of the single resistor R9 (As seen in figure 21) and has a value of 100kOhms as this is based on the impedance response of the ultrasonic receiver which is found in the technical datasheet. [22] The justification of equipping TL084CN as the proposed dual sided op-amp is because of its specification that meets most of the criteria listed. For example, it has a good slew rate of 13V/µs, good gain- bandwidth product, low harmonic distortion with typically 0.001% and lastly it accepts 3V supply. The dual sided op-amp will be positively and negatively supplied by two cell batteries with voltage of 3V. The first stage of the circuit is the filtering stage which is based on the Sallen-Key topology and consists of a 2nd order Butterworth low pass filter & a 2nd order Butterworth high pass filter with respective cut-off frequencies of 86.2 kHz and 14.6 kHz and with respective gains of 2 V/V and 2.2 V/V. These parameters were achieved based on the specified bandwidth of the 2nd order Sallen-Key Butterworth Band-pass filter between the range of 10kHz to 90kHz and values of the resistors R & capacitors C were chosen to obtain the desired frequencies from Equation 7 and Equation 8 below. As a result, the combination of the low pass and high pass filters therefore, forms a 2nd order Butterworth band-pass filter with an overall gain of 4.4 V/V and lower & upper cut-off frequencies of 14.6kHz and 86.2kHz respectively. In addition, any input receiving signals that are out of range of the bandwidth will be attenuated which serves the purpose of smoothing the input signals through eliminating the unwanted noise signal. [24] = (Equation 7) = 1 + (Equation 8) Onto the next stage of the circuit which is the amplification stage. This consists of a non-inverting operational amplifier whose gain is 2.8 V/V based on Equation 2. This means that the overall gain of the band is 12.32 V/V. Following this stage is the offset stage which is performed by the level shifter part [25] . A potential divider, consisting of two resistors 1kOhms (R13) & 3.3kOhms (R18), is used to obtain approximately 0.7V (Exact value obtained was 0.69V) from a single 3V coin battery cell to supply to the non-inverting positive input of the dual-sided op amp and provide the DC offset. The formula used to calculate this value is shown in Equation 9. Moreover, this stage has an unity gain since the output which is halved due to the setup of two parallel connected 100kOhms resistors is amplified by the gain of 2 before moving on to the next part. Therefore, the resulting signal is shifted up by the DC offset value of 0.7V and this required as the input supply range of the ADC is between 0 to 1.4V. = × (Equation 9) Lastly, the remaining part of the circuit is a safety protection for the ADC. This consists of a clipper diode clipping at approximately 1.4V (Achieved 1.39V) which is the maximum voltage that the ADC can handle [26] . This is achieved by placing a resistor (R16) in parallel with 3 diodes in series resulting a forward bias voltage of 1.39V. A precision rectifier is placed at the end part of the circuit which has a direct function of eliminating any unwanted negative signal [27] . The precision rectifier is designed based on using a MCP6281 dual-sided op amp and place a forward biased diode (D4) and a resistor (R4) to the output. The purpose of implementing this part as a precautionary measure is essential because according to technical specification of the CC3200 microprocessor, it only allows an acceptance input signal ranging from 0V to 1.4V.
  • 35. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 34 6.2.3 Testing and Results This section describes the testing of the band, the results that the band achieves and an evaluation of the performance. The first test involves testing the frequency response of the 4th Order Butterworth Band-pass filter circuit to have the desired cut-off frequencies that were described previously. The method is as follows:  Supply an input AC signal of 100mVp-p at 40 kHz by a signal generator  Observe and record the output voltage of the circuit between frequencies of 5 kHz and 200 kHz. The results is shown in the plot of gain (dB) vs frequency and comparison between actual results and simulated results in figure 22. Figure 22: The graph of the voltage gain is shown against the input frequency The actual results taken from the experimental test have shown that the bandwidth of the 2nd order Sallen-Key Butterworth Band-pass filter is between 12 kHz and 85 kHz. To compare the simulated and actual plotted graphs, the achieved bandwidth is approximately close to the simulated bandwidth within 5% of percentage error. In comparison with the calculated cut-off frequencies which are 86.12 kHz and 14.6 kHz, the low-pass cut- off and high-pass cut-off frequencies have a percentage error of 1.3% and 17% respectively were calculated using equation 10. = 100 (Equation 10) As a result, the frequency response of the 4th order Butterworth Band-pass filter is achieved and valid in accordance with the simulated results. The next stage of testing is assessing the overall gain of the band. The method is as follows: 0 5 10 15 20 25 30 1 10 100 1000 Gain(dB) Frequency(kHz) Frequency Response of the Band Actual Results Simulated Results
  • 36. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 35  Using a signal generator, supply an AC input signal ranging from 50mVp-p to 250mVp-p with an increment of 10mV and at a constant frequency of 40 kHz.  Measure the output voltage of the band The results of the test is shown in figure 23. The results below have shown that the band circuitry has a constant gain of approximately 12 and based on the designated specification, the circuit is able to achieve at the calculated gain of 11.76 which approximates to 12. However, the output voltage is constant at 2.92V with any input above 240mV because the double-sided op amp is supplied with 3.0V positively and negatively and therefore the output voltage would clip at 3V. Figure 23: The output voltage of the band is plotted against the supplied input voltage The next series of tests involve testing the full adder, clipper diode and precision rectifier to ensure ensure each sub unit works fine. The left figure in figure 24 shows the output signal of the circuit supplied by an input signal of 100mVp-p in the absence of the aforementioned sub units i.e. The input to the offset stage. The right figure of figure 24 shows the output signal of the full adder circuit when it is added to the previous circuit i.e. without the aforementioned sub units. It shows that it was able to shift the level of output signal upwards by 0.7V. The left figure in figure 25 depicts that the clipper diode is capable of clipping the output signal at 1.4V when the input signal is supplied at 250mVp-p which without the clipper diode, would output 3Vp- p.Lastly, it can be observed from the right figure in figure 25 that the precision rectifier’s functionality of eliminating any unwanted negative part of the signal in the circuit is working. 0 0.5 1 1.5 2 2.5 3 3.5 0 50 100 150 200 250 300 OutputVoltage(Vp-p) Input Voltage(Vp-p) Overall Gain of Band Circuitry
  • 37. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 36 Figure 24: The input to the offset stage is shown on the left and the output of the offset stage is shown on the right Figure 25: The output of the clipper diode is shown on the left and the output of the precision rectifier is shown on the right Finally, the last test that was carried out was the system testing of the band. This was carried out to ensure that it is performing correctly when all stages are placed together as a whole. The method of testing is as follows:  Connect an ultrasonic receiver to the input of the band circuitry  Connect an ultrasonic transmitter to the signal generator and set a sine wave of frequency 40 kHz and amplitude of 9Vp-p  Record the output voltage for distances between 1m to 10m with an increment of 1m The results of the test are shown as a plot of output voltage vs distance in figure 26. Overall, the analysis of the results from the system testing has indicated that the band is functioning in accordance with the specified requirements of band design.
  • 38. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 37 Figure 26: Graph of output power against distance of separation between the ultrasonic receiver and the ultrasonic transmitter 6.2.4 Band’s ADC and differences with node’s ADC The Band will also be making use of a CC3200 in order to have Wi-Fi capabilities as well as an appropriate ADC module. The latter shares the same requirements as the ADC designed for the node: 1. It needs to have a sampling rate of at least 81 kHz. 2. It needs to have a minimum resolution of 10 bit. However unlike the node a band is supposed to use its ADC to register input signals and send them back to the hub for processing. The smoothing circuit that was designed to enable the nodes to determine whether they heard ultrasonic signals becomes obsolete here. Introducing the 0.7 V offset instead allows the signal to remain positive at all times, which enables the CC3200’s ADC to capture the actual AC signal detected by the ultrasound receiver. Once activated, the ADC of the band continuously samples for the duration of 85 ms at a sampling rate of 125 kS/s. The 85 ms duration, just like the node’s ADC insures that all ultrasonic signals sent at the moment of activation have been captured and sampled. 85 ms worth of data equates to 10640 captured samples, each two bytes long and all stored inside an array in preparation for W-Fi transmission. The hub awaiting these samples can only receive 140 at a time because it can only scan for one packet at a time, so to ensure full sample transmission the ADC program running on the CC3200 microcontroller sends 140 elements of the sample array at a time which in total comes to 76 transmissions. The band’s ADC was tested by having the ADC continuously sample a 0.2V p-p 40 kHz signal generated signal sourced from a signal generator. Once sampling was complete the sample array were sent to the hub program via Wi-Fi. The result of that experiment is shown in figure 27. 0 10 20 30 40 50 60 0 2 4 6 8 10 12 Outputpower(dB) Distance between Ultrasonic receiver and transmitter(m) Plot of System Testing for Band
  • 39. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 38 Figure 27: Data captured by the ADC and the Fast Fourier Transform of that data. The result shows that the expected frequency component has been successfully captured by the ADC and received by the hub. Then the input of the band’s ADC was set as the ultrasound receiver capturing ultrasonic signals sent by a transmitter 1 meter away powered at 9V p-p. This test was done to prove that the ADC can integrate with the ultrasonic equipment. Its result mimic the one shown in figure 27 proving the success of the ADC integration. 6.3 ANDROID APPLICATION The android application acts as the user interface between the system and the user in which he/she will be able to control the operations that occur in the system E.G. Choosing a person to track. This section describes the functionality & develop of this application. 6.3.1 Requirements  The user should be able to initiate the grouping of nodes  The user should be able to provide a name to a room & also remove a name provided to a room  He/ She should be able to add a band, provide a name for that band and be able to remove a band  He/ She should be able to select a band to triangulate  He/ She should be able to get an up-to-date list of the current bands and rooms in the system 6.3.2 Design & tests The design and tests are structured to show & test a particular sequence of interfaces that would occur sequentially when run with the entire system.
  • 40. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 39 6.3.2.1 Grouping interfaces Algorithm:  When the user presses Group Nodes on the main menu, transmit “Group Nodes” via WIFI to the hub directly if its IP is set or broadcast it if unknown.  Wait for a response from the hub for 10 seconds and then timeout if no response.  If “Group Formed” received, inform the user that the group was successfully grouped. Otherwise, output an error screen Unit testing: Test no Operation under test Expected Result Actual Result Pass/Fail 1 Check “Group Nodes” is sent successfully MATLAB should receive the command and print it out Same as expected Pass 2 Check if timer is working The timer counts down in 1 second intervals and when timer expires, it stops Same as expected Pass 3 Check if “Group Formed” is received successfully The message received by the android phone should output it to logcat Same as expected Pass Integration testing: 4 Check if pressing on Group Nodes button in the main activity causes a transition to the appropriate waiting activity Should see the next screen titled “Forming Group” Same as expected Pass 5 Check if after receiving the command “Group Formed” during the waiting activity Should see the next screen titled “Completed Grouping Protocol” Same as expected Pass
  • 41. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 40 causes a transition to the appropriate completed activity 6 Check if receiving any different command causes an error screen Should see next screen being the error screen and a detail of the error Same as expected Pass Algorithm:  When the user presses “Obtain Hub IP” on the main menu, broadcast “Discover Hub” via WIFI  Wait for a response from the hub for 10 seconds and then timeout if no response.  If “Store Hub <IP Address” is received, store the IP address and output to the user that the hub IP was successfully obtained. Otherwise, output an error screen. Unit testing: Test no Operation under test Expected Result Actual Result Pass/Fail 1 Check “Discover Hub” is sent successfully MATLAB should receive the command and print it out (Logcat should also show it received its own message as it is a broadcast) Same as expected Pass 2 Check if “Store Hub <IP Address>” is received successfully The message received by the android phone should output it to logcat Same as expected Pass 3 Check if the hub IP address is stored and used for future communications Repeat Group Nodes operation but now logcat shouldn’t show its own message as not a broadcast Same as expected Pass
  • 42. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 41 Integration testing: 4 Check if pressing on “Obtain Hub IP” button in the main activity causes a transition to the appropriate waiting activity Should see the next screen titled “Obtaining hub IP” Same as expected Pass 5 Check if after receiving the command “Store Hub <IP Address>” during the waiting activity causes a transition to the appropriate completed activity Should see the next screen titled “Successfully obtained HUB IP Address!” Same as expected Pass 6 Check if receiving any different command causes an error screen Should see next screen being the error screen and a detail of the error Same as expected Pass Algorithm:  When the user presses “Manage Rooms” on the main menu, show “Add Room” & “Remove Room” options to the user  If the user selects “Add Room”, send “Expect Node_Button” to hub and Inform the user to press a button on a node inside the room they wish to name  Wait for a response from the hub for 10 seconds and then timeout if no response.  If “Discover Room_Name” is received, show a screen for retrieving the name for the room. Otherwise, output an error screen.  Get the room name entered when the user presses the confirmation button and send “Store Room_Name <Room name>” to the hub  Wait for a response from the hub for 10 seconds and then timeout if no response.  If “Group Named” is received, inform the user that the room was named successfully. Otherwise, output an error screen. Unit Testing: Test no Operation under test Expected Result Actual Result Pass/Fail 1 Check “Expect Node_Button” is sent successfully MATLAB should receive the command and print it out Same as expected Pass
  • 43. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 42 2 Check if “Discover Room_Name” is received successfully The message received by the android phone should output it to logcat Same as expected Pass 3 Check if the room name entered by the user is retrieved successfully and is validated to ensure uniqueness Logcat should output the name after the confirmation button is pressed. If the name entered is the same a name in the room list, the activity should not finish and a toast should appear to alert the user. Same as expected Pass 4 Check “Store Room_Name <Room name>” is sent successfully MATLAB should receive the command and print it out Same as expected Pass 5 Check if “Group Named” is received successfully The message received by the android phone should output it to logcat Same as expected Pass Integration testing: 6 Check if pressing on “Manage Rooms” button in the main activity causes a transition to the appropriate setting menu activity Should see the next screen titled “Choose an option” Same as expected Pass 7 Check if pressing on the “Add Room” causes a transition to the appropriate waiting activity Should see the next screen titled “Press a button on any node in the room you wish to name” Same as expected Pass 8 Check if after receiving the command “Discover Room_Name” during the waiting activity causes a transition to the appropriate naming activity Should see the next screen titled “Provide a unique name to this room” with a text field and a confirmation button Same as expected Pass 9 Check if after receiving the command “Group Named” during the waiting activity causes a transition to the appropriate completed activity Should see the next screen titled “Successfully named group!” Same as expected Pass 10 Check if the room name that was submitted is Go through Manage Rooms -> Remove Same as expected Pass
  • 44. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 43 stored in the local list of room names Room and the name that was submitted should be in the list 11 Check if receiving any different command during the waiting screens causes an error screen Should see next screen being the error screen and a detail of the error Same as expected Pass Algorithm:  When the user presses “Manage Rooms” on the main menu, show “Add Room” & “Remove Room” options to the user  If the user selects “Remove Room”, show a list of all rooms that they can remove  For the option that they select, send “Remove Room <Room selected>” to the hub  Wait for a response from the hub for 10 seconds and then timeout if no response  If “Room Deleted” is received, inform to the user that the room was successfully deleted. Otherwise, output an error screen. Unit Testing: Test no Operation under test Expected Result Actual Result Pass/Fail 1 Check if reading and outputting a list as a set of radio buttons works Using a predefined list called “roomnames.txt” with 1 name in each line, the list should be seen in the screen Same as expected Pass 2 Check “Remove Room <Room name>” is sent successfully MATLAB should receive the command and print it out Same as expected Pass 3 Check if “Room Deleted” is received successfully The message received by the android phone should output it to logcat Same as expected Pass Integration testing: 4 Check if pressing on “Manage Rooms” button in the main activity causes a transition to the appropriate setting menu activity Should see the next screen titled “Choose an option” with two buttons, “Add Room” & “Remove Room” Same as expected Pass 5 Check if pressing on the “Remove Room” Should see the next screen titled “Check the button for Same as expected Pass
  • 45. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 44 causes a transition to the appropriate list activity which room you wish to remove” 6 Check if after selecting a room from the list that this causes a transition to the appropriate waiting activity Should see the next screen titled “Deleting room ‘<Room name>’” Same as expected Pass 7 Check if after receiving the command “Room Deleted” during the waiting activity causes a transition to the appropriate completed activity Should see the next screen titled “Successfully deleted room!” Same as expected Pass 8 Check if the room name that was submitted is deleted from the local list of room names Go through Manage Rooms -> Remove Room and the name that was submitted should either not be there or a pop up appears if that was the only name in the list Same as expected Pass 9 Check if receiving any different command during the waiting screens causes an error screen Should see next screen being the error screen and a detail of the error Same as expected Pass 6.3.2.2 Triangulation related interfaces Algorithm:  When the user presses “Manage Bands” on the main menu, show “Add Band” & “Remove Band” options to the user  If the user selects “Add Band”, Inform the user to press a button on the band they wish to add  Wait for a response from the band for 10 seconds and then timeout if no response  If “Store Band <IP Address>” is received, show a screen for retrieving the name for the band. Otherwise, output an error screen.  Get the band name entered when the user presses the confirmation button and send “Store Band_Name <Band name> <Band IP_Address>” to the hub
  • 46. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 45  Wait for a response from the hub for 10 seconds and then timeout if no response.  If “Band Named” is received, inform the user that the band was named successfully. Otherwise, output an error screen. Unit Testing: Test no Operation under test Expected Result Actual Result Pass/Fai l 1 Check if “Store Band <IP Address>” is received successfully The message received by the android phone should output it to logcat Same as expected Pass 2 Check if the band name entered by the user is retrieved successfully and validated Logcat should output the name after the confirmation button is pressed. If the name is the same as one in the local band list then a toast will pop up and not allow the activity to finish Same as expected Pass 3 Check “Store Band_Name <Band name><Band IP Address>” is sent successfully MATLAB should receive the command and print it out Same as expected Pass 4 Check if “Band Named” is received successfully The message received by the android phone should output it to logcat Same as expected Pass Integration Testing: 5 Check if pressing on “Manage Bands” button in the main activity causes a transition to the appropriate setting menu activity Should see the next screen titled “Choose an option” Same as expected Pass 6 Check if pressing on the “Add Band” causes a transition to the appropriate waiting activity Should see the next screen titled “Press a button on the band you wish to setup” Same as expected Pass 7 Check if after receiving the command “Store Band <IP Address>” during the waiting activity causes a transition to the appropriate naming activity Should see the next screen titled “Provide a unique name to this band” with a text field and a confirmation button Same as expected Pass 8 Check if after receiving the command “Band Named” during the waiting activity causes a transition to the appropriate completed activity Should see the next screen titled “Successfully named band!” Same as expected Pass 9 Check if the band name that was submitted is stored in the local list of band names Go through Manage Bands -> Remove Band and the name that was submitted should be in the list Same as expected Pass 10 Check if receiving any different command during the waiting screens causes an error screen Should see next screen being the error screen and a detail of the error Same as expected Pass
  • 47. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 46 Algorithm:  When the user presses “Manage Bands” on the main menu, show “Add Band” & “Remove Band” options to the user  If the user selects “Remove Band”, show a list of all bands that they can remove  For the option that they select, send “Remove Band <Band name selected>” to the hub  Wait for a response from the hub for 10 seconds and then timeout if no response  If “Band Deleted” is received, inform to the user that the band was successfully deleted. Otherwise, output an error screen. Unit Testing: Test no Operation under test Expected Result Actual Result Pass/Fail 1 Check if reading and outputting a list as a set of radio buttons works Using a predefined list called “bandnames.txt” with 1 name in each line, the list should be seen in the screen Same as expected Pass 2 Check “Remove Band <Band name>” is sent successfully MATLAB should receive the command and print it out Same as expected Pass 3 Check if “Band Deleted” is received successfully The message received by the android phone should output it to logcat Same as expected Pass Integration Testing: 4 Check if pressing on “Manage Bands” button in the main activity causes a transition to the appropriate setting menu activity Should see the next screen titled “Choose an option” with buttons “Add Band” & “Remove Band” Same as expected Pass 5 Check if pressing on the “Remove Band” causes a transition to the appropriate list activity Should see the next screen titled “Check the button for which band you wish to remove” Same as expected Pass 6 Check if after selecting a room from the list that this causes a transition to the appropriate waiting activity Should see the next screen titled “Deleting band ‘<Band name>’” Same as expected Pass
  • 48. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 47 7 Check if after receiving the command “Band Deleted” during the waiting activity causes a transition to the appropriate completed activity Should see the next screen titled “Successfully deleted band!” Same as expected Pass 8 Check if the band name that was submitted is deleted from the local list of band names Go through Manage Band -> Remove Band and the name that was submitted should either not be there or a pop up appears if that was the only name in the list Same as expected Pass 9 Check if receiving any different command during the waiting screens causes an error screen Should see next screen being the error screen and a detail of the error Same as expected Pass Algorithm:  When the user presses “Triangulate” on the main menu, show a list of all objects that can be tracked  For the object that is chosen, send “Triangulate Band <Object name>” to the hub via WIFI  Wait a response from the hub for 10 seconds and then timeout if no response.  If “Triangulate <Object name> <Room name>” is received, output the location of the object to the user. Otherwise, output an error screen. Unit Testing: Test no Operation under test Expected Result Actual Result Pass/Fail 1 Check “Triangulate Band <Object name>” is sent successfully MATLAB should receive the command and print it out Same as expected Pass 2 Check if reading and outputting a list as a radio button set works Using a predefined list called “bandnames.txt” with 1 Same as expected Pass
  • 49. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 48 name in each line, the list should be seen in the screen 3 Check if “Triangulate <Object name> <Room name>” is received successfully The message received by the android phone should output it to logcat Same as expected Pass Integration tests: 4 Check if pressing on “Triangulate” button in the main activity causes a transition to the appropriate list activity Should see the next screen titled “Check the button for which band you wish to track” Same as expected Pass 5 Check if selecting a band on the list activity causes a transition to the appropriate waiting activity Should see the next screen titled “Triangulating <Band name>” Same as expected Pass 6 Check if after receiving the command “Triangulate <Object name> <Room name>” during the waiting activity causes a transition to the appropriate completed activity Should see the next screen titled “Successfully tracked band” with the body of the GUI showing <Room name> Same as expected Pass 7 Check if receiving any different command causes an error screen Should see next screen being the error screen and a detail of the error Same as expected Pass 6.3.2.3 Other important interfaces Algorithm:  When the user presses “Synchronise Data” on the main menu, send “Sync Room_List” to hub  Wait for a response from the hub for 10 seconds and then timeout if no response
  • 50. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 49  If “Sync Room_List <Hub’s Room List separated by spaces>” is received, update local room list and send “Sync Band_List” to the hub. Otherwise, output an error screen.  Wait for a response from the hub for 10 seconds and then timeout if no response  If “Sync Band_List <Hub’s Band List separated by spaces>” is received, update local band list and inform to the user that the data was successfully synched. Otherwise, output an error screen. Unit testing: Test no Operation under test Expected Result Actual Result Pass/Fail 1 Check “Sync Room_List” is sent successfully MATLAB should receive the command and print it out Same as expected Pass 2 Check if “Sync Room_List <Roomname1> <Roomname2>…” is received successfully The message received by the android phone should output it to logcat Same as expected Pass 3 Check “Sync Band_List” is sent successfully MATLAB should receive the command and print it out Same as expected Pass 4 Check if “Sync Band_List <Bandname1> <Bandname2>…” is received successfully The message received by the android phone should output it to logcat Same as expected Pass Integration testing: 5 Check if pressing on “Synchronise Data” button in the main activity causes a transition to the appropriate waiting activity Should see the next screen titled “Synchronising Room List” Same as expected Pass 6 Check if after receiving the command “Sync Room_List <Roomname1> <Roomname2>…” during the waiting activity causes a transition to the next waiting activity Should see the next screen titled “Synchronising Band List” Same as expected Pass 7 Check if after receiving the command “Sync Band_List <Bandname1> <Bandname2>…” during the waiting activity causes a transition to the appropriate completion screen Should see the next screen titled “Successfully synchronised data” Same as expected Pass 8 Check if data was synchronised Open Manage Rooms - >Remove Room and see if the list is as expected Open Manage Bands - >Remove Band and see if the list is as expected Same as expected Pass
  • 51. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 50 9 Check if receiving any different command causes an error screen Should see next screen being the error screen and a detail of the error Same as expected Pass These interfaces are shown when either an error occurred that wasn’t due to the sender not responding (Left interface) or when a response was not received (Right interface). 6.3.3 Evaluation The program meets all pre-requirements and passes every test. 6.4 HUB PROGRAM 6.4.1 Coordinator program In order to achieve band triangulation, some level of coordination between the devices participating in the process is required. To this purpose the hub serves as the glue that holds all other system devices into place. Every device communicates with it to access information and it is at the hub stage that triangulation of the band’s position is performed, as will be further discussed in the section covering the TDOA algorithm. The diagram presented in figure 28 describes the functionalities that were programmed to enable the hub to control the nodes & band(s) and communicate with the phone. A combination of these functionalities is used to perform either the grouping or triangulation protocols described previously.
  • 52. UKFC/CITIES UNLOCKED HARDWARE TRIANGULATION REPORT APRIL 29, 2016 BY SALMAN MIAN, YAHIA AL KAHF & JENQ YAO, LIM 51 Figure 28: Class diagram of the hub coordinator program. 6.4.1.1 Requirements 1. The most important aspect of the hub is its accessibility: it should entertain all Wi-Fi connection attempts made. For this reason the hub will need to continuously listen on an input port for messages sent to it. 2. A transport protocol with broadcasting capacities will be needed because the only way for the hub to initiate a communication with unknown devices will be through broadcasts. 3. The hub will also need to store the IP addresses of the devices that are part of the system. This allows the hub to communicate with them whenever required without the need to broadcast any messages. 4. It will need to coordinate between the different devices 6.4.1.2 Development In the grand scheme of things, TDOA would not be possible if the nodes present in the same room were not triggered to emit ultrasound at the same time. A way to avoid this issue is to ask all the nodes to transmit ultrasonic signals. This approach raises a problem: due to the limited available bandwidth afforded by the ultrasonic equipment, nodes will then need to share emitting frequencies; the signal picked up by the band will present the assigned frequencies however their origin becomes a mystery as they could have been emitted by multiple nodes. In conclusion, frequency sharing was not considered which led to the development of a new idea, based on the finding that ultrasound happens to be well contained within a room, that enables both the identification of the source of ultrasound based on the frequency of the emission and the triggering of these devices at the same time: the grouping protocol. This protocol encapsulates: