You are on page 1of 51

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

SCHOOL OF ELECTRONIC AND TELECOMUNICATION

*****  *****

BME 3 REPORT
Measurement and transmission of data from the Vital
Parameters Circuit to MySql

Instructor: PhD. Nguyen Thu Van

Student: Pham Long Hoang 20182950


Pham Viet Hoang 20182952
Tran Tri Duc 20182945

Class: ET -E5

Ha Noi, 1/2022
Contents
ACKNOWLEDGEMENT………………………………………………………………………...1
ABSTRACT……………………………………………………………………………………….2
Chapter I. Introduction………………………………………………………………………...3
1.1. Problem analysis.....................................................................................................3

1.2.Human survival parameters......................................................................................4

1.2.1. Temperature.....................................................................................................4

1.2.2. Heart rate..........................................................................................................5

1.2.3. Blood Oxygen Saturation SpO2.......................................................................6

Chapter 2. Circuit design……………………………………………………………………...7


2.1. Objectives...............................................................................................................7

2.2. Functional requirements..........................................................................................7

2.3. Non-functional requirements...................................................................................7

2.4. Block Design...........................................................................................................8

2.5. Sensor selection.......................................................................................................9

2.5.1.Temperature sensor DS18B20...........................................................................9

2.5.2. Heart rate and SpO2 sensor MAX30100........................................................11

2.5.3. Arduino Uno...................................................................................................15

2.6. Data tranmission block.........................................................................................17

2.7. Tasks of the control program.................................................................................22

Chapter 3. Database And Web Design……………………………………………………24


3.1. Database Selection................................................................................................24

3.1.1. Overview of MySQL......................................................................................24

3.1.2. MySQL's Advantages.....................................................................................25


3.2. Database design....................................................................................................26

3.3. Website Design.....................................................................................................27

3.3.1. Website's Requirements...............................................................................27

3.3.2. Domain name.................................................................................................27

Chapter 4. Programming languages and development environments………………..30


4.1. Measure and upload data to Web Server.............................................................30

4.1.1. Programing languages....................................................................................30

4.1.2. Development environments...........................................................................30

4.2. Data input into MySQL and display on the Webscreen.........................................32

4.2.1. Programing languages....................................................................................32

4.2.2. Development environments...........................................................................33

Chapter 5. Result and Discussions…………………………………………………………36


5.1. Simulation Circuit Diagram....................................................................................36

5.2. Evaluation of the accuracy of the vital measuring circuit......................................36

5.2.1. Systematic error.............................................................................................36

5.3. Discussions and future plan..................................................................................41

CONCLUSION………………………………………………………………………………......43
REFERENCES…………………………………………………………………………………..44
LIST OF FIGURES
Figure 1. Temperature sensor DS18B20
Figure 2. MAX30100 sensor
Figure 3. Block diagram of Max30100 sensor
Figure 4. Image illustrates how I2C communication works
Figure 5. Arduino Uno Pinout
Figure 6. ESP32 Pinout16
Figure 7. Microprocessor block principle circuit diagram17
Figure 8. Algorithm diagram of control program19
Figure 9. Diagram of communication block principle
Figure 10. Functional diagram of the control program
Figure 11. Rankings of databases
Figure 12. SpO2, BPM Data Table
Figure 13 Temperature Data Table
Figure 14 000WebHost
Figure 15. Register website's domain name
Figure 16. Web's original interface
Figure 17. Arduino IDE’s main interface
Figure 18. Code to measure data with Arduino Uno
Figure 19. Code to upload data with ESP 32
Figure 20. Website Manager
Figure 21. Code to upload data to MySQL
Figure 22. Code to display data to Webscreen
Figure 23. Webscreen
Figure 24. Simulation Circuit Diagram
Figure 25. Result of temperature measurement with mercury thermometer
and DS18B20
Figure 26. SpO2 and heart rate measurement results using Lk87 and
Max30100
ACKNOWLEDGEMENT

First of all, we would like to extend special thanks to Ms. Nguyen Thu Van,
who gave us all the guidance and insightful advice that we could complete this
project.

In the era of technology 4.0 along with the continuous development of


technology in digital health, a device used to monitor the patient's vital health
parameters is absolutely necessary and widely used in hospitals around the world.

Based on the technology and techniques available on a modern ‘patient monitor


‘along with the sensors available to measure the body index, we have designed a
mini ‘parameter measuring device’ capable of transmitting measured data to the
database and store the data to facilitate the lookup and assessment of the patient's
health status. This device is also very useful for F0 patients to help them monitor
body parameters during treatment, helping patients and doctors to grasp the
situation and be more active to control the patient's health.

