Sie sind auf Seite 1von 5

Proceeding of the 2015 IEEE

International Conference on Information and Automation


Lijiang, China, August 2015

Android Bluetooth Multi-Source Signal Acquisition


For Multi-Parameter Health Monitoring Devices
Xiaojing Tang1 , Chao Hu2 , WeiXing Lin2
1. Ningbo University, NingboChina315211
2. Ningbo Institute of Technology, Zhejiang University, Ningbo, China, 315100
{tangxiaojing27@163.com, chao.hu@siat.ac.cn, linweixing@nbu.edu.cn
Abstract - In this paper, a portable physical health monitoring nodes to acquire the human blood oxygen, heart sounds, blood
system is proposed based on the Android smart phone system. pressure and other vital signs parameters in real-time. The
This system can be applied to monitor human multi physiological acquired messages (vital signs) are transmitted to the 3G smart
and biochemical parameters in real time, including the ECG, phone and the intelligent terminal.
blood pressure, body temperature, heart rate, SPO2, blood sugar,
Recently, we have also done some work to monitor
and etc. The Android smart phone receives the parameters via
Bluetooth communication from each health sensor module, and health data in more convenient way[5]. We tried to build a
display the monitoring data simultaneously. It also delivers the portable instrument to include as many the normal parameters
related data to web server, which makes the health diagnosis and as possible, such as the physiological parameters: blood
analysis on these data and feedbacks important information to pressure, SO2, heart rate, body temperature, ECG, breathe
the users. In order to solve the problem of the common Bluetooth rate, and the biochemical parameters such as blood sugar.
module only providing the one to one communication, the Nevertheless, we wish to use the smart phone to collect all
multi-thread and the link reuse techniques are applied to realize messages from different instruments. It results in the problem
the wireless data transmission from multi-sources to the smart of multi-source signal acquisition, and each source has
phone. The experimental results show that this network works
multi parameters for the health monitoring. Besides, it is also a
effectively, and the smart phone can interact with up to 7
Bluetooth sensor modules simultaneously. challenge to analyze the multi-source data and send them to
the web server.
Keywords: Android; Bluetooth; Multi-Source Signals; We solve the problem that common Bluetooth module
Health-Monitoring has mutual exclusion and can only provides the one to one
communication. The proposed method is to use the
I. INTRODUCTION multi-thread technique to realize the data transmission and
Human health is an eternal important topic. While the synchronization from the multi-source sensors to the android
health monitoring hardware and systems are being smart phone.
continuously improved, the home medical examination In this paper, the framework of health monitoring system
instruments and telemedicine techniques have been caught the is discussed in section II; including the acquisition module, the
sight of the medical workers, the researchers and the Android program and the web service server. The multi
customers. Recently, there are increasing novel ideas and Bluetooth connection algorithms and the Android/server
inventions for the new portable medical devices in hospitals, programs are described in section . In section IV, we
communities, and even in common families. These new present the experiments for testing the connections of the
devices have been integrated with the high capacity embedded health monitoring modules to the smart phone; and the speed
microcomputer (or microprocessor), the wireless network, and rate of the data transmission. Finally, the conclusion is given
the intelligent algorithms, so that their function and the quality in section V.
are significantly improved. One example is presented by Shi
II. FRAMEWORK OF HEALTH MONITORING SYSTEM
Xiong et al[1]; they put forward a physiological parameter
monitoring system based on the smart phone with the Android The health monitoring system includes three parts, the
operating system and realizes the transmission of acquisition module, the Android program and the web server,
physiological data from the detecting module to smart phone. as is shown in Fig.1.
For the interaction between acquisition module and smart
phone, LiGuo Li et al [2] developed a health service terminal
on the basis of analyzing the Bluetooth and the Android
operating system. They focused their research on the operating
system to support the Bluetooth communication. On the other
hand, Bo Gao et al[3] proposed a Bluetooth low power
consumption personal health network. The algorithm is able to
adaptively control transmitting power based on RSSI and
reduce power consumption at most 25%. Heng Ma et al[4] built
a system for a health monitoring body sensor network (BSN)
based on ZigBee and Bluetooth, which controls the sensor
Fig.1 System framework

978-1-4673-9104-7/15/$31.00 2015 IEEE 1790


Acquisition module contains some physiological and If paired and connected, the Bluetooth module can work
biochemical acquisition devices of conventional parameters, in full-duplex mode, support 8 bits of data transfer, one stop
such as blood oxygen, blood sugar, heart rate and body bit; it supports the standard baud rate from 4800bps to
temperature and etc. All the acquisition modules have their 115200bps; here 9600bps is chosen. The 3, 4 pin are set high
own independent MCU unit and use the Bluetooth chip to to enter the AT command mode to set the corresponding
send results wirelessly. We choose the latest Bluetooth 4.0 as parameters.
the version of the Bluetooth module, for the reason that it not For the android mobile phone, the system has already
only is compatible with 2.0 and 3.0 module, but also has the made a good encapsulation to the Bluetooth application
characteristics of low power consumption and relative high package. We set the mobile Bluetooth in master mode and the
speed rate. monitoring module in slave mode. When the acquisition
The architecture of the Android system is similar to other equipment is opened and completes the pairing with mobile
operating system and a layered architecture, from upper to phone, it can send data to the phone without pairing again in
lower the application layer is application framework runtime the later data transfer process.
layer, system layer and the Linux kernel layer. Our android
program is coded by the Java language and has different B. The Data Transfer Protocol
function partitioned modules. The main part is the data Health monitoring of physiological and biochemical
processing module and data display module. The Bluetooth parameters have two types. One is the instantaneous value,
monitoring program is on the application layer, but the such as temperature, blood sugar, height, weight and etc. The
Bluetooth driver is provided by the kernel layer. The other is the long-data and real-time monitoring parameters,
monitoring program is divided into three main parts. The first such as Electrocardiograph (ECG) and Photoplethysmogram
is connection processing module for the connection request (PPG). So we designed two types of transmission protocols
and data transfer; the second is the management module and send the collected data in different formats.
responsible for mapping interface and data display; the third For small amount of the instantaneous parameters data,
part is the interaction module responsible for the interaction the validity and accuracy of the data must be verified; so we
with the cloud server. add several bits for identifications to the normal data and set a
The web server has few function partitions, including the data validation byte by weighted check. For example, the
data processing module and the user interaction module. The blood glucose data are transferred in bytes with total length of
data processing module stores the monitoring data from the eight bytes. The first and the second bytes are flags bytes
Android phone. It can send health or medical warning which are defined as hex 0x52 and 0x42; the middle section of
messages to users when receiving abnormal health monitoring three bytes are random bytes; and 7,8 bytes are the data of
data. The user interaction module is a interface which provides blood sugar, as shown in Table 1. For example, a receiving
APIs to the web service to query health monitoring data. frame is (0x52 x42 0xff 0x10 x65 0x00 x00 x32); we can
determine the blood sugar value is 0x32 (for Blood glucose
. MULTI BLUETOOTH CONNECTIONS TECHNOLOGY AND 5.2).
SOFTWARE DESIGN Table. 1 Blood glucose data format
Byte0~3 Byte4 Byte5 Byte6
The focus of this article is on the topic how to establish
define Random Temperature Temperature Fixed 0xff
multiple connections between multi health monitoring High 8 bit Low 8 bit
modules and a server phone, to monitor Multi-Source signals.
Table. 2 Ear temperature data format
A. The Bluetooth Module Connection With MCU Byte0 Byte2 Byte3~5 Byte6 Byte7
The method of sending data is turn the serial port to define Flag1 Flag2 Random Low 8 bit High 8 bit
Bluetooth. The chips UART serial port TX pin is connected value 0x52 0x42
to the Bluetooth module RD pin, UART serial port RD pin is
connected to Bluetooth module TX pin, and then each others
VCC3 and GND pin was connected, as is shown in Fig.2. For real-time monitoring, the data should be sent to the
After this, we can send data that in the register of the chip to mobile terminal in time to avoid the data lagging. For this type
the paired and connected device in the way of turning serial of data transmission, if a large number of auxiliary data and
port to Bluetooth. flags are added to normal data, it will leads wasting of
bandwidth and data lag inevitably, so we check the first
several data in the head of the data packet. It starts with 4
bytes of flag data and no other redundant data, the format is
shown as the following Table. 3.

Table. 3 Blood glucose data format


Byte0 Byte1 Byte2 Byte3 Byte4
define Flag1 Flag2 Flag3 Flag4 data
Fig. 2 Connection between MCU and Bluetooth chip value 0x47 0x53 0x83 0x11

1791
C. Android Program Design the two receivers events, the program will get the address
The android program is designed by using the Android info of the client and save it. The server phone use the client
Bluetooth API which can do operations such as search for address info to distinguish different acquisition module and
mobile and make connection between Bluetooth devices. make Bluetooth socket connection, the flow is shown in Fig.4.
Besides, Java multi-thread and multi-channel model skills
were applied to manage each connected device socket and
realize the multiple devices data transmission and monitoring.
In the Multi-Source signal acquisitions, the acquisition module
can be arbitrary switched, turn on or turn off, as well as the
data transfer to the Android mobile terminal. The program
interface is programmed by using Android conventional
component. TextViews are used to show the blood oxygen,
blood sugar, heart rate, body temperature and other monitoring
data. The Real-time monitoring data curve is drawn by
Achartengine which is a Google open source project. The
work flow of the Android program is shown as Fig.3.
Message transmission

The web server

Fig. 4 Bluetooth work flow

2) Multiple Connections Establishment


