You are on page 1of 7

Available online at www.sciencedirect.

com

Procedia Engineering 41 (2012) 75 – 81

International Symposium on Robotics and Intelligent Sensors 2012 (IRIS 2012)

Investigating Target Detection and Localization in Wireless Sensor


Network
Han Fei Min, Leong Wai Yie
National Technological University, 50 Nanyang Avenue Singapore 639798.
Univesiti Tunku Abdul Rahman, Jalan Genting Kelang, Setapak 53300, Kuala Lumpur.

Abstract
In this paper, the Wireless Sensor Network(WSN) has been developed for location tracking purposes. The two possible techniques of
localization, namely the RSSI based and the hop count based, were investigated. For RSSI based technique, the principle and
methodology was presented. The experiment was carried out to investigate the performance between the RSS and hop count technique. A
set of nesC programme was designed to review the structural requirement. The performance analyses of both techniques in localization
were investigated.

© 2012 The Authors. Published by Elsevier Ltd. Selection and/or peer-review under responsibility of the Centre of
Humanoid Robots and Bio-Sensor (HuRoBs), Faculty of Mechanical Engineering, Universiti Teknologi MARA.

Keywords: localization; tracking; wireless sensor network; RSSI, hop count

1. Introduction
The rapid advancements in wireless communications and electronics in the past few years have enabled the
development of low-cost, low-power, multifunctional sensor nodes that are portable, light-weight and communicating
wirelessly over short distance, which is generally regarded as the Wireless Sensor Network (WSN). WSN has been used in a
lot of applications such as distributive monitoring system of temperature, humidity and other parameters [1].
Wireless tracking and positioning belongs to one of the many applications that can be realized by WSN. Due to the
small transmission range of wireless sensor nodes, the set-up is applicable to small-scale relative localization, for instance,
indoor positioning. Several possible methods to realize the application are sound/sonar, RSSI-based, and access point
reference. The objective of this paper is to investigate the localization technique using two types of methods: namely the
RSSI technique and hop count technique in WSN.
2. Localization Techniques
In general The design, implementation, and operation of a sensor network requires the confluence of many
disciplines, including signal processing, networking and protocols, embedded systems, information management, and
distributed algorithms [4].
Sensor node is a node in a wireless sensor network that is capable of gathering sensory information, performing
signal processing, and communicating with other connected nodes in the network. These nodes can form a network to
communicate with each other to establish a route to send the measurements to the base station. The base station is used to
send and receive data or commands to the sensor nodes, and also to transmit data to a higher-level control or monitoring
system (e.g. Computer) [3]. The measurement acquired by the sensors can be logged to a database in a higher level control
system for later use.
A. Received Signal Strength Indication (RSSI)
The Received signal strength indicator (RSSI) is a measurement of the power present in a received radio signal. It
is generic radio receiver technology metric, which is usually invisible to the user of device containing the receiver, but is
directly known to users of wireless networking of IEEE 802.11 protocol family.
Under ideal condition, the strength of received radio wave is proportional to1/d2 of the transmitted strength, with d
being the distance from the source to the device [14].

* Corresponding author. Tel.: +603-41079802; fax: +603-41079803.


E-mail address: Nicholas_hfm@hotmail.com, waiyie@ieee.org

1877-7058 © 2012 Published by Elsevier Ltd.


doi:10.1016/j.proeng.2012.07.145
76 Han Fei Min and Leong Wai Yie / Procedia Engineering 41 (2012) 75 – 81

Preceived 1
(1)
Ptransmitted d2

Fig.1. Relationship of Power and Distance


