Activity Monitoring System for Independent Elderly Living

Some elderly people prefer to live independently and not in group settings, such as nursing homes. As age increases, health risks for independent living increase, including incapacitation. The longer one remains in an incapacitated state before being detected and receiving help, the higher the risk of permanent impairment or death. Systems that monitor activity within a residence may allow an elderly person to live independently, since the system would detect a lack of activity and would make alerts for help to arrive if one were to enter an incapacitated state. The objectives of this project were to develop and test modules of an activity monitoring system for a bathroom, the toiletry restroom of a residence. Prototype modules have been developed based on a Raspberry Pi, sensors for motion, contact switches to determine opening and closing of doors and cabinets, water valve sensors, and a temperature and humidity sensor. LEDs in the prototype serve the role of alerts or actuators, to be developed further. The prototype system did read from each sensor and controlled LEDs that modeled actuators. The received data was stored in Google Spreadsheet with data presented in graphs. The system shows promise but further development and testing are required toward application.


INTRODUCTION
Many older people live alone.With aging, risk of becoming incapacitated progressively increases, such as due to falling, stroke, heart attack, neurological condition, muscle weakness, illness or even severe depression [1].Morbidity increases if the state of incapacitation is not detected and treated by others.In spite of this progressively risky condition, elderly people value living independently and prefer to delay moving into group settings, like nursing homes, for as long as possible [2].The incidence of this dilemma of wanting to live independently in spite of progressive risk of becoming incapacitated as one ages is expected to increase due to the aging demographics.
Caregivers traditionally address this problem by methods of regularly "checking in" with the older person who lives alone.Such casual methods of checking in have many benefits, but may be unclear on which events are urgent.For example, an unanswered phone call could have resulted from many situations, some benign and others of high urgency.An automated system that continually monitors activity and reports prolonged periods of low activity may improve timely detection of incapacitation.However, systems to monitor activity have cost, may disrupt the living space and may be considered an invasion of privacy [3].Selection of the methods to monitor activity and placement of the devices would affect the level of function and acceptance of the system.
The sensor design could try to capture all human activity in every location of a residence, but that would increase cost and complexity.Specific tasks that a functional person does routinely on at least a daily basis could be the ones selected to be monitored [4].Neither a living room nor bedroom is essential since people have been known to be awake or sleep in either one and avoid the other for periods lasting longer than a day.A kitchen would seem more essential, but a person might eat preserved snack food and not enter the kitchen for more than a day.The bathroom or toiletry restroom of a residence could be the most essential place where a functioning person would use at least on a daily basis.The bathroom may also be a place with higher risk of certain factors that could lead to incapacitation, such as falling due to wet surfaces, cutting oneself due to grooming, or a stress induced heart or neural conditions [2].
Sensors in a bathroom that would reflect human activity might be contact sensors to detect opening or closing actions on the door, drawers or cabinets.Contact sensors could also be positioned to detect turning of valves, such as water for sink, tub or shower, or for flushing the toilet.Proximity sensors could be used to detect human movement as one enters or moves within the bathroom [5].Activities may also affect the temperature and humidity in the room, such as usage of hot water for tub or shower.Sensors for temperature and humidity could be used to detect these changes.Changes in the values of such sensors could be utilized to reflect human activity occurring in the room.
Based on this sensor feedback, a microcomputer, acting as the hub of the system, could process sensor data to determine whether or not the person using the bathroom is in need of assistance.This data would be displayed via a website, which would be hosted by the microcomputer for both remote and local access.Health care professionals and caregivers could access this website to check for irregular behavior, especially prolonged periods of no activity [4].
The objectives of this project were to design, assemble, and test modules of a monitoring system based on multiple sensor feedback toward improving the safety of senior citizens in a bathroom setting.Once the system modules are functioning, usage data could be collected over time and used for analysis to characterize normal activity patterns from abnormal, especially patterns that might indicate potential states of incapacitation.The ability to discretely monitor an elderly person would allow them to maintain their independence, dignity, and most importantly, their safety [6].The proposed activity monitor has the potential to enable more independent living with lower risk during a period of aging.

