Communications and Network
Vol.1 No.2(2009), Article ID:922,5 pages DOI:10.4236/cn.2009.12015

Mobile Positioning System Based on the Wireless Sensor Network in Buildings

Xiujun LI, Gang SUN, Xu WANG

College of Software, Nankai University, Tianjin, China

E-mail: {nklixiujun, sungangwinner},

Received August 2, 2009; accepted August 19, 2009

Keywords: Positioning, Intelligent Navigation, Video Transmission, Wireless Communication, Sensor Networks, Multi-Core Computing


Established on the Intel Multi-Core Embedded platform, using 802.11 Wireless Network protocols as the communication medium, combining with Radio Frequency-Communication and Ultrasonic Ranging, implement a mobile terminal system in an intellectualized building. It can provide its holder such functions: 1) Accurate Positioning 2) Intelligent Navigation 3) Video Monitoring 4) Wireless Communication. The innovative point for this paper is to apply the multi-core computing on the embedded system to promote its computing speed and give a real-time performance and apply this system into the indoor environment for the purpose of emergent event or rescuing.

1. Introduction

Before, there exist many positioning system applications, such as GPS, wireless positioning system, but the computing capability is limited by their hardware or software. In this paper, we employ the OpenMP [1–3] on Intel Multi-Core Embedded platform [4] to maximize the degree of parallelism of computing [5], using the 802.11 wireless network protocols as the communication medium, combining RF-Communication with Ultrasonic Ranging technology to construct a system can implement the accurate positioning and intelligent navigation.

Here is a diagram to compare the several existing positioning systems:

Table 1. Comparison between the several localization systems [7].

2. Background

With the development of technologies, the positioning and wireless communication is being more and more mature, and the cost of hardware is decreasing. The electronic products with intelligent navigation can provide people with convenient and smart service. However, all these kinds of existing positioning systems can be only applied in the wide areas, lacking of the support to the local areas, especially, and an indoor environment. In fact there are more and more local areas raising around us, for example, a modern intellectualized building. These large buildings are full of hundreds of function units, so the security of them is becoming more and more important. In order to cope with the possible emergencies, such as terror attack, fire, and arrive at the event locale timely, and rescue the trapped people as quickly as possible, it is of far-reaching significance and practical values to construct such a system.

It is well known that GPS is the most common wireless navigation and positioning system, but the signal of GPS can not cover the buildings. Also, in recent years, wireless navigation based on the mobile communication networks [6] was being caught more and more attention, however, the resolution of this technology was low, and the error of positioning was so big that it can not be applied in the need of emergent events. Aiming at the above circumstances, we designed a solution that can implement accurate positioning and real-time navigation.

Ultrasonic is the traditional ranging method, can implement the function of positioning, however, the information that Ultrasonic can capture is single, it is not good for identifying the target, so it can not support the wide-area, continuous and accurate positioning.

In order to solve the problem of identifying the target object, it is feasible to construct a method based on the Wireless Sensor Networks [8,9], combining the RF-Communication with Ultrasonic Ranging technology, considering the limited computing capability, we maximize the resource and employ the multi-core computing in this system. It can provide an intelligent navigation, accurate positioning for an intellectualized building, and improve the management service of the building.

3. System Design

This design comprises of two parts: Mobile terminal and Server.

The Listener receives the information from more than three (including three) nodes, it will transfer these information to the mobile terminal, the terminal will calculate the position coordinate, then the terminal transfers all kinds of information (such as position coordinate, video data) to the remote monitor server. The server can monitor all the terminals and send commands to anyone of them.

3.1. Mobile Terminal

As the Figure 2, the mobile terminal comprises of six modules: Central Control module, Display module, Locating Module, Navigation Module, Video Module and Wireless Networking Module.

1) Central Control Module: Central Control Module equals to the manager in the system, it takes responsibility of the initialization, task-ispatching, allocating and releasing resources etc.

2) Display Module: The GUI of the software, show the electronic map. It should give the real-time performance on the mobile terminal (real-time updating the position of the terminal on the electronic map), shows the optimal path from the current position to the destination etc.

