Professional Documents
Culture Documents
BME 3 REPORT
Measurement and transmission of data from the Vital
Parameters Circuit to MySql
Class: ET -E5
Ha Noi, 1/2022
Contents
ACKNOWLEDGEMENT………………………………………………………………………...1
ABSTRACT……………………………………………………………………………………….2
Chapter I. Introduction………………………………………………………………………...3
1.1. Problem analysis.....................................................................................................3
1.2.1. Temperature.....................................................................................................4
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.
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
2
Chapter I. Introduction
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.
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
- Diagnostic.
4
1.2.Human survival parameters
1.2.1. Temperature
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.
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.
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.
Vital Designed
parameters Database webside
circuit screen
7
2.1. Objectives
Therefore, basically, the measuring device will consist of the following parts:
- Can measure vital indicators such as: heart rate, SpO2, temperature.
- Can communicate with computer through COM port with low source energy.
The block diagram of the main functions of the circuit to measure the vital
parameters the human body is shown in figure:
9
The measuring circuit includes the following functional blocks:
- Data transfer with Heart Rate, SpO2 and temperature to software via
communication block
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.
10
The DS18B20 sensor has the following characteristics:
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.
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.
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.
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.
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).
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
Memory:
32KB
2KB SRAM
1KB EEPROM
Security:
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
ATMega16U2 Processor
512B EEPROM
512B SRAM
Power
2.7-5.5 volts
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.
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
Two timer groups, including 2 x 64-bit timers and 1 x main watchdog in each
group
20
RTC watchdog
Peripheral
12-bit SAR ADC up to 18 channels
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
Hall sensor
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.
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
23
- Operating current Icc: ~20mA
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:
• 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.
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.
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.
- 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.
28
Figure 15. Temperature Data Table
Using the following criteria in mind, we opted to establish our website with
000WebHost.
29
Figure 16. 000WebHost
30
We choose the domain name is:
benhandientuchickenteam.000webhostapp.com
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
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 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
33
Figure 20. Code to measure data with Arduino Uno
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.
Unlike the process of measuring and uploading data to the Web Server, in
this process, we program it directly on the Website management part.
35
Figure 23. Code to upload data to MySQL
36
Figure 25. Webscreen
- Measurements number.
37
- Celsius scale (°C).
- Heart rate.
- Spo2 . stat.
38
Figure 27. Illustrates the simulation Circuit designed and fabricated
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
• SpO2 meter with heart rate: used to compare with Max30100 sensor.
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.
• 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 .
40
Figure 28. Result of temperature measurement with mercury
thermometer and DS18B20
• 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.
41
Figure 29. SpO2 and heart rate measurement results using Lk87 and
Max30100
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)
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.
- 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.
- The measuring circuit is not stable (maybe because the sensor has not been soldered
together....)
- 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
- Build the web into a complete electronic medical record (add features for login,
registration, access rights for different objects...)
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.
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