MATERIALS AND METHODS
As shown in the system block diagram in Figure 1, the activity monitoring system receives information from several different types of sensors.For the prototype, the target room to monitor human activity was the bathroom, the toiletry restroom of a residence.The microcomputer functions as the central processing hub.A Raspberry Pi (Raspberry Pi Foundation, Cambridgeshire, UK) was utilized in the prototype for the microcomputer.A humidity and temperature sensor would be placed near the shower or tub.For the prototype, these were measured by a combination humidity and temperature sensor DHT22 (SMK Electronics, Chula Vista, CA).Multiple motion detection sensors would be placed to detect human movement, such as by the door, sink, toilet, shower and tub.The prototype utilized passive infrared sensor PIR HC-SR501 (Bayite, Shenzhen, China) to detect motion.Opening and closing of doors, drawers, cabinets and valves would be done by contact switches.These would serve the purpose of determining whether the individual has entered or exited the area or ran water.The prototype utilized magnetic reed switches 8061 (Directed Electronics, Vista, CA).The microcomputer processed the collected data and exported the information to a web interface which, would be viewable from several web enabled devices.These devices include smart phones, laptops, and desktop computers, as well as a wall mounted LCD display which would attach directly to the microcomputer.The wall mounted display would be useful in settings like assisted living facilities, where staff may routinely walk by but not enter a residence.The webpage was hosted by the microcomputer, and was made available both locally and remotely through the use of Dynamic Hosting Services.The Raspberry Pi serves as a server, which hosted a website that displayed processed sensor feedback to multiple clients.Utilizing HTML, JavaScript, Python, and PHP, the website provided a portal for web clients to connect and view a graphical user interface displaying the sensor feedback.The data was stored in Google Spreadsheets and was automatically organized into graphs, accessible over the web.Medical professionals and caregivers could view this webpage to observe the level of activity.
In the case of observing a prolonged period of inactivity that might indicate a condition of incapacitation, the microcomputer would send out an alert to the appropriate caregivers or medical staff.
The passive infrared sensor module was tested to assess ability to detect human movement.The sensor output was recorded by an oscilloscope.The test objective was to observe how the Raspberry Pi would receive the sensor's feedback in response to motion detection and inactivity.The Raspberry Pi supplied the 5V necessary to power the sensor and was expected to receive a high voltage upon motion detection.When generating the test, defining time intervals to create a clear distinction between the sensor feedback during motion detection and during inactivity yielded clear results.For ten seconds, a human subject would walk in front of the sensor within detection range.Ten seconds of walking activity would be followed with ten seconds of inactivity.The test was concluded after sixty seconds of alternating between walking and inactivity.
The recorded data needed to the stored for analysis and display, such as accessible on the web.The Google Chart API was utilized to store and generate three different graph types, one for each sensor type.Each sensor provided data that needed to be processed by the Raspberry Pi to have a consistent format.Google Scripts was utilized for data manipulation within Google Spreadsheet.Once the data was processed, graphs were generated within Google Spreadsheet.The graphs were linked to each interface, and auto-updated as new data was collected.

RESULTS
The passive infrared sensor module was tested with results shown in Fig. 2. The alternating 10-second periods of walking activity and inactivity were distinguishable in the graphs.The periods of inactivity are demonstrated by a low voltage output (~0 V) from the sensor.When the sensor detected movement, the voltage output rose to ~3.3 volts.The first ten seconds of the plot shows no motion being detected within the range of the sensor (Fig. 2).The following ten seconds displays a high value when walking activity occurred.Over the sixty second testing period, three cycles of walking motion were recorded.Aspects of the website are displayed in Figures 3-6.The data were stored and presented on the web so that accessible to caregivers.
Figure 3 shows the web display from the temperature and humidity sensor.The webpage featured a status indicator and three live-updating gauges.The status indicator showed whether the sensor was connected and was receiving a high voltage across the data pin.If the status returned low, the indicator become gray.This was intended to notify the user if the sensor became damaged or disconnected.Three instrument gauges displayed the most recently recorded temperature in Celsius and Fahrenheit, as well as the humidity percentage.
The changes in temperature and humidity over time was shown on the web by a graph automatically generated by Google Spreadsheet (Figure 4).This graph was interactive, allowing the user to select data for further information.The graph plotted humidity percentage and temperature (Celsius) from a database hosted within a Google Spreadsheet.The graph refreshed with new sensor data every few minutes.The user could adjust the range of the timeline using a slider at the bottom of the graph to highlight any point of the graph to see the exact time and sensor values collected.While this added a great deal of interactivity, the graph relies on the Flash Player plug-in, which would limit client compatibility.For the sake of demonstration, this specific graph type was used, but an alternative graph type could be implemented to increase compatibility across all client devices.Figure 5 shows data on the web interface for the PIR Motion Sensor.The webpage features two status indicators and a basic scatterplot chart.The first status indicator illuminated yellow when a high signal is sent from the data pin of the sensor, indicating an instance of motion detection.When motion was not detected, the indicator become gray to specify inactivity.The second indicator showed whether the sensor was connected and receiving a high voltage from the power input pin.The indicator turned gray when a low signal was detected.This was intended to inform the user that the sensor may have become damaged or disconnected.The graph displayed a history of when motion was detected.This graph was interactive, as the user could highlight specific data points to view information about each detection instance.Client accessibility for this graph was not limited by the Flash Player plug-in for operation.Consequently, the data could be viewed on nearly any client device.