The idea for this product is not new. However, with changes, improvements in
design and operation mechanism; we hope our products will be well received and
supported by you. In particular, we are extremely grateful to receive your
comments and suggestions so that our team can overcome the limitations and
improve this product. Once again, we would like to thank you all.

1
ABSTRACT

Human vital parameters are biological parameters of person that need to be


measured, stored and monitored regularly, especially in case of patients who need
continuous monitoring such as those in emergency or resuscitation ... Moreover,
the tracking and storage of this data needs to be easily accessible and must be
managed correctly. Recently, Electronic medical records have become an
inevitable trend of development that provides a medium for real-time storage and
access of such data. The purpose of the research is to build a method and system
that can connect and transmit data from the vital parameters measurement circuit to
the electronic medical record. First, the vital parameter circuit is designed and
built. Then, the biological signals, including heart rate, SPO2, temperature, etc…
are encoded and stored on MySQL. Next, the data is displayed on a designed web
in order. The results obtained from the research have many directions for
development, such as integrating with a patient monitoring company to bring vital
parameters to electronic medical records, which can be incorporated into electronic
medical records of hospitals and building a database and transmitting patient vital
parameters data, which can become an information system for monitoring and
managing vital parameters of patients with infectious diseases such as COVID-
19…

2
Chapter I. Introduction

1.1. Problem analysis

Vital parameters are an important factor in monitoring the progression of patients of


all ages during hospital stay, as they allow rapid detection of disease progression. Vital
parameters are measured and help doctors make basic assessments of the patient's health
status.

The most common measurement method performed in the hospital is the traditional
measurement of vital parameters, the most basic parameters include temperature, pulse
rate, blood pressure, blood oxygen saturation (SpO2). and respiratory rate. Tracking,
storing and managing these data and putting them in the patient's medical record helps
medical staff have sufficient data from which they can make timely and continuous
clinical indications. has great significance.

Conventionally, those parameters are manually input into paper-based medical


records or computer-based medical records by medical staff, given the fact that
automatic transfer of data from devices such as bedside monitors to the database
system is not yet a common practice at medical centres and hospitals worldwide.
However, the advantages of automatic data transfer from monitoring devices to a
database is undeniable, as it helps to reduce errors in the manual inputing process
and provides a real-time storing and retrieving system that can be accessed from
any location at any time.

3
Ideally, our study should have aimed at transfering data from bedside monitors and
other monitoring devices to a database. However, due to time and resource constraints
partly subjectively and partly caused by the pandemic, we did not have the opportunity to
work on bedside monitors or any other monitoring devices that are widely used at
hospitals. Therefore, our study aimed at designing and fabricating a circuit to monitor
vital signs such as heart rate and SpO2,… which are then automatically transferred to a
database Mysql

Purpose of measuring vital parameters:

- Periodic health check.

- Diagnostic.

- Monitor disease status and disease progression.

- Follow up the results of treatment and care.

4
1.2.Human survival parameters

Vital parameters (life signs) include: temperature, blood pressure, blood


oxygen saturation SpO2, heart rate,… are signs indicating the functioning of
organs, reflecting the physiological function of the body.

1.2.1. Temperature

Body temperature is the body temperature. Body temperature is kept constant


by thermoregulation, which ensures a balance between heat production and heat
loss.

The core body temperature is the temperature in the deep tissues. Central
body temperature is the purpose of thermoregulatory activity, little change with
ambient temperature and always kept constant 36 ºC - 37.5 ºC to ensure optimal
conditions for biochemical reactions. Temperatures measured rectally, in the
mouth, and in the armpits are considered to reflect the core temperature. The
temperature measured rectally was the most stable (this temperature measured at
baseline was 36.3 ºC - 37.1 ºC). Although less accurate, measuring body
temperature in the armpit and mouth is used more because of its simplicity and
convenience.

Peripheral body temperature is the temperature measured in the skin and


extremities. This temperature is lower than the core zone temperature, subject to
many influences of the environment (air temperature, humidity, wind, temperature
of surrounding objects ...) and varies according to the measurement location, the
more open the place, the better. The lower the temperature, the lower the
temperature in contact with cold objects.

1.2.2. Heart rate

5
The standard heart rate can vary from person to person, depending on age,
physical fitness, gender... For people 18 years of age and older, a normal resting
heart rate ranges from 60 to 100 beats per minute. Usually, the healthier the
person, the lower the heart rate.

Table 1. Heart rate standards

Age Standard heart rate (beats/minute)

Infant 120 – 160

Children from 1 to 12 months 80 – 140

Children 1 - 2 years old 80 – 130

Children from 2 to 6 years 75 – 120


old

Children from 7 to 12 years 75 – 110


old

Adults > 18 years old 60 – 100

Athletes 40 - 60

