Professional Documents
Culture Documents
Project proposal report submitted in partial fulfillment requirements for the degree of
Bachelor Of Science in Electrical and Electronic Engineering
By
STEPHEN SAGINI MACHOKA
BSEE/0078/2016
Date submitted
1|Page
DECLARATION
I Stephen Sagini Machoka declare the content of this project report representation my own unaided
work, and the report has not previously been submitted for academic examination towards any
qualification. Furthermore, it represents my own opinion and not necessarily those of the Technical
University of Mombasa.
Signed………………………….. Date………………………………..
DEDICATION
I dedicate this proposal report to my family members, fellow classmates and my lecturers who have
been guiding and inspiring me through my journey of education. I thank them for their prayers, support
and motivation.
2|Page
ABSTRACT
From today world of automation, Application of engineering and technology has proved its
significance in the field of biomedical. It not only made doctors more efficient but also helped
them in improving total process of medication.
In multispecialty hospitals, where there are a huge number of wards and in each ward, there is a
lot of patients, doctors cannot supervise the patient each and every moment. For this, doctors
form the time slots and each ward is visited after specific period of time. But patients may have
some problems in between these time slots. This leads to inconveniency of patient monitoring in
the hospital. The GSM based Patient monitoring system for doctors provides solution for this. It
continuously provides following information to doctors.
Heartbeat of patient
Body temperature of patient
Respiration of patient
This is achieved by using sensors that will measure the parameters. Raw data from the sensors
(temperature sensor, heart rate sensor and respiratory sensor) is received by the Arduino Uno
Board, then sent to the GSM which is used to transmit the data over the network to the mobile
receiver device e.g. mobile phone.
By use of this device patients enjoy many advantages since they can be monitored anywhere
and anytime continuously by the health caregiver.
By so doing, not only the burden cost can be minimized in terms of installation and maintenance
of the existing hardwiring in the hospitals, but also an efficient patient monitoring will be
achieved.
3|Page
ACKNOWLEDGEMENT
First and foremost, thanks to the Almighty God for the favor throughout my five year stay in
Technical University of Mombasa.
I would also like to thank my supervisor Mr. Kariuki for the support for guidance and
encouragement throughout this project. Thanks to my classmates and everybody who has given
me support.
Lastly, I express my heart felt gratitude to my entire family for their continued support and love.
4|Page
Table of contents
DECLARATION ................................................................................................................................................... 2
DEDICATION ...................................................................................................................................................... 2
ABSTRACT ......................................................................................................................................................... 3
ACKNOWLEDGEMENT....................................................................................................................................... 4
1 CHAPTER ONE ........................................................................................................................................... 7
1.1 Introduction ...................................................................................................................................... 7
1.2 Problem statement ........................................................................................................................... 8
1.3 Overall objectives .............................................................................................................................. 9
1.4 specific objectives ............................................................................................................................. 9
1.5 Motivation of the project .................................................................................................................. 9
2 CHAPTER TWO ........................................................................................................................................ 10
2.1 Literature review ............................................................................................................................. 10
2.1.1 Arduino Uno overview ............................................................................................................ 12
2.1.2 Summary ................................................................................................................................. 13
2.1.3 Power ...................................................................................................................................... 13
2.1.4 Memory ................................................................................................................................... 14
2.1.5 Input and Output ..................................................................................................................... 14
2.1.6 Communication ....................................................................................................................... 15
2.2 Programming ................................................................................................................................... 15
2.2.1 Automatic (Software) Reset .................................................................................................... 16
2.2.2 USB Overcurrent Protection .................................................................................................... 16
2.3 ATMEGA328 MICROCONTROLLER .................................................................................................. 16
2.3.1 PIN DESCRIPTIONS ................................................................................................................... 17
2.4 Temperature Sensor DS18B20 ........................................................................................................ 19
2.1 MQ3 Alcohol Sensor ........................................................................................................................ 20
2.2 GSM SIM800 module....................................................................................................................... 21
3 METHODOLOGY ...................................................................................................................................... 22
3.1 Block diagram of the Monitoring system ........................................................................................ 22
3.2 Arduino Uno Board.......................................................................................................................... 23
3.3 The Alcohol Sensor .......................................................................................................................... 26
3.4 The DS18B20 temperature sensor .................................................................................................. 27
5|Page
3.5 ARDUINO GSM SHIELD .................................................................................................................... 28
3.5.1 Power requirements ............................................................................................................... 28
3.5.2 On board indicators................................................................................................................. 28
3.5.3 GSM Library ............................................................................................................................. 31
3.5.4 Sending a SMS message .......................................................................................................... 31
3.5.5 Schematic diagram .................................................................................................................. 37
4 RESULTS AND DISCUSSION ..................................................................................................................... 37
4.1 Normal range................................................................................................................................... 37
4.2 Abnormal range............................................................................................................................... 38
4.3 Conclusions ..................................................................................................................................... 39
4.4 PRACTICAL RESULTS ........................................................................................................................ 39
5 CONCLUSION........................................................................................................................................... 40
6 Challenges ............................................................................................................................................... 41
7 Recommendation ................................................................................................................................... 42
8 References .............................................................................................................................................. 42
9 APPENDIX ................................................................................................................................................ 42
Programming source code .......................................................................................................................... 42
Table of Figures
FIGURE 2.1.......................................................................................................................................................................... 13
FIGURE 2.2.......................................................................................................................................................................... 17
FIGURE 3.1 BLOCK DIAGRAM OF THE SYSTEM.............................................................................................................................. 23
FIGURE 3.2 ARDUINO UNO ..................................................................................................................................................... 24
FIGURE 3.3 LCD DISPLAY ....................................................................................................................................................... 26
FIGURE 3.4 ALCOHOL SENSOR DIAGRAM .................................................................................................................................... 27
FIGURE 3.5 TEMPERATURE SENSOR CCT ..................................................................................................................................... 28
FIGURE 3.6 GSM ON ARDUINO UNO ......................................................................................................................................... 29
FIGURE 3.7 GSM ................................................................................................................................................................. 30
FIGURE 3.8 SCHEMATIC DIAGRAM OF GSM BASED MONITORING SYSTEM .......................................................................................... 37
FIGURE 4.1 NORMAL PATIENT CONDITION.................................................................................................................................. 38
FIGURE 4.2 ABNORMAL PATIENT CONDITION.............................................................................................................................. 39
6|Page
1 CHAPTER ONE
1.1 Introduction
Patient monitoring by definition is the repeated or continuous observation of vital signs or
physiologic functions to ensure patient safety and guide therapeutic interventions. Today, most
advanced monitoring systems depend on invasive sensors, cables, and bulky monitors to recognize,
transfer, process, and display the bio-signals to be monitored. Therefore, continuous advanced
monitoring is mainly restricted to the intensive care unit, the operating room, and the post
anesthesia care unit. Most other monitoring in the hospital continues to be basic and intermittent—
including monitoring on medical and surgical general care wards. When at home, before-and-after
hospital admission, patients are usually not monitored at all.
Current ward monitoring protocols typically consist of intermittent spot checks by a nurse about
every 4–8 h. This leaves patients unmonitored for most of the time during their hospital stay [
(Leuvan CH, 2008)]. Alterations in vital signs as warning signs of clinical deterioration are
frequently not or only belatedly recognized by the conventional spot check-based monitoring
strategy. In hospitalized patients recovering from non-cardiac surgery, severe prolonged
hypoxemia is common and unfortunately seriously underestimated using intermittent vital sign
checks [ (Duus CL, 2018)]. Similar patterns regarding the rate of recognized abnormal vital signs
were observed for tachycardia, bradycardia, tachypnea, and bradypnea. In patients recovering from
abdominal surgery on the general care ward, postoperative hypotension (mean arterial pressure <
65 mmHg for ≥ 15 min) has been shown to occur in about one fifth of patients and not to be
recognized by routine vital sign assessments in about half of the cases. In addition to missing
critical changes in vital signs, the recognition of abnormal vital signs by a bedside nurse often
triggers a long chain of commands resulting in delays until an intervention can be taken. A closed
claims analysis of opioid induced respiratory compromise on the general care ward identified
nearly half of all these events occurred within 2 h of the last nursing check. In addition, the authors
concluded that nearly all of these events would have been prevented by better continuous
monitoring and education [ (Lee LA, 2015;)]. Considering that most nursing spot checks of vital
signs leave gaps of about 4 h in-between two consecutive assessments, this period is associated
with the highest vulnerability
7|Page
Automated continuous noninvasive ward monitoring may enable clinical deterioration to be
identified well before a serious adverse event occurs. There is already some evidence that
intensified and automated ward monitoring of vital signs may improve patient outcome by a
reduction of rescue events . Before-and-after studies showed that the deployment of an electronic
automated advisory vital signs monitoring and notification system, is associated with significant
improvements in key patient-centered clinical outcomes in patients treated on the normal ward.
8|Page
1.3 Overall objectives
To design, implement, construct and test a prototype of a GSM based patient health monitoring system
9|Page
2 CHAPTER TWO
2.1 Literature review
Dae-Ki Cho (cho, 2015) et al did research on a remote medical monitoring system using
Bluetooth P2P networks [1]. In his research paper; with his colleagues from the University of
California, Los Angeles, one of their goals was to examine the possibility and effectiveness of
hospital networking using Bluetooth and data mulling of medical records from patients to an
Internet medical database. Patient data was collected from body sensors and stored on a Bluetooth
enabled gateway. The system was then designed such that once a designated caregiver (e.g. a
nurse), comes within the patient range, the patient’s gateway would initiate a connection to the
caregiver’s Bluetooth gateway (typically, a Smartphone) and transfer the stored data using a
Peerto-Peer (P2P) technique called Blue Torrent. Data can be transferred either on a preset
schedule (every 10 minutes) or immediately upon the availability of a caregiver. Later, the
caregiver, upon completing his/her round of patient visits, uploads the patient data to a central
server. This delivery can occur either directly (i.e. the same caregiver receives and then delivers
the data to server), or indirectly (the data has been opportunistically transferred from nurse to
nurse in a P2P manner). Blue Torrent is a P2P file sharing application based on ubiquitous
Bluetooth-enabled devices. It was originally proposed for sharing multimedia content such as
movie clips or music files, but it can easily be adopted and used for transfer of medical monitoring
data.
Blue Torrent works similarly to BitTorrent by splitting the files sent into small chunks before
propagating them to other nodes. The key difference between Bit Torrent and Blue Torrent is that
10 | P a g e
Blue Torrent is designed for single hop data transfers. This is due to the fact that TCP transfers
are unreliable over multi-hop wireless paths in general, and the challenges experienced in
maintaining a multi-hop (e.g. scatter net type) path in Bluetooth particularly. Thus, in Blue
Torrent, random pieces are transferred only between adjacent peer nodes and it also handles
transfers of multi-block files. Just like in BitTorrent, each node keeps track of the pieces received
at any point in time. Each receiving node will endeavor to complete the assembly of the file by
requesting the missing packets of the file from available neighboring nodes.
Other than the relaying of medical records from patients to the central Internet database, the
Bluetooth network may also be used to alert a medical attendant that a patient has a medical
emergency requiring immediate attention.
(Rishahb Jain, 2018)Here in his research he came up with IoT based Health Monitoring
System [3] which records the patient heart beat rate and body temperature and also send an
email/SMS alert whenever those readings go beyond critical values. Pulse rate and body
temperature readings are recorded over Thing Speak and Google sheets so that patient health
can be monitored from anywhere in the world over internet. A panic will also be attached so
that patient can press it on emergency to send email/SMS to their relatives
(Zhuang, 2016)Ho ting cheng and weihua Zhuang came up also with a related research
(Bluetooth-enabled in-home patient monitoring system) [4]. In their study they focused on
early detection of Alzheimer’s disease. They did in home patient location tracking and the
location information will then be recorded in a local database. With knowledge of the
movement pattern of a patient, a medical practitioner will be able to determine whether ta target
patient is developing Alzheimer’s disease.
11 | P a g e
(purnima, 2014)Purnima from Army Institute of Technology India, did a research in patient
monitoring (Zigbee and GSM based patient Health monitoring system) [2]. In his paper, patient
parameters were measured (temperature, heartbeat, ECG) and wirelessly transmitted using
ZigBee. The patient health is monitored and the acquired data is analyzed at a centralized ARM
microcontroller. If a particular patient’s health parameters fall below the threshold value, an
automated SMS is sent to the pre-configured Doctor’s mobile number using GSM module
interfaced to the ARM microcontroller.
The Arduino Uno is a microcontroller board based on the ATmega328. 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 an AC-to-DC adapter or battery to get started. is the Arduino Uno board
diagram.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver
chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.
The latest revision of the board has the following new features:
• 1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other new
pins placed near to the RESET pin, the IOREF that allow the shields to adapt to the
voltage provided from the board. In future, shields will be compatible with both the
board that uses the AVR, which operates with 5V and with the Arduino Due that
operates with 3.3V. The second one is a not connected pin that is reserved for future
purposes.
• Stronger RESET circuit.
• Atmega 16U2 replace the 8U2.
12 | P a g e
Figure 2.1
2.1.2 Summary
Microcontroller ATmega328
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz
2.1.3 Power
The Arduino Uno can be powered via the USB connection or with an external power supply.
The power source is selected automatically by the board.
External (non-USB) power can come either from an AC-to-DC adapter or a battery. The adapter
can be connected by plugging a center-positive plug into the board's power jack. Leads from a
battery can be inserted in the Gnd and Vin pin headers of the POWER connector.
13 | P a g e
The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however, the 5V pin is bound to supply less than five volts and the board may be unstable. If
supplied with more than 12V, the voltage regulator may overheat and damage the board.
Therefore, that means the recommended range is 7 to 12 volts.
• VIN. The input voltage to the Arduino board when it's using an external power source
(as opposed to 5 volts from the USB connection or other regulated power source). You
can supply voltage through this pin, or, if supplying voltage via the power jack, access it
through this pin.
• 5V. This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V),
or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins
bypasses the regulator, and can damage your board therefore it is discouraged.
• 3V3. A 3.3-volt supply generated by the on-board regulator. Maximum current that can
be drawn is 50 mA.
• GND. Ground pins.
• IOREF. This is a pin on the Arduino board that provides the voltage reference with
which the microcontroller operates. A properly configured shield can read the IOREF
pin voltage and select the appropriate power source or enable voltage translators on the
outputs for working with the 5V or 3.3V.
2.1.4 Memory
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). In addition to that it also has
2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM
library).
2.1.5 Input and Output
Each one of the 14 digital pins on the Arduino Uno can be used for input or output, using the
functions , digital Write, and digital Read. They operate at 5 volts with each pin providing or
receiving a maximum of 40 mA. Each pin has an internal pull-up resistor
(disconnected by default) of 20-50 KΩ. In addition to this, some pins have specialized
functions:
• Serial: 0 (RX) and 1 (TX). Receives (RX) and transmits (TX) TTL serial data.
These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL
serial chip. External Interrupts: 2 and 3. These pins can be configured to
trigger an interrupt on a low value, a rising or falling edge, or a change in value.
• PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog Write
function.
• SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
• LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
14 | P a g e
The Uno has 6 analog inputs, ranging from A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default, they measure from ground to 5 volts, though
it is possible to alter the upper end of their range using the AREF pin and the analog Reference
function. For the analog inputs too, some pins have specialized functionality:
• TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the
Wire library.
• AREF. Reference voltage for the analog inputs. Used with analog Reference.
• Reset. Bring this line LOW to reset the microcontroller. Typically used to add a
reset button to shields which block the one on the board.
2.1.6 Communication
The Arduino Uno has a number of avenues for effecting communicating with computers, other
Arduinos, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the
board channels this serial communication over USB and appears as a virtual com port to
software on the computer. The ‘16U2’ firmware uses the standard USB COM drivers, and no
external driver is needed. However, on Windows computers, a ‘.inf file’ is required. The
Arduino software includes a serial monitor which allows simple textual data to be sent to and
from the Arduino board. The RX and TX LEDs on the board will flash when data is being
transmitted via the USB-to-serial chip and USB connection to the computer (but not for serial
communication on pins 0 and 1).
A Software Serial library allows for serial communication on any of the Uno's digital pins.
In addition, the ATmega328 also supports I2C (TWI) and SPI communication. The Arduino
software includes a Wire library to simplify use of the I2C bus and for SPI communication,
SPI library is used.
2.2 Programming
To program the Arduino Uno, the Arduino software is used; it is an open source software so it
can be easily downloaded from the Arduino website. Once the software is installed, select
"Arduino Uno from the Tools > Board menu (according to the microcontroller on the board).
The ATmega328 on the Arduino Uno comes preboned with a bootloader that allows the user to
upload new code to it without the use of an external hardware programmer. It communicates
using the original STK500 protocol (reference, C header files).
Alternatively, the bootloader can be bypassed and the microcontroller programmed through the
ICSP (In-Circuit Serial Programming) header using Arduino ISP or similar.
15 | P a g e
2.2.1 Automatic (Software) Reset
To do away with the need of a physical press of the reset button before an upload, the Arduino
Uno is designed in a way that enables it to be reset by software running on a connected
computer. The reset line of the ATmega328 is connected to one of the hardware flow control
lines (DTR) of the ATmega8U2/16U2 via a 100 nano-farad capacitor. Asserting (taking low)
this line causes the reset line to drop long enough to reset the chip. The Arduino software uses
this capability to allow you to upload code by simply pressing the upload button in the Arduino
environment. This means that the bootloader can have a shorter timeout, as the lowering of DTR
can be well-coordinated with the start of the upload.
This setup has other implications. When the Uno is connected to either a computer running Mac
OS X or Linux, it resets each time a connection is made to it from software (via USB). For the
following half-second or so, the bootloader is running on the Uno. While it is programmed to
ignore malformed data (i.e. anything besides an upload of new code), it will intercept the first
few bytes of data sent to the board after a connection is opened. If a sketch running on the board
receives one-time configuration or other data when it first starts, make sure that the software
with which it communicates waits a second after opening the connection and before sending this
data.
The Uno contains a trace that can be cut to disable the auto-reset. The pads on either side of the
trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may also disable
the auto-reset by connecting a 110-ohm resistor from 5V to the reset line.
16 | P a g e
Figure 2.2
VCC
Vcc this is the voltage supply pin that powers the processor
GND
This is a zero potential connection point
17 | P a g e
Depending on the clock selection fuse settings, PB6 can be used as input to the inverting
Oscillator amplifier and input to the internal clock operating circuit.
Depending on the clock selection fuse settings, PB7 can be used as output from the inverting
Oscillator amplifier.
If the Internal Calibrated RC Oscillator is used as chip clock source, PB7.6 is used as TOSC2.1
input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.
Port C (PC5:0)
Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
PC5.0 output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port C pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical
characteristics of PC6 differ from those of the other pins of Port C.
If the RSTDISBL Fuse is unprogrammed, PC6 is used as a Reset input. A low level on this pin
for longer than the minimum pulse length will generate a Reset, even if the clock is not running.
Port D (PD7:0)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit).
The Port D output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port D pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
AVCC
AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It should be
externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be
connected to VCC through a low-pass filter. Note that PC6.4 use digital supply voltage, VCC.
AREF
18 | P a g e
AREF is the analog reference pin for the A/D Converter.
Normal human being body temperature is about 37.0 degree Celsius or 98.6-degree Fahrenheit.
However, body temperature also varies depend on sickness or individual conditions such as
metabolism or physiological conditions.
The temperature sensor measures, transmits a digital signal to the Arduino board. In the
Arduino board a decision is made:
If the temperature is within 36 to 42 degrees Celsius, it’s deemed to be normal, a signal value is
sent to the LCD display unit, but if the temperature measured falls outside of the limits, it’s sent
19 | P a g e
to the display unit and the GSM SIM900 GSM/GPRS module which is sent to the mobile phone
of the care giver.
2.1 MQ3 Alcohol Sensor
MQ-3 alcohol sensor below in fig.2.4 detects ethanol in the air. It is used to detect alcohol in the
human breath. It has 6pins, the cover and the body. 2 pins are used for heating system, while other
2 are for connecting power and ground. It also has Alumina tube cover by SnO2, which is tin
dioxide. And between them there is an Aurum electrode. See the sensor with the pins in (figure
2.4)
Operating voltage 5V
Sensing Resistance 1 MΩ – 8 MΩ
If coil inside electrode is heated, SnO2 ceramics will become the semi – conductor which means
that it can make some current flow. When there are alcohol molecules in the breath of the patient,
it meets the electrode that is between alumina and tin dioxide, ethanol burns into acetic acid then
20 | P a g e
more current is produced. So, the more alcohol molecules there are, the more current we will get.
Because of this current change, we get the different values from the sensor.
Very low-cost cellphone module. A mini GSM / GPRS breakout board based on SIM800L
module, supports quad-band GSM/GPRS network, available for GPRS and SMS
message data remote transmission.
21 | P a g e
The board features compact size and low current consumption. With power saving
technique, the current consumption is as low as 1mA in sleep mode.
It communicates with microcontroller via UART port, supports command including 3GPP
TS 27.007, 27.005 and SIMCOM enhanced AT Commands.
In transmission the module can consume up to 2 Amps of current. You will need to power
the module between 3.7V and 4.2V.
Features
- Quad-band 850/900/1800/1900MHz
- Connect onto any global GSM network with any 2G SIM
- Make and receive voice calls using a headset or an external speaker such as this and an
electret microphone such as this.
- Send and receive SMS messages.
- Send and receive GPRS data (TCP/IP, HTTP, etc.).
- Find GSM (GPRS) location - this is not GPS.
- AT command interface with "auto baud"
3 METHODOLOGY
This project is divided into two parts:
Hardware design
Software design
Hardware design focuses on the main controller hardware, Arduino Uno board and how is
connected to the sensors, the display unit and the GSM.
22 | P a g e
Figure 3.1 block diagram of the system
23 | P a g e
The Arduino Uno in fig.3.2 is the heart of the whole system because it controls all the other
components used in the prototype. It receives all the raw data from the sensors, processes it and
sends it for display. In case of need to send it over the GSM network, it also prompts the GSM
module to send to the required GSM device. It achieves all these by the use of the ATmega328P
microcontroller that does all the processing after receiving the inputs from the sensors and gives
the output the LCD display and the GSM module
A circuit will be developed and a prototype with the Arduino Uno as the heart and the controller
of the GSM enable patient monitoring system.
The 20x4 LCD below in fig.4.4 uses the common HD44780 interface
Pin 1- Ground
Pin 2- +5V
Pin 3- Contrast adjustment
Pin 4- H/L Register Select
Pin 5- H/L Read/Write
Pin 6- H/L Enable
Pin 11- DB4
Pin 12- DB5
24 | P a g e
Pin 13- DB6
Pin 14- DB7
25 | P a g e
Figure 3.3 LCD display
26 | P a g e
Figure 3.4 alcohol sensor diagram
The DS18B20 sensor can be powered by between 3.0V and 5.5V so connection of its GND pin
to 0V and the VDD pin to +5V from the Arduino is possible. Alternatively, the DS18B20 can
also extract its power from the data line which means only two wires can be needed to connect
it effectively making it great for use as an external sensor. Below is a circuit diagram of the
sensor connected to the Arduino. See fig 3.5
27 | P a g e
Figure 3.5 temperature sensor cct
The modem can need up to 2.5A of current at peak usage, which mostly occurs during data
transmission. This current is availed through the large orange capacitor on the board's surface.
28 | P a g e
• Net: blinks when the modem is communicating with the radio network.
To use the shield, a SIM card is inserted into the holder. The metal bracket is slid away from
the edge of the shield and the cradle lifted up.
The SIM is inserted in the plastic holder so the metal contacts are facing the shield, with the notch
of the card at the top of the bracket. The SIM is slid all the way into the bracket. The SIM is
pushed to the board and the metal bracket slid towards the edge of the shield to lock it in place.
Once the SIM is inserted, the GSM shield is mounted on top of an Arduino board as shown in fig
.3.6. To upload sketches to the board, I connect it to your computer with a USB cable and upload
my sketch with the Arduino IDE. Once the sketch has been uploaded, the board can be
disconnected from the computer and power it with an external power supply.
29 | P a g e
Digital pins 2, 3 and 7 are reserved for communication between the Arduino and modem as
shown below in fig 4.8. Communication between the GSM shield and Arduino is handled by the
software serial library on pins 2 and 3. Pin 7 is used for the modem reset.
When modem is powered the yellow status LED turns on, and you can try connecting to the
network.
Developer versions of the GSM shield require the user to press the Power button on the shield
for a few moments to turn the modem on.
30 | P a g e
3.5.3 GSM Library
Communication between Arduino and the GSM shield is handled by the GSM library. The
majority of functions are for data management, voice, and SMS communication. In addition, there
are a number of utilities for managing information about the modem and the SIM card's PIN too.
The following code is for interfacing the Arduino circuit board with the LCD display:
The following code is for programming the GSM SIM800 to send the sms:
31 | P a g e
char text[]="System Online"; //SMS to send
intnumdata; boolean started=false;
charsmsbuffer[160]; char n[20];
inttempThreshold = 35; intbreaThreshold =
100; intalcoSensor; intheartRate;
int16_t raw = (data[1] << 8) | data[0];
void setup(void) {
lcd.begin(16, 2);
// Print a message to the LCD.
Serial.begin(9600);
Serial.begin(9600);
Serial.println("GSM initialization");
Serial.println("Loading phone number...");
Serial.println("Initializing number ");
Serial.println("Auto_Check mode...");
The following code is for the process of sending sms to the provided phone number and the
message displayed on the LCD display:
lcd.setCursor(0,0); lcd.print("Patient
Alert Systm");
lcd.setCursor(0,1); // Set LCD cursor position (column 0, row 0)
lcd.print("System Config...");
// Start GSM shield
Serial.println("Patient Alert Systm");
//Start configuration of shield with baudrate.
//For http uses is raccomanded to use 4800 or slower. if
(gsm.begin(2400)) {
Serial.println("\nstatus=READY"); started=true;
} else Serial.println("\nstatus=IDLE");
if(started) {
lcd.setCursor(1,1); // Set LCD cursor position (column 0, row 0)
lcd.print("Sending ConfigMsg");
32 | P a g e
//Enable this two lines if you want to send an SMS. if
(sms.SendSMS("+254723513536", "System Activated"))
Serial.println("\nSMS sent OK");
lcd.setCursor(0,1); // Set LCD cursor position (column 0, row 0)
lcd.print("ConfigMessaga Sent");
} else
{
Serial.println("Not connected"); lcd.clear();
lcd.setCursor(0,1); // Set LCD cursor position (column 0, row 0)
lcd.print("CONNECTION ERROR");
delay(1000);
}
}
if ( !ds.search(addr)) {
Serial.println("No more addresses.");
Serial.println();
ds.reset_search(); delay(250);
return;
}
if (OneWire::crc8(addr, 7) != addr[7]) {
Serial.println("CRC is not valid!"); return;
}
Serial.println();
The following code is for programming the internal working of the Arduino uno processor:
33 | P a g e
// the first ROM byte indicates which chip
switch (addr[0]) { case 0x10:
Serial.println(" Chip = DHT11"); // or old DS1820
type_s = 1; break; case 0x28:
Serial.println(" Chip = DS18B20");
type_s = 0; break; case 0x22:
Serial.println(" Chip = DS1822");
type_s = 0; break; default:
Serial.println("Device is not a DS18x20 family device."); return;
}
ds.reset(); ds.select(addr);
ds.write(0x44, 1); // start conversion, with parasite power on at the end
The following code is for programming the input of the temperature sensor:
34 | P a g e
raw = (raw & 0xFFF0) + 12 - data[6];
}
} else {
bytecfg = (data[4] & 0x60);
// at lower res, the low bits are undefined, so let's zero them if
(cfg == 0x00) raw = raw & ~7; // 9 bit resolution, 93.75 ms else
if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms else if
(cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms
//// default is 12 bit resolution, 750 ms conversion time
}
celsius = (float)raw / 16.0; fahrenheit
= celsius * 1.8 + 32.0;
Serial.print(" Temperature = ");
Serial.print(celsius);
Serial.print(" Celsius, ");
Serial.print(fahrenheit);
Serial.println(" Fahrenheit");
lcd.clear(); lcd.setCursor(0,0);
lcd.print("Patient Alert Systm");
//Serial.print(" Temperature = ");
lcd.setCursor(0,1); // Set LCD cursor position (column 0, row 0)
lcd.print("Temperature: ");
lcd.setCursor(12,1); // Set LCD cursor position (column 0, row 0)
lcd.print(celsius);
lcd.setCursor(16,1);
lcd.print("Celsius"); //
Serial.print(celsius);
35 | P a g e
lcd.setCursor(0,3); // Set LCD cursor position (column 0, row 0)
lcd.print("Heart Rate: ");
lcd.setCursor(11,3); // Set LCD cursor position (column 0, row 0)
lcd.print(heartRate); lcd.setCursor(16,3); lcd.print("BPM"); //Serial.print(heartRate);
delay(1000);
The following code is for sending sms alert if the threshold specified are not met:
if(celsius>tempThreshold)
{
sms.SendSMS("+254723513536", "UBNORMAL TEMP");
}
if(alcoSensor>breaThreshold )
{
sms.SendSMS("+25423513536", "UBNORMAL RESP");
}
36 | P a g e
3.5.5 Schematic diagram
37 | P a g e
Figure 4.1 normal patient condition
38 | P a g e
Figure 4.2 Abnormal patient condition
4.3 Conclusions
➢ From simulations patients’ parameters; temperature, heartbeat rate and respiration were
successfully simulated.
➢ The system was able to measure all the parameters continuously. Immediately when the
specified limit was exceeded, a virtual sms was received in the virtual phone.
➢ From the results its promising that the implementation of the system can achieve the
project objectives
4.4 PRACTICAL RESULTS
The LCD display results of the temperature, the respiratory and the heartbeat sensor
39 | P a g e
Figure 4: Body Temperature Displayed
The following is a sms alert sent to the care giver’s phone in case threshold is exceeded.
5 CONCLUSION
Use of wireless technologies and more so the GSM based patient monitoring system could have a
great impact in medical applications since it can provide long term, real time and nonobstructive
medical supervision to the patients. Therefore, this wireless technology effectively enhances the
quality of life and reduces of burden cost especially in the hospitals and nursing care homes for the
old. The challenge of limited bed space in the hospital wards can also be effectively reduced by
the adoption of this system. By the use of the system, the patients can be monitored continuously
40 | P a g e
even after they have been discharged to go home or any other places that could be far from the
doctors, nurses or any other healthcare providers.
For demonstration, I developed a prototype of a GSM based patient monitoring system with a
number of sensors. Based on the results obtained from the project prototype, it was a clear
demonstration that the project achieved the objectives.
It was possible to interface the Arduino Uno board with three sensors (temperature, heart rate and
respiratory sensors) and a GSM module. The sensors were used to collect the temperature, heart
beat and respiratory status of a dummy patient and the information processed and displayed on a
16x2 LCD display. In case the above parameters at any point in time do not meet the given threshold
measurements they trigger the GSM to send an alarm text message to the GSM mobile phone
number given so as to alert the care giver and prompt him/her to respond appropriately. All the
interfacing of the involved components was achieved through the programming using the Arduino
software.
This Project was aimed at producing a better system in terms of coverage of the communication
equipment and also cut on the cost to come up with a cheap system. This was achieved by the use
of the GSM technology instead of the Bluetooth and Wi-Fi technologies that have been used in the
past that are quite limited.
6 Challenges
Although we were successful in the use of cheap sensors, they face a limitation of low accuracy and
susceptibility to noise from the surrounding environment. The heartbeat sensor which uses infra-red
technology is affected by radiations from the surrounding environment so that it will keep
incrementing the values obtained even without introducing the required parameter. We also faced
the challenge of lack of the right sensor for measuring the respiration rate of the patient, and were
forced to replace it with an alcohol sensor which did not serve as a perfect alternative. This was due
to unavailability of a small and cheap respiratory sensor; the ones available were bulky and too
expensive.
41 | P a g e
7 Recommendation
To be able to successfully commercialize the device for use by the public, some improvements
should be considered so as to bring in more vitals parameters and by so doing make it more
valuable to the patients. This can be achieved by bringing in more sensors in order to
comprehensively be able to monitor the patients.
There is need for better sensors to be used in place of the ones used in this project due to the challenge
of inaccuracy and low immunity to noise from the surrounding leading to poor results .
8 References
1 cho, D.-k., 2015. opportunistic Medical monitoring using bluetooth p2p networks. IEE, 12 10, pp.
4450.
2 Dublin, 2021. Global Remote Patient Monitoring Markets, 2020-2021 & Forecast to 2025 -
ResearchAndMarkets.com, s.l.: BusinessWire.
3 purnima, p. s., 2014. Zigbee and GSM Based patient Health Monitoring System. India, ICECS.
4 Rishahb Jain, 2018. IoT Based Patient Health Monitoring System using ESP8266 and Arduino. circuit
digests, 20 september, pp. 20-40.
5 Zhuang, H. .. T. C. a. W. .., 2016. bluetooth-enabled in-home patient monitoring system. IEEE Wireless
Communications, 10 february, pp. 74-79.
9 APPENDIX
Programming source code
initialize the library instance
#include <OneWire.h>
#include "SIM800.h"
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
#include "sms.h"
SMSGSM sms;
42 | P a g e
OneWire ds(5); // on pin 10 (a 4.7K resistor is necessary)
void setup(void) {
lcd.begin(16, 2);
// Print a message to the LCD.
Serial.begin(9600);
// initialize serial communications and wait for port to open:
Serial.begin(9600);
Serial.println("GSM initialization");
Serial.println("Loading phone number...");
Serial.println("Initializing number ");
Serial.println("Auto_Check mode...");
lcd.setCursor(0,0); lcd.print("Patient
Alert Systm");
lcd.setCursor(0,1); // Set LCD cursor position (column 0, row 0)
lcd.print("System Config...");
// Start GSM shield
Serial.println("Patient Alert Systm");
//Start configuration of shield with baudrate. //For
http uses is raccomanded to use 4800 or slower. if
(gsm.begin(2400)) {
Serial.println("\nstatus=READY"); started=true;
} else Serial.println("\nstatus=IDLE");
if(started) {
lcd.setCursor(1,1); // Set LCD cursor position (column 0, row 0)
lcd.print("Sending ConfigMsg");
//Enable this two lines if you want to send an SMS. if
(sms.SendSMS("+254723513536", "System Activated"))
Serial.println("\nSMS sent OK");
lcd.setCursor(0,1); // Set LCD cursor position (column 0, row 0)
lcd.print("ConfigMessaga Sent");
} else
{
Serial.println("Not connected"); lcd.clear();
43 | P a g e
lcd.setCursor(0,1); // Set LCD cursor position (column 0, row 0)
lcd.print("CONNECTION ERROR");
delay(1000);
}
}
if ( !ds.search(addr)) {
Serial.println("No more addresses.");
Serial.println();
ds.reset_search(); delay(250);
return;
}
if (OneWire::crc8(addr, 7) != addr[7]) {
Serial.println("CRC is not valid!"); return;
}
Serial.println();
ds.reset(); ds.select(addr);
ds.write(0x44, 1); // start conversion, with parasite power on at the end
44 | P a g e
delay(1000); // maybe 750ms is enough, maybe not
// we might do a ds.depower() here, but the reset will take care of it.
45 | P a g e
Serial.print(fahrenheit);
Serial.println(" Fahrenheit");
lcd.clear(); lcd.setCursor(0,0);
lcd.print("Patient Alert Systm");
//Serial.print(" Temperature = ");
lcd.setCursor(0,1); // Set LCD cursor position (column 0, row 0)
lcd.print("Temperature: ");
lcd.setCursor(12,1); // Set LCD cursor position (column 0, row 0)
lcd.print(celsius); lcd.setCursor(16,1); lcd.print("Celsius"); // Serial.print(celsius);
46 | P a g e