1. Trang chủ
  2. » Công Nghệ Thông Tin

Assignment 2 1690 Internet Of Things

26 0 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Internet of Things
Tác giả Tran Duc Long
Người hướng dẫn Le Anh Ngoc
Trường học tec
Chuyên ngành computing
Thể loại assignment
Năm xuất bản 2023
Định dạng
Số trang 26
Dung lượng 1,61 MB

Nội dung

This exercise earns Pass points in arduino programming. This exercise demonstrates an IoT device that measures heart rate and blood oxygen levels. Use HTTPS protocol to display data on the website. Website uses PHP language

Trang 1

ASSIGNMENT 1 FRONT SHEET

Unit number and title Unit 43: Internet of Things

Trang 2

Summative Feedback: Resubmission Feedback:

Internal Verifier’s Comments:

Signature & Date:

2.1

Trang 3

Table of Contents

A Introduction 4

B Task 1: Develop the IoT application (P5-P6-M5) 5

I Employ an appropriate set of tools to develop your plan into an IoT application 5

1 Overview 5

2 Select an appropriate set of tools to develop your plan 6

3 Develop the solution 8

II Video and test product 15

1 Product 15

2 Website 16

3 The perfect and incomplete points in our system 20

C Task 2: Test and Evaluate the user feedback (P7 – M6) 20

1 Run end user experiments and examines feedback 20

2 Evaluate end user feedback from your IoT Application 23

D Conclusion 25

Table of Figure Figure 1: Framework ESP8266 7

Figure 2: Framework adafruit 7

Figure 3: Demo products 10

Figure 4: Hosting service of our project 14

Figure 5: All files in my website project 15

Figure 6: Example source code PHP in project website 15

Figure 7: Final product 16

Figure 8: Home page 17

Figure 9: Health monitor page 18

Figure 10: HistoryLog page 18

Figure 11: Contact page 19

Figure 12: Feedback of user from website 19

Figure 13: Product introduction and calculation formula 20

Trang 4

A Introduction

In Assignment 1, I explored IoT platforms, tools, and hardware while elucidating the fundamental principles of IoT This report aims to implement the solutions outlined in the previous document for the identified problem Subsequently, I will gather feedback from project participants and evaluate the ultimate outcome

Trang 5

B Task 1: Develop the IoT application (P5-P6-M5)

I Employ an appropriate set of tools to develop your plan into an IoT

of sectors and industries, including areas such as agriculture, transportation, and education However, one notable and recent example that vividly underscores the importance of IoT is its deployment in the field of epidemic prevention

In particular, IoT has played a crucial role in safeguarding the health of a significant population, especially in the context of diseases like Covid-19 Given the serious nature of such illnesses, we have taken proactive steps to develop a product that integrates IoT functionalities This product is specifically designed for monitoring essential physiological parameters, specifically heart rate and blood oxygen levels

By enabling users to continuously track these vital metrics, our innovation serves

as a proactive tool for monitoring cardiovascular health and oxygen levels in the blood This, in turn, allows for timely medical intervention in cases of emergency

It is worth noting that a common symptom of Covid-19 is a decrease in blood oxygen levels, which, if not addressed promptly, can lead to respiratory distress and, in severe instances, even mortality

b Solution

To effectively tackle the challenge mentioned earlier, our team has developed and implemented a solution involving a device designed for monitoring both heart rate and blood oxygen levels This innovative device has been carefully crafted to meet the specific requirements associated with these medical conditions, allowing individuals to easily assess their health status Notably, this device not only has the ability to collect relevant data regarding heart rate and blood oxygen levels but also features the capability to promptly send notifications to the patient, their family members, and the attending medical professional for swift follow-up and intervention It's essential to highlight that even beyond the current epidemic situation, this technology remains a

Trang 6

valuable asset in the healthcare sector, providing ongoing support and significant potential for future enhancements and advancements

2 Select an appropriate set of tools to develop your plan

Our team has opted for an IoT application centered around monitoring heart rate and blood oxygen levels This application will encompass two key features: a heart rate sensor and a blood oxygen level sensor The data collected from these sensors will be transmitted to a website via the HTTP protocol for analysis and to issue warnings based on the user's heart rate and SpO2 severity

