//Logo Image
Author: Che-Chang Yang (2006-08-27); recommended: Yeh-Liang Hsu (2006-09-01).
Note: This article is Chapter 6 of Che-Chang Yang’s Master thesis “Development of a Portable System for Physical Activity Assessment in a Home Environment.”

Chapter 6. System integration and testing

This chapter describes the system integration and the PC-user interface program. The results of the long-term test are also presented.

6.1     System integration

6.1.1 Protocol of data address in wireless transmission

In the stage of the DAU, after a still posture or dynamic activity has been identified by the algorithm, that identified event is encoded into a binary sequence according to the bit code assignment listed in Table 6.1. The encoded event is then transmitted. When a transmitted event is received by the DDS, it is decoded into the original binary sequence. The corresponding number of that event is finally written in the MMC.

In the bit code assignment of the binary sequence, the first bit D0 registered as “1” and “0” in turn is a check bit for cyclic data transmission. Bit D0 is changed in turn either from 1 to 0 or from 0 to 1 in every one-by-one data transmission. This mechanism is to recognize whether the currently received data is the latest and updated. Therefore, the DDS will decode the received data if its bit D0 in the binary sequence differs from the previous one.

The bit D1 is for recognizing movement intensity. D1 will be assigned “1” for the slower movements or transitions, and “0” for normal or fast cases. The four bits D2 to D5 are assigned for event data address. For example, “0010” stands for “lying still”, and “0100” for “standing still”, and so forth. As a result, a binary sequence, e.g., addressed as “10101” for bit D1 to D5 represents a “slow-paced walking movement”.

Table 6.1 Bit code assignment for the binary sequence

Event

No.

D0

D1

D2

D3

D4

D5

 

 

Check

Intensity

Event

Lying still

1

 

 

0

0

1

0

Sitting still

2

 

 

0

0

1

1

Standing still

3

 

 

0

1

0

0

Walking

4

 

 

0

1

0

1

Sit-to-stand

5

 

 

0

1

1

0

Stand-to-sit

6

 

 

0

1

1

1

Lie-to-sit

7

 

 

1

0

0

0

Sit-to-lie

8

 

 

1

0

0

1

Possible fall

9

 

 

1

0

1

0

6.1.2 Functional procedure integration of the DAU

The algorithm developed for posture and activity identification was described at length in Chapter 5. Figure 6.1 shows the flowchart of the recursive functional procedure in the DAU, which integrates the algorithm and wireless data transmission control. The sections inside the dashed-lined block represent the process of the algorithm as described previously in Chapter 5. When the DAU is on, the primary sampling in 0.5s interval is initiated to detect whether any dynamic action occurs. If a dynamic action is detected, the secondary sampling in 2.0s is immediately activated to collect the remaining data. The data collected in both processes are combined for the following posture and activity identification in the algorithm.

As for the wireless data transmission control, transmission is enabled (TE=on) after a posture or activity has been identified. As described in Chapter 4, the TE time should be at least 500ms to 800ms. However, it is impossible for the procedure to transmit the data alone which causes significant interruption for recursive movement detection. Therefore, each identified event is transmitted in the period of one of the two data sampling stages simultaneously in the next cycle. Note that when the DAU is on and runs the data sampling stage, the transmission is initially disabled (TE=off) because there is no identified event. In addition, transmission is not enabled to transmit each still posture identified and classified by the primary stage for the reason that the primary sampling time is too short for TE. Instead, transmission is enabled in every 6 cycles to transmit the 6nth identified event in the primary sampling stage.

Figure 6.1 Flowchart of the functional procedure in the DAU 

6.1.3 Data storage format and scheme

At the stage of DDS, event data received is saved in a text file whose filename is given as current date (year+month+day). For example, the text file “060605.txt” is created to store the event data received on June 5th, 2006. In other words, any event data acquired within a day is stored in the same text file.

The events received are first buffered in the RAM of the PIC microcontroller until 30 events have been received, and they are then written to the MMC. The real-time clock information (hour and minute) which corresponds to the first received event in the buffered data is also recorded in each MMC data writing process. Table 6.2 shows the format of data recorded in the text file, and Figure 6.2 shows an example of the stored data in a text file. Each number in a row is partitioned across a Tab space such that this text file can be easily edited in Microsoft Excel software. Note that for the situation of discontinuous uses of the DAU in one day, the DDS will not overwrite the previous stored data in the text file.

  Table 6.2 Data registration format

Event No.

(Tab Space)

Slow

(Tab Space)

Hour