Our heart rate at each time is often affected by many factors, for example: The body's
physical activity before that time, health and medical conditions, ambient temperature,
standing, sitting position, or lying down). In addition, mental and emotional states are
also affected more or less (eg emotions of anger, joy, fear, anxiety...).

If there is a cause or effect that causes the heart rate to become irregular, such as a fast
heart rate (more than 100 beats per minute), a slow heart rate (less than 60 beats per
minute), or a fast or slow heartbeat, Evenif there is a heartbeat but no pulse, it is called an
arrhythmia.

6
1.2.3. Blood Oxygen Saturation SpO2

Blood oxygen saturation, also known as SpO2, represents the ratio of oxygenated
hemoglobin to total hemoglobin in the blood. If all the hemoglobin molecules in the
blood carry oxygen, then the oxygen saturation is 100%.

SpO2 index is considered one of the important vital parameters of the body, besides
signs such as temperature, pulse, breathing rate and blood pressure. When there is a lack
of oxygen in the blood, organs such as the heart, liver, and brain will be negatively
affected very quickly. Therefore, it is necessary to monitor the SpO2 index regularly to
promptly intervene if a dangerous situation occurs.

-The amount of dissolved oxygen in the blood is between 97% - 99%: good oxygen in
the blood.

-Dissolved oxygen in the blood is between 94% and 96%: moderate blood oxygen –
need to give extra oxygen.

-The dissolved oxygen in the blood is between 90% - 93%: low blood oxygen that
should be monitored by a nurse or doctor or go to the nearest hospital.

-SpO2 is below 92% without oxygen or below 95% with oxygen: these are signs of
very severe respiratory failure.

-An oxygen saturation lower than 90% is a clinical emergency.

1.3. Overview about the system

Vital Designed
parameters Database webside
circuit screen

Chapter 2. Circuit design

7
2.1. Objectives

The objective of the report is to design a circuit that measures 3 vital


parameters including: heart rate, SpO2, body temperature. These parameters will
be sent to the database in real time.

Therefore, basically, the measuring device will consist of the following parts:

• Sensors, signal processing: temperature sensor, SpO2 sensor, heart rate,


data processing and transmission to the data transmitter;

• Controller: controls the operation of the sensors when there is a command


from the administrator;

• Transmitter receive data: send measured data to the software.

2.2. Functional requirements

- Can measure vital indicators such as: heart rate, SpO2, temperature.

- Can send parameters to the database

- Can communicate with computer through COM port with low source energy.

- Display data on web screen

2.3. Non-functional requirements

- Fast measurement time, easy measurement

- Works well at room temperature

- Low design cost


8
- Easy to carry

2.4. Block Design

The block diagram of the main functions of the circuit to measure the vital
parameters the human body is shown in figure:

Figure 1. Block diagram of project

9
The measuring circuit includes the following functional blocks:

• Data measurement block: has the function of measuring body parameters


through sensors and then sending signals to the Arduino microcontroller

• Data tranmission block : signals sended to ESP32

- Data transfer with Heart Rate, SpO2 and temperature to software via
communication block

• Storage and display data block

2.5. Sensor selection

The circuit measures vital including 3 parameters: temperature, heart rate and SpO2.
These sensors usually have a remarkable accuracy that is not affected by objective
factors. Because of that, the cost is much higher than the sensors used in industry. To
match the research time, the scope of the topic, the temperature sensor DS18B20 and the
heart rate sensor with SpO2 Max30100 were selected.

2.5.1.Temperature sensor DS18B20

The DS18B20 temperature sensor is widely used in industry to monitor the


temperature variation on the surface; is a digital sensor that follows the 1-wire
protocol and can measure temperatures from -55 oC to +125 oC (-67 oF to +257
oF) with ±5% accuracy. Although it is a commonly used sensor in industry, in this
study it can be used to replace high-precision sensors that are not suitable for
research. The DS18B20 sensor is shown in Fig1.

10
The DS18B20 sensor has the following characteristics:

- Principle of direct conversion from temperature to numeric value


- Change the number of bits according to the change of temperature
- There are 3 pins including PIN #1 VCC +%Voltage, PIN#2 is data pin, PIN#3 is
ground pin

Figure 2. Temperature sensor DS18B20