Given the ideal relationship, in wireless sensor network, the received signal strength at particular mote can be used
as indication of distance.
B. Hop Count Value
Hop count has been used as a technique of roughly determining the range of the target. The algorithm takes
advantages of the multi-hop property of the mesh network. The further the target is away from the fixed point, the more
hops it needs to send the message to this point. Therefore, by setting up a grid of motes, the location of the target can be
roughly be decided by analyzing the hop count one target has towards multiple fixed points.
In the set up of [8], two components are seen, anchor and node. The anchors are the fixed point. It is programmed
only to broadcast information. The node does three things: it listens the information broadcasted by the anchor and updates
its hop count accordingly; it send multi-hop message back to the base station containing the hop count of its own; and it
relay packets from other nodes to the base station [15]. This topic shall be further explained in the implementation section.
3. Methodology and Implementation
3.1 RSSI Localization
3.1.1 Triangulation Method
Triangulation is a commonly used method in positioning. Recall that the strength of a wireless signal degrades as
distance increases. The relationship between the received signal strength and the distance is given above. The property of
the wave prorogation enables us to infer the distance from an access point by considering the loss of signal strength [16].
Under ideal circumstance, when the mobile device is detected by the first access point A, the distance between the
device and access point can be obtained by calculating the strength at the device over the strength at access point. This has
placed the device on the circle centred at the access point A. When the device is detected by access point B, from the same
calculation, the possible positions of the device can be narrow down to the intersecting point of circle A and circle B. When
detected by a third access point, the position of the device can be decided as the intersecting point of the three circles [16].

Fig.2. Triangulation Illustration


Ideally, the distance from the target to the access point A, B and C can be calculated according to the fact of
electromagnetic wave prorogation.
Pi transmitted
di ;i A, B, C (2)
Pi  received
Thus, the relative position of the mobile device can be acquired. Each of these distances represents the radius of a
circle centred on the respective access point. There is only one possible location where these three distance lines can
intersect at a single point. This point represents the device’s location.
However, when this method is applied at indoor environment, the precision might be reduced due to the fact that
the presence of obstacles can cause reflection, diffraction, attenuation and scattering of radio waves [14].
In practice, due to the low-power transmission scheme used by the WSN, as well as the presence of obstacles in
indoor environment, the distance that directly calculated from the above equation, which is under the assumption of ideal
situation, may not be correct. Thus, it is better that an empirical model can be built to refer the signal strength data to
distance.
Han Fei Min and Leong Wai Yie / Procedia Engineering 41 (2012) 75 – 81 77

3.1.2 Triangulation Set-up


Generally, there are two ways to implement the triangulation methodology. Basic implementation of a four-reference-
point prototype is provided in both approaches.

A. Target Listening Approach


In this approach, the target serves as a promiscuous listener. It listens and collects all the RSSI data from the reference
points. In the prototype set-up, the target requires at least three reference points within its communication range so that it
can get at least three RSSI data to perform triangulation positioning.
In the four-point prototype, four RSSI data from four reference point can be acquired by the target. The extra data can
be used to validate the result.
After RSSI data is collected by the target, it is directly sent to the gateway or base station to insert to database and
display on the computer for processing. A graphical illustration of this set-up is given in the figure 3.

Fig.3. Illustration of Target Listening Approach

B. Reference Point Listening Approach


In this approach, the four reference points serve as promiscuous listeners. They listen to the packets broadcasted from
the target, and measure the RSSI data when receive the packet. In the prototype set-up, the target should be in at least three
reference points’ communication range so that at least three RSSI data can be obtained to perform triangulation positioning.
In the four-point prototype, four RSSI data collected by the fourth reference point can be used to validate the result.
After RSSI data is collected by the reference points, it is directly sent to the gateway or base station to insert to database and
display on the computer for processing. A graphical illustration of this set-up is given in the figure 4.

Fig. 4. Illustration of Reference Point Listening Approach


3.1.3 Relationship of Distance and RSSI
The experimentation regarding the distance and RSSI was conducted making use of XSniffer as a reader of the RSSI
value [17]. The steps of the experiment are listed as follows:
1) Fix the XSniffer at the 0 marking of the ruler;
2) Put the one broadcasting mote at X cm marking;
3) Press “start” or “continue” in the XSniffer programme, observe the data in RF column. The display of XSniffer
programme is shown in figure 5. For each distance, 20 entries are considered. Among the 20 values, the median is
chosen as the represented data.
4) Increase the distance from mote to the station, till significant increase in RF can be observed.
5) Repeat step 2 to step 4 until the end. The result acquired from the above method is presented as follows:
Distance (cm) RSSI (dBm) Distance(cm) RSSI (dBm) Distance (cm) RSSI (dBm)
7 -20 39 -43 230 -60
9 -24 50 -43 250 -64
11 -25 60 -45 270 -66
13 -27 70 -48 290 -75
15 -29 80 -51 310 -70
17 -31 90 -55 330 -70
78 Han Fei Min and Leong Wai Yie / Procedia Engineering 41 (2012) 75 – 81