For conventional Bluetooth communication mode(c/s),
the server of the smart phone do some essential operations and
start the accept service according to their Bluetooth device
Fig. 3 Android program frameworks address. A client device make a connection operation
according to the server address and create a socket by
a universally unique identifier (UUID) which must
1) The Underlying Data Interaction be accordance with the server, RFCOMM protocol use UUID
The underlying data interface module is responsible for to distinguish different Bluetooth devices. The steps are like
data interaction with the acquisition equipment, establishing this:
connection with multi acquisition devices, receiving and (1)pairing the phone and the desired device.
parsing the received monitoring data. Data processing and (2)The master side start accept action according to the
displaying should in accordance with transmission protocol of prescribed UUID and then begin broadcasting connection
byte stream that we designed. information.
We use the Android4.2 and ADT22.6 as development (3)The slave side creates a socket according to the
tools. In order to realize the function of Bluetooth in the prescribed UUID and the server device address, then sends the
Android system, some preparation work should be done. First connection request.
of all, some permissions should be declared in the (4)The master side listens this request and get a socket
AndroidManifest XML file. Second, a Bluetooth adapter is channel.
obtained, and the local Bluetooth adapter can be gotten by (5)The server and the client communicate with each other
using getDefaultAdapter function and then get remote by the established socket channel.
Bluetooth adapter by BluetoothDevice class. After getting the The above procedure is typically used for one to one
Bluetooth adapter, the Bluetooth function is opened and the connection. For the multi source connections, we should make
surrounding equipment is searched. some changes. For Android applications layer, the established
In searching for a remote Bluetooth device, socket connections between Bluetooth devices will not
bluetoothadapter.getBluetoothDevice is used to get specified disconnect when there is a new connection request and starts
Bluetooth address. The class is actually a Bluetooth hardware new thread. So, we use the multi-thread technique to establish
address book, and we use BluetoothAdapter class to create a multiple Bluetooth socket connections and manage the data
Bluetoothdevice object, the classes we used in our program is transmission. The main process include several threads. The
shown in table 4. first is the main thread which is responsible for drawing view;
At the beginning of the program, the the second is the accept thread in charge of handling the
ACTION_DISCOVERY_FINISHED and ACTION_FOUND Bluetooth connection request; the third is the communication
broadcast receivers are registered to monitor the connection manage thread. All the read thread and write thread of each
request of the client. When the connection request triggered

