Real-time system for security management and personal productivity based on wireless sensors OTHMANI Youssef Electrical department Master degree in Embedded System ISET Nabeul Othmaniyoussef3@gmail

Real-time system for security management and personal productivity based on wireless sensors

Electrical department
Master degree in Embedded System
ISET Nabeul
[email protected]
Electrical department
ISET Nabeul
line 3: City, Country
line 4: e-mail address if desired

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!

order now

Abstract — always companies have implemented their security and productivity referential using the concept of system management and the principles of continuous improvement. In this article, I will present a new concept of real-time embedded system that aims at localization of personal location based on the received signal strength indicator (RSSI) and radio identification (RFID) to manage their security and productivity. The proposed hardware architecture contains tags (RFID), XBee modules and an Arduino board that runs a real-time kernel that respects time constraints. The choice fell on an embedded real-time kernel ChibiOS, this system supported by the family of ATmega microcontrollers. The application allows both to locate the personal in work areas using the wireless nodes, install on the site, the verification of the targeted area security measures and the management of productivity .The system meets the standards of the organization international standards ISO 45001, occupational health and safety management systems. The work suit must be equipped with wireless sensors to perform the required tasks of location and identification.
Keywords—component; formatting; style; styling; insert (key words)
Generally, work accidents related to employers who neglect the protection and security measures in the site. Also in manufacturing plants, especially the chemical and nuclear production sectors, the risk of toxicity even an explosion can occur.
For this reason, it is necessary to know the location of each person on the site to protect and guarantee the security, to make the traceability of movements on site in order to give back the information useful for management productivity. The purpose of the proposed system is to minimize the rate of workplace accidents in one-time hazard areas and to create a database that collects all information (path, work time and location) to improve the production strategy, and the grouping of human resources.
To solve the problem of location and identification of risks, we find that embedded systems are the most efficient solution. Embedded systems are modern computer systems covering a wide range of applications. 1 However, the need to reduce the development time and complexity of embedded software has led to the use of a real-time operating system to highlight synchronization, scheduling, inter-task communication, and material resource management. The choice is to fall on ChibiOS.
The system is located employee location using a combination of sensors, stationary sensors installed on site and mobile sensors included in the employer’s uniform.
The employer considered to use special protective clothing equipped with RFID tags to identify the safety equipment provided and their adaptability to the employer’s location.
The information of position and safety equipment data are send to the control room via wireless communication. Figure 1 shows the distribution of the sensors for the proposed system.

Figure 1. The principle of sensor distribution

The safety helmet contains the brain of our system, which has three main parts.
A control board based on microcontroller ATmega 328 known with the trade name ARDUINO. There is 20 pins (0-19) that six are analog inputs that can also use as general-purpose pins 2. It is fully compatible with the ChibiOS operating system.
Automatic identification modules based on the RFID technology (Radio Frequency Identification), the choice fell on the RFID module MFRC522. The latter is an RFID reader based on the integrated circuit MFRC522, a 13.56 MHz contactless RFID communication chip, highly integrated.
A communications wireless module XBee: This is a family of wireless components developed by (Digi). They implement different wireless communication protocols including IEEE 802.15.4. 1
The microcontroller ATmega 328 must handle several tasks simultaneously. Position measurement, RFID tag reading and signal strength measurement received RSSI from the fixed nodes on the site and the transfer of all previous data to the control room.
To ensure proper system operation and management of different tasks, I proposed the operating system ChibiOS for embedded systems.
ChibiOS meet the need of our embedded system. An embedded real-time kernel includes several services such as binary semaphores, shareable resources and the thread and synchronization between tasks 3.

Figure 2. Synoptic of the proposed solution

The overall operation of the system as indicated below in the flowchart in Fig. 3 contains the measurement of the received signal power transmitted by the neighboring stations, fixed on site. The reading of the RFID tags of the connected equipment to the target object (helmet, jeans, shoes and protection boot..), if the number of equipment read is less than 1 an interruption will be calibrated and an alert message will be sent instantly to the control room. Finally, all collected data will forwarded to the control room for treatment, management of productivity and risk management.
A. Implimenting the application with ChibiOS
To meet the need of the proposed application, I created a set of three tasks with different levels of priorities using ChibiOS. The first task is a periodic software task and for the remaining two tasks, these are hardware tasks as shown in Figure 3.

Figure 3. Management of system tasks under ChibiOS

The first task is a software task with a priority equal to one. The task sends periodic standard messages to the fixed node install on the site and measure the received signal strength (RSSI). Task 1 synchronized with the hardware communication task using queues principle supported by ChibiOS.

Figure 4. Synoptic synchronization with waiting line (Queue)