11
Sensor specifications
• Power: 3 – 5.5V
• Temperature range: -55 to 125 degrees Celsius (-67 to 257 degrees Fahrenheit)
• Error: +- 0.5 oC when measuring in the range -10 – 85 oC
• Resolution: user selectable from 9 – 12 bits
• Communication standard: 1-Wire (1 wire).
• There is a heat warning when the threshold is exceeded and power is supplied from the
data pin.
• Maximum temperature conversion time: 750 ms (when 12bit resolution is selected).
• Each IC has its own code (stored on the IC's EEPROM), so it is possible to
communicate with multiple DS18B20s on the same wire.
• Stainless steel tube (moisture-proof, water-proof) 6mm in diameter, 50mm in length
• Probe diameter: 6mm
• Wire length: 1m
With the above structure, the data pin of the sensor can be directly connected to the
microcontroller

12
2.5.2. Heart rate and SpO2 sensor MAX30100

Heart rate sensor and SpO2 MAX30100 integrated 16-bit sigma delta ADC
and low-noise analog signal processor for highly accurate and stable sensor
operation. At the same time, it has a compact design that can be used as a wearable
device and is easy to interface with MCUs.

Light is emitted from the LED, hits the hand and then is reflected back. The
rays reflected back from the skin depend not only on the absorption spectrum of
the blood but also on the structure and pigmentation of the skin.

Saturated oxygen concentration is measured by analyzing the red light and


infrared light signals through pulses. The light is picked up by the photodiode after
being scattered back from the skin surface. The photodiode absorbs light and
passes it through an ADC converter, converting an analog signal to a digital
signal. The light from the LED entering the cell is scattered due to the movement
of the red blood cells and the cell does not move. Part of this scattered light
reaches the photodiode which is calculated by the meter and gives the SpO2 value.

Figure 3. MAX30100 sensor

13
The two LEDs absorb red light and infrared light with two wavelengths of
650 nm and 950 nm, respectively. A photodiode absorbs and synthesizes light
from two leds, converting the light energy into an electric current. Then pass
through the ADC to convert the analog signal to the digital signal. The signal
processor has a built-in temperature sensor to compensate for changes in blood
oxygen when the ambient temperature changes. Then through a cascade amplifier
with filter to remove 50/60Hz noise and background noise

After filtering and amplifying, we race it through the ADC block to read the
signal through the I2C line. The ADC has a resolution of 16bit, so the output data
rate is programmable from 50Hz to 1000Hz.We can measure heart rate by
analyzing the time series response of reflected infrared and red light. The LED
Drivers block allows us to choose between two modes of measuring SpO2 and
heart rate.

Figure 4. Block diagram of Max30100 sensor

14
SCL, SDA, INT pins are the signal pins of the Max30100 sensor, these 3
pins are connected to the pins of the microprocessor through resistors.

The interface between sensor and microprocessor is I2C interface. I2C


combines the best features of SPI and UART. With I2C, it is possible to connect
multiple slaves to a single master (like SPI), there can be multiple masters
controlling one or more slaves.

Like UART communication, I2C only uses two wires to transfer data
between devices: SDA (Serial Data) - transmission line for master and slave to
send and receive data. SCL (Serial Clock) - the line that carries the clock signal.
I2C is a serial communication protocol, so data is transmitted bit by bit along a
single line (SDA line). Like SPI, I2C is synchronous, so the output of the bits is
synchronized with the sampling of the bits by a clock signal shared between the
master and the slave. The clock signal is always controlled by the master.

With I2C, data is transmitted in messages. The message is divided into data
frames. Each message has an address frame containing the binary address of the
slave address and one or more data frames containing the data being transmitted.
The message also includes start and stop conditions, read/write bits, and
ACK/NACK bits between each data frame.

Start-up condition: The SDA line goes from high voltage to low voltage
before the SCL line goes from high to low.

Stop condition: The SDA line changes from low voltage to high voltage level
after the SCL line turns from low to high.

Address Frame: A string of 7 or 10 bits unique to each slave to identify the


slave when the master wants to communicate with it.

15
Read/Write Bit: A unique bit that specifies whether the master is sending
data to the slave (low voltage level) or requesting data from it (high voltage level).

ACK/NACK bit: Each frame in a message is followed by an


acknowledge/non-acknowledge bit. If an address or data frame is successfully
received, an ACK bit is returned to the sending device from the receiving device.

Figure 5. Image illustrates how I2C communication works

2.5.3. Arduino Uno

Arduino UNO is a microcontroller board based on the ATmega328P. It has


14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog
inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP
header and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or power it
with a AC-to-DC adapter or battery to get started. You can tinker with your UNO
without worrying too much about doing something wrong, worst case scenario
you can replace the chip for a few dollars and start over again.

In this project, we use Arduino Uno and the above sensors to measure the
vitals of the body. Also connect Arduino Uno to the control block to process the
received data.

16
Figure 6. Arduino Uno Pinout

Arduino Uno has the following specifications:

Memory:

 AVR CPU at up to 16 MHz

 32KB

 2KB SRAM

 1KB EEPROM

Security:

 Power On Reset (POR)

 Brown Out Detection (BOD)

Peripherals

17
 2x 8-bit Timer/Counter with a dedicated period register and compare channels
1x 16-bit Timer/Counter with a dedicated period register, input capture and
compare channels

 1x USART with fractional baud rate generator and start-of-frame detection

 1x controller/peripheral Serial Peripheral Interface (SPI)

 1x Dual mode controller/peripheral I2C

 1x Analog Comparator (AC) with a scalable reference input

 Watchdog Timer with separate on-chip oscillator

 Six PWM channels

 Interrupt and wake-up on pin change

ATMega16U2 Processor

 8-bit AVR® RISC-based microcontroller

 Memory 16 KB ISP Flash

 512B EEPROM

 512B SRAM

 debugWIRE interface for on-chip debugging and programming

Power

 2.7-5.5 volts

2.6. Data tranmission block

18
The microprocessor used in the circuit is responsible for receiving signals
from Arduino and send it to the web server.And then we can storage and display
the data. To serve research as well as future topic development, ESP32 processor
was selected (Figure 6). The purpose is to be able to connect to the software on the
computer in the future via Wifi.

Figure 7. ESP32 Pinout

ESP32 is a powerful microcontroller from Espressif Systems, which can be


easily programmed with many different languages such as Lua, Python, C/C++,
etc. ESP32 is a powerful and versatile MCU module widely used. in Wifi
Bluetooth and BLE PCB circuit designs. Products are widely applied in topics
related to IoT today.

ESP has 1 core called ESP32-D0WDQ6 chip. The embedded chip is


designed to be highly scalable and customizable. The ESP32 design has 2
independent CPU cores that can be easily controlled. The clock frequency can be
easily adjusted from 80MHZ up to 240MHZ. During use, the programmer can turn

19
off the CPU to be able to use the device in low power mode. Thereby monitoring
the change and threshold crossing. ESP32 is integrated with various peripheral
interactors such as: Hall sensor, capacitive sensor, SD card, high speed SPI, I2S,
I2C or high speed SPI

ESP 32 has the following specifications:

CPU and Memory

 Xtensa® Dual-Core 32-bit LX6 microprocessors, up to 600 DMIPS

 448 KByte ROM

 520 KByte SRAM

 16 KByte SRAM in RTC

 QSPI Flash/SRAM, up to 4 x 16 MBytes

 Power supply: 2.2 V to 3.6 V

Clocks and Timers

 Internal 8 MHz oscillator with calibration

 Internal RC oscillator with calibration

 External 2 MHz to 40 MHz crystal oscillator

 External 32 kHz crystal oscillator for RTC with calibration

 Two timer groups, including 2 x 64-bit timers and 1 x main watchdog in each
group

 RTC timer with sub-second accuracy

20
 RTC watchdog

Peripheral
 12-bit SAR ADC up to 18 channels

 2 × 8-bit D/A converters

 10 × touch sensors

 Temperature sensor

 4 × SPI

 2 × I2S

 2 × I2C

 3 × UART

 1 host (SD/eMMC/SDIO)

 1 slave (SDIO/SPI)

 Ethernet MAC interface with dedicated DMA and IEEE 1588 support

 CAN 2.0

 IR (TX/RX)

 Motor PWM

 LED PWM up to 16 channels

 Hall sensor

 Ultra low power analog preamplifier

21
With the above built-in features, ESP32 represents a line of microcontroller
chips that not only have high processing speed but also integrate a lot of peripheral
functions, very suitable for use as well as development in future.

Figure 8. Microprocessor block principle circuit diagram

The basic algorithm measures survival parameters and sends the measured data to the
software according to the following steps (Figure 8):

• Step 1. When there is a signal from the software sent to the microcontroller, the
microcontroller will start running the program
• Step 2. The sensors will measure the parameters and send them to the
microprocessor, the microprocessor calculates the results
• Step 3. The calculated data will be sent to the software and displayed on the
software
• Step 4. Finish the survival parameter measurement process

22
Figure 9. Algorithm diagram of control program

As described above, the ESP32 microprocessor is selected to control the


program. The ESP32 module is integrated with many peripheral features,
including port communication with the computer. The communication block uses
IC CH340 to convert USB to UART communication. This IC has the following
specifications:

- Operating voltage: ~5V

- Input pin voltage: -0.5V to 5.5V

- Temperature range: -40C to 125C

23
- Operating current Icc: ~20mA

- Standby current consumption: 200uA

- Pulse cutoff frequency: 12Mhz

• Warm-up time: 20~50ms

Figure 10. Diagram of communication block principle

2.7. Tasks of the control program

On the basis of the block diagram of the survival parameter measurement circuit,
the functional diagram of the control program has been built. The required
functions of the control block include the following contents:

• There are standard connection interfaces according to components

• Filter out noise when measuring parameters

• The program only works when there is a signal from the software on the computer

24
From there, the functional block diagram of the software controlling the measuring
circuit is designed as shown in Figure 10.

Figure 11. Functional diagram of the control program

Figure 12. Connection block diagram

25
Chapter 3. Database And Web Design

Chapter 2 presented about the circuit to measure the body's vital parameters
and how to communicate to send data to the computer. This chapter will introduce
how to design and build a database.

3.1. Database Selection


3.1.1. Overview of MySQL

Swedish company MySQL AB developed MySQL in 1994. American


technology company Sun Microsystems then retained ownership of MySQL after
acquiring MySQL in 2008. In 2010, the Oracle giant bought Sun Microsystems
and MySQL has been owned by Oracle ever since.

MySQL is an open source database management system (Relational


Database Management System, abbreviated as RDBMS) operating under the
client-server model. RDBMS is a software or service used to create and manage
databases in the form of managing the relationships between them.

MySQL is one of the RDBMS software. RDBMS and MySQL are often said
to be one because of MySQL's immense popularity. The biggest web apps like
Facebook, Twitter, YouTube, Google, … All use MySQL for data storage
purposes. Even though it was initially used for very limited use, it is now
compatible with many important computing platforms such as Linux, macOS,
Microsoft Windows, and Ubuntu.

MySQL is not the only database management system (RDBMS) on the


market, but it is indeed the most popular and second only to Oracle Database when
26
it comes to key parameters such as search volume, user profiles per LinkedIn, and
the amount of discussion on internet forums.

Figure 13. Rankings of databases

3.1.2. MySQL's Advantages

As shown in Figure 11 , currently there are many database management systems,


but MySQL has outstanding advantages when compared to other database
management systems:

- Flexible and easy to use: You can modify the source code to meet your needs at no
additional cost. The installation process is also very simple and usually takes no
more than 30 minutes.
- High performance: Many server clusters use MySQL. No matter you store large
data of e-commerce sites or heavy IT-related businesses, MySQL can handle it
with smooth, high speed.
- Industry standard: The data and technology industry has been using MySQL for
many years, so it is a fundamental skill for a professional programmer. MySQL
users can also deploy projects quickly and hire data experts for a fee if they need
to.

27
- High security: Data safety is always the most important issue when choosing
RDBMS software. With its decentralized access and account management system,
MySQL sets very high security standards. Encryption of credentials and
authentication from the host are both available.

The above reasons are also the reason why we choose MySQL for this project.

3.2. Database design


In this project, we use two sensors to measure body metrics: MAX30100
sensor is used to measure heart rate and SpO2, sensor DS18B20 is used to
measure temperature. Therefore, we built two data tables for two sensors. Each
data sheet has the actual measurement time of each metric type.

Figure 14. SpO2, BPM Data Table

28
Figure 15. Temperature Data Table

3.3. Website Design


3.3.1. Website's Requirements

Our website has specific requirements because this is an experimental


initiative:

- It's a simple design that's easy to see.


- a low cost (we choose free hosting instead of buying separate hosting).
- It's simple to change based on your needs.
- Using MySQL for data binding.
- Data from the database can be shown on the Web screen.

3.3.2. Domain name

Using the following criteria in mind, we opted to establish our website with
000WebHost.

This is a private free hosting company that started in 2004 in Lithuania (a


small country in Northern Europe) under the name Hosting Media. And now
present in 178 countries with more than 29 million users.

29
Figure 16. 000WebHost

Figure 17. Register website's domain name

30
We choose the domain name is:
benhandientuchickenteam.000webhostapp.com

Figure 18. Web's original interface

Chapter 4 will explain how to connect the web to the database and how to
display data from the database on the web screen.

31
Chapter 4. Programming languages and development
environments

4.1. Measure and upload data to Web Server


4.1.1. Programing languages

From the requirements of the topic, the control program of the measuring
circuit has been analyzed, designed and built to be completed with the task of
connecting and controlling the components of the survival parameter measurement
circuit, the implementation results achieved the design objectives and properly met
the contents of the research topic set out.

The control program is programmed in the C programming language. C is a


mid-level, C programming language developed by Dennis M. Ritchie for UNIX
development at Bell Labs. The C programming language is used to create system
applications that directly interact with hardware devices such as drivers, kernals,
etc.

The C programming language has many different data types, such as:
character type (character), integer type (integer) and real number type (float).

C is tightly coupled to the UNIX system but is not tied to any particular
computer or operating system. C is very effective for writing programs in many
different fields. The basic C programming language is considered the basis for
other programming languages, that's why it is known as the parent language.
32
4.1.2. Development environments

After choosing a programming language, there should be a development


environment suitable for that language. The programming environment (IDE) of
choice is Arduino IDE – Free Open Source Programming Software. The IDE in
the Arduino IDE is the part that is meant to be open source, which means that the
software is free both in terms of download and copyright: The user has the right to
modify, improve, develop, upgrade according to certain principles. generally
permitted by the publisher.

Figure 19. Arduino IDE’s main interface

33
Figure 20. Code to measure data with Arduino Uno

Figure 21. Code to upload data with ESP 32

4.2. Data input into MySQL and display on the Webscreen


4.2.1. Programing languages

We utilize the PHP programming language to save the data sent to the
database and to display the data from the database on the web interface.

34
PHP stands for Hypertext Preprocessor, the PHP programming language
used to build websites and web applications.

PHP is a scripting language that works on the server with the task of
connecting to the database and performing the functions of the web or web
application. PHP is easily embedded in HTML through the <?php … ?> tag pair,
when running PHP will generate HTML codes to return to the user.

PHP is an extremely popular programming language when developing


websites and Web applications due to its high compatibility with browsers and
being a flexible language when it comes to problem solving.

4.2.2. Development environments

Unlike the process of measuring and uploading data to the Web Server, in
this process, we program it directly on the Website management part.

Figure 22. Website Manager

35
Figure 23. Code to upload data to MySQL

Figure 24. Code to display data to Webscreen

36
Figure 25. Webscreen

4.3. Result on web screen

Figure 26. Table of parameters

In the figure shown in turn parameters of human :

- Measurements number.

37
- Celsius scale (°C).

- Fahrenheit scale (°F).

- Heart rate.

- Spo2 . stat.

- Measurement sampling time and date .

Chapter 5. Result and Discussions

5.1. Simulation Circuit Diagram.

38
Figure 27. Illustrates the simulation Circuit designed and fabricated

5.2. Evaluation of the accuracy of the vital measuring circuit


5.2.1. Systematic error

The measuring circuit uses two types of sensors, a heart rate sensor, SpO2
Max30100 and temperature sensor DS18b20. Each sensor is announced by the
manufacturer a specific error value, with the DS18b20 temperature sensor the
systematic error is ± 0.5oC, and for the max30100 sensor, it is 4%. In addition, to
evaluate the detailed error of each sensor as well as the entire measuring circuit,
the measured values of the vital index measurement circuit will be compared with
standard devices commonly used in medical facilities.

39
5.2.2. Comparison of the readings of the measuring circuit with the reference
device

To evaluate the error as accurately as possible, it is necessary to prepare:

• Mercury thermometer: used to compare with temperature sensor DS18b20.

• SpO2 meter with heart rate: used to compare with Max30100 sensor.

• Number of measuring samples: 15 people corresponding to 15 measuring


samples

Temperature, heart rate, and SpO2 data were measured on 15 people using
pulse oximeters and matching devices to assess circuit accuracy. The 2-sample t-
test was used to compare the difference between two sets of values, with p < 0.05
representing two statistically different sets of values. Values > 0.05 represent two
sets of values that are not statistically different.

Measure mercury thermometer as follows:

• Lightly scale the thermometer to return the measurement line to the original
position.

• Place the thermometer in your armpit, then close your hand. Keep hands
closed, forearms in front of chest level .

• After 5 minutes, remove the thermometer and read the result .

With the DS18b20 temperature sensor, apply the same measurement as a


mercury thermometer, after 5 minutes read the results on the computer screen.

40
Figure 28. Result of temperature measurement with mercury
thermometer and DS18B20

Measure Lk87 machine as follows:

• Open the clamp, place your finger in the clamp slot so that the tip of the
finger touches the end of the machine so that the tip of the finger covers the sensor
in the clamp slot.

• Press the power button to start the machine. Unable to move the hand,
operate the pulse, keep the body in the most relaxed state.

• Results will be displayed on the screen.

41
Figure 29. SpO2 and heart rate measurement results using Lk87 and
Max30100

Table 2. Temperature measurement results (oC)

Mercury
DS18B20
  thermometer
Sample 1 36.3 36.25
Sample 2 36.2 36.15
Sample 3 36.2 36.25
Sample 4 36.3 36.1
Sample 5 36.2 36.25
Sample 6 36.3 36.25
Sample 7 36.3 36.5
Sample 8 36.3 36.4
Sample 9 36.3 36.2
Sample 10 36.3 36.2
Sample 11 36.3 36.3
Sample 12 36.3 36.2
Sample 13 36.3 36.1
Sample 14 36.3 36.1
Sample 15 36.3 36.2
p-value 0.114
Table 3. Heart rate measurement results (bpm/min)
Max3
  Lk87 0100
Sample 1 72 73
Sample 2 72 74
Sample 3 73 70
Sample 4 74 74

42
Sample 5 72 71
Sample 6 81 81
Sample 7 80 83
Sample 8 80 83
Sample 9 82 82
Sample 10 80 83
Sample 11 89 89
Sample 12 90 88
Sample 13 88 85
Sample 14 89 92
Sample 15 89 89
p-value(paired 2 sample t-
0.472
test)

Table 1. SpO2 measurement results (%)


Max
Lk87 3010
  0
Sample 1 99 98
Sample 2 99 98
Sample 3 99 98
Sample 4 99 98
Sample 5 99 98
Sample 6 99 99
Sample 7 98 99
Sample 8 99 99
Sample 9 99 99
Sample 10 99 99
Sample 11 97 37
Sample 12 97 97

43
Sample 13 98 97
Sample 14 97 97
Sample 15 97 97
p value 0.294

The p-values of the three comparisons are all > 0.05, from which it can be
concluded that the measurement circuit has no statistical difference compared to
the devices being used on the market. Therefore, the measured results can be used
to enter electronic medical records.

5.3. Discussions and future plan


Advantages of the project

In the process of product research and development, we have achieved certain


results:

- Design a circuit to measure the vital indicators of the body (temperature, bpm, spo2)
for relatively accurate results.

- Send measured results to the database via wifi connection, so that patient data can be
safely stored and used for future projects.

- Display the measured results on the web screen.

Limitations of the product

However, our product has some limitations as follows:

- The measuring circuit is not stable (maybe because the sensor has not been soldered
together....)

- Website design is simple, only data display function

- The website only has the function of displaying data, not hierarchical users such as
administrators and users

44
- The patient has not been able to access the data on the database

Future plans

In the future, we will continue to research to overcome the above disadvantages,


and at the same time develop products in different directions, depending on actual
needs:

- Increase the security of the web (using private hosting...)

- Build the web into a complete electronic medical record (add features for login,
registration, access rights for different objects...)

- Improved data accuracy (better sensor usage, less interference effects...)

- Measure other indicators (electrocardiogram, blood pressure ....)

- Increase more participants in the experiment, divided by different factors


(gender, age, BMI ...)

- Add the feature to classify patients users

- Research more development direction on app. Instead of displaying data on the


web screen, we will build an app on mobile devices, directly linking to each
patient's database so that the patient can look up his or her vitals one by one. easy
way.

CONCLUSION

45
Based on the sensor and techniques available on a modern ‘patient monitor
‘along with the sensors available to measure the body index, we have designed a
mini ‘parameter measuring device’ capable of transmitting measured data to the
cloudbase and store the data to facilitate the lookup and assessment of the patient's
health status. This device is also very useful for F0 patients to help them monitor
body parameters during treatment, helping patients and doctors to grasp the
situation and be more proactive and control the patient's health.

The device is mainly designed on a white circuit board, so it takes up a lot of


space and is difficult to carry. In the future, we plan to design the hardware of the
circuit on the PCB so that the patient can easily carry it and be more convenient in
the treatment’s use process .

REFERENCES

46
[1]. B. C. F. a. W. J. Ivayla I Geneva, Normal Body Temperature: A Systematic
Review, US National Library of Medicine, 2019 Apr 9.
[2]. ESP32 datasheet, Version 3.8, ESPRESSIF SYSTEMS
[3].https://www.vinmec.com/vi/tin-tuc/thong-tin-suc-khoe/nhip-tim-chuan-la-bao-
nhieu/
[4]. S. S. Yesman, S. A. Mamilov, M. M. Asimov and A. I. Gisbreht, “noninvasive
methods of measuring oxygen saturation in venous blood” Journal of Applied
Spectroscopy, Vol. 78, No. 3, July, 2011 (Russian Original Vol. 78, No. 3, May–June,
2011
[5]. Bộ y tế, “Triển khai bệnh án điện tử theo Thông tư số 46/2018/TT-BYT của Bộ Y
tế”, 17/01/2020
[6].https://www.vinmec.com/vi/tin-tuc/hoi-dap-bac-si/nhiet-do-o-tung-vung-co-nguoi/
[7]. Trung tâm đào tạo và chỉ đạo tuyến Bạch Mai, “Kỹ thuật đo dấu hiệu sinh tồn” ,
http://bmmc.edu.vn/537/print-article.bic
[8]. Ayu Jati Puspitasari, Deshinta Famella, M Sulthonur Ridwan and M Khoir,
“Design of low-flow oxygen monitor and control system for respiration and SpO2 rates
optimization”, Journal of Physics Conference Series, January 2020.
[9]. M T Tamam, A J Taufiq and A Kusumawati, “ Design a system of measurement
of heart rate, oxygen saturation in blood and body temperature with non-invasive
method”, International Conference on Engineering and Applied Technology (ICEAT),
October 2018
[10]. Elizabeth C. Murphy, Frederick L. Ferris, III, and William R. O’Donnell, “An
Electronic Medical Records System for Clinical Research and the EMR–EDC Interface”,
Invest Ophthalmol Vis Sci. 2007 October

47

You might also like