19 -31 100 -57 350 -71


21 -33 130 -60 370 -66
23 -36 140 -55 390 -68
25 -36 160 -56 410 -69
27 -39 180 -60 450 -69
29 -41 200 -65 470 -71
33 -41 210 -62 490 -74

Table 1. Relationship of Distance and RSSI

Fig.5. Transfer data from the serial COM port to the text file. Fig. 6. RSSI vs. Distance

The RSSI data with respect of distance can be plotted as Figure 6. The findings and discussion from the experiment are
presented as the following points:
x When the distance between the target and the mote is relatively low, the RSSI data acquired is very stable, the variance
is relatively small, meaning that the 20 data acquired at the sampling point do not vary much.
x When the distance is increased, the variance of the acquired data is also increasing, especially at long distance, where
data in the 20 samples vary greatly and is not as precise as small distance measurement.
x At long distance, due to the disturbance of the environment, the data acquired deviate a lot from the ideal model. This
can be view from the above graph, where a lot of fluctuation can be observed at long distance RSSI measurement.
Some of the data acquired, which deviate too much from the model or inconsistent with previous and latter sampling
data, can be erroneous.
x The above property discovered during the measurement indicates a possible disadvantage that the positioning might
not be that precise when at large distance. The main contributing factor is the signal received is too weak and very
much depend on the condition of physical environment (reflection, diffraction, attenuation).

3.2 Hop Count Localization


An improved version of localization technique using hop count value is developed. Each node keeps a local variable
named local hop count. This is the value that indicates the number of hops from the target node to the current node. Since
the communication range of one node is known, with the knowledge of the hop count value, we can have a rough idea of
location of the target.
The architecture of the new set up consist three tiers of components:
x Target: The target will only broadcasting message to the mesh network with its identification value. The ID of the
target is programmed as ‘1’;
x Relay: The relay node does the following: 1) It receives the broadcasting packets from the mesh network; 2) It updates
the local hop count value, which is an indication of the number of hops from the current node to the target; 3) It sends
multi-hop message containing its local hop count value to the base station; 4) It broadcasts the same message
containing the hop count to its neighbouring nodes.
x Anchor: The anchor node does the following: 1) It receives the broadcasting packets from the mesh network; 2) It
updates the local hop count value, which is an indication of the number of hops from this anchor to the target; 3) It
sends multi-hop message containing its local hop count value to the base station.
3.2.2 Software Programmes in MoteWorks
In order to realize the set-up described above, a set of software programmes in nesC/TinyOS are developed using
MoteWorks.
For the ease of programming, all the packets, broadcasting or multi-hopping, follow the same structure in the data
section. The headers are added before the data section, which is different for multi-hop message and broadcasting message.
Han Fei Min and Leong Wai Yie / Procedia Engineering 41 (2012) 75 – 81 79

The data section structure is as follows:


uint8_t board_id;
uint8_t packet_id;
uint8_t node_id;
uint8_t hopCount;
uint8_t fw_node_id;
uint8_t rsvd;
uint16_t vref;
uint16_t thermistor;
uint16_t light;
uint16_t mic;
uint16_t accelX;
uint16_t accelY;
uint16_t parent;
uint16_t magY;
The data type uint8 takes up one byte and uint16 takes up two bytes. This data section is modified from the
MTS300/MTS310 sensor board data section. The three field that are useful in this application are node_id, hopCount, and
parent.
For the multi-hop message, there is 12 bytes of header ahead of the data section. Therefore, when referring to the
data bytes in xserve configuration xml file, the offset byte will be 12 plus the offset byte in the data section. For instance,
the offset of node_id will be 12 plus the two bytes before the field, which will be 14. This will be covered in the user guide
in further chapter of the report.
Note that due to the broadcasting message does not have an address, it will not be passed to the base station via
hopping, nor will it be heard by the base station even if it is within the transmission range of the base. For multi-hop
message, the address is set to the base. Therefore, the message will be sent via hopping and will finally reach the base.
However, the multi-hop message will not be parsed by the nodes relaying it because these relay nodes are programmed only
to receive broadcasting message.
For the target node, the programme will only broadcast the message to neighbouring nodes. The process is repeated
every one second.
For the relay nodes, the node will create two identical packets when initializing. One is intended to send to the multi-hop
layer to the base station; the other is broadcasted to the neighbouring nodes to inform the neighbours its hop count. Note that
the ways of initializing the two packets are different because broadcast message and multi-hop message have different
headers. The local hop count value is initialized as 100.
// initialize the first MHop packet
pack1 = (XDataMsg*) call Send.getBuffer(&msg_buffer1, &len);
pack1->board_id = SENSOR_BOARD_ID;
pack1->packet_id = 2;
pack1->node_id = TOS_LOCAL_ADDRESS;

// initialize the broadcast packet


pack2 = (XDataMsg*)&(msg_buffer2.data);
pack2->board_id = SENSOR_BOARD_ID;
pack2->packet_id = 2;
pack2->node_id = TOS_LOCAL_ADDRESS;
}
Whenever the relay node receives a broadcasting message from its neighbouring nodes, it parses the packet and
extract the ID of the source and the hop count value of the source. If it finds that the ID of the source is ‘1’, then it will
update its local hop count value as 1. If the ID is some other relay node, it will increase the hop count heard by one and
assign the value to local hop count. Since the source needs x hops count back to the target, the current will need x+1 hops
back to the target.
event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr m) {
// define local variables
uint8_t idHeard, receivedHopCount;

idHeard= m->data[2]; //extract sending node id from received packet


receivedHopCount= m->data[3]; //extract hopCount from received packet

if (idHeard == 1) // if the packet is from target


atomic localHopCount = 1;
else // if it is received from other nodes
if ((receivedHopCount+1)<localHopCount)
atomic localHopCount = receivedHopCount+1;
atomic pack2->hopCount = localHopCount;
post BroadcastData();
return m;
}
80 Han Fei Min and Leong Wai Yie / Procedia Engineering 41 (2012) 75 – 81

The relay node will repeat the process of sending two packets in every five seconds.
For the anchor node, it is largely similar to the relay node. The only difference is that the anchor node does not broadcast the
message to neighbouring nodes anymore. It only sends the multi-hop packet to the station for later use.
3.3.3 Actual Implementation
From the description given in the above section, an easy set up of grid two by two using the hop count localization
can be deduced as follows:

Fig. 7. Hop Count Localization Structure


The d in the graph indicates the transmission range of all nodes. Therefore, for a single anchor, there are three relay
nodes within its transmission range.
The position of the target is obtained from the knowledge of the hop counts from the four anchors. The area of the
position is decided from the overlapping area of four hop count values as shown in the following graph.

Fig. 8. Deciding Overlapping Region


The overlapping region indicates the possible position of the target. In theory, three hop count values are needed to
arrive at such decision. In this set-up, we provide one redundant hop value to validate the result.
There are three types of possible situations:
1. The target node is located within one grid. Therefore, the hop count value to the nearest anchor will be one. However,
for the rest of the anchors, the target is not within their transmission range. Since there are relay nodes placed in
between the target node and the anchors, once the relay nodes receive the message from the target, they will broadcast
a message with the hop count equals to one. When the out-of-range anchors hear the message, it will parse the packet
and increase hop count by one, which becomes two. Therefore, the overlapping area of the anchors’ hop count is going
to be the grid where the sensor is located.
2. The target node is located at the edge between two grids. In this case, since the edge is within the transmission range
of two anchors, there will be two anchors having the hop count value of one. In this case, the overlapping area should
be the edge between the two grids.
3. There is no overlapping area. In some cases, no overlapping area can be found due to transmission delay or some other
error. The system will output the whole area.
From the above set-up, a graphic user interface is designed to visualize the result. The programme is written in MATLAB. It
will read in the text file generated by xserve, present the readings in a table, as well as parse the data and indicate the area
Han Fei Min and Leong Wai Yie / Procedia Engineering 41 (2012) 75 – 81 81