1792
socket connection is managed by the communication manage method is similar with polling, but we must do some control to
thread. The thread framework is shown as the fig. 5. remove the errors and overtime.

D. Server and Web Service Program Design


The storage of health monitoring data and early warning
function are under the platform of the mobile cloud services. It
is a kind of internet interactive access mode. The server of the
monitoring system designed has a few function partitions. To
reduce the coupling of the code, we separate the data
processing module from the user interaction module. The
servers work flow is show as Fig.6.
The basic function of the server is to handle the
monitoring data sent from the mobile client; the mobile client
automatically synchronizes the collected data to the cloud
server from various regions. While the servers data access
service must meet the total mass of users request, we
Fig. 5 the thread framework of the program configure the thread pool model to manage the data processing
Besides a normal connection, we add 2 new steps to threads. The thread pool trends to adjust the number of the
establish multi connection: available threads according to the number of the device which
(1)At the end of a listening, that is, after the two devices request data synchronization and data storage.
completing the Bluetooth socket establishment, the program
create a new message and send it to the main process.
(2)The process thread cancel the original accept thread
after receiving the message, and then reopen the accept
operation according to a new UUID. Then we can deal with
other Bluetooth devices connect request.
client

Table. 4 Bluetooth API in Android


package description

BluetoohAdapter Local blue adapter


