T4 Wearable Physiological Sensors
From SoftwarePractice.org
Introduction
" The medical profession are interested in a wearable device that can measure and record physiological parameters of the human body. They hope that data collected in this way can be useful for medical diagnosis and provide clues to a person's physiological state over time. "
This page aims to document the design and implementation of the said topic. Team 4 will be developing a prototype over the semester and will continually add to the page as the project unfolds.
Members of Team 4
- Kim Huynh
- Albert Ong
- Davor Pankovic
- Andrew Tran
Problem Statement and Analysis
Medical monitoring systems are important for diagnosis and treatment of patients suffering from illness/injury. However, many monitoring systems are large and heavy, limiting patients from doing everyday activities. Others are just time consuming as they can only measure one thing at a time.
Our objective is to design a system that is a wearable, light weight, compact and user-friendly medical monitoring device to measure the wearer's pulse rate, galvanic skin response, and skin temperature and display this information as useful graphs. It will store these measurements and be able to transfer the data to another device via a USB link and accessed as a hierarchy of folders and files. It will be user-friendly by having only the necessary information and features displayed as well as having easily accessible buttons to make selections. A clock will also be used to help keep track of the duration of use. A touch screen will be used to select each button so that no button is accidentally pushed due to unwanted contact from hard surfaces (e.g. bumping into a wall). Also, our system will enable the user to store his/her profile as their name so the files transferred to another device is meaningful.
Analysis
Stakeholders
There are three primary stakeholders:
- Customers - This includes medical practitioners, patients, athletes, and the general public.
- The engineers who designed the device - Team 4.
- The manufacturers of the device's hardware.
Requirements
The device will need to be able to provide the following:
- Be strapped to the user's wrist
- Must have dimensions of 7cm x 5cm x 0.5cm
- Provide data readings of skin temperature, pulse rate and galvanic skin response (GSR)
- Display dynamically updated graphs of sensor readings on a GUI
- Data readings need to be time stamped and saved to file
- The file is transferable to an external device
- Be able to retrieve historical data and display selected time frames of data
- Be able to accept user entered information about themselves
Usage Scenarios
- Greg goes to the doctor feeling unwell. The doctor wishes to measure Greg's vital signs to help determine an accurate diagnosis in a short period of time. The doctor straps the device onto the patient and observes and saves the readings in the patient's folder on his computer. The doctor determines the diagnosis and provides Greg instructions on how to get better. Greg then leaves the doctor's office knowing what to do and feeling safe that he had received an accurate diagnosis.
- Wendy has a severe cold and has been asked to wear the device for a week to determine the healing rate of her condition. After a week, Wendy returns to the doctor, who observes the graphs that show her vital signs to be reaching normal towards the end of the week. The doctor assures that Wendy is getting better and that she may take a day off school to recover completely.
- Amy has purchased the device and wishes to observe readings to help maintain her health. She wears it as she exercises and monitors how quickly her vital signs get back to normal each time over a month of regular exercise.
Use Cases
UC001 - Starting up the Device for the first time
Actors User
Pre-conditions Device is off and never been used
Main Path 1. User holds onto the 'power' button.
2. Device displays screen for user to enter their name.
3. User enters his name "John".
4. Device displays each character after user selection.
5. User selects the 'OK' button.
6. Device displays screen for user to set the time.
7. User inputs the current time and clicks OK.
8. Device displays 'Home' menu with current time.
Alternative Path(s)
Post-conditions 1. User name is stored in device memory.
2. Time is stored in device memory.
CRC Cards
Class Diagram
Initial Class Diagram
Final Class Diagram
Sequence Diagrams
SD01 - Startup
The user starts up the system by pushing the power button located on the physical device. The main class WearablePortableSensor creates a new instance of the HomeScreen class and runs this in the main thread. The HomeScreen firstly creates the profile object to store the user profile. It then creates the DataWriter object which in turn creates the CSVWriter object that is responsible for the actual reading and writing of data to a text file.
The HomeScreen instance calls the getProfile() method of the DataWriter object which delegates the reading of the profile text file to CSVWriter. The HomeScreen instance then stores value received from the DataWriter object, regardless of its value, into the profile object.
SD02 - Set Clock
The user presses the button on the HomeScreen instance to display the screen responsible for configuring the time. HomeScreen then creates a new SetClockScreen object.
The user then sets the desired hour, minute, and second using the SetClockScreen GUI, however, not necessarily in that order (this is a limitation of sequence diagrams). The user confirms the time which results in the SetClockScreen GUI calling the setTime() method of the clock object in order the change the time to the one configured by the user.
SD03 - Set Profile
The user presses the button responsible for switching the GUI from the HomeScreen to the SetProfileScreen. This causes the HomeScreen GUI to create a new SetProfileScreen object. The SetProfileScreen GUI calls the getName() method from the profile object that was sent to the SetProfileScreen instance during construction.
The user is then able to enter his or her name using the buttons provided by the SetProfileScreen GUI. Once the user is done, he/she clicks on the confirmation button which results in the SetProfileScreen GUI calling the setName() method of profile to save the name entered by the user in memory.
The SetProfileScreen stores a persistent copy of the profile by calling the saveProfile() method of the DataWriter object, which delegates the actual writing of the profile to CSVWriter. Finally, the CSVWriter object overwrites the profile text file with the new profile name entered by the user.
SD04 - Show Graph for the first time
The user presses the button responsible for displaying the graph screen resulting in the HomeScreen GUI creating a new SelectGraphScreen instance which is stored as a reference in the former object. The SelectGraphScreen then retrieves the DataWriter object using the static getDataWriter() method in the DataWriter class.
SD05 - Select Graph
This sequence diagram assumes that the user is currently viewing the SelectGraphScreen GUI.
The user presses the pulse button to switch the currently displayed graph to the pulseGraph. This results in the SelectGraphScreen GUI calling an internal method changeGraph(). This method is used to switch between the different graphs.
SD06 - Record Pulse
This sequence diagram is generic for the recording of all the sensors (GSR, Pulse, and Temperature). The differences are:
1. pulseSensor object is replaced by the gsrSensor or temperatureSensor objects for GSR and Temperature respectively.
2. pulseGraph object is replaced by the gsrGraph or temperatureGraph for GSR and Temperature respectively.
This sequence diagram assumes that the currently displayed graph is the pulse graph. This is important as the record/stop button is context sensitive and dependent on which graph is currently being displayed.
The user starts the recording of his/her pulse by pressing the record button on the SelectGraphScreen GUI, which in turn calls the start() method of the pulseSensor object. The pulseSensor object notifies its observers (the dataWriter instance and the pulseGraph object) every time a new value is received.
Due to the indeterminate nature of threads and how the JVM switches between them, it is impossible to determine the exact sequence of events that occur in the loop (rectangular box) after the second notifyObservers() method.
When the pulseGraph receives the notification, it retrieves the last reading from pulseSensor using the getReading() method. It then plots this reading onto a chart using its internal method addNewData().
Similarly, when the DataWriter object receives the notification, it retrieves the last reading from pulseSensor using the getReading() method. It saves this to a persistent text file by calling the append() method in CSVWriter.
Source Repository
The SVN address for the source code is located at:
https://swordfish.eng.uts.edu.au/projects/ood08spr_04/svn
To access the source code via a web browser click on this link:
https://swordfish.eng.uts.edu.au/projects/ood08spr_04/svn/WearableSensor/
For instructions on how to configure the program using the Eclipse IDE, read these instructions. The file is called "WPS_Install_Guide.doc" and it is located under:
https://swordfish.eng.uts.edu.au/projects/ood08spr_04/svn/WearableSensor/doc/
Division of Work on Program Between Team Members
We planned to divide the program amongst the team members as follows:
- Andrew Tran - main menu, clock and profile
- Kim Huynh - Graphics to use in program and temperature graph
- Albert Ong - Pulse graph
- Davor Pankovic - GSR graph
Design Issues, Assumptions and Decisions
There are several issues that will affect the design of our system for the wearable sensors.
Firstly the fact that it will be wearable means that the physical size of the device will be an issue and directly affect how much information we will be able to display on any one screen. For this issue we will have to assume that the device will be worn by people of average size wrists (measured by the wrists of our group) and have therefore decided that our system will display information on a screen of approximately 5 cm x 3 cm.
Another issue relates to how the user will select options in our system (our system will implement a touch screen) while viewing graphs or menus. We have assumed that the device will not be used by extremely obese people (with abnormally large fingers) and have decided to make our system more user friendly by only have the essential amount of buttons on any screen so that as much information can be displayed and the buttons that are needed can be made larger and easily accessible.
The processing ability of the device will be another issue. Due to the small size of the device it will have limitations to how much data it can handle. This will limit the amount of features and functions that we can implement in our system. For this issue we have assumed that the sensors have already been taken into account and that we won't have to worry about how much data they provide or how much processing power needs to be contributed by them. We have also decided to only include the essential features and functions to minimize the chance that our system will become far too complex.
The size of storage on the device is also an issue. It will not have the capacity of a hard disk in a PC and so we will need to consider what data from our system will be kept. We have assumed that only data recorded by the device will be put into memory and that the user will not use the device for any other data storing. We have therefore decided that our system will only have the minimum amount of data types that require storing to avoid any potential problems with this issue.
These four issues where discovered before the start of the creation of our system but more may arise as we start to implement our system.
Sensors and Outputs of Sensors
Pulse Rate
Pulse, being a mechanical movement, needs to be recorded using mechanical means. It may be possible to use a mechanical button-like switch to send on-off signals to the processor to show each pulse, which can be counted in a period of time to calculate instantaneous pulse rates. However this is limited to the strength of the heart beat - if the beat is not strong enough, it will not trigger the switch.
Galvanic Skin Response (GSR)
GSR is normally a measure of conductivity of the skin, which has the ability to change from emotional stimulus.
This can be measured through the use of an ammeter or ohmeter on the skin itself.
We have also found a marketed device on the internet which monitors/records skin conductance [1]
Skin Temperature
Skin temperature can be measured using a thermistor and a ohmmeter. A thermistor is a heat senisitve resistor whose resistance changes based upon the amount of heat it is exposed to [2]. These resistors are sensitive, accurate, and cheap; making it suitable for the device.
To measure the change in resistance, a digital ohmmeter can be used to measure the changes in resistance and send its signal to the processor. The program we will develop can then calculate the temperature from a precalculated scale.
Design of User Interface
The design basically consists of these four main screens shown below. For more information click on T4 Development of GUI design.
Presentation of Draft Design
The following link contains the presentation slides used for our Milestone 1 Presentation: T4 MIlestone 1 Presentation Slides.
Program Design
We first aimed to build the program to suit functionalty before we started adding any visual asthetics.
We started with the design of the program, basing the button positions and sizes on our agreed GUI design.
We implemented our own images to get the final GUI design.
The buttons were redesigned to be easily recognisable from the grey background, to be appealing to the user, and to be large enough to be pressed on a touch-screen by most human fingers.
Resources and References
1. Bucknell University. "Temperature Sensor - The Thermistor". Bucknell University. viewed 2 November 2008. <http://www.facstaff.bucknell.edu/mastascu/elessonsHTML/Sensors/TempR.html>
2. Bonsor, Kevin. 17 July 2001. "How Lie Detectors Work." HowStuffWorks.com. viewed 01 November 2008. <http://people.howstuffworks.com/lie-detector.htm>
3. Advanced Medical Electronics Corporation. 2008. "Wearable Skin Conductance Monitor/Recorder". HF1 Revision 2.21, January 2008. AME Corp. viewed 2 November 2008. <http://www.ame-corp.com/HF1%20Sternal%20Skin%20Conductance%20Recorder.pdf>