where the node is. The interface is given below.

Fig. 9. GUI for Hop Count Localization


The left part contains two graphs. The upper one is presenting the entire sensor nodes situation: the ID of the node,
the time last packet arrives, the parent ID, the voltage, the temperature, and the hop count value. The node ID is highlighted
in green colour if the last packet received is within one minute. If there has been more than one minute since the station
receives the last packet, the highlight colour will become orange. If there is more than five minutes, the colour will become
red. The lower table shows all the incoming packets. The time is given by MATLAB, which is the time the packet is read by
MATLAB, not the time the packet arrives at the base station.
The right part contains a plot of two by two grids. The localization area is marked with red rectangle.
3.3.3 Extension
The above set-up can be extended to more complicated grid given enough motes, while the same method of localization can
be applied. The size can be extended to n by n grid. The diagonal distance of each grid is set to the communication range of
the mote. The possible area of localization is decided from the overlapping area of the hop count values from four anchor
nodes.
5. Conclusion
Using RSSI as parameter to localize a target is feasible but requires deeper understanding of NesC language to be able to
retrieve the RSSI data from the lower layer. Also, due to the low power of transmission between motes, RSSI value
becomes increasingly unstable when the distance increases. This might pose instability of localization at larger distance.
Hop count technique is a feasible localization technique as well. A set of software programme in NesC are designed to meet
the requirements of the three tiers structure. However, the result obtained from hop count technique is not as precise as the
result obtained from triangulation technique.
Wireless sensor network enjoys the advantages of low-cost and systematic way of transmitting packets. It is a promising
technology that can be applied to solve the problem of localization.
REFERENCES
[1] Z. Y. Zhang, "Wireless Technology II," Singapore Institute of Research and Technology 2008.
[2] R. Kay and F. Mattern, "The Design Space of Wireless Sensor Networks," IEEE Wireless Communications, vol. 11, pp. 54-61, 2004.
[3] H. Salem and N. Mohamed, "Middleware Challenges and Approaches for Wireless Sensor Networks," IEEE Distributed Systems Online vol. 7, 2006.
[4] Tiwari and Ankit, "Energy-efficient wireless sensor network design and implementation for condition-based maintenance," ACM Transactions on
Sensor Networks (TOSN).
[5] Anonymous, "Wireless Sensor Networks - Product Reference Guide," Crossbow, Ed., ed: Crossbow 2007.
[6] Anonymous, "XMesh User's Manual," Crossbow 2007.
[7] Anonymous, "XServe User's Manual," Crossbow 2007.
[8] T. N. Le, "Wireless Sensor Networks for Forest Fire Detection," Nanyang Technological University, Singapore 2008.
[9] Anonymous, "MoteWorks Getting Started Guide," Crossbow 2007.
[10] Anonymous. (2009, Jun 20). TinyOS Tutorials.
[11] K. Liu. (2005, Jun 20, 2010). TinyOS/Motes, nesC Tutorial.Available: www.cs.binghamton.edu/~kliu/ta/cs527/nesc-tutorial.pdf
[12] P. Levis. (2006, TinyOS Programming. Available: csl.stanford.edu/~pal/pubs/tinyos-programming.pdf
[13] Anonymous, "MoteView User's Manual," Crossbow 2007.
[14] M. Bouet and A. L. d. Santos, "RFID Tags: Positioning Principles and Localization Techniques."
[15] L. Sun, "Wireless Sensor Networks for Fire Detection and Monitoring - I," Nanyang Technological University, Singapore 2010.
[16] O. Tanz and J. Shaffer, "Wireless Local Area Network Positioning," Ambient Intelligence for Scientific Discovery, vol. 3345, pp. 248–262, 2005.
[17] F. Han, "SIM-TECH URECA – INTERIM REPORT," Nanyang Technological University and Singapore Institute of Manufacturing Technology,
Singapore 2010.

You might also like