DISCUSSION
Further testing with the sensor modules needs to be done.This includes developing Python scripts to ensure proper operation, as well as further HTML, JavaScript, and PHP scripting to add each type of sensor to the hosted website interface.Each type of sensor has an individual Python script that tests the functioning of the respective module.The script runs from a Linux terminal interface, returning either data, in regard to the humidity and temperature sensor, or a high or low voltage.For the magnetic reed switch, the Python script logic has the Raspberry Pi waiting for the switch to close, grounding the circuit to a low state.
While the Raspberry Pi otherwise read a high signal from an open circuit, a light emitting diode (LED) illuminated to indicate that the door was open.A message and timestamp display in console could be developed to enter a database within the website for metrics logging.This would support ability of enacting responses to sensor feedback.If the Raspberry Pi read a low signal from the magnetic reed switch, it would determine that the reed switch was making contact, such that the door or faucet was closed.The LED was turned off and a timestamp and message was printed to terminal informing the user that the switch is now closed.
The humidity and temperature sensor used a Python script that continually attempted to obtain sensor readings in order to display temperature value, humidity percentage, and a timestamp on the console.The web interface for each sensor needs further development.
Once the sensor modules and recording of data become functional, activity in a bathroom could be recorded and analyzed to determine how to characterize the different states.Machine learning would be one way to characterize the activity.Normal activity patterns in the bathroom need to be distinguished from patterns that may indicate an incapacitated state.When a potential incapacitated state is detected alarms would need to be issued and sent to the appropriate caregivers and medical staff.
The design and early testing of the prototype modules appears to show promise.Further development and testing is required prior to potential testing in a room arrangement.Other extensions of the system could be useful, such as wireless sensors to simplify placement.A microphone could be added to detect audio spikes that reflect human activity, such as a fall or call for help.Adding a speaker that could alert the user that a fall has been detected and that help is on the way could promote a less stressful user experience.The speaker could also be utilized in debugging and testing the system in a similar method to the LED.Another feature that could benefit the system would be the integration of a mobile application to view the website interface.Although nearly all clients can access the Raspberry Pi's web server, a mobile application holds potential to improve the user experience.
Finally, further development in terms of an artificial intelligence to increase accuracy of fall detections would greatly benefit the effectiveness of the system.

Figure 1 :
Figure 1: System Block Diagram of the Prototype System.

Figure 3 :
Figure 3: Web display dials indicators to show current values of temperature and humidity.

Figure 4 :
Figure 4: Web display graph to show the recorded changes in temperature and humidity over time.Graph automatically generated by Google Spreadsheet based on data values recorded and stored from the Raspberry Pi.

Figure 5 :
Figure 5: Web display graph to show occurrences of motion detection over time.Graph automatically generated by Google Spreadsheet based on data values recorded and stored from the Raspberry Pi.

Figure 6
Figure 6 shows closed and open signals from a magnetic reed contact switch.The interface featured two status indicators and a stepped area chart.The first indicator illuminated a green box with white text when the magnet was disconnected, informing the user that the switch was open.This would typically indicate that a door was open or a faucet was dispensing water.When the magnet returned to the reed switch, the second indicator's background would turn green with white text, indicating that the switch was closed.The first indicator background turned white to streamline the user interface by only displaying one indicator at a time.The stepped area chart displayed the previously recorded statuses of the reed switch.This graph was interactive, as the user could highlight specific data points to view information from each time the sensor reported data.

Figure 6 :
Figure 6: Web display graph to show occurrences of a contact switch being open or closed over time.Graph automatically generated by Google Spreadsheet based on data values recorded and stored from the Raspberry Pi.