INTRODUCTION
The urgency of the subject
The elderly healthcare IoT system is a topic of great urgency due to the rapidly aging population of the world According to the World Health Organization, the number of people aged 65 and over is expected to reach 1.4 billion by 2030, and 2.1 billion by 2050 This means that there will be a growing need for healthcare solutions that can help to keep the elderly healthy and independent.
The IoT can play a vital role in meeting this need by providing a way to remotely monitor and track the health of the elderly This can help to identify potential problems early on, and can also provide peace of mind for families and caregivers.
There are a number of different IoT-based solutions that are currently being developed for elderly healthcare These include:
• Fall detection systems: These systems use sensors to detect when an elderly person has fallen, and can then send an alert to a caregiver or emergency services.
• Remote health monitoring systems: These systems use sensors to track the elderly person's vital signs, such as heart rate, blood pressure, and blood sugar levels This information can then be sent to a caregiver or doctor for review.
• Virtual care systems: These systems allow elderly people to have video or audio consultations with doctors or nurses from the comfort of their own homes This can help to reduce the need for in-person visits to hospitals or clinics.
The IoT has the potential to revolutionize elderly healthcare by making it more convenient, affordable, and accessible As the technology continues to develop, we can expect to see even more innovative solutions that can help to keep the elderly healthy and independent.
In addition to the benefits mentioned above, the IoT can also help to:
• Reduce the risk of loneliness and isolation: The elderly are at risk of loneliness and isolation, which can have a negative impact on their physical and mental health The IoT can help to connect the elderly with their families and friends, and can also provide access to social activities.
• Improve the quality of life: The IoT can help to improve the quality of life for the elderly
For example, the IoT can be used to provide reminders for medication, to order groceries, or to book appointments.
Overall, the IoT has the potential to make a significant contribution to elderly healthcare.
By providing innovative solutions that can help to keep the elderly healthy, independent,and connected, the IoT can help to improve the quality of life for millions of people around the world.
Scientific and practical significance of the topic
Currently, the elderly healthcare iodine system is being developed rapidly and is becoming more and more popular This system has the potential to revolutionize the way elderly people are cared for, helping them live safer, healthier and happier lives.
Here are some scientific and practical implications of the elderly healthcare iodine system:
• Scientific significance: The elderly health care iodine system can help us better understand the aging process and the factors that affect the health of the elderly From there, we can develop new, more effective health care methods for the elderly.
• Practical significance: The elderly health care iodine system can help reduce the burden on families and society in caring for the elderly The system can also help older people live safer, healthier and happier lives.
Research objectives of the topic
The research objectives of the topic IoT system for healthcare of the elderly are:
• Develop an IoT system that can effectively and cost-effectively monitor and care for the elderly's health.
• Enhance safety and quality of life for the elderly.
• Reducing the burden on families and society in caring for the elderly.
Object and scope of the study
The research scope of the topic includes the development of an IoT system that can effectively and cost-effectively monitor and care for the elderly's health This IoT system will be used to monitor the health indicators of the elderly, detect danger signs early, send alerts to relatives or medical staff when the elderly have problems, provide providing telehealth services,
Research Methods
The methodological basis of the topic IoT system for elderly healthcare is a combination of scientific research methods, including:
• Theoretical research: This is the process of understanding and synthesizing knowledge about IoT, healthcare for the elderly and related fields.
• Case Study: This is the process of collecting and analyzing real data on the healthcare needs of the elderly, existing IoT solutions, and challenges to be addressed.
• Research and Development: This is the process of developing a new IoT system that can meet the healthcare needs of the elderly.
Here are some specific research methods that can be used in the study of the elderly healthcare IoT system:
• Document study: This is the process of understanding and synthesizing knowledge about IoT, elderly health care and related fields Documents can include books, articles, research reports, etc.
• Experiment: This is the process of performing an experiment to test the effectiveness of the IoT system to take care of the elderly Experiments can be performed with elderly people or with elderly models.
• Data Analysis: This is the process of analyzing data collected from different research methods Data analytics can help identify the healthcare needs of older people, existing IoT solutions, and challenges to be addressed.
The project is divided into 6 chapters Chapter 2 provides an overview of the project, including its goals, objectives, and scope Chapter 3 discusses the theoretical foundations that were used in the project Chapter 4 outlines the requirements of the project and the solutions that were implemented to meet those requirements Chapter 5 describes the process of implementing the project Chapter 6 presents the experimental parameters that were obtained after the project was completed.
The elderly healthcare IoT system is a system that uses Internet-connected devices to monitor and care for the elderly's health This system can be used to monitor the health indicators of the elderly, detect early signs of danger, send alerts to relatives or medical staff when the elderly have problems, provide providing telehealth services,
The research object of the topic IoT system to care for the elderly's health is the elderly who have a need for home health care The research scope of the topic includes the development of an IoT system that can effectively and cost-effectively monitor and care for the elderly's health This IoT system will be used to monitor the health indicators of the elderly, detect danger signs early, send alerts to relatives or medical staff when the elderly have problems,provide providing telehealth services,
System characteristics
Here are some characteristics of the elderly healthcare IoT system:
• Flexibility: The elderly healthcare IoT system can be customized to fit the needs of each elderly person For example, the system can be used to monitor various health indicators, such as heart rate, blood pressure, blood sugar, etc The system can also be used to provide care services different health, such as medical advice, treatment support,
• Convenience: The elderly healthcare IoT system can be used remotely, helping the elderly to receive health care anytime, anywhere The system can also be used to connect older people with family and friends, helping them feel loved and cared for.
• Efficiency: Elderly healthcare IoT systems can help reduce healthcare costs for the elderly The system can help detect danger signs early, helping to prevent illnesses and hospitalizations The system can also help older people live more independently and confidently.
Structure of the system
Here are some key components of the elderly healthcare IoT system:
• Sensors: Sensors are devices used to collect data about the health of the elderly Sensor devices can include heart rate monitors, blood pressure monitors, blood glucose meters,etc.
• Transport network: A transport network is a system used to transmit data from sensor devices to the data center The transmission network can be a wired network or a wireless network.
• Data Center: A data center is a place to store and process data from sensor devices The data center can be used to monitor the health of the elderly, detect danger signs early, send alerts to relatives or medical staff when the elderly have problems, provide telehealth services,
• Mobile Application: A mobile application is an application used to access and view data from a data center The mobile application can be used by the elderly, relatives of the elderly and medical staff.
Research related to the topic
Here are some researches related to the topic of IoT systems for elderly healthcare:
• Health DL-A large medical data collection and storage system by the authors Phan Tan, Tran Viet Trung, Nguyen Huu Duc, Nguyen Thanh Tung (2017).
• Chatbot technique applying an expert system for automatic disease diagnosis by author Nguyen Thi Bich Diep, (2019).
• Application of artificial intelligence to localize organs in radiotherapy by authors Tran
Sy Hung, Nguyen Thu Ha, Vu Trung Hung (2020).
• User experience design solution based on UCDC model for E-doctor electronic medical application by author Tran Quoc Trung (2020).
• The topic Results of robotic surgery in cancer rectal cancer and prostate cancer conducted by Binh Dan Hospital, accepted in May 2021 Evaluated as a valuable research work, from the background of the topic, Binh Dan Hospital will continue to deploy and replicate the process of using robots in many digestive diseases (such as colon cancer, cancer, etc.) stomach cancer, esophageal cancer) and urology, thoracic, ,contributing to improving the capacity of surgery to treat cancer patients in the city.
The limitations of the system
The elderly healthcare IoT system also has some limitations, including:
• Cost: Elderly healthcare IoT systems can be quite expensive, especially for seniors with special healthcare needs.
• Privacy: Elderly healthcare IoT systems can collect large amounts of personal data about older people, which can make them worry about their privacy.
• Availability: Elderly healthcare IoT systems may not be available in all areas, especially in areas with poor Internet connectivity.
Despite some limitations, the elderly healthcare IoT system is still a potential solution that can help improve the quality of life of the elderly With the development of technology, the limitations of the elderly healthcare IoT system will be solved and this system will become more popular in the future.
LITERATURE REVIEW
Internet of things IOT
The Internet of Things (IoT) is a system of interrelated devices connected to a network and/or to one another, exchanging data without necessarily requiring human-to-machine interaction In other words, IoT is a collection of electronic devices that can share information among themselves Examples include smart factories, smart home devices, medical monitoring devices, wearable fitness trackers, smart city infrastructures, and vehicular telematics.
The Internet of Things can be used in many different aspects of life, in both the private and public sectors Thanks to IoT, people can track things like lost pets, their house’s security systems, or appliance maintenance schedules.
Consumers can use the IoT to help them make restaurant reservations, monitor their exercise progress and overall health, and receive coupons for a store only by virtue of walking by the business in question.
Businesses can use IoT to monitor supply chains, track customers’ spending habits as well collect their feedback, monitor and maintain inventory levels, and engage in predictive maintenance of their machines and devices.
The IoT also proves helpful in ITIL, which is a set of IT service management, an important detail, since IT departments are called on to do more and more in a world that’s getting increasingly digital, with more reliance on wireless networks.
Blockchain, which is being increasingly used as a more efficient and secure method of transaction and data processing, is a natural beneficiary of IoT technology We can expect to see IoT and Blockchain coming together more often in the future.
IOT also have application in those fields:
The Internet of Medical Things (IoMT) is the collection of medical devices and applications that connect to healthcare IT systems through online computer networks Medical devices equipped with Wi-Fi allow the machine-to-machine communication that is the basis of IoMT IoMT devices link to cloud platforms such as Amazon Web Services, on which captured data can be stored and analyzed IoMT is also known as healthcare IoT.
Examples of IoMT include remote patient monitoring of people with chronic or long-term conditions; tracking patient medication orders and the location of patients admitted to hospitals; and patients' wearable mHealth devices, which can send information to caregivers Infusion pumps that connect to analytics dashboards and hospital beds rigged with sensors that measure patients' vital signs are medical devices that can be converted to
Web Sever
A web server is a computer program that runs on a computer (web server) that delivers web pages to users Web pages are delivered in response to HTTP requests from users HTTP is the Hypertext Transfer Protocol, and it is the protocol that is used to transfer web pages over the Internet.
Web servers are typically used to store and deliver static web pages Static web pages are web pages that do not change, such as home pages However, web servers can also be used to store and deliver dynamic web pages Dynamic web pages are web pages that change, such as web pages that display the latest news or weather.
Web servers are an essential part of the Internet, and they allow users to access web pages from anywhere in the world.
Here are some of the functions of a web server:
• Storing web pages: Web servers store web pages in a file system When a user requests a web page, the web server retrieves the web page from the file system and sends it to the user.
• Delivering web pages: Web servers deliver web pages to users in response to HTTP requests HTTP is the Hypertext Transfer Protocol, and it is the protocol that is used to transfer web pages over the Internet.
• Managing security: Web servers can manage security Security is important for web servers, as they are often used to store sensitive data.
• Managing performance: Web servers can manage performance Performance is important for web servers, as they need to be able to deliver web pages quickly.
IOT based mobile app
The Internet of Things (IoT), is fast emerging as a concept that will immensely impact the way we live our lives as well as the way we work In fact, IoT is a way to disrupt the way we live IoT is a system of interrelated computing devices, people, mechanical and digital machines etc that are marked by unique identifiers and have the ability to transfer data over a network.
The use of IoT is changing business administration, expanding the productivity of the value chain, which ultimately prompts to the formation of new business models and markets The development of the applications of the internet of things in mobile apps provides the controller of smart gadgets, such as wearables (wristwatches, eyeglasses),sensors, medical devices, and much more.
Figure 3.5: IOT for Home Convenience
Machine Learning
Machine learning (ML) is a type of artificial intelligence (AI) that allows software applications to become more accurate in predicting outcomes without being explicitly programmed to do so Machine learning algorithms use historical data as input to predict new output values.
Here are some of the most common types of machine learning:
• Supervised learning: This type of machine learning is used when you have labeled data that you can use to train the model For example, you could use supervised learning to train a model to recognize images of cats and dogs if you have a dataset of images that have already been labeled as cats or dogs.
• Unsupervised learning: This type of machine learning is used when you don't have labeled data For example, you could use unsupervised learning to cluster similar images together if you don't have a dataset of images that have already been labeled.
• Reinforcement learning: This type of machine learning is used when you want the model to learn by trial and error For example, you could use reinforcement learning to train a robot to walk by giving it rewards for taking steps in the right direction and penalties for taking steps in the wrong direction.
Machine learning is a powerful tool that can be used to solve a variety of problems. However, it is important to remember that machine learning models are only as good as the data they are trained on If the data is not accurate or representative, the model will not be able to make accurate predictions.
DIRECTIONS AND SOLUTIONS
Requirements
The objective of this project is to develop an innovative IoT-based healthcare system for remote patient monitoring The system should utilize a wireless sensor network to gather health data from sensor nodes equipped with advanced sensors, including the MAX30102 for heart rate and SpO2 monitoring, the MLX90614 for body temperature measurement, and the MPU6050 for fall detection The sensor nodes, consisting of ESP8266 microcontrollers, should wirelessly transmit the collected data to a central hub, which will be a Raspberry Pi The Raspberry Pi should receive and store the data in a MySQL database, organized into tables for heart rate, SpO2, body temperature, fall detection, and ambient humidity/temperature The stored data should be easily retrievable and available for analysis.
In addition, the system should include a dedicated website for doctors, allowing them to access patient data from the MySQL database The website should provide a comprehensive overview of each patient's health status, including vital signs, temperature, and fall incidents It should support simultaneous monitoring of multiple patients and offer a user- friendly interface to enable informed decision-making.
Furthermore, an Android app should be developed to empower patients and their relatives. The app should retrieve data from the MySQL database and present real-time information on vital signs, body temperature, and overall well-being It should feature functionalities such as notifications, medication reminders, and emergency contact information, facilitating patient engagement and communication with healthcare providers.
No Specification name Unit Value
Table 4.1: Sensor node 1 specification requirement:
No Specification name Unit Value
Table 4.2: Sensor node 2 specification requirement
No Specification name Unit Value
Methodology
There are several microcontrollers suitable for building IoT healthcare systems The choice of microcontroller depends on specific requirements such as processing power, connectivity options, power efficiency, and available peripherals Here are some commonly used microcontrollers for IoT healthcare applications:
ESP32: The ESP32 microcontroller is widely used in IoT applications due to its built-in
Wi-Fi and Bluetooth connectivity It offers sufficient processing power, low power consumption, and a rich set of peripherals, making it suitable for wearable health devices and sensor nodes Advantages:
• Dual-core processor and higher clock speed (up to 240 MHz), providing more processing power.
• Built-in Wi-Fi and Bluetooth connectivity.
• Rich peripheral set, including GPIO pins, I2C, SPI, UART, PWM, and more.
• Larger flash memory options (up to 4MB).
• Active development community and extensive library support.
• Lower power consumption compared to some other high-performance microcontrollers.
• Higher power consumption compared to low-power microcontrollers.
• Complexity may pose a learning curve for beginners.
• Cost may be higher compared to some lower-end microcontrollers.
• Availability may vary in certain regions.
Arduino Nano 33 BLE Sensor: This microcontroller is based on the nRF52840 chipset and combines Bluetooth Low Energy (BLE) connectivity with a range of onboard sensors such as accelerometer, gyroscope, temperature, humidity, and microphone It is ideal for wearable health monitoring devices.
• BLE connectivity, making it suitable for wearable applications.
• Onboard sensors, including accelerometer, gyroscope, temperature, humidity, and microphone.
• Compact form factor and low power consumption.
• Arduino IDE compatibility, with a user-friendly development ecosystem.
• Integration with various cloud platforms.
• Limited GPIO pins (around 14) and peripheral options compared to some other microcontrollers.
Figure 4.2: Arduino Nano 33 BLE Sense
ESP8266: The ESP8266 is a highly integrated chip, designed for the needs of the
Internet of things (IOT) It provides a complete and self-contained Wi-Fi networking solution, allowing it to host applications or to offload all Wi-Fi networking functions from one application processor.
• Built-in Wi-Fi connectivity, enabling wireless communication.
• Cost-effective and widely available.
• Established development ecosystem, including support for Arduino IDE.
• Lower power consumption compared to some high-performance microcontrollers.
• Suitable for applications with moderate processing requirements.
• Lower processing power compared to the ESP32 or higher-end microcontrollers.
• Limited GPIO pins (around 9 to 17) and peripheral interfaces.
• Power consumption may not be as efficient as some low-power microcontrollers.
My group choose The ESP8266 is a powerful and versatile microcontroller that can be used to build a wide variety of IoT applications With a microcontroller low-cost, low-power microcontroller with Wi-Fi connectivity, the ESP8266 is a great option.
Several machine learning algorithms can be suitable for fall detection of the elderly Here are some commonly used algorithms in fall detection systems:
Support Vector Machines (SVM): SVM is a supervised learning algorithm that can be trained to classify fall events based on input features It works well for binary classification problems and can handle non-linear data.
Random Forest: Random Forest is an ensemble learning algorithm that combines multiple decision trees It can effectively handle complex and high-dimensional data, making it suitable for fall detection Random Forest is also resistant to overfitting and can provide feature importance rankings. k-Nearest Neighbors (k-NN): k-NN is a simple and intuitive algorithm that classifies new instances based on the proximity to labeled examples in the feature space It can work well in fall detection scenarios when the surrounding context is essential for accurate classification.
Several database can be suitable for send data from an IoT device Here are a few databases commonly used in IoT applications:
MySQL: A popular open-source relational database management system (RDBMS) known for its stability, scalability, and ease of use.
PostgreSQL: Another open-source RDBMS with advanced features, extensibility, and support for complex data types and queries.
MongoDB: A document-oriented NoSQL database that offers high scalability,
My group selected MySQL because MySQL is a reliable and feature-rich database system that can handle the storage, retrieval, and management of IoT device data effectively.
Here is a list of popular web implementation technologies for IoT applications:
• Node.js with Express.js: Node.js is a JavaScript runtime that allows for server-side implementation using JavaScript Express.js is a minimalist web application framework for Node.js, making it a suitable choice for building scalable and real-time IoT web applications.
• Python with Django: Django is a powerful Python web framework that follows the Model-View-Controller (MVC) architectural pattern It offers robust features, security mechanisms, and an extensive ecosystem, making it suitable for developing IoT web applications.
• PHP is a cross-platform language, meaning it can run on various operating systems like Windows, Linux, macOS, etc This flexibility allows you to deploy PHP applications on different web servers and hosting environments.
My group selected PHP because PHP has strong support for database integration It has built-in extensions and libraries to interact with popular databases like MySQL and PostgreSQL This application PHP was designed specifically for web development, which makes it well-suited for implementing web applications It provides features and functions that simplify tasks like handling HTTP requests, processing form data, and generating dynamic HTML content.
Flutter is an open-source UI framework developed by Google for building natively compiled applications for mobile, web, and desktop platforms It uses the Dart programming language and offers a rich set of pre-designed widgets and tools that enable developers to create visually appealing and high-performance user interfaces. o Beautiful and Customizable UI o High Performance
Disadvantage o Limited native access: Flutter uses its own rendering engine and UI components, which means that direct access to native features and APIs may require additional work or platform-specific plugins. o Large app size o Need lots of study to adapt
App Inventor is a visual, blocks-based development environment created by MIT that allows individuals with little or no programming experience to create mobile applications for Android devices It simplifies the app development process by using a graphical interface where users can drag and drop blocks of code to define app behavior and logic.
The main goal of App Inventor is to make app development accessible and engaging for beginners, particularly in educational settings It provides a user-friendly environment where users can create interactive and functional apps without needing to write complex code.
Advantage o Visual and Beginner-Friendly o App Inventor enables quick prototyping and testing of app ideas. o It provides an engaging platform for learning computational thinking and problem-solving skills. o Rich Set of built-in components and blocks o Cross-Platform
Disadvantage o Limited Advanced Functionality o Dependency on Internet Connection o Performance Considerations o Lack of Extensive Libraries and Third-Party Support
Work flow
DESIGN AND IMPLEMENTATION
Hardware design
The team came up with the idea to design a box containing a screen to display health parameters, two wearable devices containing sensors to measure health parameters for users.
3D printing technology is evolving rapidly, allowing us to design with a variety of materials Each material has its own properties and is suitable for different applications The team plans to build the box using 3D printing technology with mainly plastic materials. According to their market research, there are many types of plastic materials that could be used for the box, including:
Characteristics: PLA is a bioplastic that is easy to print, handle, and use It is also safe, affordable, and widely available PLA is often available in a variety of colors, making it a versatile material for 3D printing.
Application: PLA plastic is a popular choice for printing fast prototypes and statues because it is easy to print and relatively inexpensive.
Characteristics: TPU is a thermoplastic polyurethane that is known for its elasticity and durability It can withstand compression and traction much better than ABS and PLA, making it a good choice for applications where flexibility and strength are important.
Application: TPU is a good choice for 3D printing applications where the printed details will be subject to compression or need a certain elasticity when used.
Characteristics: ABS plastic is a hard, durable material with a high melting temperature It is more difficult to print than PLA plastic, which is why it is usually more expensive.
Application: ABS plastic is used for similar purposes as PLA plastic, but it is typically chosen when the printed model needs to be strong and resistant to heat.
After considering the properties of different plastics, the team decided to use PLA plastic for their project PLA is easy to obtain and relatively inexpensive, and its properties are sufficient to meet the project's requirements.
Block diagram
A 450mAh LiPo battery powering both the ESP module and the sensor The battery connects to a power regulators AMS1117 that regulates and
Battery distributes power to the components The ESP module serves as the central processor, while the sensor measures data The LiPo battery may also power supporting components, and protection circuitry ensures safe operation.
The ESP8266 which functions as the central processing unit It’s responsible for handling signal from health sensors and use its Wifi capabilities to transfer data to the database on a remote server.
The display module visually presents health sensor data to the user, allowing for easy interpretation and monitoring It utilizes a screen (TFT) to display processed information of health data as numerical values
The Raspberry Pi connects to a DHT11 sensor to measure humidity and ambient temperature It also interfaces with a TFT display to present collected health data, including heart rate, SpO2, and body temperature
Module that measures humidity and ambient temperature It detects changes in humidity and temperature and provides digital output for interfacing with the Raspberry Pi or microcontroller.
Sensor module for monitoring vital signs like heart rate and SpO2.
The MLX90614 block provides accurate and reliable temperature readings for health applications.
The MPU6050 is an accelerometer and gyroscope sensor module used for fall detection, enabling the detection of sudden changes in motion or orientation that can indicate a fall.
The internet block allows the system to establish a connection to the MySQL server, send SQL queries, and receive query results or updates from the server It ensures seamless and secure communication between the system and the MySQL database for data retrieval, storage, and manipulation.
Figure 5.9: Block diagram of health monitoring system
Basic connection
The wireless sensor node is designed to facilitate the measurement of heart rate and blood oxygen levels in patients It encompasses an ESP8266 microcontroller responsible for data processing, enabling the conversion of raw data acquired from the MAX30102 sensor into a readable format To ensure optimal functionality of the sensor, the ESP8266 is equipped with pull-up resistors in the RST, EN, IO15, and IO2 pins Additionally, a button is connected to the RST pin, offering the capability to reset the firmware within the ESP8266 when necessary.
Figure 5.10: Processing module hardware connection for sensor node 1
No ESP8266 Pin Name Connection Description Additional Component
1 RST 3.3V For normal operation 10K Resistor
2 EN 3.3V For normal operation 10K Resistor
Figure 5.11: Sensor pins hardware connection
The external MAX30102 sensor communicates with the ESP8266 module through the I2C (Inter-Integrated Circuit) protocol The I2C pins on the ESP8266, namely SCL (Serial Clock) and SDA (Serial Data), are responsible for establishing communication with the MAX30102 sensor The 3.3V pin on the ESP8266 connects to the corresponding 3.3V pin on the MAX30102, providing power to the sensor Similarly, the GND (Ground) pin on the ESP8266 connects to the GND pin on the MAX30102, establishing the common ground reference between the two devices.
By connecting the MAX30102 sensor to the ESP8266 via the I2C interface, the ESP8266 can read the heart rate and blood oxygen level measurements from the sensor The I2C protocol enables bidirectional communication between the ESP8266 and the sensor, allowing the ESP8266 to request data from the sensor and receive the measurement results.
This connection setup enables the ESP8266 to gather vital health information using the MAX30102 sensor, providing valuable data for applications such as medical monitoring, fitness tracking, or other related projects
No ESP8266 Pins MAX30102 Pins Description Additional Component
Table 5.2: Sensor pins hardwareware connection description
Figure 5.12: Firmware reprogramming pins hardware connection
When the firmware of a device such as the ESP8266 needs to be reprogrammed, either for updating or optimizing purposes, specific pins come into play These pins serve as connections to an external programmer, which could be a NODE-MCU module or aUSB to UART Converter Module By linking the external programmer to the corresponding pins on the ESP8266, the reprogramming process can be initiated This approach allows for flexibility and convenience in modifying the firmware, ensuring that updates, bug fixes, performance enhancements, and compatibility adjustments can be seamlessly implemented The external programmer acts as an intermediary, facilitating the communication between the device and the software being installed or modified.Through this connection, the firmware can be modified, customized, or adapted to meet the changing requirements, improving the overall functionality and performance of theESP8266 device.
No ESP8266 Pins Connection Description Additional Component
GND Power stabilization 10uF Capacitor
5 GPIO0 DTR Enter programming mode
6 RST RESET Hardware reset for programming purpose
Table 5 3: Firmware reprogramming pins hardware connection description
Figure 5.13: Voltage regulation module hardware connection
The module in question plays a crucial role in managing the power supply derived from a Lipo battery It incorporates an AMS1117 regulator IC, which functions as a power regulator,ensuring a stable and regulated power source This regulator takes the varying input voltage from the Lipo battery and produces a consistent output voltage, which serves as the direct power source for the ESP8266 module and other associated components By employing theAMS1117 regulator, the module effectively safeguards the connected devices against voltage fluctuations and ensures reliable power delivery This is particularly important for the proper functioning and longevity of the ESP8266 module, as well as other components that rely on a stable power supply The module's role in power regulation enhances the overall performance and reliability of the system, allowing it to operate efficiently and without interruptions caused by fluctuations in the Lipo battery voltage.
No AMS1117 Connection Description Additional Component
1 GND Battery GND Power source
GND Power stabilization 10uF Capacitor
3 Vout ESP8266 Vin Power source
Table 5.4: Voltage regulation module hardware connection description
Sensor Node 2 closely resembles the first sensor node, with minor changes made to the I2C pin connections to accommodate the use of different sensors The addition of an MPU6050 enables fall detection, providing crucial information for doctors and relatives to respond promptly in case of a dangerous situation This sensor monitors acceleration and orientation, allowing for the detection of sudden falls or movements Alongside theMPU6050, an MLX90614 temperature sensor is incorporated into Sensor Node 2 to monitor a patient's body temperature accurately This functionality aids in the detection of abnormal temperature fluctuations, aiding healthcare providers in identifying potential health issues The adjusted I2C pin connections facilitate seamless integration and communication between the sensors, microcontroller, and other components of SensorNode 2, ensuring reliable and effective monitoring of patient safety and well-being.
No ESP8266 Pin Name Connection Description Additional Component
1 RST 3.3V For normal 10K Resistor operation
2 EN 3.3V For normal 10K Resistor operation
5 GPIO2 3.3V For normal 10K Resistor operation
6 GPIO15 GND Control ESP8266 10K Resistor
Table 5.5: Processing module hardware connection description for sensor node 2
Figure 5.15: Voltage regulation module hardware connection for node 2
No ESP8266 Pins MPU6050 Pins Description Additional Component
Table 5.6: MPU6050 hardware connection description for sensor node 2
No ESP8266 Pins MLX90614 Description Additional Component
No ESP8266 Pins Connection Description Additional Component
GND Power stabilization 10uF Capacitor
5 GPIO0 DTR Enter programming mode
6 RST RESET Hardware reset for programming purpose
Table 5.8: Firmware reprogramming pins hardware connection description for sensor node 2
No AMS1117 Connection Description Additional Component
1 GND Battery GND Power source
GND Power 10uF Capacitor stabilization
3 Vout ESP8266 Vin Power source
Table 5.9: Voltage regulation module hardware connection description for sensor node 2
Android application
An Android activity is a crucial component in Android app development, serving as a fundamental building block It represents a distinct screen or user interface that users can interact with Activities act as containers for various UI elements, such as buttons, text fields, images, and more, enabling users to perform actions and navigate through the app Each activity has a lifecycle that includes different states like created, started, resumed, paused, stopped, and destroyed This lifecycle allows the system to manage the activity's behavior, optimize resources, and handle user interactions effectively Activities facilitate intent-based navigation, where one activity can launch another and pass data between them By leveraging activity callbacks, developers can respond to lifecycle events and perform necessary operations for proper app functioning Moreover, activities offer animation capabilities to create smooth transitions between screens, enhancing the overall user experience With their versatile functionality, activities play a central role in creating interactive and engaging Android applications.
The activity lifecycle in Android refers to the various states and transitions that an activity goes through during its existence Understanding the activity lifecycle is crucial for managing resources, handling user interactions, and maintaining the overall state of an app An activity has three states:
- Resumed: The activity is in the foreground of the screen and has user focus.
- Paused: Another activity is in the foreground (visible) and has focus, but this one is still visible Paused activities are completely alive but can be killed by the system in low memory situations.
- Stopped: The activity is running in the background and is no longer visible by the user Stopped activities are also alive and can be killed by the system.
In order to manage the lifecycle of our activity, we need to implement the callback methods Callback methods can be overridden to do the appropriate work when the state of the activity changes The most important callback methods are:
- onCreate() method is called when the activity is created for the first time This is where all the set up needs to be done such as create views, bind data to lists, and so on.
- onResume() method is called just before the activity starts interacting with the user.
- onPause() method is called when the system is about to start resuming another activity.
- onDestroy() method is called before the activity is destroyed.
Figure 5.16: Android activity’s lifecycle b UI (User Interface) and user interaction
They are essential aspects of any software application, including Android apps UI refers to the visual and interactive elements that users see and interact with on the screen It includes components like buttons, text fields, images, menus, and more User interaction involves how users engage with the UI elements to perform actions and navigate through the app Users can tap buttons, enter text in input fields, select items from lists, swipe screens, and perform other gestures to interact with the app's functionality In Android, UI and user interaction are typically implemented using XML-based layout files and corresponding Java or Kotlin code.Developers design the UI by arranging and styling the elements and define their behavior through event listeners and callback methods Effective UI design and intuitive user interaction are crucial for creating user-friendly and engaging apps It involves considerations such as responsiveness, accessibility, consistency, and visual appeal By providing a well-designed UI and seamless user interaction, developers can enhance the overall user experience and make their apps more enjoyable to use.
Figure 5.17: Example of an interactive User Interface for Android OS
Android UI elements is to provide a user-friendly and visually appealing interface for Android applications These elements serve various purposes and functionalities, contributing to an engaging and intuitive user experience Here are some common purposes of Android UI elements:
- Button: A button is referred to as a "Button" in Android Studio It represents a clickable
UI element that triggers an action when pressed.
- TextView: A TextView is called a "TextView" in Android Studio It is used to display text or strings on the screen.
- EditText: An EditText is referred to as an "EditText" in Android Studio It provides a
- RadioButton: A RadioButton is called a "RadioButton" in Android Studio It represents a choice or option within a group, where only one option can be selected at a time.
- Switch: A Switch is referred to as a "Switch" in Android Studio It provides a toggle functionality where users can turn an option or setting on or off.
- ProgressBar: A ProgressBar is called a "ProgressBar" in Android Studio It visually indicates the progress of an operation or task. c Sidebar
In Android Studio, the sidebar refers to the panel located on the left-hand side of the IDE's interface It provides essential tools, views, and navigation options to assist developers in various tasks during Android app development The sidebar in Android Studio includes several key components One of them is the Project view, which displays the project structure, including source code files, resources, libraries, and dependencies It allows developers to navigate and manage project files conveniently Additionally, the sidebar contains the Android view, which provides quick access to essential Android-specific tools and resources This includes the layout editor, where XML layouts can be designed visually, and the resource editor, which allows for easy management and editing of app resources such as strings, colors, and dimensions The sidebar also features the VersionControl system integration, enabling developers to interact with Git or other version control systems directly from the IDE It provides access to features like committing changes,branching, merging, and viewing version history.
Figure 5.18: Example of a simple sidebar by android studio d Notification
Notifications in Android Studio are a fundamental part of an app's user experience, providing timely and relevant information to users Android Studio offers a range of features and tools to create and manage notifications effectively Notifications are visual and auditory alerts that appear in the status bar of a user's device They can display brief messages, icons, and other relevant information to notify users about new messages, events, updates, or reminders.
Android Studio provides the NotificationCompat class, which allows developers to build notifications that are compatible with various Android versions With the NotificationCompat.Builder, you can customize the notification's appearance, including the title, content, icon, and other essential elements Additionally, you can add actions to notifications, enabling users to perform quick actions or navigate directly from the notification.
Notification channels are an important feature introduced in Android 8.0 (API level 26) and above They categorize notifications based on their type or importance Android Studio enables developers to create and manage notification channels, giving users control over the types of notifications they receive and allowing them to customize notification behavior.
Android Studio also offers expanded notifications, which provide more detailed content or interaction options Expanded notifications can display large text, images, progress bars, media controls, or other custom layouts This allows users to preview or interact with app content without opening the app Notification styles in Android Studio allow further customization of notifications Styles such as BigTextStyle, InboxStyle, and MediaStyle offer different visual representations to suit specific content types.
The NotificationManager class in Android Studio is responsible for issuing and managing notifications Developers can use it to post notifications, update their content,cancel or dismiss them, and handle user interactions The NotificationManager also supports notification grouping and stacking, which organizes related notifications for a more streamlined user experience During the development process, Android Studio provides tools to preview notifications using the Notification Preview tool It also offers debugging and testing features to simulate notification behavior and monitor their interaction with the app using the Android Emulator and the Notification Log.
5.4.2 Communication with user database on Android app
In our project, we implemented a REST API to facilitate seamless communication between our Android app and a MySQL database The REST API acted as an intermediary, enabling the app to securely retrieve data from the database Using standard HTTP methods, the Android app sent requests to the API to interact with the MySQL database The API served as a bridge, translating these requests into SQL queries that accessed the relevant data in the database. a RestAPI overview
A RESTful API is a standardized interface that utilizes HTTP requests to facilitate communication between software systems It follows the principles of REST and allows different applications, regardless of their programming language, operating system, or database, to interact and exchange data The REST API provides a set of remote calls using common methods like GET, PUT, POST, and DELETE, and ensures that the data is returned in a specific format By implementing a REST API, we establish a universal and easily understandable system for seamless communication and integration between various applications, promoting interoperability and facilitating data exchange in a consistent and efficient manner.
- Implementation: REST is built entirely on the foundation of HTTP.
- Service Definition: REST's flexibility allows modifications to ensure compatibility with the application's request/response format.
The RESTful API revolves around resources and efficient operations performed on them using HTTP The key features of REST API design include:
- Unique Identifiers: Each entity should have a distinct identifier.
- Standard Methods: Read and modify operations should be conducted using standardized methods.
- Support for Different Resource Types: The API should provide support for various types of resources.
- Statelessness: Interactions should be independent of previous requests or stored states.
To adhere to the REST model, the following rules must be followed:
- Client-Server Architecture: The interface should be separate from the server-side data repository, enabling independent development of components.
- Statelessness: Client connections are not maintained on the server between requests.
- Cacheability: It must be explicitly indicated whether responses can be cached by the client.
- Multi-level: The API should function whether interacting directly with a server or through additional layers, such as load balancers. b HTTP Components
Machine learning
Machine Learning (ML), which is one of the most prominent applications of Artificial Intelligence, is doing wonders in the research field of study In this report, machine learning is used in predict fall detection for elderly people Falls are constant threats to elderly people and can minimize their ability to live independently Elder people with neurodegenerative disorders like Parkinson disease often fall This leads to the damage of physical condition and also mental condition This affects the mental health and well-being of the elderly Therefore, elderly people should be taken care of every time However, it is impossible to take care of them all day Therefore, there is a need for a fall detection system in the elderly to track at any time An automated fall detection system will detect it in time and help avoid unfortunate things from happening The design of falling detection and notification system for the elderly in the form of short messages sent to web server, mobile phones and stored in the system database.
The dataset that is presented here has Heart Rate Variability (HRV), SpO2 levels and accelerometer reading (Threshold is 1) in relationship to the decision of falls (0- no fall detected, 1- person slipped/tripped/prediction of fall and 2- definite fall)
Heart Rate Variability (HRV): The heart rate variability is considered to measure sudden changes in the breaths per minute as a sudden change in the heart rate is abnormal The maximum heart rate in older adults is lower (at around 162±9 beats/min) than the maximum heart rate in younger men (191±11 beats/min).
Blood Oxygen Saturation (SpO2): Levels Continuous monitoring of SpO2 levels is provided in device as hypoxemia or low blood oxygen levels creates shortness of breath, excessive sweating, low heart rate and even unconsciousness in older adults.
Accelerometer: The accelerometer sensor parameter is used to measure the non-gravitational or linear acceleration The accelerometer is located inside the devices and is designed to respond to the vibrations associated with any movement The microscopic crystals that undergo stress when in vibration help in providing a voltage which is generated as a reading on any acceleration When there is a movement in human body, the axes of accelerometer x, y and z are continuously changing If the g-force of the y axis exceeds ±3 g’s, the accelerometer would pass the threshold to detect a fall
The Data Set consists of 2039 Rows and 4 Columns.
The type of all the variables in the data set are in numerical format (Integer Or Float) According to first impressions, there is no missing value(NaN Value) in the data set.
The minimum value of the HRV is 60, and the maximum value is 125 The mean of the data for the HRV is 92.5
The minimum value for the "SpO2" variable is 60, and the maximum value is 100 The average of these two numbers is 80.
In summary, we can say that this data is prone to a normal distribution, but there is a slight right skew.
• The vast majority of data HRV are between 80 and 120.
• The vast majority of data SpO2 are between 75 and 95.
The threshold 1 is 66.2% and the threshold 0 is 33.8%
So, the number of threshold 1 is more than twice that of threshold 0.
This code allows you to split a dataset into training and testing sets, which is a crucial step in machine learning model development for evaluating the model's performance on unseen data. Determines the proportion of the dataset to include in the testing set In this case, it is set to 0.2, meaning that 20% of the data will be used for testing, and the remaining 80% will be used for training
This code builds and trains a random forest classifier with a specified depth and number of trees, using the RandomForestClassifier class from Scikit-learn It demonstrates the basic steps of creating and training a random forest model for classification tasks.
This code performs a grid search using nested loops to find the best combination of hyperparameters for a random forest classifier by evaluating the average cross-validation accuracy.
This code builds and trains a random forest classifier using the best hyperparameters obtained from cross-validation The classifier is trained on the entire dataset, and the resulting model is stored in the variable `clf_RF`.
This code snippet takes a set of features (LoF), which represents a list of three numerical values, and uses a trained random forest classifier (clf_RF) to predict the fall outcome based on these features The predicted outcome is obtained by calling the predict() method on the classifier with the input features.The predicted outcome is then converted to an integer using int() for indexing purposes The code retrieves the corresponding outcome value from the outcome_list based on the predicted status And the model correctly predicted the fall probability of elderly with 3 inputs such as HRV, SpO2 and accelerometer
Webpage
We designed a webpage hosted on the Raspberry Pi Apache server The purpose of the webpage is to monitor different patients’ health conditions and save it to the database The database management system used in our project is MySQL Our webpage includes three main parts:
The webpage includes two user input with type Text for entering Username and Password, one submit input with value Login to submit user input and a Sign up button, which is used to register a new user.
Figure 5.34: Login interface of the webpage
Includes the functions of creating, reading, editing and deleting patients for admin.
Figure 5.35: List of patients interface of the webpage
This webpage will display all information of a patient, including personal information such as name, age, gender, address, phone and health condition like heart rate, SPO2 and body temperature displayed by chart It also gives information about the ambient environment including ambient temperature and humidity.
Figure 5.36: Profile patient interface of the webpage
PRODUCTION EXPERIMENT
Experiment design
N4 Interactive User interface from web and android application
N5 Notification function works with minor time delay
N7 Easy for repairing and maintenance
After discussing fundamental needs, we figured out some necessary metrics to measure for satisfying those needs.
Metric number Needs Metric description Unit
4 interface from I I web and android application
5 function works D D with minor time delay
7 Easy for repairing D and maintenance
- I - Indirect measure: the quantity to be measured is not measured directly, instead a related parameter is measured and inference is drawn from there.
- D - Direct measure: the quantity to be measured is determined directly by measurement tools such as calipers, micrometers, etc.
Metrics Metric name Unit Type of test Method Sampling description Static Dynamic
M1 Heart rate BPM x Observed 20 returned value
M3 Body temperature °C x Observed 20 returned value
M4 Ambient temperature °C x Observed 20 returned value
M5 Humidity RH x Observed 20 returned value
M6 Angular velocity degree/se x Observed 20 c returned value
M10 Dimension cm x Using measuring 1 tools
M16 Power consumption Wh x Using measuring 1 tools
Experiment implementation
Proposed value Measured value Unit
Material PLA Plastic PLA Plastic
Proposed value Measured value Unit
Material PLA Plastic PLA Plastic
Proposed value Measured value Unit
Material PLA Plastic PLA Plastic
Sample number Sensor value Measurement tool value Unit
Comment: The sensor ensures the consistency while measuring the humidity However, there’s a minor difference between our device and actual tool, with the gap between 4%
Sample number Sensor value Measurement tool value Unit
Sample Sensor value Measurement tool value
Person Person Person Person Person Person Person Person number
Comment: While measuring the body temperature, the value tends to fluctuate more due to theI2C signal, but overall, it can show the body temperature value with minor difference compared to the value measured by the tools
Sample Sensor value Measurement tool value
Person Person Person Person Person Person Person Person number
Sensor value Measurement tool value Sample number
Person Person Person Person Person Person Person Person
Comment: Similar with heart rate, while measuring the blood oxygen, the value tends to fluctuate more due to the I2C signal and complex signal processing algorithm, as a result, the value measured is not as expected when comparing to actual medical device, but the difference is still acceptable and can be used to monitor health status of patient
Sample number Sensor value (x – y - z) (°/s) Application response
Comment: Overall, the response of the application with respect to the accelerometer sensor value met the expectation
No Specification name Unit Value
No Specification name Unit Value
Table 6.4: Sensor node 2 final specification
No Specification name Unit Value
Through the project, we understand the structure of a basic IOT application and have a chance to implement such a system We also work with sensors and know how to interact with them through registers, how to communicate with them through wireless connection such as WIFI.Additionally, we learn more knowledge through machine learning model to predict falls in the elderly Morever, we also have an opportunity to learn new languages such as Javascript, Python and PHP to interact with the MySQL database management system, and show all sensor data to a webpage hosted on a Raspberry Pi server.
Always updating user health status data and paying attention to expert suggestions are necessary for this project to increase in value and quality This initiative enables users to keep an eye on their own health and take action in case of emergency Future research may focus on improving blood pressure monitoring technology so that users may quickly identify signs of stress or overwork, can predict stroke and heart disease for elderly people.Aslo, improved web and app with more features such as chat, video call or make appointment for patients Additionally, in order to assist each user in maintaining good health, we will give more data to users through health notifications about reminders to drink water or recharge from food to help each user have a good condition for study and work.
[1] Md Milon Islam, Ashikur Rahaman & Md Rashedul Islam, Development of Smart
Healthcare Monitoring System in IoT Environment, SN Computer Science (2020) 1:185
[2]Gulraiz J Joyia, Rao M Liaqat, Aftab Farooq, and Saad Rehman, Internet of Medical Things (IOMT): Applications, Benefits and Future Challenges in Healthcare Domain,
Journal of Communications Vol 12, No 4, April 2017
[3]Deepti Ameta, Kalpana Mudaliar and Palak Patel, MEDICATION REMINDER AND
HEALTHCARE – AN ANDROID APPLICATION, International Journal of Managing
Public Sector Information and Communication Technologies (IJMPICT) Vol 6, No 2, June 2015
[4]THIẾT BỊ THEO DÕI SỨC KHỎE TẠI NHÀ FACARE, link https://old.benhvien199.vn/thiet-bi-theo-doi-suc-khoe-tai-nha-facare_dt_11077
[5] MySQL (Original) - Manual - PHP, link https://www.php.net/manual/en/book.mysql.php\
[6] MySQL 8.0 C API Developer Guide, link https://dev.mysql.com/doc/c-api/8.0/en/
[7] Database Management System, "database management system (DBMS)", link https://www.techtarget.com/searchdatamanagement/definition/database-management- system
[8] MAX30102 datasheet, "Pulse Oximeter and Heart-Rate Sensor IC for Wearable Health", https://www.analog.com/media/en/technical-documentation/data-sheets/MAX30102.pdf
[9] DHT11 Datasheet, "DHT 11 Humidity & Temperature Sensor", https://www.mouser.com/datasheet/2/758/DHT11-Technical-Data-Sheet-Translated-
[10] MLX90614 Datasheet, "MLX90614 family - Single and Dual Zone Infra Red Thermometer in TO-39", https://www.sparkfun.com/datasheets/Sensors/Temperature/MLX90614_rev001.pdf
[11] MPU6050 Datasheet, “MPU-6000 and MPU-6050 Product Specification Revision 3.4”, link https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-6000-Datasheet1.pdf
[12] Falin Wu, Hengyang Zhao, Yan Zhao, Haibo Zhong, Development of a Wearable- Sensor-Based Fall Detection System, International Journal of Telemedicine and
Applications, vol 2015, Article ID 576364, 11 pages, 2015
[13] Elderly Fall Prediction and Detection Dataset, link https://www.kaggle.com/datasets/laavanya/elderly-fall-prediction-and-detection
[14]R Alazrai, Y Mowafi and E Hamad, A fall prediction methodology for elderly based on a depth camera, 2015 37th Annual International Conference of the IEEE
Engineering in Medicine and Biology Society (EMBC), Milan, Italy, 2015, pp 4990-4993
[15] Rajagopalan R, Litvan I, Jung TP., Fall Prediction and Prevention Systems: Recent
Trends, Challenges, and Future Research Directions, Sensors (Basel), 2017 Nov 1
[16] Lee, S.M., Lee, D., Healthcare wearable devices: an analysis of key factors for continuous use intention, Serv Bus 14, 503–531 (2020).
MINISTRY OF EDUCATION AND TRAINING
HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION
FACULTY FOR HIGH QUALITY TRAINING
RESEARCH, DESIGN AND MANUFACTURE OF A HEALTH MONITORING SYSTEM USING WIRELESS
SENSOR NETWORK FOR ELDERLY AT HOME
Instructor: NGUYEN VU LAN Ph.D
Ho Chi Minh City, July 2023
Ho Chi Minh city University of RESEARCH, DESIGN AND MANUFACTURE OF A
Ho Chi Minh city University of RESEARCH, DESIGN AND MANUFACTURE OF A
Ho Chi Minh city University of RESEARCH, DESIGN AND MANUFACTURE OF A