Sie sind auf Seite 1von 5

A localization and an identifcation system of

personnel in areas at risk using a wireless sensor


networ
CHERIET MOHAMMED EL AMIE
Electronics dept
University of Science and Technology Oran (US TOMB)
Oran, Algeria
E-mail: microcheriet@gmail. com
Abstract- In this paper, we present the design of a new
embedded real time system that performs two main tasks, the
localization based on the received signal strength indicator
(RSSI) and the radio frequency identifcation (RFID). This
proposed hardware platform is implemented using a RFID
module an XBee, and an Arduino running a multitasking
application, which respects the different time constraints
required by the environment. In our case, the management was
performed by an embedded real-time operating system, the
FreeRTOS, running on the AT mega microcontroller. This
application allows both locating personnel in areas at risk using
wireless instruments installed in the site, and the verifcation of
the required area security measures. This work is done according
to the internationally recognized benchmark for management
systems of health and safety OHSAS 18001, using RFID
technology. A worker suit, equipped with appropriately
distributed sensors to accomplish the required tasks of
identifcation and localization is given here. The results obtained
afer testing the system are very encouraging, since the system
based on a wireless sensor network is operating properly. The
localization is done with an acceptable accuracy and the
identifcation is achieved successfully.
Kewords- Real-time; wireless communication; sensor;
localization; RFl; FreeRTOS; XBee
I. INTRODUCTION
Many companies are implementing a management system
for health and safety in the context of their risk management
strategy, to respond to development in legislation in order to
protect their employees. The objective of this system is to
minimize the rate of workplace accidents by studying the
punctual risks. However, in most cases, there are always
accidents caused by workers neglecting safety measures in the
site. Furthermore, in the manufacturing indust such as
refneries, the toxic risk and even an explosion may occur.
Therefore, it is necessary to know the location of each
individual in the site, in order to protect workers' health and
safety.
ISBN: 978-1-4673-5613-82013 IEEE
OUSLIM MOHAMED
Electronics dept
University of Science and Technology Oran (USTOMB)
Oran, Algeria
E-mail: ouslim@yahoo.com
The use of an embedded system, to tackle the problem of
localization and identifcation is a very attractive objective, as
embedded systems are modem computing systems covering
various ranges of applications. However, the need to reduce
the development time of embedded systems, and the high
degree of embedded sofware complexity have led to the use of
a real-time operating system, which requires that each element
of the system must be real-time, that is taking into account
time constraints. Such an operating system is called a real
time operating system [1]. The problems involved with task
scheduling, task synchronization, inter-task communications,
resource management, and interrupt handlers should be solved
in order to make the whole system fnctioning properly. The
FreeRTOS [2] [3] [4] was used for this purpose in our
implementation.
The next parts of this paper describe the electonic circuit
developed, the real-time kerel and the programming of the
tasks in the environment of the embedded system used, as well
as the analysis of the proposed system.
II. DESCRIPTION OF THE PRORPOSED APPLICATION
We developed an application that locates the personnel in
risk areas using wireless instuments installed in the site. It
ensures also the necessary zone safety measures. We started
this application by adequately putting the wireless sensor of the
target in the worker safety helmet. Whereas, the special worker
suit used as protective clothes, was equipped with multiple
RFID antennas to identif the necessary safety equipments
which were supplied with RFID tags. As a consequence, the
position inforation and the data delivered by the safety
equipment, wor by the person within the site, are all sent to
the contol room using a wireless communication.
Fig. l shows the various safety equipments involved with the
proposed application. A detailed description is given in what
follows.
127
Rtag
"ie less semor
+
R reader
R antenna
Fig. 1. Difrent equipments of the proposed application.
A. Safet helmet
The safety helmet has the sensor of the target within an
embedded system made of several components as it is shown in
Fig.2.
Arduino Uno [5]: This is an embedded system based on
ATmega328 micro controller. It is compatible with the
FreeRTOS real time kerel.
XBee module: This is a wireless component developed by
Digi (formerly MaxStream). It implements different
communication protocols, including IEEE 802. 15. 4. There are
various types of XBee modules. XBeel with interal antenna,
XBee2 (MMCX) with connector UFL using exteral antenna,
XBee3 with integrated wire antenna and XBee4 with printed
antenna. XBee 1 and XBee4 are used for applications that have
size constaints. Whereas, XBee2 is used when the module is
enclosed in a metallic box in order to avoid the Faraday cage
effect. The XBee3 has less directivity than the XBeel and it is
also recommended in the case of size design constaints within
the application [6]. In our case, afer a preliminary study, we
selected XBee2 the appropriate module/antenna combination
for our application.
RFID Module UM005 [12]: This module allows contactless
reading of transponders RFID type Unique . It has a LED
outut, a buzzer outut and a serial RS232 outut.
Inertial sensors: The used sensors are the accelerometer 3
axes and the gyroscope 2 axes, to measure the mobility of the
target, as it is shown in Fig. 2.
Fig. 2. The embedded circuit.
ISBN: 978-1-4673-5613-82013 IEEE
The need for these sensors is justifed by the fact that the
localization technique based on the RSSI is inaccurate, in the
case where the target is moving. Therefore, we deterined the
target's position when the mobility is less than a certain
threshold.
B. Safet worker suit
The worker suit protects the body of the person in the site,
thereby allowing someone to check the security measures
necessary for areas at risk using RFID antennas, as it is shown
in Fig. I.
C. Securit Accessories
All safety accessories, such as safety shoes and gloves, are
equipped with RFID tags so that we can identif them.
The micro contoller within the helmet must process
several tasks at the same time. These are the measurement of
the inertial data and the mobility, the reading of different RFID
tags, the RSSI measurement of neighbour nodes, and the
transmission of all information of interest to the main station.
To guarantee an adequate operating mode and to allow the
appropriate management of these tasks, we used the
FreeRTOS, an embedded real-time kerel that has several
services such as binary semaphores for mutual exclusion
between sharable and non-shareable resources, and the queuing
mechanism for the purose of synchronization among the
tasks.
III. DUIOS AND FREERTOS
Developed by Richard Barry [2], the FreeRTOS is a real
time operating system, open source, feely distibuted under the
GPL. One can fnd in its website, different versions that can
run on different embedded devices such as Altera, Atmel, and
Microchip [7] [8]. This is an executive kerel, small in size and
it presents good performance. [t is particularly suitable for
embedded systems. Under FreeRTOS, tasks are represented by
fnctions that run indefnitely or they are self deleting. Each
task is assigned a priority. The level 0 is the lowest. The kerel
handles a task using the task control block (TCB). The TCB
exists for each task in the kerel and it contains all the
necessary inforation to completely describe the state of a
task. The scheduling algorithm of the FreeRTOS is dynamic
and it is a priority based. The communication among tasks is
performed by either binary semaphores or message queues [2]
[8][11]. DuinOS is also a real-time multitasking and pre
emptive operating system. [t is specifcally designed for the
Arduino platforms using the Atmel microcontroller. It is based
on the FreeRTOS solid core. Therefore, the declaration of tasks
and the system calling are the same.
[v. PRACTICAL APPLICATION OF FREERTOS
A. Management of tasks and resources by FreeRTOS
To flfl the proposed application needs, we created six tasks
with different priority levels using the FreeRTOS, as it is
128
shown in Fig.3. We have four sofware periodic tasks; task 1,
2, 3 and 4 and two hardware tasks; task 5 and task6.
Measurement
Gyroscope
of acceleration
PrioritYl
PrioritYl
Mobility
PriOritY2
Communication
PrioritY3
Fig. 3. The FreeRTOS management of the developed tasks.
Task I is a sofware task with a priority level equals to two.
It sends a broadcast message to neighbouring nodes and
measures the strength of signals received (the RSSI). It is
synchronized with the task of communication using the RSSI
queue and the task 3 of mobility using the broadcast message
queue as it is shown in FigA.
Queued
Broadcast message
Queued
RSSI
Fig. 4. Task queue synchronization.
Task 2 and 3 are periodic tasks with a \ 00 mS time period.
They have a low priority level which is equal to one. These
tasks can measure the inertial data. That is, the linear
acceleration x, y, z and the angular acceleration x, y. They use
the analogue to digital converter considered as a non-shareable
resource. In order to solve the problem of mutual exclusion, we
used a binary semaphore, as it is shown in Fig.5.
Semaphore
Analog Converter
Fig. 5. Resource management using the binary semaphore.
Task 4 is a periodic sofware task with a I Second time
period and a priority level equals to two. It allows the
measurement of the target mobility using the inertial sensors.
The role of this task is to synchronize the task 1 to start the
neighbourhood discovery, in the case where the target is stable,
checking whether the mobility is less than or equals to a
specifc threshold.
Task 5 is a hardware task with the highest priority level
three. It handles the neighbourhood detection by receiving
ISBN: 978-1-4673-5613-82013 IEEE
signal frames through RS232 interface, using the XBee
module, and it rebuilds a neighbourhood table containing the
information concering neighbouring nodes such as the node
ID number and the RSSI within the wireless sensor network.
Task 6 is a periodic task with a 5 Second time period and
with a priority level equals to two. It allows the identifcation
of different safety equipments wor by the target, using the
RFID reader connected to the antennas within the worker suit.
It tansmits the gathered inforation, the neighbourhood table
and the type of safety equipments, to the main station via radio
waves using the XBee module.
B. Implementation of the application with the FreeRTOS
The development of the main program and the coordination
among tasks, based on the FreeRTOS, required several steps
namely, the confguration of microcontollers, the creation of
both semaphores and queues, and the scheduling. These steps
are illustrated in Fig. 6 and they are described by giving the
necessary FreeRTOS code in the following paragraph [4].
G
and resources
Creation of semaphores
Fig. 6. Organization chart of the implemented tasks.
Launch of scheduling: We use the system call
vtaskstartscheduler 0 to start the task scheduling and to create
the idle task.
Creation of Semaphores: The semaphores initialized to 1
(S=\) are binary semaphores. The 0 indicates that the
semaphore is considered unavailable or empty. When it is
equal to \, the semaphore is considered available or fll.
During its creation, one can assign to it, a value of 1 or o. The
binary semaphores are used for synchronization and for mutual
exclusion. When using a semaphore protection, it is important
to avoid destroying tasks in the critical section, otherwise we
get a blocking situation. Indeed, if the task is destroyed in the
critical section, it can never retur S back to I, and the critical
section will be permanently blocked. Thus, the tasks should not
be easily destoyed or blocked. The following code is used to
create the binary semaphore initialized to o.
xSemaphoreHandle xSemaphore _ Ana=NULL;
/ / Creation of the semaphore:
129
vSemaphoreCreateBinary(xSemaphore _Ana);
Creation of message queues: The handles of queues are
created for the different tasks using the following code.
xQueueHandle xQueue_RSSI;
xQueueHandle xQueue_BROADCAST;
To create the needed queues we used , the following two lines
of code.
xQueue_RSSI = xQueueCreate( 2, sizeof( struct Message * ) );
xQueue_BROADCAST = xQueueCreate( 2, sizeof( struct
Message * ) );
Creation of the tasks: The tasks handles, xTaskHandle, and
the tasks are created using respectively the following two
statements.
xTaskHandle xHandle TaskO I, xHandle Task02, xHandle _Task03,
xHandle _Task04, xHandle _Task05, xHandle _Task06;
xTaskCreate(function , name, pile, parameter,
priority,xTaskHandle)
The overall suarized source code of the proposed
application is given below.
xTaskCreate(vTask_TaskOt, "Tt" ,
confgMINIMAL_STACK_SIZE, ( void *) NULL, 2 ,
&xHandle _ TaskOl);
xTaskCreate(vTask_Task02, "T2" ,
confgMINIMAL_STACK_SIZE, ( void *) NULL, 1 ,
&xHandle _ Task02 );
xTaskCreate(vTask_Task03, "T3" ,
confgMINIMAL_STACK_SIZE, ( void *) NULL, t ,
&xHandle_ Task03 );
xTaskCreate(vTask_Task04, "T4" ,
confgMINIMAL_STACK_SIZE, ( void *) NULL, 2 ,
&xHandle _ Task04 );
xTaskCreate(vTask_TaskOS, "TS" ,
confgMINIMAL_STACK_SIZE, ( void *) NULL, 3 ,
&xHandle_ TaskOS );
xTaskCreate(vTask_Task06, "T6" ,
confgMINIMAL_STACK_SIZE, ( void *) NULL, 2 ,
&xHandle_ Task06 );
V. COMPUTATION OF THE POSITION OF THE TARGET
The target information is received in the main station using the
sink node connected to a PC via USB port, as it is shown in
Fig.7.
We used four wireless sensor nodes, as reference nodes and the
ffh as the target node. The RSSI of neighbouring nodes was
converted into a distance, and the position of the target was
computed using the Cramer's Rule. Given the position of the
neighbouring nodes, in the case where the target is in a
classifed zone, one checks whether these nodes cary the
necessary safety classifed zone equipment. The failure to
comply with security measures will be automatically posted to
the contol room.
ISBN: 978-1-4673-5613-82013 IEEE
XBee2
XBee2
XSee2
(((
-
))
' Target
xseepr2
XBee2
Gateways (sink)
XBee2
Google maps or plan
Fig.? Block diagram of the proposed WSN.
Converting the measured RSSI to a distance: The most
common method to convert the RSSI to a distance is to use the
mathematical equation given in (1).
kSSI--(!0n loglO d+A) (1)
Where n is the signal propagation constant, d is the distance
fom the sender, and A is the received signal stength at a 1
meter distance.
Cramer's Rule approach [9] [10] has been widely applied in
several localization applications. It is based on the concept of
linear equation systems, where the number of equations is
equal to the number of variables, and the tansformation of
these linear equations into the matrix for. Fig.S shows the
structure and components used by Cramer's rule based on three
reference nodes to determine the target position, which is
considered as the intersection of the three circles.
Fig. 8. The Cramer's rule [9] .
In Fig. 8, we used (x; , yD
.
as the coordinates of the reference
node i, (xu, Yu) as the coordmates of the

arget object, and R; as


the distance between the reference node I and the target.
From the circle equation given in equation (2), and doing all
mathematical transformations as in [9], we get equations (3),
(4) and (5) fom which we can obtain the coordinate defning
the position of the target node as it is indicated in equation (6).
(::

(,,k

/!.?. (2)
130
VI.
!ei( I
X


1 !ei( ~)
( Rj2 - R )
-
( Xj2 - X ) - (y

- y )
(
-
R )
-
(
x;
-
xi
)
- (Y; -
y
i
)
!ei( ~

)
and
.

() !ei ~
(6)
THE PERFORMANCE OF THE EMBEDDED SYSTEM
(5)
In order to study the performance of our embedded system and
its operation in real time, we measured the execution time of
each task by using the fnction micros O. The obtained results
are indicated in Table 1.
From Table 1, we can state that the overall execution time
respects the time constraints of the application. The memory
size required to run the proposed application, was around 56%
of the available microcontoller memory size. That is,
18Kbytes versus 32Kbytes provided by the A Tmega328. This
allowed us to use the FreeRTOS kerel, which occupies
9Kbytes. Furthermore, the proposed system performed the
target localisation with a position error less or equals to 1.7
meter. This result is considered acceptable, if we take into
account the resticted number of reference nodes used within
the proposed wireless sensor network.
TABLE I. THE EXECUTION TIME OF THE APPLICATION TASKS
Tasks Execution Time in ISeconds
Task I 2 980 836
Task 2 340
Task 3 224
Task 4 10
Task 5 4696 a
Task 6 1396 b
a. (844 x number of neighboring nodes) + (300 x number of RI tag) + 120
b. 340 x number ofRI tags, using four RI tags and four neighboring nodes
VII. CONCLUSION AND PERSPECTIVES
In this paper, we have presented the design of an embedded
system based on a wireless sensor network implemented on
Arduino platform, XBee modules and the FreeRTOS.
During this work, we were faced with the real-time operating
mode and the multitasking problems. Thus, we proposed the
necessary mechanisms that solved these problems. The overall
performance of the designed application was acceptable. The
localisation and the identifcation achieved tasks, allowed us to
state that the proposed system is able to protect a person in its
workspace with a limited accuracy.
ISBN: 978-1-4673-5613-82013 IEEE
The overall obtained results are very encouraging, the reason
why we are continuing this work. Indeed, we noticed that we
need to improve the proposed localization technique. In order
to achieve this objective we are working on the fsion of the
inertial data, the acceleration and the velocity, together with the
position of the target using the Kalman flter. We believe that
by estimating the next target position this will help us to
precisely locate the target.
REFERENCES
[I] P. Lindgren, J. Nordlander, and J. Eriksson. "Robust Real-Time
Applications in Timber," In Sixth IEEE International Conference on
Electro, Infrmation Tech, pp.191-196, May 2006.
[2] R. Barry, "Manual FreeRTOS," http://www.freertos.org/ ,2011.
[3] D. Deharbe, S. Galvao, A. M. Moreira. "Formalizing FreeRTOS: First
Steps," In SBMF '09. LNCS 5902, pp. 101-117. Springer, 2009.
[4] R.Goyette, "An Analysis and Description of the Inner Workings of the
FreeRTOS Kernel," Carleton University, 2007.
[5] Arduino, http://arduino.cc/en/Main/ ArduinoBoardUno
[6] S.Hassa, Safdar H. Bouk, Amad Mehmood, Nadeem Javaid, and
Sasase Iwao, "Effect of Fast Moving Object on RSSI in WSN: An
Experimental Approach," http://arxiv.org/abs/1202.4137vl, 19 Feb
2012.
[7] DuinOS, htp://code.google. comlp/duinos/
[8] J.T. MOhlberg, and L.Freitas,"Verifing FreeRTOS: fom requirements
to binary code," Proc. A VoCS 20 II ,pp.I-2, 20 II.
[9] K.Maneerat, c.Prommak,"On the Analysis of Localization Accuracy of
Wireless Indoor Positioning Systems using Cramer's Rule," World
Academy of Science, Engineering and Technology, article 60, pp202-
206,2011.
[10] B. Cooperstein, "Elementary Linear Algebra," University of California,
Santa Cruz, pp. 312-323, January 2006.
[II] K. Aizi, "Telemesure des donnees meteo i base de capteurs sans f",
Master's thesis 2011, department of electronic USTOMB, 2011.
[12] RFlD UM005, http://www. netronix.pl/
131

Das könnte Ihnen auch gefallen