Proceedings of KGCOE 2005 Multi-Disciplinary Engineering Design Conference Page 5
Project Number: 05504
Copyright © 2005 by Rochester Institute of Technology
Proceedings of KGCOE 2005 Multi-Disciplinary Engineering Design Conference Page 5
Medical internet interface
Shamit Patel/ RIT Electrical Engineer / Shari McNamara/ RIT Electrical EngineerCopyright © 2005 by Rochester Institute of Technology
Proceedings of KGCOE 2005 Multi-Disciplinary Engineering Design Conference Page 5
Abstract
The purpose of this project was to utilize wireless technology to record information from home medical devices and allow a health care provider to access this data via the internet. Two 2.4 GHz IEEE 802.15.4 standard Freescale development boards were utilized to provide the link between the medical device and the patient’s home server (the CerfCube). The medical device used consists of both an Electrocardiogram (ECG) and an Electromyogram (EMG). Utilizing the web browser, the health care provider is to have the ability to control which of the two outputs is viewed.
Introduction
Home medical monitoring devices allow individuals to measure their health. Unfortunately the data obtained is not under the scrutiny of a medical professional. In general, medical monitoring technology is available to the home owner but the link between the home and the medical profession to analyze the data is missing. The Medical Internet Interface team’s design is part of a large picture to develop the complete link between the home medical monitoring device and the physician. One of the sub tasks was to implant IEEE 802.15.4 wireless technology to transmit data from the medical monitoring device to a central location. [11]
One other important aspect of this is project is the convenience this device can provide to a patient. Because their health can be remotely monitored by a physician, the number of simple check-up doctor visits can be reduced.
Nomenclature
The following abbreviations are used throughout this paper:
ASCII American Standard Code for Information Interchange
BDM Background Debug Module
CGI Common Gateway Interface
ECG Electrocardiogram
EMG Electromayogram
FLASH Fast Low-Latency Access with Seamless Handoff
IEEE Institute of Electrical and Electronics Engineers
IO Input Output
LED Light Emitting Diode
MCU Micro Control Unit
PC Personal Computer
RAM Random Access Memory
RS-232 Standard serial interface
SARD Sensor Applications Reference Design
SCI Serial Communication Interface
SSH Secure Shell Host
SMAC Simple Media Access Control
UART Universal Asynchronous Receiver Transmitter
USB Universal Serial Bus
Project Requirements
The hardware and tools to be used in our project consists of the following: two Freescale IEEE 802.15.4 development boards; one Intrinsyc CerfCube with embedded Linux as the OS; one USB multilink BDM; two function generators; one oscilloscope; two personal computers with internet connection; one PC running Linux Fedora Core 2 for cross compiling for Arm processor; Code Warrior software development program; HyperTerminal; and putty (ssh program).
The system chain starts with the patient and the health monitoring devices they will be using. For our project, the two devices will be an ECG and EMG. The output of these health devices will be obtained by one of the Freescale development boards. This signal will be 0 to 3 volts, with a 1 to 100 Hz frequency. The Freescale board obtaining the two channels of signal will use the analog to digital converter to put the signal in a form that can be wirelessly transmitted. This will be done with a sampling rate of 300 Hz, well above the rate at which aliasing will occur. Also, the resolution will be 10 bits. This Freescale board is then to be programmed to transmit this data to the second Freescale board, which will be connected to the server, or CerfCube. The CerfCube is an embedded Linux kernel that will be connected to the Freescale board via RS-232. The CerfCube will have a web server with a web page programmed to access the health information. This information will then be viewed using a web browser by a physician.
From this web browser, the physician will be able to choose which of the two channels will access the ECG or the EMG. It will be possible to view two channels of ECG, two channels of EMG, or one channel of ECG with one channel of EMG. When the physician sets these channels, the command will then travel back through to the Freescale board which is connected to the ECG/EMG devices, and the channels will be toggled respectively.
Design
Freescale Development Boards
The Freescale development boards were obtained as a toolkit for wireless development. Two boards were used and they each transmit at 2.4 GHz. The wireless technology is the Zigbee-ready IEEE 802.15.4 standard. This technology is attractive because it runs off low power, is cost effective and has a decent transmission range (1-100 meters.) The 802.15.4 standard will also be easy to use to implement additional health devices with because it allows a network of up to 2^64 nodes. The Freescale board also has a low power 8 bit microcontroller with features such as 60K in re-programmable FLASH memory, 4K of random access memory, a 8 channel 10-bit analog to digital converter. An RS-232 port is also on each development board, used to monitor the device and program the FLASH memory. A BDM port is onboard for MCU Flash reprogramming and in-circuit hardware debugging. LEDs and switches are also available for demonstration, monitoring and control. In addition, the kit was supplied with programming software, Metrowerks’ CodeWarrior Development Studio for HCS08 special edition. [1-3]
Fig 1: Freescale 1379SARD Development board
Intrinsyc’s CerfCube
The high performance, low power and low cost CerfCube was a good choice for the projects web server because of the features it offers. The CerfCube has an Intel PXA255 32-bit processor, which runs at 400 MHz. The CPU board has 32MB of programmable Flash and 64 MB or RAM. There are three Ethernet ports, two RS-232 ports, and an USB port. The system runs an embedded Linux kernel, which will host the project’s web server where the collected health information will be accessed. [4-6]
Data Transmission
As discussed previously, this project’s goal is to demonstrate the usability of the devices. Because of this, an interface for the ECG/EMG user has not been developed. The CerfCube and the Freescale board connected to it will always be powered on. The system will be initiated by the patient when they press a button connected to the Freescale development board that is connected to the ECG/EMG device. At this point data will be transferring from the ECG/EMG to the CerfCube, wirelessly through the Freescale development boards. This process is shown in Figure (2.)
Receiving and Displaying Data
As the ECG/EMG data is transferred to the CerfCube, the information will be accessed through a web page hosted by the CerfCube. The web page will display the graphical waveform of the two channel output signal. The graph will show five seconds of output per a webpage refresh, and the refresh will be automatic.
The physician will also be able to control the device output through radio buttons on the web page. When this occurs, the message will be sent back through the system to the Freescale board connected to the ECG/EMG. At this point, the signal will be toggled.
Fig. 2: Overall Communication System
Implementation
Analog to Digital Converter and Communication Protocol
The ECG/EMG device will provide 2 analog channels having range of 0-3 volts and frequency varying from 1 to 100 Hz. There are 7 analog to digital channels available on the Freescale development board. Each capable of doing conversion at 10 bit resolution of voltage varying from 0 to 3 volts. The signal from ECG/EMG device was converted into digital form using 2 of the analog to digital channels on the Freescale board. This signal was then transmitted to another Freescale board. For this particular process, in order to avoid aliasing, we have to have sampling rate that is more then double the maximum frequency range. So just to be on the safe side, the sampling frequency was selected to be at 300 samples per second.
The digital data converted from the analog to digital converter is encoded in a packet in a unique way as shown in Figure 3. As shown in the Figure, character ‘X’ represents channel 1 and ‘Y’ represents channel 2. The 2 byte character after ‘X’ represents the 10 bit of analog data coded in 16 bits. The last 6 bits are unused. And similarly, 2 byte character after ‘Y’ represents the data from channel 2. In presence of multiple devices, this type of protocol will be very efficient.
As shown in the Figure (3), character ‘X’ represents channel 1 and ‘Y’ represents channel 2. The 2 byte character after ‘X’ represents the 10 bit of analog data coded in 16 bits.
Fig. 3: Transmit Protocol from Medical Device to UII
The last 6 bits are unused. And similarly, 2 byte character after ‘Y’ represents the data from channel 2. In presence of multiple devices, this type of protocol will be very efficient. If for example, a scale need to work concurrently with the ECG/EMG device, then wireless communication board attached to scale can be programmed to send ‘A’ and followed by the data packet. This will enable the wireless communication board attached to the CerfCube to know from which device is the data coming from. Similarly, if the Freescale board connected to the black box wants to send some data to the ECG/EMG device, it can send in a packet coded as shown in the diagram below:
Fig. 4: Receive Protocol from UII to Medical Device
Just as before, ‘x’ represents information for channel 1 and ‘y’ represents for channel 2. In this case, lowercased letters were used to indicate information is sent by the CerfCube Freescale board to the medical device Freescale board. And hence, the device wireless board is the only program to listen to broadcasted information only directed to them.
The wireless board attached to the CerfCube is a universal listener. It will listen to information send to it and check if the data is in correct format. Once it does that, it will transfer it to the CerfCube via built in RS-232 port.
Software organization
Fig. 5a: Zigbee Transmitting Software Flow Diagram
Fig. 5b: Zigbee Receiving Software Flow Diagram
The software on the Freescale boards is programmed in the way that it can be used as the transmitter for the medical devices or receiver for the CerfCube. If one of these boards is to be used as transmitter, it needs to be reset while pressing any one of the 4 push buttons on the Freescale boards. This will tell it to go to the transmitter loop. And as default, if a pushbutton is not pressed, the board will act as a receiver on the CerfCube side.
Medical Device Side Software
The Freescale board for the ECG/EMG device side will go in a infinite loop where it will read the data from the two analog to digital converters, encode it in a way that the CerfCube board can understand what the data is and where it is coming from. There after, the receiver is turned off so the transmitter can send the data to the CerfCube. And once that is done, the receiver is turned on to accept commands from the CerfCube as per which digital lines need to be turned on and off for ECG/EMG device to select proper channels. This process is shown in Figure (5a). When the wireless board sends the string ‘xcym’, the program gets interrupt and raises a flag. This flag is then handled inside a code where it decodes the messages just translated to send a request to channel 1 to send the ECG signal and channel 2 to send the EMG signal. This is done by raising digital output line, which represents channel 1, to high and dropping the output line, which represents channel 2, to low. Once this command is carried out, the program goes back to its regular routing where it gets that data from the ECG/EMG device and transmits it to the other device.
CerfCube Side Software
For this program, the CerfCube Freescale board’s main task was to receive data and send it to the CerfCube. Hence, this board was programmed to be in the receive mode and once it received something, it causes an interrupt. It would send all the information to the RS-232 port via UART in the same way it received (Figure 3). When a data packet is received in the wireless receiver buffer, it generates an interrupt. It takes just 1.16 milliseconds to handle this interrupt, check for the valid data and send it to the RS-232. This process is described in Figure (5b).
Figure (6) and shows the oscilloscope reading that confirms the sampling rate at 330 Hz. A doctor or a health care provider could also be able to switch between what they want to see on channel 1 and channel 2. The CerfCube is programmed in a way that when a doctor selects to view channel 1 as ECG signal and channel 2 as EMG, it will send a data packets which are 4 bytes wide to the Freescale board connected to it via the RS-232.
Fig. 6: 1/Delta X shows the Sampling Frequency
These data packets are in the same form shown in Figure (4). Once this data is send to the UART, it generates an interrupt, goes to transmit mode and sends the same data packet and then returns back to the receive mode. This entire process takes 1.02 milliseconds.
Setting up the CerfCube
The CerfCube is a server that runs Embedded Linux. It is running a web server called Boa which hosts a website that is viewed by a doctor. The Freescale boards are connected to the CerfCube via the RS-232 port which receives the medical data from the devices and sends the commands to the medical devices. This is done using a CGI script running in near real-time when a call is made through the website. The CerfCube hosts an html website which takes the user to screen shown in Figure (10). When the view button is clicked after selecting the required signals on particular channels, the CerfCube sends parameters and runs a CGI script which writes the command needed to be sent to medical devices on the RS-232 port. Once this is done, it starts receiving all the information from the medical device. Five seconds worth of this information is stored in an array which is there after passed to a java script. The java script, which will run on the client side, will take these points received from both the channels and then plot them as shown in Figure (11). The CGI script is written in such a way that it will plot five seconds worth of data points as it refreshes every five seconds. The CGI script is also programmed to have a start and a stop button on the website. A doctor can choose to stop the refresh and view the received data and start it when ever he/she wishes. Figure (9) shows how this module works.