BluetoohClassService Bluetooth service
BluetoohDevice Bluetooth device(remote)
BluetoohServiceSocket Listen class
BluetoohSocket Bluetooth connect class Fig. 6 Server framework

According to the present standard android document for The web service is a better way providing data access,
Bluetooth communication, max seven client connections can and users can submit the form in the relevant page to complete
be realized to the server. These seven connections can be the relevant informations query from the SQL database. The
active and send data at the same time. In addition, we can keep database of the server provides some API to submit and query
248 connections in sleep mode, and the connections on sleep health monitoring data form web service of the user. We
or activated can be switched. programmed a PHP web page and configure its proxy server
As all the manufacturers of Bluetooth module produce with Nginx, and then placed it on the public IP. The patients
the chip in a uniform standard, the chips used have the same and the doctor can query the whole mentoring data form the
UUID which is defined as web page without the mobile client.
UUID00001101-0000-1000-8000-00805F9B34FB. We can
IV. EXPERIMENTAL RESULTS ANALYSIS
not change the UUID address of the integration module, what
we can do is just modify the master-slave mode, so it causes Since the main problem is to handle Multi-Source signal
some trouble to connect multiple health monitoring modules acquisition, we do the experiment for the maximum
to smart phone. However, we use the RFCOMM protocol to connections for the system and test the speed rate.
match and establish multi socket connections by using the way
of connecting devices one by one. A. The Maximum Connection Experiment
All the connections between modules and phone use the We chose various types of Bluetooth chips and connected
same UUID. After a connection has been established, the them to the microcontroller and do the connection tests with
server post a notification, and cancel the origin receiving Android phone, as is show in Fig. 7.
operation and start a new accept with the same arguments. The