The initial step in bringing this program to life involves selecting an Integrated Development Environment (IDE) for source code development, program debugging, and code compilation Our team has chosen the Arduino IDE for this project because it operates on a microcontroller, a compact computer capable of running a single program continuously This setup provides a user-friendly circuit board for managing repetitive tasks, such as heart rate monitoring and sensor runtime control To monitor and control the device remotely, we'll need a platform or API We've decided to use the free domain name registration and hosting service provided by 000webhost due to its simplicity and affordability This service will serve as the primary server and enable us to create a dynamic website interface that facilitates data transmission via the HTTP protocol, accessible on various devices wherever internet connectivity is available

As 000webhost is a free hosting service, we have the flexibility to utilize PHP and MYSQL source code, along with technologies like HTML, CSS, JS, AJAX, and JQUERY,

to craft a comprehensive website with the ability for customization This will allow

us to control the system and test devices via the internet Thus, we've chosen to integrate the Arduino IDE with the C++ programming language and 000webhost to construct the system The Arduino Software (IDE), which is free and open source, simplifies data encoding and uploading to the website This IDE can be used with any Arduino board

Framework:

• ESP8266

A collection of modules called the ESP8266 IoT Framework can be used as a basis for new ESP8266 projects It implements OTA updates, WiFi management, a React web interface, HTTPS requests, and a live dashboard

Trang 7

The framework consists of five key components: a web server, including classes for handling HTTP requests and OTA updates, a WiFi manager, a configuration manager, and the user interface it supports The diagram provided below offers a visual representation of the framework's structure

Figure 1: Framework ESP8266 The development of this framework was guided by the following fundamental principles:

- The framework is built upon the ESP8266 Arduino libraries

- It does not include features for controlling external hardware

- The framework is designed for straightforward deployment as it is contained and does not rely on LittleFS or SPIFFS storage

self It maintains a strict separation between the web interface via an API and the ESP8266 application

By utilizing this framework, the device can collect user data, transmit it to a server, and perform health diagnostics to notify the user or their family members about their health condition

• Adafruit:

The device will utilize sensors to measure both blood oxygen levels and heart rate

To achieve the desired functionality, we require the Adafruit framework Adafruit

is well-known for offering open-source libraries and hardware compatible with a wide range of microcontrollers and sensors, including the ones utilized by our team

Figure 2: Framework adafruit

Trang 8

Hardwares of this IoT project:

capable of connecting to the Internet and is commonly used to implement IoT applications It helps us connect with Max30100 sensor and other device to collect data like oled screen

Which then allows me to stream the data to the web server

pulse oximetry and heart-rate monitor sensor module It is commonly used for non-invasive measurement of heart rate and blood oxygen saturation (SpO2) The MAX30100 sensor utilizes red and infrared light

to measure the amount of oxygen in the blood and detect heart rate

consumption We use them to display the measurement data of the

Max30100 sensor on the screen

prototyping platform is a breadboard

or protoboard, which is employed for linking wires to hardware

3 Develop the solution

All of the mentioned hardware components will form an interconnected smart heart rate monitoring system, accessible through a WiFi connection Since the entire system will operate online, users can conveniently assess its functionality

Trang 9

and performance prerequisites using various smart devices like computers, smartphones, tablets, or other similar gadgets by simply visiting the following web link: https://iotg2gch1106.000webhostapp.com/home.php

Utilizing this hardware, the smart heart rate monitoring system will gather data regarding an individual's heart rate and blood oxygen levels This data will then be transmitted via the Internet to the 000Webhost server Subsequently, an API will process this data and relay it back to the user's computer, which is responsible for displaying the information on the project's website interface This interface allows access through a range of internet-connected devices, including smartphones, tablets, laptops, and more

Pulse Oxygen Measurement: The MAX30100 sensor measures blood oxygen saturation (SpO2) and heart rate by shining light through the skin and measuring the amount of light absorbed by oxygenated and deoxygenated hemoglobin The MAX30100 communicates with the microcontroller and other devices using the I2C communication protocol So we have developed and integrated into Internet