:

minute

2

1

1

4

3

5

3

 

 

 

 

 

Figure 6.2 Example of the stored event data in a text file

6.2     PC browser and program design for data management

The data stored in the DDS can be accessed by either an Internet browser or a dedicated VB program on a client PC. Users can also directly access to the DDS to read the real-time data using an Internet browser as shown in the Figure 6.3. In the Internet browsers in figure 6.3, a series of numbers which represent the sum for each event are listed. The webpage refreshes every 2 seconds. This interface provides brief information of real-time acquired event data for the users without any dedicated software.

Figure 6.3 IE browser interface

Complete data management can be achieved by using dedicated PC-based programs. Figure 6.4 shows the interface of the PC program for this system developed in Microsoft Visual Basic. The program features the following fundamental functions:

l          Remote data access capability: The authorized users (e.g., the system administrator, care-giver or families) are allowed to access to the DDS and retrieve the data stored in it through TCP communication.

l          Real-time monitoring information: The real-time monitoring information (still posture or dynamic activity) is displayed on this interface.

l          Recorded data display: The daily recorded data can be chronologically displayed to show the overall activity distribution. As shown in the Figure 6.5, rests and activities can be distinguished. They are also classified and given quantitative results, such as the numbers, percentages of those events in the data. All the related information can be saved to an Excel file (*.xls).

l          Event-driven function: The DDS can be optionally equipped with a GSM module to provide event-driven capability. When this function is enabled by the user, the DDS is able to actively send a cell phone text message to a user-specified person when a possible fall has been detected.

Figure 6.4 PC program interface

As shown in Figure 6.4, this program displays real-time status automatically when both the IP address and its port (default: 83) of the DDS are assigned. The text message of the real-time event is displayed in the column of “Real-Time Status” on this interface. To download the recorded data, the user must specify the respective date. When clicking the “Download” button, a user authorization password is required to request the data from the DDS for the fist time. Data cannot be retrieved if the user fails to pass the authorization.

Raw data retrieved for one specific date is displayed in the textbox “Data Preview” in the data format shown in Figure 6.2. This allows the users to quickly preview the entire recorded events. An “EOF” message is marked at the end of the data sequence when the entire data set has been successfully downloaded.

After data retrieval, the user can click the “Result” button to display statistical results of the retrieved data as shown in the Figure 6.5. The amounts of the total events and the estimated time under monitoring are shown. The amounts of the still postures and dynamic activities as well as both percentages are shown, respectively. Moreover, the amounts of the still postures as well as the amounts of dynamic posture transitions and walking are also shown. From the total amount, the percentage of time spent for each event (sitting still plus lying still, standing still, sit-stand transitions, lie-sit transitions and walking) are shown. The values shown indicate sufficient information about the activity distribution of a person under monitoring. Note that when users click the “Result” button, the raw data and all the statistical results are also saved to an Excel file. The user can further click the “Open Excel file” button to open the data via Excel software if the user needs to edit the data in detail.

In addition, the event-driven function is optionally available in the program. The system will actively send a text message to a specified cell phone when specific situations are detected; for example, when a fall event has been detected. To activate this function, click the “Yes” button in the “Phone message” block, and then the user is allowed to give the phone number that the message is sent to. “Enabled” or “Disabled” is shown in the box after “SMS Mode” to indicate whether this function is activated.

Figure 6.5 Display of the statistical results of retrieved data

6.3     A test of long-term daily monitoring

Figure 6.6 shows an example of a subject’s long-term monitoring data in a day at home. In this test, the system began to record data at about 1:00 and ended at about 16:00. In the home environment, the user (subject) is not expected to use this system continuously throughout the monitoring period during some situations such as taking a shower, going outside, etc. Therefore, the data recorded may not be continuous, and the actual monitoring time in this test is about 405 minutes. That is, about 6.75 hours within the 15-hour period is recorded.

According to the statistical results shown in Figure 6.6, more than 90% of the recorded events are still postures. Moreover, lying still postures occupy about 61% of total recorded events. Figure 6.7 is the activity chronograph which chronologically displays the recorded events in detail. It can be observed that the subject was mostly in the “lying still” (event number 1) posture from 4:00 to 9:00, which indicates that the subject was probably sleeping during that period. In addition, the subject had large numbers of “sitting still” (event number 2) postures from about 9:00 to 13:00. After 14:00, the subject performed many posture transitions and walking movements.

Figure 6.6 Example of statistical results of long-term recorded data

Figure 6.7 Activity Chronograph of the recorded data