The document describes a wireless medical surveillance system using a Raspberry Pi and X-Bee devices. It discusses how existing patient monitoring systems use wired connections that make it difficult to monitor patients who need to be moved. The proposed system uses wireless sensors connected to an X-Bee module to transmit patient data like temperature, oxygen levels, ECG readings to a Raspberry Pi base station. This allows for continuous remote monitoring of patients and alerts caregivers if readings exceed thresholds, making the system more flexible and effective for medical care.
2. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 2
1.1 Prelude
Nowadays, wireless communication is more popular and powerful communication
technique over the wired communication. In medical science, wireless application rapidly
increased with number of advantages over the wired connection such as, its ease to use, its
reduced risk of infection, failure and patient discomfort, to enhance mobility. The low cost
portable devices like heart rate monitors, SPO2 sensor, temperature monitoring,
ECG(Electrocardiogram) and EMG (Electromyography) sensor, are essential instruments in
intensive care. It is difficult to monitor the patients continuously, this kind of patients attached
with relevant sensors to the body and the patient become sequentially bed bound with sensors.
Earlier the patient is monitored from ICU and sends the patient condition to the bed side PC
through wired communication. Whenever patient needs to be moved from bed, all patient
monitoring device has to be disconnected and then need to be reconnected it later.
The use of sensor with X-Bee module and GSM will make patients monitoring systems
more effective. Here Raspberry Pi is used to continuously update patient’s data to the monitoring
system.
Wireless Sensor Network used to monitor the patient’s physiological conditions
continuously using X-Bee technology. The X-Bee based sensor network makes the transmission
of patient’s data to a remote base station (Raspberry pi). The use of X-Bee makes it a low power
device. A patient monitoring system during the critical situation plays a vital role in every house.
Point-of-care (POC) patient monitoring refers to near patient testing, usually outside the central
hospital or primary care facility. The remote monitoring of patients health using Wireless Sensor
Networks makes the system more centralized and makes the sensing wireless. Raspberry Pi makes
the system to update the data acquired using wireless sensor network to the server using which a
central monitoring of patients is done. In the proposed system, the patient’s physiological
conditions are acquired by the wireless sensors nodes attached on the patient body, and are then
transmitted to the remote base-station. The base station is designed using a Raspberry Pi. These
features are explored to communicate with the wireless sensor network designed to acquire data
and update the status to monitoring display.
3. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 3
1.2 Motivation
We have seen in many hospitals that patients have been suffering from various critical
conditions like increasing in temperature, and some critical heart related diseases.
Due to lack of Nurse and hospital authorities are not able to observe every patient
simultaneously. In rural areas there are very few number of doctors are available, So we have
decided to develop this system.
4. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 4
1.3 Problem Statement
In hospital’s patient monitoring system contains various parameters like body
temperature, Oxygen level, blood pressure etc. It is actually bed side system all the
instruments connected to patients body using wires, and monitor is located in same room so
nurse have to come frequently and check condition of patient. Another major problem is that
if in any emergency we want to move patient from one place to other place the bed side
system should have to remove and hence we can’t monitor patient.
5. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 5
1.4 Objectives of Proposed Work
To replace bed-side PC monitoring with wireless PC in ICU (Intensive Care Unit) of
hospital's.
To provide accurate data about patient wellness so that Doctor can make proper treatment
to patient.
To make hospital surveillance system more flexible with high accuracy.
6. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 6
Chapter 2.
Literature Review
7. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 7
2.1 Introduction:
Nowadays the world is facing many challenges in reducing energy consumption and
global warming. In the same time there are many technologies that can be used to resolve these
problems and moreover support better living. High accuracy and low power consumption with
low cost is the main parameters of any project. Literature survey gives us an idea about previous
work done on particular project, so that we can implement system better and flexible. There are
various systems available for patient monitoring as stated next.
8. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 8
2.2 Microcontroller Based Heart Beat Monitoring system:
Heart rate is the number of heartbeats per unit of time, typically expressed as beats per
minute. Heart rate can vary as the body's need to absorb oxygen and excrete carbon dioxide
changes during exercise or sleep. The measurement of heart rate is used by medical professionals
to assist in the diagnosis and tracking of medical conditions. It is also used by individuals, such as
athletes, who are interested in monitoring their heart rate to acquire maximum efficiency. Changes
in lifestyle and unhealthy eating habits have resulted in a dramatic increase in incidents of heart
and vascular diseases. Furthermore, heart problems are being increasingly diagnosed on younger
patients. Worldwide, Coronary heart disease is now the leading cause of death. Thus, any
improvements in the diagnosis and treatment tools are welcomed by the medical community. In a
clinical environment, heart rate is measured under controlled conditions like body temperature
measurement, heart beat measurement, Electromyography and Electrocardiogram. However, there
is a great need that patients are able to measure the heart rate in the home environment as well.
The heart rate rises gradually during exercises and returns slowly to the rest value after exercise.
The rate at which the pulse returns to normal is an indication of the fitness of the person. This
paper presents the design and implementation of a compact and low cost microcontroller-based
portable system used for monitoring of heart beat on real time and alerting about patient to a care
person in real time.
Fig.2.1: Heart Beat monitoring System
9. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 9
2.3 Real Time Wireless Health Monitoring System:
In this paper a real time telemonitoring system for health care is presented. In order to
monitor conditions of patients and performance of athletes the system can be used in hospitals and
gymnasiums. The system consists of sensors (Temperature, SPO2, Heart Rate, Breath Rate) for
data acquisition, data transmission devices and LabVIEW for Soft Computing and graphical user
interface (GUI). Received physical parameters can be used for calculation of Anaerobic Threshold
(AT), VO2max and Total Calories Burned (TCB) during exercise. In fitness laboratories
performance of athletes is judged with VO2max, AT and TCB. Proposed Health Monitoring
System can considerably improve existing infrastructure of Hospitals and Gymnasiums. Results
of vital signs monitoring are accurate and energy estimations based on the system are reliable.
Fig. 2.2: Wireless Health Monitoring System
10. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 10
2.4 Mobile Device Based ECG Analysis System:
Coronary heart disease (CHD) such as heart disease is the most common cause of sudden
death in many countries. Its main manifestations consist of Acute Myocardial Infarction (AMI, or
heart attack) and angina. Heart failure and stroke cause a big burden on society due to their high
costs of care, lower quality of life and premature death. Among those having a heart attack, about
25% die within an hour of their first-ever symptoms and over 40% will be dead within a year. So,
for the 40% who would generally be dead in one year, wireless monitoring can be a life saver.
Comparing with monitoring at hospital premises, home based telemonitoring not only
provides great financial advantage but also gives patients freedom of staying home and living a
normal life with their family. Moreover, rural hospitals with limited healthcare resources also
benefit from telemonitoring service if those hospitals are connected with major advanced
hospitals in metropolitan areas.
The Electrocardiograph is the electric signal generated by the heart activities. ECG is of
significant diagnostic value to various cardiovascular diseases. ECG signal is one vital
physiological signal that telemonitoring systems normally pay attention. A typical telemonitoring
system includes medical signal or image acquisition, data storing, data analysis, and data
transmission subsystems. Thus a telemonitoring system needs to have sufficient data processing
power and processing speed to handle the required high computation overhead.
In this paper, it is proposed that an electrocardiogram signal monitoring and analysis
system utilizing the computation power of mobile devices. This system has good extensibility and
can easily incorporate other physiological signals to suit various telehealth scenarios. The system
can be carried by both users, e.g., chronic patient, and the service providers, e.g., the medical
doctors. Java TM based software running on the mobile phones performs computation intensive
tasks like raw ECG data compression and decompression, encryption and detection of
pathological patterns. The system can automatically alert medical service providers through Short
Message Service and Multimedia Message Service, when medical assistance is deemed crucial for
the user based on the analysis results.
11. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 11
2.5 Conclusion:
According to literature survey there are various health monitoring systems using different
microcontrollers, zigbee and other communication channels like bluetooth etc. but these systems
has some disadvantages like some of them are still wired, few number of sensors and in some of
them communication range is the main problem.
12. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 12
Chapter 3.
Block Diagram And Flowchart
13. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 13
3.1 Introduction:
The temperature sensor, SpO2 sensor, heart beat sensor, ECG sensor and EMG sensor are
connected to X-bee module. One more push button is connected to X-bee module to alert the
Nurse as well as Doctor if any emergency case. X-bee module 1 transmit the data to Raspberry Pi
module. X-bee module 2 connected to Raspberry pi which act as receiver. Data is processed in
Raspberry pi and displayed on monitoring display. If any value exceeds beyond the specified or
threshold limit system alert is generated.
14. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 14
3.2 Block Diagram:
Fig. 3.1: Functional block diagram
The whole system architecture is shown in fig. 3.1. It is composed of medical sensor nodes
such as temperature sensor, heart rate sensor, SpO2 sensor, EMG sensor, ECG sensor and
alarming switch. Sensors are connected to X-Bee (IEEE 820.15.4 standard). Results of sensors are
sent to Raspberry Pi through X-Bee transceiver. The values are displayed on Graphical user
interface along with ECG graph GUI. In case of patient monitoring if there is any abnormality in
physical parameters alarm is generated.
15. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 15
3.3 Flowchart:
START
Initialize Sensors and display
STOP
If sensor output
> threshold
?
Turn on Alarm & Show notification
Display the measured parameters of GUI
Take input from sensors
Transmit data through transceiver to Processor
YES
NO
16. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 16
Chapter 4.
System Design
17. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 17
4.1 Raspberry Pi 2 module.
4.2 Temperature sensor
4.3 SpO2 sensor.
4.4 EMG (electromyography) sensor.
4.5 X-bee Transceiver.
4.6 GUI (Graphical User Interface)
4.7 ECG Sensor
18. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 18
4.1 Raspberry Pi 2 module:
Broadcom BCM2835 – single core
ARM1176
Lower power consumption- between 0.5 to 1W.
Neater form factor.
Video support- HDMI – 1080p
RCA (analog), without audio
DSI* – for touchscreens
Speed-700MHz
RAM- 512 MB
USB 2.0 -4X PORTS
EXTERNAL STORAGE-SD-card, & support for an external USB2.0 drive
40 GPIO pins
ADC support
Fig.4.1: Raspberry Pi 2Model B
19. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 19
4.1.1 Comparision of different Raspberry Pi Models
Table.1: Comparison of different Raspberry Pi Models
Raspberry Pi
Model
Model A+ Model B Model B+ 2,Model B
Price in INR 1340 2680 2010 2680
Quick summery Cheapest, smallest
single board computer
The original
Raspberry Pi
More USB and GPIO
than B.
Newest, most
advanced
Raspberry Pi
Chip Broadcom BCM 2835 Broadcom BCM
2836
Processor ARM v6 single core ARMv7 quad core
Processor Speed 700 Mhz 900 MHz
Voltage and power
draw
600mA @ 5V 650mA @ 5V
GPU Dual Core VideoCore IV Multimedia Co-Processor
Size 65x56 mm 85x56 mm
Memory 256 MB SDRAM
@400 MHz
512 MB SDRAM @400 MHz 1 GB SDRAM
@400 MHz
Storage Micro SD
(Not included)
Micro SD
(Not included)
Micro SD
(Included)
Micro SD
(Not included)
GPIO 40 26 40
USB 2.0 1 2 4
Ethernet None 10/100 mb Ethernet RJ45 Jack
Audio Multi-Channel HD Audio over HDMI, Analog stereo from 3.5 mm Headphone Jack
20. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 20
4.2 Temperature sensor:
Normal human body temperature, also known as normothermia or euthermia, is a narrow
temperature band indicating optimal health and thermoregulation. Individual body temperature
depends upon the age, sex, health, and reproductive status of the subject, the place in the body at
which the measurement is made, the time of day, the subject's state of consciousness (waking or
sleeping), activity level, and emotional state.
The measurements taken form body parts, such as under the arm or in the ear, produce
different typical temperatures. While some people think of these averages as representing normal
or ideal measurements, a wide range of temperatures has been found in healthy people. The body
temperature of a healthy person varies during the day by about 0.5 °C (0.9 °F) with lower
temperatures in the morning and higher temperatures in the late afternoon and evening, as the
body's needs and activities change. Other circumstances also affect the body's temperature. The
core body temperature of an individual tends to have the lowest value in the second half of the
sleep cycle; the lowest point, called the nadir, is one of the primary markers for circadian rhythms.
The body temperature also changes when a person is hungry, sleepy, sick, or cold.
Human body temperature is of interest in medical practice, human reproduction, and athletics
Temperature classification:
Hypothermia <35.0 °C (95.0 °F)
Normal 36.5–37.5 °C (97.7–99.5 °F)
Fever >37.5 or 38.3 °C (99.5 or 100.9 °F)
Hyperthermia >37.5 or 38.3 °C (99.5 or 100.9 °F)
Hyperpyrexia >40.0 or 41.5 °C (104.0 or 106.7 °F)
• Temperature is the most-measured process variable in medical surveillance system
a temperature sensor is used to convert temperature value to an electrical value.
• Temperature sensors are the key to read temperature correctly and to control temperature
of the human body.
• LM35 is a precision IC temperature sensor, whose output voltage proportional to the
Fahrenheit temperature.
• You can measure temperature more accurately than a using thermistor. The sensor
circuitry is sealed and not subject to oxidation, etc.
• Possesses a low self-heating capability.
• The output voltage is converted to temperature by a simple conversion factor.
• The operating temperature range is from -55°C to 150°C.
21. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 21
Pin diagram:
Fig. 4.2: Temperature sensor
Features:
• Calibrated directly in ˚ Celsius (Centigrade)
• Linear + 10.0 mV/˚C scale factor
• 0.5˚C accuracy guarantee able (at +25˚C)
• Rated for full −55˚ to +150˚C range and Suitable for remote applications
• Low cost due to wafer-level trimming
• Operates from 4 to 30 volts
• Less than 60 µA current drain
• Low self-heating, 0.08˚C in still air
• Nonlinearity only ±1⁄4˚C typical
• Low impedance output, 0.1 Ω for 1 mA load
22. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 22
4.3 SpO2 sensor:
It is a device which measures the percentage of molecules of haemoglobin in the arterial
blood saturated with the oxygen. The sensor is put over the thin part of the body. Within the SpO2
sensor, there is a light sensor containing two LEDs as light sources, which emit red and infrared
light, on one side and a light sensitive photo-detector on the other one.
The lights shine through the body tissues in particular sequences. First the SpO2 activates
the red light and it passes through the body tissues and gets to the detector on the other side. Then,
the red LED light goes off, whilst infrared LED goes on. The detector records the amount of LED
lights plus room lights which fall on it. Eventually, when both lights are off, the only light which
falls on the detector is room light. At this stage, the amount of the room light is known, thus the
sensor can subtract it from LED lights to measure the amount of red and infrared lights seen by
the detectors. The quantity of light received by the detector reveals the percentage of oxygenated
blood concentration. Oxygenated haemoglobin absorbs more red lights, which have a wavelength
of 660nm and deoxygenated haemoglobin absorbs more infrared lights with wavelength of
910nm. By comparing the red and infrared lights, the equipment can calculate the amount of
oxygen in the body. Transmission method is used to detect light passing through the finger. In this
method, the emitter and photo detector are placed opposite each other with the finger in between
such that light can then pass through the finger.
Fig. 4.3: Source and Detector Configuration of SpO2 sensor
23. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 23
4.4 EMG Sensor:
Fig.4.4: EMG Sensor
Description:
1) Connect the power supply (two 9V batteries) a. Connect the positive terminal of the first 9V
battery to the +Vs pin on your sensor. b. Connect the negative terminal of the first 9V battery to
the positive terminal of the second 9V battery. Then connect to the GND pin on your sensor. c.
Connect the negative terminal of the second 9V battery to the –Ve pin of your sensor.
2) Connect the electrodes a. After determining which muscle group you want to target (e.g. bicep,
forearm, calf), clean the skin thoroughly. b. Place one electrode in the middle of the muscle body,
connect this electrode to the RED Cable’s snap connector. c. Place a second electrode at one end
of the muscle body, connect this electrode to the Blue Cable’s snap connector. d. Place a third
electrode on a bony or non-muscular part of your body near the targeted muscle, connect this
electrode to the Black Cable’s snap connector.
3) Connect to a Microcontroller (e.g. Raspberry Pi) a. Connect the SIG pin of your sensor to an
analog pin on the Raspberry Pi. Connect the GND pin of your sensor to a GND pin on the
Raspberry Pi.
24. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 24
EMG testing has a variety of clinical and biomedical applications. EMG is used as a
diagnostics tool for identifying neuromuscular diseases, or as a research tool for studying
kinesiology, and disorders of motor control. EMG signals are sometimes used to guide botulinum
toxin or phenol injections into muscles. EMG signals are also used as a control signal
for prosthetic devices such as prosthetic hands, arms, and lower limbs.
EMG then acceleromyograph may be used for neuromuscular monitoring in general
anesthesia with neuromuscular-blocking drugs, in order to avoid postoperative residual
curarization (PORC).
Except in the case of some purely primary myopathic conditions EMG is usually performed with
another electrodiagnostic medicine test that measures the conducting function of nerves. This is
called a nerve conduction studies . Needle EMG and nerve conduction studies are typically
indicated when there is pain in the limbs, weakness from spinal nerve compression, or concern
about some other neurologic injury or disorder. Spinal nerve injury does not cause neck, mid back
pain or low back pain, and for this reason, evidence has not shown EMG or nerve conduction
studies to be helpful in diagnosing causes of axial lumbar pain, thoracic pain, or cervical spine
pain. Needle EMG may aid with the diagnosis of nerve compression or injury, nerve root injury,
and with other problems of the muscles or nerves. Less common medical conditions include
amyotrophic lateral sclerosis, myasthenia gravis, and muscular dystrophy.
25. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 25
PCB Layout of EMG sensor:
Fig.4.5: PCB layout of EMG sensor
26. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 26
4.5 X-bee Transceiver:
X-Bee 802.15.4 OEM RF modules are embedded solutions providing wireless end-point
connectivity to devices. These modules use the IEEE 802.15.4 networking protocol for fast point-
to-multipoint or peer-to-peer networking.
X-Bee is an adaptation of the IEEE 80.15 low-data rate WPAN standard. The technology
is an alternative to Bluetooth and WiFi networking. Unlike Bluetooth and Wifi, X-Bee requires
low data rate (from 250 kbps at 2.4 GHZ to 20 kbps at 868 MHz). X-Bee uses low energy
consumption and are low cost devices.
X-Bee alliance defined two types of physical devices by in order to lower the costs. Full
Function Device (FFD) allows building any topology. It can take a role of a network coordinator
and is able to communicate with any other X-Bee device. In a network it takes a similar role to a
master unit in Bluetooth, however the physical design is different to the other type of device (in
Bluetooth the devices are in general the same any anyone can take the role of a network
coordinator). Reduced function device (RFD) can be used only in a star topology and only as a
distant unit. It is controlled be an (FFD) and can communicate only with it after. The
implementation of an RFD is strongly simplified comparing to FFD, which significantly lower the
cost of the whole system.
X-Bee modules are ideal for low-power, low-cost applications. X-Bee-PRO modules are
power-amplified versions of X-Bee modules for extended-range applications. Part of the X-Bee
family of RF products, these modules are easy-to-use, share a common footprint, and are fully
interoperable with other X-Bee products utilizing the same technology. Module users have the
ability to substitute one X-Bee module for another with minimal.
27. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 27
Fig.4.6: X Bee S2 Model Fig.4.7: X Bee S2 Model Pin diagram
Features and Benefits
No configuration needed for out-of-the-box RF communications
Common X-Bee footprint for a variety of RF modules
Fast 250 kbps RF data rate to the end node
2.4 GHz for worldwide deployment
Sleep modes supported for extended battery life
Features X-Bee Bluetooth
Standard 802.15.4 802.15.1
Application focus Monitoring & control Cable replacement
Network architecture Mesh Star
Complexity Simple Complex
Range Upto 150m Upto 10m
Data rate 250Kbps 1Mbps
Latency 30ms-1s 10 seconds
No. Of support nodes 65536 7
Security 64bit, 128bit 128 bit AES
Table.2: Comparision table of X-Bee and Blutooth
28. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 28
4.5.1 Comparision Table:
Table.3: Comparison of X Bee Series 1 and X Bee Series 2
X Bee Model XBee Series 1 XBee Series 2
Indoor/Urban range up to 100 ft. (30m) up to 133 ft. (40m)
Outdoor RF lineof sight range up to 300 ft. (100m) up to 400 ft. (120m)
Transmit Power Output 1 mW (0dbm) 2 mW (+3dbm)
RF Data Rate 250 Kbps 250 Kbps
Receiver Sensitivity -92dbm (1% PER) -98dbm (1% PER)
Supply Voltage 2.8 - 3.4 V 2.8 - 3.6 V
Transmit Current (typical) 45 mA (@ 3.3 V) 40 mA (@ 3.3 V)
Idle/Receive Current (typical) 50 mA (@ 3.3 V) 40 mA (@ 3.3 V)
Power-down Current < 10 uA < 1 uA
Operating Temperature -40˚ to 85˚ C -40˚ to 85˚ C
Antenna Options Chip, Integrated Whip, U.FL Chip, Integrated Whip, U.FL,
RPSMA
Network Topologies Point to point, Star Point to point, Star, Mesh
29. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 29
4.6 Graphical User Interface:
User interface communicates to the user via display. NetBeans IDE software was used to
design GUI. The NetBeans IDE provides drag and drop capability to relieve us of the necessity to
write code to display a button, textfield, label, and so on. In this GUI, it shows the data from
every sensor in separate fields. GUI is divided into three parts as shown below.
Fig.4.8: Admin’s Login.
First part of GUI is for giving access to the authenticating persons only using ‘User Name’
and ‘Password’. Fig. shows first page of GUI.
30. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 30
Second part of GUI includes display of various parameters in separate fields. It also provides
facility of buttons for sending SMS and getting the patient’s details. Fig. shows second page of
GUI.
Fig.4.9: Parameter Display
31. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 31
Fig. shows third part of GUI which will show the patient’s details.
Fig.4.10: Patient’s details
32. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 32
4.7 ECG Sensor:
Electrocardiography is the process of recording the electrical activity of the heart over a
period of time using electrodes placed on the skin. These electrodes detect the tiny electrical
changes on the skin that arise from the heart muscle's electrophysiologic pattern
of depolarizing during each heartbeat. It is a very commonly performed cardiology test.
In a conventional 12 lead ECG, ten electrodes are placed on the patient's limbs and on the
surface of the chest. The overall magnitude of the heart's electrical potential is then measured
from twelve different angles ("leads") and is recorded over a period of time (usually 10 seconds).
In this way, the overall magnitude and direction of the heart's electrical depolarization is captured
at each moment throughout the cardiac cycle. The graph of voltage versus time produced by
this noninvasive medical procedure is referred as an electrocardiogram.
During each heartbeat, a healthy heart will have an orderly progression of depolarization
that starts with pacemaker cells in the sinoatrial node, spreads out through the atrium, passes
through the atrioventricular node down into the bundle of His and into the Purkinje
fibers spreading down and to the left throughout the ventricles. This orderly pattern of
depolarization gives rise to the characteristic ECG tracing. To the trained clinician, an ECG
conveys a large amount of information about the structure of the heart and the function of its
electrical conduction system. Among other things, an ECG can be used to measure the rate and
rhythm of heartbeats, the size and position of the heart chambers, the presence of any damage to
the heart's muscle cells or conduction system, the effects of cardiac drugs, and the function of
implanted pacemakers.
33. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 33
4.7.1 Amplitudes and intervals:
All of the waves on an ECG tracing and the intervals between them have a predictable
time duration, a range of acceptable amplitudes (voltages), and a typical morphology. Any
deviation from the normal tracing is potentially pathological and therefore of clinical significance.
For ease of measuring the amplitudes and intervals, an ECG is printed on graph paper at a
standard scale: each 1 mm (one small box on the standard ECG paper) represents 40 millisecond
of time on the x-axis, and 0.1 millivolts on the y-axis.
In a healthy heart, depolarization occurs in an orderly progression. This progression is
measured as a change in voltage between electrodes and produces the PQRST waveform.
Fig.4.11: ECG Functional graph
34. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 34
4.7.2 ECG R-R peak detection
R-R peak and HVR
Electrocardiogram or ECG is the record containing electrical activities of the heart. ECG
is widely used to diagnose different heart abnormalities. Different patterns of a normal ECG graph
are denoted by P, Q, R, S and T. Detection of ECG RR interval and QRS complex from
the recorded ECG signal is crucial for a sustainable health monitoring scenario, since a wide
range of heart diseases like tachycardia, bradycardia, arrhythmia, palpitations etc. can be
efficiently diagnosed utilizing the resultant RR interval. Many different RR interval calculation
algorithms have been proposed.
By knowing the RR peak, it is easy to further calculate the Heart Rate Variability (HRV). HRV is
the rhythmic alteration in heart rate. Although there have been many researches conducted on
HRV, the understanding of HRV is still not completed. It is generally accepted that HRV is an
important index for heart condition in two aspects: the high frequency part (0.18-0.4Hz) is
correspondent to respiration and the low frequency part (0.04-0.15 Hz) is related to vagus and
cardiac sympathetic nerves. There are many different approaches to assess the HRV.
Various techniques to calculate RR Peak are s below:
1. Amplitude Based Technique (ABT)
2. First Derivative Based Technique (FDBT)
3. Second Derivative Based Technique (SDBT)
From above ABT is explained as:
The Amplitude based technique (ABT) performs very simple comparison where the ranges
of sample ECG points falling beyond an amplitude threshold are determined to be a QRS complex
candidate. The amplitude threshold can be 0.2. After the QRS complex is detected, the highest
amplitude of the detected QRS is ascertained to be R peak. Equation (1)-(4) generalizes the
amplitude based method. The original ECG signal, Xn, from the patient body is given by (1).
Xn = x1,x2,.......,xN (1)
Where, n = 1, 2,…, N and N is the length of the signal.
(xr,xr+1,xr+2,.....,xr+k),....., (xr,xl+1,xl+2,.....,xN-c)>amplitude threshold (2)
where, 1<r<l<N, x N-c is the last value greater than the threshold and both x r+k+1 and x
nc+1 are less than the amplitude threshold. Each of the section enclosed by the parenthesis of (2)
(left side of the equation) is QRS complex candidate.
35. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 35
RPeak =Max(QRS Complex) (3)
RR interval= (4)
where, nr is the number of samples between two corresponding R peaks and f is the
sampling frequency of the ECG.
Fig. 4.12: RR Detection
36. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 36
4.7.3 PCB layout of ECG sensor:
Fig.4.13: PCB layout for ECG sensor
37. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 37
4.7.4 LM 324 IC:
LM324 is a 14pin IC consisting of four independent operational amplifiers (op-amps)
compensated in a single package. Op-amps are high gainelectronic voltage amplifier with
differential input and, usually, a single-ended output. The output voltage is many times higher
than the voltage difference between input terminals of an op-amp.
These op-amps are operated by a single power supply LM324 and need for a dual supply
is eliminated. They can be used as amplifiers, comparators, oscillators, rectifiers etc. The
conventional op-amp applications can be more easily implemented with LM324.
Fig.4.14: Pin Diagram of LM 324
Pin Description:
Pin No Function Name
1 Output of 1st
comparator Output 1
2 Inverting input of 1st
comparator Input 1-
3 Non-inverting input of 1st
comparator Input 1+
4 Supply voltage; 5V (up to 32V) Vcc
5 Non-inverting input of 2nd
comparator Input 2+
6 Inverting input of 2nd
comparator Input 2-
7 Output of 2nd
comparator Output 2
8 Output of 3rd
comparator Output 3
9 Inverting input of 3rd
comparator Input 3-
10 Non-inverting input of 3rd
comparator Input 3+
11 Ground (0V) Ground
12 Non-inverting input of 4th
comparator Input 4+
13 Inverting input of 4th
comparator Input 4-
14 Output of 4th
comparator Output 4
Table.4: Pin Description of LM 324
38. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 38
Chapter 5.
Softwares Used
39. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 39
5.1 Software Requirements:
• X-CTU tool: Used for X-bee module programming.
This is a configuration and Test utility software for X-Bee
• NetBeans IDE 8.0.2 and JDK by JAVA: Used for GUI designing
• Eclipse 4.5.2 (Mars.2) : Used to create Graph display of ECG sensor
• The Proteus Design Suite
It is an Electronic Design Automation (EDA) tool including schematic capture,
simulation and PCB Layout modules.
44. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 44
7.1 Applications:
• ICU’s (Intensive Care Unit).
• Operation theaters.
• Gives patients freedom of staying at home and living a normal life with their family.
• For personal care unit for Athletes’ and Gymnasists.
7.2 Advantages:
• High Accuracy
• Lower power consumption
• Real time response
• Reliable
• Low cost
• Flexibility
7.3 Future scope:
• The whole health monitoring system, which we have proposed can be integrated into a
small compact unit as small as a cell phone or a wrist watch.
• This will help the patients to easily carry this device with them wherever they go.
45. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 45
Bill Of Material
Component Description Rating Quantity Cost(INR)
Raspberry Pi 2 module 650mA @ 5V 1 2900
X-Bee Series 2 2 1800
HDMI to VGA converter Compatible with:
HDMI
1080/720p/1080i
1 420
Raspberry Pi module case 1 270
Capacitors 1)1µF
2)0.1µF
12 12
Resistors 1)10KΩ
2)100KΩ
12 12
LM 324 2 2 16
PCB Board 4”*6” 1 35
FeCl3 solution 50ml 30
ECG connector patch ECG electrodes adult 4 76
LM 35 sensor + 10-mV/°C 1 45
Multicore wire 2 m 2 50
DC Adapter 2A/5V 1 100
Diodes 1N4447 8 4
Male to Female connectors 12 48
Male to male connectors 6 24
LED 5MM RED 2 2
LED 5MM IR 2 10
X-bee breakout board 1 180
Total 5989
47. Wireless Medical Surveillance System Using Raspberry Pi and X-Bee By. Nikhil Patewar Page 47
References:
1) IOSR Journal of Electronics and Communication Engineering (IOSR-JECE) e-ISSN:
2278-2834, p- ISSN: 2278-8735.Volume 9, Issue 1, Ver. I (Jan. 2014), PP 30-32
www.iosrjournals.org www.iosrjournals.org 30 | Page Microcontroller Based Heart Beat
Monitoring and Alerting System Mayank Kothari Assistant Professor N MIMS, MPSTME
Shirpur, India.
2) X-Bee Wireless Sensor Networks for Temperature Monitoring Vongsagon Boonsawat, Jurarat
Ekchamanonta, Kulwadee Bumrungkhet, and Somsak Kittipiyakul School of Information,
Computer, asnd Communication Technology Sirindhorn International Institute of Technology,
Thammasat University, Pathum-Thani, Thailand 12000.
3) IOSR Journal of Electrical and Electronics Engineering (IOSR-JEEE) e-ISSN: 2278 1676,
p-ISSN: 2320-3331, Volume 9, Issue 3 Ver. VI (May – Jun. 2014), PP 31-38
www.iosrjournals.org www.iosrjournals.org 31 Real Time Wireless Health Monitoring System
1AsadKhaliq*, 2M. AbdullahAwan , 3M.UmairSaleh, 4M.Waseem Abbas, HusnulMaab,
5Salman Khan 1,2,3,4,5GIK Institute of Engineering Sciences an Technology, KPK, Pakistan.
4) HUMAN HEALTH MONITORING USING WIRELESS SENSORS NETWORK
Rajasekaran.S1, Kumaran.P2, Premnath.G3, Karthik.M4 Computer Science & Engineering 1,
2, 3, 4, Assistant Professor2, 3, 4, JRF1Veltech Multitech Dr.Rangarajan Dr.Sakunthala
Engineering College, Avadi, Chennai-600 062
5) Vol. 02, Issue 01, June 2013 International Journal of Web Technology
www.iirpublications.com ISSN: 2278-2389 Integrated Intelligent Research (IIR) 137
Wireless Health Monitoring System Using ZigBee.
6) Coursework for sensors and actuators-blood pressure and blood saturation monitors-
140526035253-php app01
7) A Mobile Device Based ECG Analysis System, Qiang Fang, Fahim Sufi and Irena Cosic
School of Electrical and Computer Engineering, RMIT University Australia