1793
According to the diagram, when the number of
Table 5 Maximum connection tests average value of twenty times connections rising, the overall speed rate decline and maintain
Total number 1 2 3 4 5 6 7 8 the total Bluetooth transmission bandwidth. It is owning to
Success connections 1 2 3 4 5 6 7 7
that the Bluetooth RFCOMM protocol uses L2CAP protocol
to realize reuse link. Health physiological parameters are
Total times 1 3 4 6 9 11 12 13 always low frequency signal and concentrated in 1 to 10hz. If
Average time (s) 1 1.5 1.3 1.5 1.8 1.8 1.7 1.8 we adopt 10KHz sampling frequency and 16-bit sampling
accuracy, the amount of data per second is 300b/s, and the
If the connected socket channel was disconnected, the minimum transmission rate of 20kb/s in the experiment can
socket will return a state code, which shows whether the meet the requirement.
connection is active. At the same time, we calculate and V. CONCLUSION
record the total time of establishing connection to all the
devices, the result is show as Table 5. A Health monitoring network system is presented based
From the table, we observe that Android system can on Android Bluetooth communication, which realizes the
support maximum seven connections of Bluetooth devices at health monitoring of Multi-Source signals acquired from multi
the same time. When the number of connections is more than acquisition modules. The problems of data transmission and
seven, the connect operation might be fail or a connected synchronization from the multi-source sensors to the android
device will be disconnected. Seven devices were paired, and smart phone have been researched and tested. The results
the connections between devices and phone take about ten show that the proposed method realizes the functions of the
seconds. In a single server and multi client mode, up to seven health monitoring system in the smart phone by overcoming
activate connections are guaranteed. If more devices are the problems of the multi-channel Bluetooth communication.
desired, we suggest the method to use a client device as a 2nd The experiment shows that the system work effectively and
level server, to form a sub-network and deliver the data to the can support multi acquisition devices simultaneously.
1st network server.
ACKNOWLEDGEMENTS
This work was supported by National Natural Science
Foundation of China (No.61273332, 61202196), Ningbo Sc. &
Tech. (Innovation Team) plan project (2014B82015).

REFERENCES
[1] Shi Xiong, XiaoMing Wu, Technology of Data Transmission through
Bluetooth in Android, Chinese Journal of Medical Physics, vol. 29, no.
6, pp. 3801-3803, 2012.
Fig. 7 Bluetooth connection test [2] LiGuo Li, Hui Zhang, Hao Cheng, The Design and Implementation of
Bluetooth Software Based on Android Health Service Terminal,
Flectrnnic Sci.&Tech., vol. 25, no. 5, pp. 789-795, 2012.
B. The Speed Rate Research [3] Bo Gao, Ning Ge, Design and implementation of Bluetooth low
On the other hand, we concern about the Bluetooth powerconsumption personal health network, Transducer and Micro
System Technologies, vol. 32, no. 6, pp. 84-87, 2013.
bandwidth at the same time. We send 10M mp4 files from [4] Heng Ma, JunBo Cheng, Jun Tian, XinHao Cheng, Design of Personal
multi Android client phones to a Android server phone in the Health Monitoring System Based on Body Sensor Network,
protocol that have discussed in the second part of the paper Measurement and control technology, vol.34, no.1, pp.24-27, 2015.
and the client number was added one each time. We started [5] Pengxiang Jin, Chao Hu, Weixing Lin, Interface Design for
Multi-parameter Health Monitoring Instrument Based on ARM-9
the experiment with two clients and added the number of the Embedded System, Proceeding of the IEEE International Conference on
clients to maximum seven. The speed rate value was recorded Information and Automation, Hailar, China, July 2014.
to different text file; the results are shown as Fig.8. [6] Y. H. Lin, I. C. Jan, P. C. I. Ko, Y. Y. Chen, J. M. Wong, and G. J. Jan,
"A wireless PDA-based physiological monitoring system for patient
transport", IEEE Transactions on Information Technology in
Biomedicine, vol. 8, no. 4, pp. 439-447, 2004.
[7] W. Y. Chung, C. L. Yau, K. S. Shin, and R. Myllyla, A cell phone based
health monitoring system with self analysis processor using wireless
sensor network technology, 2007 Annual International Conf. of the IEEE
Engineering in Medicine and Biology Society, vol.1-16, pp. 3705-3708,
2007.
[8] Fu Xiaoling, Wu Jianmin, and Wang Dianlai, Solution of mobile GIS
Based on Blootooth GPS Receiver, Computer Engineering and Design,
Vol. 9, pp. 298-300, 2009.
[9] Shi Yuguang, Liu Xiaohong, and Li Wenting, "Based on The Research of
Bluetooth Wireless Remote Operation", China Science & Technology,
Fig.8 The average transmission rate of twenty times of vol. 6, pp. 546-551, 2007
device number range 4 to 7

1794

Das könnte Ihnen auch gefallen