of Things (IoT) applications for remote health monitoring, allowing real-time data transmission Its data will be displayed on the OLED screen and on our hospital website, on the website heart rate parameters data will be analyzed and given high, low, normal warning status

Hardware configuration:

The assembly of the MAX30100 Pulse Oximeter Webserver on a NodeMCU is straightforward The MAX30100 Oximeter Sensor operates through the I2C bus, so you just need to link the I2C pins (SCL and SDA) of the oximeter module to the D1 and D2 pins on the NodeMCU Connect the INT pin to the NodeMCU's D0 pin Likewise, supply 3.3V power to the VCC and ground the GND pin After finishing config, we have product:

Trang 10

Figure 3: Demo products Source code/Program:

I use Arduino sketch that interfaces with a MAX30100 Pulse Oximeter sensor and

an OLED display, and it sends the sensor data to a remote server over Wi-Fi These are the libraries I use in the project:

These lines include several libraries required for the project These libraries provide functionality for I2C communication, OLED display control, Wi-Fi connectivity, and interfacing with the MAX30100 Pulse Oximeter sensor

• Constants and Variables:

These are constant values defining the reporting period for sensor data (600 milliseconds), the interval for sending data to the server (15 seconds), and a delay after sending data (0.5 seconds)

Trang 11

Here, I have constants and variables for averaging sensor data The code buffers the last AVERAGE_COUNT sensor readings for heart rate (BPM) and SpO2 levels

These lines define the Wi-Fi network name (SSID), password, and the URL of the server where data will be sent It also specifies an API key and the name of the sensor

• Objects:

These are object declarations:

display is an OLED display object with a resolution of 128x64 pixels

pox is an object for the MAX30100 Pulse Oximeter

https is an HTTP client object for making secure HTTP requests

• setup() Function:

The setup function is executed once when the Arduino starts It initializes the serial communication, connects to Wi-Fi, initializes the display, and sets up the sensor

• loop() Function

Trang 12

The loop function is the main execution loop It continuously reads data from the sensor, displays the data, and sends it to the server at specified intervals

• Other Functions:

initializeDisplay(): Sets up and initializes the OLED display

initializeSensor(): Initializes the Pulse Oximeter sensor

gettingSensorData(): Updates and processes data from the sensor

Trang 13

displaySensorData(): Displays sensor data on the OLED screen

sendDataToServer(): Sends the BPM and SpO2 data to the remote server using

an HTTP POST request

Trang 14

The code implements a basic IoT setup to collect and send pulse oximeter data

to a remote server via Wi-Fi The sensor data is displayed on an OLED screen This code assumes that you have the required hardware components and libraries installed for the project to function properly

• HTTP Website:

My task in the group is to design the website for this project Therefore, I chose the 000Webhost server hosting service to push my website to the host so users can access it via the internet application I use PHP, MySQL source code along with technologies such as CSS, Boostrap, JQuery, AJax to create a complete website called Hospital

Figure 4: Hosting service of our project

Trang 15

Figure 5: All files in my website project

Figure 6: Example source code PHP in project website

II Video and test product

By closely following the connectivity guidelines described earlier and using the provided code, the device is ready to function without any issues A product demonstration is available through Google Drive; to access it, please click on the link provided

1 Product

Here we introduce our team's groundbreaking product called the 'Heart Rate Sensor.'

By placing your finger on the device's red light emitter (MAX30100), it swiftly records your current heart rate and oxygen levels in real-time These crucial data points will then be displayed on the device's screen for user convenience and monitoring

Trang 16

Figure 7: Final product Moreover, the data will be sent to a web server at 15-second intervals, enabling others to access it by visiting a designated website

2 Website

When users access the website link:

https://iotg2gch1106.000webhostapp.com/home.php The screen will move to the following interface Here users can explore website information, view the history of measurements, or see an introduction to the website,

or can send feedback to us right on the website

Trang 17

Figure 8: Home page

When the user clicks on the health monitor section on the home page, they will be redirected to the monitoring interface, where the user will see someone's 5 most recent measurements This is where website data is displayed When the user places their hand on the product's sensor, the data will be displayed on the screen and pushed to this website

Ngày đăng: 24/02/2024, 01:58