3) Positioning Module: It reads the data from the Listener via Serial Port, analyze the data and calculate the position coordinates which will be used by Display Module to update on the map.

4) Navigation Module: This part is to calculate an optimal path from the current position to the destination using the Dijkstra algorithm [10], displaying this path on

Figure 1. System structure (listener is attached at the mobile terminal via serial port).

Figure 2. The structure of the mobile terminal.

the e-map, and real-time updating. In the emergent condition, it will save a lot time for the user.

5) Video Module: This part is to complete the tasks: video capture, video compression, and video transmission over Wireless Networking, video decompression, video recovery.

6) Wireless Networking Module: Wireless Networking is the medium of this system. It is needed by the interactive communication between the client and server, video transmission, and some error checking.

In the above six modules, there needs among of computing in the Positioning Module and Navigation Module, so we can introduce OpenMP to increase the degree of parallelism, to promote its computing speed.

3.2. Server

The Server Comprises of Three Parts: Control Module, Display Module and Communication Module.

4. System Theory

4.1. Theory of Positioning

As the Figure 3, there are a number of wireless sensors as the Beacons distributed across the building according to a certain principle. These sensors have such functions as RFcommunication, sending and receiving ultrasonic signals. What’s more, every sensor node stores its own information, including its unique ID and three dimensional coordinates.

When the mobile terminal enters into the area, its Listener will receive the surrounding sensors’ information (sensor’s ID, sensor’s position coordinates etc.) by RFCommunication. At the same time, the terminal utilizes the Ultrasonic Ranging method to measure the distance between the receiver and sensor. Once the terminal receives more than three (including three) sensor nodes’ information, referencing the Triangle Localization Principle, it will calculate the position of the terminal quickly.

4.2. Parallel Computing

In the Module of Positioning and Navigation, there are many circulations like while or for, in one circulation, the result may not depend on the former result, so we can separate it into several sections, and arrange the different section to an individual thread, so that we can increase our computing speed. Take for as a typical example Function Sum:

int sum()


   int ret = 0;

   for(int i=0; i<100; i++)

      ret += i;

   return ret;


We can reconstruct this function like thisint sum()


  int ret1 = 0;

  int ret2 = 0;

  //Task A

  for(int i=0; i<50; i++)

     ret1 += i;

  //Task B

  for(int j=50; i<100; i++)

     ret2 += j;

  return (ret1 + ret2);


We distribute Task A for Thread1, at the same time, distribute Task B for Thread2. So we save nearly half time on this circulation computing.

We can use the similar mechanism in our programming to increase the degree of parallelism of computing.

5. Software Implementation

This part gives the details of software implement. Due to the complex computation in the program, in order to increase the reaction speed of system, we use the Intel Multi-Core platform at the side of the Mobile Terminal, and employ Multi-thread programming both on the Mobile Terminal and Server.

5.1. Mobile Terminal

1) Positioning Function When the Listener receives the surrounding sensors’ information, the terminal will read the information via Serial Port. We use the .COM programming to implement the Serial Communication [11].

There is a fixed format for the data read via Serial Port. Here is an example:

VR=2.0, ID=01:ff:fe:fe:10:00:00:db, SP=, DB=4123, DR=790, TM=1004, TS=1864768 Though there are seven segments for these data, only two parts of them are useful for us: ID is the ID number of the sensor; DB is the distance between the sensor and the Listener.

After we got more than three sensors (including three), we can calculate the position coordinates of the terminal by this formula:

In the Position Computing, we can use OpenMP [1–3] to increase its parallelism. Here are several commands for increasing its parallel computing.

for: #pragma omp parallel for Increase parallel sections: #pragma omp parallel sections 2) Real-Time Navigation Function: Firstly, we should introduce some concepts about our self-defined elec-

Figure 3. Theory of positioning.

Figure 4. The communication between the beacon and listener.

tronic map. Considering the three dimensional structure of the building, we adopt XML file for storing the data of the whole building.

There are some important tag nodes stored in the XML file for the different elements of a building: staircase, crossing, room, and aisle etc. Here are two examples for Aisle and Staircase:

//Aisle Aisle


      …   //store the region of the Aisle

… //store the cross points between asile and asile, asile and room

… //show the asile

//Staircase Staircase


staircase on the first floor

 …    //store the region of the Aisle

 …  //store the logical points of staircase

    …  //show the staircase



After we selected the destination, we can calculate an optimal path from the current position to the destination by the Dijkstra Algorithm. In order to give the real-time performance, we should update the position of terminal on the e-map.

3) Video Monitoring Function: After capturing the video data from the client, the client will transfer the video to the Server. Considering the huge data over the wireless [12,13] and the instability of wireless networking, we should try to decrease the amount of data over the wireless [14]: decreasing the frequency of the capturing by frame, then compress every frame of image data in the client, (using H.263 [15,16] standard compression algorithm), then transfer the video data over wireless. (The ratio of compression is 8:1). It was demonstrated that this was quite effective.

4) Wireless Communication: This part is the base of the whole application. All the data (including video data, message etc.) are transferred over Wireless. For us, we develop the application in the application layer of the networking, so it is no difference between the programming of wireless and networking. All we used is SOCKET. In order to avoid the influence between the communication module and display module, all communication is built on a separated thread.

Figure 5. Before transmission.  Figure 6. After transmission.

Here is the comparison of two pictures.

6. Conclusions

Through the introduction to this system, we can have a systemic understand. It aims to be applied in the indoor environment, such as rescuing event, anti-terrorist. It can provide such functions as accurate positioning, real-time navigation, video monitoring, and communication.

Currently, it is just a prototype, it still needs much improvement. For example, we can try to transplant it to the smart PDA, moreover, the UI is 2D, we can reconstruct it using 3D, in that case, and it is of more practical value.

7. Acknowledgments

The authors wish to thank Prof. Fengchi Sun who gave us strong support during my experiment. This work was supported in part by Intel Corporation’s hardware.

8. References

[1]       S. Akhter and J. Roberts, Multi-Core Programming, 2007.

[2]       Multi-Core Programming on Windows (Student Workbook), Intel Corporation, 2006.

[3]       A. Nakano, “OpenMP programming,” University of Southern California, 2006.

[4]       T. M. Wang, The development of Embedded system, 2003.

[5]       P. Burton, “An introduction to MPI programming,” February 2009.

[6]       S. Gezici, “A survey on wireless position estimation,” Wireless Personal Communications Manuscript, 2007.

[7]       Y. Liu, “A comparison between some location techniques,” Applied Science and Technology, 9th Period, Vol. 32, 2005.

[8]       L. M. Sun and J. Z. Li, Wireless Sensor Networking, 2005.

[9]       H. B. Yu and P. Zeng, Intelligent Wireless Sensor System, 2006.

[10]    A. Stentz, “Optimal and efficient path planning for partially-known environments,” In Proceedings IEEE International Conference on Robotics and Automation, May 1994.

[11]    C. L. Li and J. Gao, Visual C++ Serial Communication and Typical Examples, 2006.

[12]    S. H. Kang and A. Zakhor, “Effective bandwidth based scheduling for streaming multimedia,” in Proceedings of 2003 International Conference on Image Processing (ICIP 2003), Piscataway, IEEE Press, NJ, Vol. 3, pp. 633–636, 2003.

[13]    X. Q. Zhu, J. P. Singh, and B. Girod, “Video streaming over wireless: Where TCP is not enough,” Information Systems Laboratory, Stanford University, April 2008.

[14]    M. Goel, S. Appadwedula, N. R. Shanbhag, et al., “A low-power multimedia communication system for indoor wireless applications,” in 1999 IEEE Workshop on Signal Processing Systems, SiPS 99, pp. 473–82, October 1999.

[15]    Z. H. Yao, D. Tian, and L. S. Shen, “The research of real time video coding based on H.263,” Journal of Circuits Andystems, Vol. 3, 2002.

[16]    K. Rijkse, “H. 263: Video coding for, Low-bit-rate communication,” KPN Research, IEEE Communication Magazine, December 1996.