The second task is a periodic hardware task with a priority level equal to two as a goal to identify all the security equipment worn by the target employer using an RFID reader connect with the suit antenna.
The latter sent the nature of the security equipment carried by the target to the control room through radio waves of the XBee module.
The third task is the most priority tasks. It manages the detection of neighboring stations that are installed on the site by receiving signal frames using the XBee module and storing information about the neighboring node identification and the received signal strength (RSSI) in the wireless network.
To create the queues required for the application, we use the following code:

static input_queue_t rssi;
static output_queue_t emision;

rssiObjectInit(&rssi, ibuf, SERIAL_BUFFERS_SIZE, NULL, NULL);
emisionObjectInit(&emision, obuf, SERIAL_BUFFERS_SIZE, notify, NULL);

Then, to create the system tasks the following statements are used:
static THD_WORKING_AREA(name, size);
Thread_t *tp=chThdCreateStatic(name,size,Priority,Function,Parameter)

Portion of the program concerning the creation of task measure of RSSI:
static THD_WORKING_AREA(Task1, 128);
static THD_FUNCTION(RSSI, arg) {
int RSSI = 5;
pinMode(RSSI, INPUT);
while (true) {
rssiDur = pulseIn(RSSI, LOW, 200);
void setup() {
void chSetup() {
chThdCreateStatic(Task1, sizeof(128), NORMALPRIO + 1, RSSI, NULL);
The information collected in the control room using a node Xbee connect to the computer via USB link. For example, we will use three nodes as reference nodes and the fourth node is the target. The received signal strength (RSSI) will converted to a distance and the target position should calculated with the Cramer rule that uses linear algebra.
With the help of neighboring nodes, if the target is in a classified zone, we check if the target carries the necessary equipment. In case of verification failure, an alert message will be send to the control room as shown in Figure 2.
To convert the received signal strength (RSSI) into distance we use the best-known mathematical equation as indicated by equation (1).

With n is a constant that indicates the signal propagation, D is the distance from the transmitter and A the signal strength received in one meter.
The experiment aims to measure the intensity of the signal received by the target from the reference node for different distances, varying from 1 meter to 25 meters in an open space by moving the target towards the reference node. In order to minimize the error rate of the measurements, the average RSSI value calculated with the formula (2).


Table 1 shows the RSSI values in -dB as a function of distance in meters. Each RSSI value represents the average of five different measurements taken from the same target position.

Tableau 1. Measure of RSSI according to distance

Real distance (M) RSSI_Theorical (DB) RSSI_Average (DB)
1,00 -45,00 -45,2
2,00 -51,02 -50
3,00 -54,54 -53,8
4,00 -57,04 -55
5,00 -58,98 -57
6,00 -60,56 -57,2
7,00 -61,90 -59,2
8,00 -63,06 -60,6
9,00 -64,08 -62,2
10,00 -65,00 -65,2
11,00 -65,83 -64,2
12,00 -66,58 -65,2
13,00 -67,28 -67,6
14,00 -67,92 -68
15,00 -68,52 -68,2
16,00 -69,08 -68,4
17,00 -69,61 -68,6
18,00 -70,11 -70,6
19,00 -70,58 -71,4
20,00 -71,02 -71
21,00 -71,44 -70,4
22,00 -71,85 -71,2
23,00 -72,23 -71,6
24,00 -72,60 -72,4
25,00 -72,96 -73,2
The Fig. 4 below, show the variation of the RSSI received signal power as a function of the distance before the correction of the RSSI value by average RSSI.
As the curve below shows, the values of RSSI_1 and RSSI_5 show a huge shift in values compared to the theoretical RSSI value.

Figure 5. Actual RSSI value based on distance before correction

On the other hand, after the correction of RSSI values with the value RSSI_Average, we get more accurate look like the value of RSSI_Theorical as shown in the curve of Figure 5 below.

Figure 6. Average RSSI value based on distance
B. The approach of Cramer

Figure 7. The approach of Cramer

The Cramer approach has been widely applied in location applications, Figure 7 shows the structure used in the Cramer approach 4. It based on a system of linear equations such as the number of equations equal to the number of variables and fits the linear equations in the form of matrices, and then applies them 5.
The system consists of three reference nodes 1, 2 and three as shown in Figure 4. The location of the target object is determined 5 by the intersection of the 3 circles centered on the reference nodes.

To calculate the position of the target object we make:

– R is the distance between the node ? and the target
– These are the coordinates of the reference nodes I with ? = 1, 2, 3.
– , ) Are the coordinates of the target.

We have the equation of circle is equal to:

Then has the following relationships:



We treat the equations (4) and (5) :



We put equations (6) and (7) in matrix form:





Finally, we find the coordinates of the target object in equation 12 below:

And (12)

C. Location test
To evaluate the precision of this technique, a practical test was simulated in a place which has as a dimension (X = 19 m) and (Y = 9.7 m).
The fixed nodes are at the height of 2 m, the calculation of the target position based on the measurement of RSSI of the three fixed nodes in order to process it by the method of Cramer (Figure 7), then compares the measured values calculate relative to the actual values as shown in Table 2 below.
Tableau 2. Estimated position representation using the Cramer approach
Real position Estimated distance (m) Position
N° X Y N 1 N 2 N 3 X (Real) Y (Real)
1 5 8 3,98 14,12 14,79 4,67 5,94
2 5 7 4,07 14,12 14,79 4,69 5,85
3 5 6 4,07 14,12 14,45 4,69 5,34
4 5 5 5,12 14,45 14,45 4,70 4,85
5 5 4 6,02 14,45 14,45 4,96 4,85
6 5 3 6,02 14,79 14,12 4,70 3,85
7 6 3 7,24 14,45 13,48 5,38 3,45
8 7 3 10,23 14,12 13,48 7,01 3,94
9 8 3 10,23 13,48 10,23 7,47 0,88
10 9 3 9,12 10,23 10,23 8,93 4,85
11 10 3 10,23 9,12 7,24 10,07 3,26
12 10 4 10,23 9,12 10,23 10,07 5,96
13 10 5 9,12 10,23 10,23 8,93 4,85
14 10 6 9,12 10,23 9,12 8,93 3,74
15 10 7 10,23 7,24 9,12 10,87 6,44
16 11 7 9,12 6,02 9,12 10,74 7,27
17 12 7 10,23 6,02 10,23 11,30 8,38
18 13 7 13,48 5,12 7,24 13,59 6,20
19 14 7 13,48 4,07 7,24 13,85 6,70
20 15 7 14,45 3,98 6,02 14,58 5,90

Table 2 shows the estimated position of the target using the received signal strength (RSSI) of the current position.
The purpose of the test is to compare the results obtained to the actual ones in order to detect the error rate by equation (13).
We have the coordinates of the current position and the coordinates of esteemed position.
The error gap = (13)

Figure 7. Estimated position by Cramer approach
The graphical representation of the estimated position relative to the current position shows the error difference between the real value and the calculated value.
According to Figure 7, we concluded that the error gap is generally less than one meter for the majority of the values.
However, for the error of the position (1) which is almost 2 meters generally because of measurement problems and for position (9 and 14) with a discrepancy that is strictly less than 2.2 meters probably caused by electromagnetic interference.

Figure 8. The error according to the distance

The LEAN method provides high quality work with minimal money, resources and time. The Lean methodology seeks to resolve the production problems in the different levels of the company (supply, production and distribution).
According to the LEAN method the most common sources of waste is the unnecessary movements (streamline employee movement and movement to avoid wasted time.)
The proposed system of security management gives us also an image of presence time for each employees, the time spent in the post and the real time location of employees, so we can use this information to make analytical treatment to improve productivity and manage time efficiently. Therefore, the information collected is very useful for the human resources department in order to make a strategy for improving production and a good distribution of human resources. We can reduce labor costs by eliminating lost time and improving workflow.
With all this information, we can make:
? An automatic control of inputs and outputs.
? A declaration of break times (lunch, coffee, cigarettes…)
? Follow-up of working time and activities (Management of Time spent on Activities)
? Calculation of overtime (paid or recovering)
? Management of absences, holidays.
In addition, we can minimize the repair time of equipment by minimize the time of travel from the actual position to the machine, so the nearest operator will be assignment for the action according to his location (the right person, at the right time and in the right place).
In this article, I study an embedded system that includes the Arduino platform, the XBee wireless communication modules and the ChibiOS real-time kernel with respecting the time constraint and multitasking problems in order to solve the localization problem of employers, their security measures and the statistic of management productivity. The results obtained based on real experimental measurements collected from many tests.
We can say that the system is able to protect the target in the workspace with acceptable accuracy and an error discrepancy due to the disturbance of the electromagnetic waves that causes the signal deviation remains within a respectful margin that it is strictly below 2.5 meters.

In addition, the benefit of the information collected was very useful and practical for the productivity management especially for the connected industrial 4.0 that minimize the manual data entry rate and to ensure profitability, productivity and to guaranty the security of their employers in one embedded system.


1 J. N. a. J. E. P. Lindgren, «Robust Real-Time Applications in Timber,» IEEE International Conference on Electro, Information Tech, pp. 190-196, 2006.

2 Arduino, « ArduinoBoardUno,» Internet source.
3 MFRC522 radio datasheet : Internet source

4 F. Datasheet, Internet source.

5 B. Cooperstein, “Elementary Linear Algebra”, University of California.

6 C. P. Kriangkrai Maneerat, ««On the Analysis of Localization Accuracy of Wireless Indoor Positioning

Systems using Cramer’s Rule,» World Academy of Science, Engineering, pp. 202-204, 2011.

7 J. Clerk Maxwell, A Treatise on Electricity and Magnetism, 3rd ed., vol. 2. Oxford: Clarendon, 1892, pp.68–73.


I'm Sarah!

Would you like to get a custom essay? How about receiving a customized one?

Check it out