You are on page 1of 54

Smart heart rate monitoring using bluetooth module

CHAPTER 1
OVERVIEW OF THE PROJECT
In this chapter, Overview of the project, Motivation, Objectives, Literature survey, tools
used and organization of the report are discussed.
1.1 INTRODUCTION
An Embedded System is a combination of computer hardware and software, and perhaps
additional mechanical or other parts, designed to perform a specific function. A good example
is the microwave oven. Almost every household has one, and tens of millions of them are used
every day, but very few people realize that a processor and software are involved in the
preparation of their lunch or dinner.
Frequently, an embedded system is a component within some larger system. For
example, modern cars and trucks contain many embedded systems. One embedded system
controls the anti-lock brakes, other monitors and controls the vehicle's emissions and a third
displays information on the dashboard. In some cases, these embedded systems are connected by
some sort of a communication network, but that is certainly not a requirement.
At the possible risk of confusing, it is important to point out that a general-purpose
computer is itself made up of numerous embedded systems. For example, my computer consists
of a keyboard, mouse, video card, modem, hard drive, floppy drive, and sound card-each of
which is an embedded system. Each of these devices contains a processor and software and is
designed to perform a specific function. For example, the modem is designed to send and receive
digital data over analog telephone line. That's it and all of the other devices can be summarized
in a single sentence as well.
If an embedded system is designed well, the existence of the processor and software
could be completely unnoticed by the user of the device. Such is the case for a microwave oven,
alarm clock. In some cases, it would even be possible to build an equivalent device that does not
contain the processor and software. This could be done by replacing the combination with a
custom integrated circuit that performs the same functions in hardware. However, a lot of
flexibility is lost when a design is hard-cooled in this way. It is much easier, and cheaper, to
change a few lines of software than to redesign a piece of custom hardware.

Department of ECE,MRITS 1
Smart heart rate monitoring using bluetooth module

1.2 PROBLEM STATEMENT


The interface of heart monitoring devices is not that user friendly and they cannot be
accessed by everyone and they have low flexibility and also they cannot be carried everywhere.
1.3 MOTIVATION
The cause of this project is to monitor the patient using bluetooth module. it checks the
patient‟s heart rate pulse by heart beat sensor. When the patient pulse is normal it shows normal
and when it is less than the normal pulse then it shows „low‟. When it is high i.e. above 72 that is
critical. Whereas when the patient is critical or abnormality then the bluetooth module will send
the information to the micro controller and then the information is shared to other devices. So the
doctor‟s response will be quick. By this project it is easy to check the condition of patient‟s
information and displays it on LCD and parallel shows the heart rate on serial monitor
1.4 OBJECTIVE
a) To design a system which is used to monitor the patient conditions using bluetooth
module
b) In this project we use bluetooth module, sensors and buzzer.

1.5 METHODOLOGY ADOPTED


The methodology developed in this project is bluetooth module, by this the
patient information is received by the doctor. The technology defined by the bluetooth
specification is intended to be simpler and less expensive than other wireless personal area
networks (WPANs), such as wifi.Applications include wireless light switches, electrical meters
with in-home-displays, traffic management systems, and other consumer and industrial
equipment that require short-range low-rate wireless data transfer.
1.6 TOOLS USED
1.6.1 SOFTWARE
1. Arduino IDE 6.4V
2. Proteus Professional for Designing

Department of ECE,MRITS 2
Smart heart rate monitoring using bluetooth module

1.6.2 HARDWARE
1. AT mega 328 MC
2. Power supply
3. LCD display
4. Buzzer
5. Bluetooth module
6. Heartbeat sensor

1.7 ORGANIZATION OF REPORT

Chapter 2 deals with the Arduino board with microcontroller. Chapter 3 deals with the
description of hardware modules which are used in the system. Chapter 4 deals with the
implementation of heart beat sensor working and interfacing with Arduino. Chapter 5 deal with
the results obtained. Chapter 6 ends with Conclusion and future scope followed by references.

Department of ECE,MRITS 3
Smart heart rate monitoring using bluetooth module

CHAPTER 2
LITERATURE SURVEY
PATIENT MONITORING SYSTEM
A number of patient monitoring systems have been proposed by many researchers to
monitor the patient at the bedside and also at a central monitoring system. The literature survey
presented in this section includes a variety of patient monitoring systems, ranging from simple
pulse monitors, activity monitors, and portable Holter monitors, to sophisticated and expensive
implantable sensors. The history of physiological monitors looks at the technical evolution of
physiologic monitors, which incorporate a cathode ray tube (CRT) or a flat panel display.
Himmelstein and Scheiner (1952) reported that in the 1950s an instrument called
“Cardiotachoscope” found useful during surgery, featured the fundamental attributes that most
monitoring systems would eventually have. These attributes include a CRT to view the ECG, a
heart rate indicator, alarms for high and low heart rates, and a connection to a conventional
electrocardiograph for printouts. The devices of this era had monochrome displays and the
persistence of the wave was generally not sufficient to cover the screen. This meant that the ECG
waveform would show only a second or two of new data. The old data would fade away and the
trace has been described as a bouncing ball with a comet‟s tail. There were no numeric
parameters or annotations on the screen. This device does not appear to have entered into
production and the “Cardiotachoscope” term is not used anymore.
Systems of the 1950s and early 1960s made less of a distinction between the equipment roles of
monitoring and defibrillation or pacing, and were often intended to be used together as a
diagnostic and, especially, therapeutic tools at the bedside or in the operating room on a mobile
cart. Most devices had an output connector to allow direct printing on a standard
electrocardiograph. Most bedside type monitors often had round screens of about 5 inches in
diameter that limit to one or two waveform traces. Controls on these monitors generally allowed
for lead selection, focus adjustment, intensity or brightness control, sensitivity or gain control,
vertical trace position control, and sweep rate adjustment.
The 1960s featured monitoring systems whose intended functions and configurations
were surprisingly similar to more modern systems. The approach of having central monitors and
bedside monitors was common even from the early part of the decade. Numerous parameters
were technically available to be monitored including ECG, EEG, invasive pressures, and

Department of ECE,MRITS 4
Smart heart rate monitoring using bluetooth module

temperatures. In the mid 1960s, several vendors offered a magnetic tape "memory-loop" feature
that served to continuously record the last 15 or more seconds of data so that alarm events could
be interpreted based on the preceding data. Automatic printing of stored data following an alarm
could occur.
The decade of the 1970s saw some significant improvements in the presentation of the
displayed waveforms and information. This was the result of the incorporation of digital
electronics and, eventually, microprocessors. Real time arrhythmia analysis appeared at the
beginning of the decade and evolved over the duration of the 1970s.
Healy et al (1977) described a hospital patient monitoring and display system employing
a number of bedside consoles, concealable from the patient and including input for various
patient sensors such as ECG, pulse rate, patient temperature and blood pressure. The central
station includes signal processing and display apparatus to allow the patient data to be displayed
on a conventional commercial black and white or color television set along with alpha numerics
related to each respective patient. The display is coupled to the hospitals normal entertainment
television distribution network, if any, allowing the patient data to be displayed on any television
set throughout the hospital. A remote control operation via a radio frequency link may be carried
by a patient's doctor and may be operated at any time or place within reception range of the
central control to freeze the display for better examination and automatic printout of a
reproduction. After a preset period, the display resumes.
The 1980s witnessed further significant evolution in patient monitors. Arrhythmia
analysis became available at the bedside. Monitors began using color displays, monitoring.

Neonatal and pediatric Pulse Oximeter-The pulse oximeter has become a vital instrument in the
care of infants and children with cardiopulmonary disease. Recent advances in pulse oximetry
technology have improved some aspects of pulse oximeter performance. However, the reliability,
accuracy, and clinical utility of pulse oximetry remain problematic in some types of patients
under certain conditions. Improved signal processing technology has substantially improved the
ability of certain oximeters to work reliably under conditions of poor perfusion and motion
artifact.

System architecture of a wireless body area sensor network for ubiquitous health monitoring:
One of the most promising applications of sensor networks is for human health monitoring.

Department of ECE,MRITS 5
Smart heart rate monitoring using Bluetooth module

A number of tiny wireless sensors, strategically placed on the human body, create a
wireless body area network that can monitor various vital signs, providing real-time feedback to
the user and medical personnel. The wireless body area networks promise to revolutionize health
monitoring. However, designers of such systems face a number of challenging tasks, as they
need to address often quite conflicting requirements for size, operating time, precision, and
reliability.
Wireless Sensor Networks in Structural Health Monitoring Based on Bluetooth Technology:
Wireless sensor networks for structural health monitoring
Structural health monitoring (SHM) using wireless sensor networks (WSNs) has gained
research interest due to its ability to reduce the costs associated with the installation and
maintenance of SHM systems. ... The high data collection rate of WSNs for SHM pose
unique network design challenges.

2.3 CONCLUSION:
In this chapter, reference links have been referred and the analysis of the literature review
was discussed.

Department of ECE,MRITS 6
Smart heart rate monitoring using bluetooth module

CHAPTER 3
ARDUINO BOARD WITH MICROCONTROLLER

3.1 INTRODUCTION
In this chapter, Arduino Board with ATmega328 microcontroller will be discussed.
3.2 ARDUINO WITH MICRO CONTROLLER
Arduino is an open source computer hardware and software company, project and user
community that designs and manufactures kits for building digital devices and interactive objects
that can sense and control the physical world. Arduino boards may be purchased pre-assembled,
at the same time the hardware design information is available for those who would like to
assemble an Arduino from scratch. An Arduino board consists of an Atmel 8-16 or 32-bit AVR
microcontroller with complementary components that facilitate programming and incorporation
into other circuits. An important aspect of the Arduino is its standard connectors, which lets
users connect the CPU board to a variety of interchangeable add on modules known as shields.
Some shields communicate with the Arduino board directly over various pins, but many shields
are individually addressable via an I²C serial bus so many shields can be stacked and used in
parallel. Official Arduino‟s have used the mega AVR series of chips, specifically the ATmega8,
ATmega168, ATmega328, ATmega1280 and ATmega2560. A handful of other processors have
been used by Arduino compatibles. Most boards include a 5 volt linear regulator and a 16 MHz
crystal oscillator (or ceramic resonator in some variants), although some designs such as the Lily
Pad run at 8 MHz and dispense with the onboard voltage regulator due to specific form-factor
restrictions. An Arduino's microcontroller is also preprogrammed with a boot loader that
simplifies uploading of programs to the on chip flash memory, compared with other devices that
typically need an external programmer. This makes using an Arduino more straightforward by
allowing the use of an ordinary computer as the programmer.
The Arduino Uno can be powered via the USB connection or with an external power supply. The
power source is selected automatically. External (non-USB) power can come either from an AC
to DC adapter (wall wart) or battery. The adapter can be connected by plugging a 2.1mm 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. the arduino board with micro controller is shown in fig
3.1

Department of ECE,MRITS 7
Smart heart rate monitoring using bluetooth module

Fig 3.1: Arduino board with micro controller


The board can operate on an external supply of 6 to 20 volts. If supplied with less than
7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using
more than 12V, the voltage regulator may overheat and damage the board. The recommended
range is 7 to 12 volts.
3.2.1 The Power Pins Are as Follows
a) 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). It can
supply voltage through this pin or if supplying voltage via the power jack, access it
through this pin.
b) 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 the board.
c) 3V3. A 3.3-volt supply generated by the on board regulator. Maximum current draw is50
mA.
d) GND. Ground pins.
e) IOREF. This pin on the Arduino board 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.

Department of ECE,MRITS 8
Smart heart rate monitoring using bluetooth module

f) The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM
library).Each of the 14 digital pins on the Uno can be used as an input or output, using
pin Mode (), digital Write () and digital Read () functions. They operate at 5 volts. Each
pin can provide or receive a maximum of 40 mA and has an internal pull up resistor
(disconnected by default) of 20-50 kilo ohm.
g) In addition, some pins have specialized functions:
h) Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
These pins are connected to the corresponding pins of the ATmega8U2 USB to TTL
Serial chip.
i) 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. See the attach Interrupt () function for
details.
j) PWM: 3, 5, 6, 9, 10 and 11. Provide 8-bit PWM output with the analog Write () function.
k) SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using the SPI library.
l) 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.
m) The Uno has 6 analog inputs, labeled 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 is it possible to change the upper end of their range using the AREF pin and the
analog Reference () function.
n) Additionally, some pins have specialized functionality:
o) TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the
Wire library. There are a couple of other pins on the board:
p) AREF. Reference voltage for the analog inputs. Used with analog Reference ().
q) 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.
The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino 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

Department of ECE,MRITS 9
Smart heart rate monitoring using bluetooth module

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, an information 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. The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus, see the documentation for details. For SPI
communication, use the SPI library.
The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino UNO from the Tools Board menu (according to the microcontroller on board). The
ATmega328 on the Arduino Uno comes pre-burned with a bootloader that allows 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).It can also bypass the boot loader and
program the microcontroller through the ICSP (In-Circuit Serial Programming) header using
Arduino ISP or similar; see these instructions for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is
available. The ATmega16U2/8U2 is loaded with a DFU boot loader, which can be activated by
below commands.
a) On Rev1 boards: connecting the solder jumper on the back of the board (near the map of
Italy) and then resetting the 8U2.
b) On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground,
making it easier to put into DFU mode.
The use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and
Linux) to load a new firmware or use the ISP header with an external programmer (overwriting
the DFU boot loader).
Rather than requiring a physical press of the reset button before an upload, the Arduino
Uno is designed in a way that allows it to be reset by software running on a connected computer.
One of the hardware flow control lines (DTR) of the ATmega8U2/16U2 is connected to the reset

Department of ECE,MRITS 10
Smart heart rate monitoring using bluetooth module

line of the ATmega328 via a 100 Nano farad capacitor. When this line is asserted (taken low),
the reset line drops long enough to reset the chip. The Arduino software uses this capability to
allow to upload code by simply pressing the upload button in the Arduino environment. This
means that the boot loader can have a shorter timeout, as the lowering of DTR can be well
coordinate 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 boot loader 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 renewable it. It's labeled "RESET-EN". It may also
be able to disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset line.
The Arduino UNO has a resettable poly fuse that protects the computer's USB ports from shorts
and over current. Although most computers provide their own internal protection, the fuse
provides an extra layer of protection. If more than 500 mA is applied to the USB port, the fuse
will automatically break the connection until the short or overload is removed. The maximum
length and width of the UNO PCB are 2.7 and 2.1 inches respectively, with the USB connector
and power jack extending beyond the former dimension. Four screw holes allow the board to be
attached to a surface or case. Note that the distance between digital pins 7 and 8 is 160 mil
(0.16"), not an even multiple of the 100 mil spacing of the other pins.
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.

Department of ECE,MRITS 11
Smart heart rate monitoring system using bluetooth module

3.2.2 ATmega328
The ATmega328 is a single chip microcontroller created by Atmel and belongs to the
mega AVR series. The ATmega328 is shown in Fig 3.2

Fig 3.2: AT mega 328 micro controller


The Atmel 8-bit AVR RISC-based with read-while-write capabilities, 1 KB EEPROM, 2
KB SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible
timer/counters with compare modes, internal and external interrupts, serial programmable USART, a
byte oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit Analog to digital converter
(8-channels in TQFP and QFN/MLF packages), programmable watch dog timer with internal
oscillator and five software selectable power saving modes. The device operates between 1.8-5.5
volts. The device achieves throughputs approaching 1MIPS per MHz.
Table 3.1 Pin Configuration of ATmega328
Features ATmega328/P
Pin Count 28/32
Flash (Bytes) 32K
SRAM (Bytes) 2K
EEPROM (Bytes) 1K
General Purpose I/O Lines 23
SPI 2
TWI (I2C) 1
USART 1
ADC 10-bit 15Ksps
ADC Channels 8
8-bit Timer/Counters 2
16-bit Timer/Counters 1

A common alternative to the ATmega328 is the "Pico Power" ATmega328P.A


comprehensive list of all other member of the ATmega AVR series can be found on the Atmel
website.

Department of ECE,MRITS 12
Smart heart rate monitoring system using bluetooth module

Pin Diagram of ATmega328:

The pin diagram of ATmega328 as shown in Fig 3.3.

Fig 3.3 Pin diagram of ATmega328


Today the ATmega328 is commonly used in many projects and autonomous systems
where a simple, low-powered, low cost micro controller is needed. Perhaps the most common
implementation of this chip is on the popular Arduino development platform, namely the
Arduino UNO and Arduino Nano models.
3.3 CONCLUSION
In this chapter, Arduino board with microcontroller ATmega328 has been discussed.

Department of ECE,MRITS 13
Smart heart rate monitoring using bluetooth module

CHAPTER 4
DESCRIPTION OF HARDWARE MODULES
4.1 INTRODUCTION
In this chapter, description of hardware peripherals or equipment‟s like sensors and
modules are discussed.
4.2 SENSORS
HEART BEAT SENSOR
A heart beat monitor is a personal monitoring device that allows one to measure one's
heart beatin real time or record the heart beat for later study. It is largely used by performers of
various types of physical exercise. heart beat sensor is shown in fig
4.1

Fig 4.1 heart beat sensors


Heart attack (coronary artery disease) is one of the most common and very serious effects of
aging. The cholesterol, fatty deposits, emotional stress, and drug intake lead to build spasm in
blood vessel walls. As the spasm grows, less blood can flow through the arteries. As a result, the
heart muscle can‟t get the blood or oxygen what exactly, it needs. This can lead to a heart attack.
In this article, we are developing a system which will help to decrease the death rate due to the
heart attack by early heart attack detection.

Department of ECE,MRITS 14
Smart heart rate monitoring using bluetooth module

HEART BEAT SENSORS WORKING:


A simple Heartbeat Sensor consists of a sensor and a control circuit. The sensor part of the
Heartbeat Sensor consists of an IR LED and a Photo Diode placed in a clip.The Control Circuit
consists of an Op-Amp IC and few other components that help in connecting the signal to a
Microcontroller. The working of the Heartbeat Sensor can be understood better if we take a look
at its circuit diagram and shown in fig 4.2.

Fig 4.2 working of heart beat sensor.

The above circuit shows the finger type heartbeat sensor, which works by detecting the
pulses. Every heartbeat will alter the amount of blood in the finger and the light from the IR LED
passing through the finger and thus detected by the Photo Diode will also vary. The output of the
photo diode is given to the non – inverting input of the first op – amp through a capacitor, which
blocks the DC Components of the signal. The first op – amp cats as a non – inverting amplifier
with an amplification factor of 1001.The output of the first op – amp is given as one of the inputs
to the second op – amp, which acts as a comparator. The output of the second op – amp triggers a
transistor, from which, the signal is given to a Microcontroller like Arduino.The Op – amp used
in this circuit is LM358. It has two op – amps on the same chip. Also, the transistor used is a
BC547. An LED, which is connected to transistor, will blink when the pulse is detected.

Department of ECE,MRITS 15
Smart heart rate monitoring using bluetooth module

Features:

a) Heat beat indication by LED ·


b) Instant output digital signal for directly connecting to microcontroller .
c) Compact Size.
d) Working Voltage +5V DC.

Application:

a) Digital Heart Rate monitor.


b) Patient Monitoring System.
c) Bio-Feedback control of robotics and applications.
Specifications:
Table:4.1 specifications of heart beat sensor
PARAMETER VALUE
Operating Voltage +5DC regulated
Operating current 100mA
Output data level 5V TTL Level
Heart beat detection indicated by LED and output high pulse
Light source 660nm Super Red LED

4.3 MICRO CONTROLLER - ATMEGA328


The Atmega328 is commonly used in many projects and autonomous systems where
a simple, low-powered, low-cost micro-controller. This will allow to use Arduino code in
custom embedded project without having to use an actual Arduino board. To get this chip
working with Arduino IDE, It need an external 16MHz crystal or resonator, a 5V supply, and
a serial connection. If not comfortable doing this recommend purchasing the Arduino
Duemilanove or Uno board that has all of these built into the board. Atmel's ATMega328 8-bit
Processor in 28 pin DIP pacakage.

Department of ECE,MRITS 16
Smart heart rate monitoring using bluetooth module

It's like the ATmega168, with double the flash space. 32K of program space.23 I/O
lines, 6 of which are channels for the 10-bit ADC.Runs up to 20MHz with external crystal.
Package can be programmed in circuit. 1.8V to 5V operating voltage.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-
serial driver chip. Instead, it features the Atmega8U2 programmed as a USB-to-serial converter.
"Uno" means "One" in Italian and is named to mark the upcoming release of Arduino 1.0. The
Uno and version 1.0 will be the reference versions of Arduino, moving forward. The Uno is the
latest in a series of USB Arduino boards, and the reference model for the Arduino platform for a
comparison with previous versions, Arduino boards Atmega328 is shown in fig 4.3

Fig 4.3 Atmega328

Features:

a) 28-pin AVR Microcontroller


b) Flash Program Memory: 32 Kbytes
c) EEPROM Data Memory: 1 Kbytes
d) SRAM Data Memory: 2 Kbytes
e) I/O Pins: 23
f) Timers: Two 8-bit / One 16-bit
g) A/D Converter: 10-bit Six Channel
h) PWM: Six Channels

Department of ECE,MRITS 17
Smart heart rate monitoring using bluetooth module

i) RTC: Yes with Separate Oscillator


j) MSSP: SPI and I²C Master and Slave Support

k) USART: Yes
l) External Oscillator: up to 20MHz
Specification:
a) Microcontroller ATmega328
b) Operating Voltage 5V
c) Supply Voltage (recommended) 7-12V
d) Maximum supply voltage (not recommended) 20V
e) Digital I/O Pins 14 (of which 6 provide PWM output)
f) Analog Input Pins 6
g) DC Current per I/O Pin 40 mA
h) DC Current for 3.3V Pin 50 mA
i) Flash Memory 32 KB (ATmega328) of which 0.5 KB used by boot loader
j) SRAM 2 KB (ATmega328)
k) EEPROM 1 KB (ATmega328)
l) Clock Speed 16 MHz
4.4 BUZZER:
A buzzer or beeper is an audio signaling device, which may be mechanical,
electromechanical, or piezoelectric. Typical uses of buzzers and beepers include alarm devices.
Sound emitter may be extremely low or ear piercing.
Types of buzzers:
Electromechanical:
Early devices were based on an electromechanical system identical to an electric bell
without the metal gong. Similarly, a relay may be connected to interrupt its own actuating
current, causing the contacts to buzz. Often these units were anchored to a wall or ceiling to use
it as a sounding board. The word "buzzer" comes from the rasping noise that electromechanical
buzzers made. Electromechanical buzzer is shown in 4.4

Department of ECE,MRITS 18
Smart heart rate monitoring using bluetooth module

Fig 4.4 electromechanical buzzer

Mechanical:
A joy buzzer is an example of a purely mechanical buzzer. They require drivers
mechanical buzzer is shown in fig 4.5

Fig 4.5 Mechanical buzzer

Piezoelectric:

Fig 4.6 Piezoelectric disk beeper

Department of ECE,MRITS 19
Smart heart rate monitoring using bluetooth module

A piezoelectric element may be driven by an oscillating electronic circuit or other audio


signal source, driven with a piezoelectric audio amplifier. Sounds commonly used to indicate
that a button has been pressed are a click, a ring or a beep.

A piezoelectric buzzer/beeper also depends on acoustic cavity resonance or Helmholtz


resonance to produce an audible beep. piezoelectric buzzer is shown in fig 4.7

Fig 4.7 Piezoelectric buzzer

Applications:
While technological advancements have caused buzzers to be impractical and
undesirable, there are still instances in which buzzers and similar circuits may be used. Present
day applications include:
a) Novelty uses
b) Judging panels
c) Educational purposes
d) Annunciator panels
e) Electronic metronomes
f) Game show lock-out device
g) Microwave ovens and other household appliances
h) Sporting events such as basketball games
i) Electrical alarms
j) Joy buzzer (mechanical buzzer used for pranks)

4.5 BLUETOOTH MODULE

To set up wireless serial communication, HC-05 Bluetooth Module is most demanding


and popular due to its low price and extremely high features. This module can be used in Master
or Slave mode and easy switchable between these two modes,

Department of ECE,MRITS 20
Smart heart rate monitoring using bluetooth module

Fig 4.8 Bluetooth module

Blue tooth is a wireless technology standard used for exchanging data between fixed and
mobile devices over distances using UHF radio waves in the industrial, scientific and medical
radio bands, from 2.402GHz to 2.480GHz, and building personal area network (PAN) with high
levels of security. It is orginally conceived as a wireless alternative to RS-232 data cables.
It can connect to several devices by overcoming problems of synchronization and keeping
transmission power extremely low to save battery power. Bluetooth 1.0 maximum transfer speed
at 1 mbps and 2.0 manage up to 3mbps now we are using 5.2 version.
Protocols used in Bluetooth module are PPP(point to point protocol), UDP(User data
gram protocol), TCP (Transmission control protocol), WAP(wireless app protocol). It is operated
in the range of 32 feet i.e, 10 meters. Bluetooth can connect simultaneously up to 8 devices with
in its range. It uses a spread spectrum frequency hopping that makes it rare for more than one
device to be transmitting on the same time.
Since every Bluetooth uses a spread spectrum frequency hopping that makes it rare for
more than one device will use 79 individual, randomly chosen frequencies with a designate range,
changing from one to another on a regular basis. In the case of Bluetooth , the transmitters change
frequencies 1,600 times every second transmitting automatically, it‟s unlikely that two
transmitter will be on the same frequency range of the same time. This same technique minimizes
the risk that portable phones will disturb bluetooth devices.

Department of ECE,MRITS 21
Smart heart rate monitoring using bluetooth module

Specifications:

a) Modulation: GFSK(Gaussian frequency)


b) Emission power:<=4dbm,class 2.
c) Sensitivity: <-84 dbm at 0.1%BER
d) Speed: Asynchronous:2.1 Mbps(Max)/160 kbps
e) Synchronous: 1Mbps/1Mbps
f) Frequency:2.4GHz ISM band
g) Security: Authentication and encryption
h) Power supply: +3.3VDC 50mA
i) Bluetooth protocol: Bluetooth Specificationv2.0+EDR
j) Profiles: Bluetooth serial port
k) Dimensions: 26.9mm x 13mm x 2.2mm

Applications:
Computer and peripheral devices:
Bluetooth peripheral devices are Bluetooth mouse, Bluetooth key board, Wireless
scanner, Bluetooth speakers, etc we can easily connect these Bluetooth peripheral devices to
your computer system using wireless connection.
GPS receiver:
Exterrnal Bluetooth GPS devices work by replacing your smartphones native GPS
location, and by then making the new location, and by then making the new location available
for apps that need it.
Industrial control:
Bluetooth low energy is increasingly used in metering, sensors, actuators, and other
small devices that need to be interconnected with Bluetooth low energy being rapidly integrated
into mobile ios and android devices, tailored apps can become powerful and cost-efficient tools
for industrial applications.

Department of ECE,MRITS 22
Smart heart rate monitoring using bluetooth module

MCU projects:
To connected a device to other device wireless we Bluetooth technology for easy MCU
interfacing.
4.6 LCD DISPLAY
Order Code LED008 16 x 2 Alphanumeric Display FRM010 Serial LCD Firmware
(optional) Contents 1 x 16x2 Alphanumeric Display 1 x data booklet Introduction Alphanumeric
displays are used in a wide range of applications, including palmtop computers, word processors,
photocopiers, point of sale terminals, medical instruments, cellular phones, etc. The 16 x 2
intelligent alphanumeric dot matrix displays is capable of displaying 224 different characters and
symbols. A full list of the characters and symbols is printed on pages 7/8 (note these symbols can
vary between brand of LCD used). This booklet provides all the technical specifications for
connecting the unit, which requires a single power supply (+5V). Further Information Available
as an optional extra is the Serial LCD Firmware, which allows serial control of the display. This
option provides much easier connection and use of the LCD module. The firmware enables
microcontrollers (and microcontroller based systems such as the PICAXE) to visually output
user instructions or readings onto an LCD module. All LCD commands are transmitted serially
via a single microcontroller pin. The firmware can also be connected to the serial port of a
computer. An example PICAXE

a) Alphanumeric displays are used in a wide range of applications, including palmtop


computers, word processors, photocopiers, point of sale terminals, medical instruments,
cellular phones, etc.

b) The 16x2 intelligent alphanumeric dot matrix display is capable of displaying 224
different characters and symbols. Lcd pin diagram and lcd display is shown in 4.9 and
4.10 respectively.

Department of ECE,MRITS 23
Smart heart rate monitoring using bluetooth module

Fig 4.9 LCD pin diagram

Fig 4.10 LCD display

Specifications:

Resolution:
The resolution of an LCD is expressed by the number of columns and rows of pixels
(e.g., 1024×768). Each pixel is usually composed 3 sub-pixels, a red, a green, and a blue one.
This had been one of the few features of LCD performance that remained uniform among
different designs. However, there are newer designs that share pixels among pixels and add
Quattron which attempt to efficiently increase the perceived resolution of a display without
increasing the actual resolution, to mixed results.

Department of ECE,MRITS 24
Smart heart rate monitoring using bluetooth module

Spatial performance:
For a computer monitor or some other display that is being viewed from a very close
distance, resolution is often expressed in terms of dot pitch or pixels per inch, which is consistent
with the printing industry. Display density varies per application, with televisions generally
having a low density for long-distance viewing and portable devices having a high density for
close-range detail. The Viewing Angle of an LCD may be important depending on the display
and its usage, the limitations of certain display technologies mean the display only displays
accurately at certain angles.
Temporal performance:
The temporal resolution of an LCD is how well it can display changing images, or the
accuracy and the number of times per second the display draws the data it is being given. LCD
pixels do not flash on/off between frames, so LCD monitors exhibit no refresh-induced flicker no
[73]
matter how low the refresh rate. But a lower refresh rate can mean visual artefacts like
ghosting or smearing, especially with fast moving images. Individual pixel response time is also
important, as all displays have some inherent latency in displaying an image which can be large
enough to create visual artifacts if the displayed image changes rapidly.
Color performance:
There are multiple terms to describe different aspects of color performance of a display.
Color gamutis the range of colors that can be displayed, and color depth, which is the fineness
with which the color range is divided. Color gamut is a relatively straight forward feature, but it
is rarely discussed in marketing materials except at the professional level. Having a color range
that exceeds the content being shown on the screen has no benefits, so displays are only made to
[74]
perform within or below the range of a certain specification. There are additional aspects to

LCD color and color management, such as white point and gamma correction, which describe
what color white is and how the other colors are displayed relative to white.
Brightness and contrast ratio:
Contrast ratio is the ratio of the brightness of a full-on pixel to a full-off pixel. The LCD
itself is only a light valve and does not generate light; the light comes from a backlight that is
either fluorescent or a set of LEDs. Brightness is usually stated as the maximum light output of
the LCD, which can vary greatly based on the transparency of the LCD and the brightness of the

Department of ECE,MRITS 25
Smart heart rate monitoring using bluetooth module

backlight. In general, brighter is better, but there is always a trade-off between brightness and
power consumption.

Advantages:
a) Very compact, thin and light, especially in comparison with bulky, heavy CRT displays.
b) Low power consumption. Depending on the set display brightness and content being
displayed, the older CCFT backlit models typically use less than half of the power a CRT
monitor of the same size viewing area would use, and the modern LED backlit models
typically use 10–25% of the power a CRT monitor would use.
c) Little heat emitted during operation, due to low power consumption.
d) No geometric distortion.
e) The possible ability to have little or no "flicker" depending on backlight technology.
f) Usually no refresh-rate flicker, because the LCD pixels hold their state between refreshes
(which are usually done at 200 Hz or faster, regardless of the input refresh rate).
g) Much thinner than a CRT monitor.

Disadvantages:
a) Limited viewing angle in some older or cheaper monitors, causing color, saturation,
contrast and brightness to vary with user position, even within the intended viewing
angle.
b) Uneven backlighting in some (mostly older) monitors, causing brightness distortion,
especially toward the edges.
c) Black levels may not be as dark as required because individual liquid crystals cannot
completely block all of the backlight from passing through.
d) Display motion blur on moving objects caused by slow response times (>8 ms) and eye-
tracking on a hold display, unless a strobingbacklight is used. However, this strobing can
cause eye-strain, as is noted next:
4.7 POWER SUPPLY:

Step down Bridge Filter circuit Regulator


transformer rectifier Section

Fig 4.11 Block diagram

Department of ECE,MRITS 26
Smart heart rate monitoring using bluetooth module

A power supply is an electronic device that supplies electric energy to an electrical load.
The primary function of a power supply is to convert one form of electrical energy to another. As
a result, power supplies are sometimes referred to as electric power converters. Some power
supplies are discrete, stand-alone devices, whereas others are built into larger devices along with
their loads. Examples of the latter include power supplies found in desktop computers and
consumer electronics devices.

Every power supply must obtain the energy it supplies to its load, as well as any energy it
consumes while performing that task, from an energy source. Depending on its design, a power
supply may obtain energy from various types of energy sources, including electrical energy
transmission systems, energy storage devices such as a batteries and fuel cells, electromechanical
systems such as generators and alternators, solar power converters, or another power supply.

All power supplies have a power input, which receives energy from the energy source,
and a power output that delivers energy to the load. In most power supplies the power input and
output consist of electrical connectors or hardwired circuit connections, though some power
supplies employ wireless energy transfer in lieu of galvanic connections for the power input or
output. Some power supplies have other types of inputs and outputs as well, for functions such as
external monitoring and control.

Specifications:

The suitability of a particular power supply for an application is determined by various


attributes of the power supply, which are typically listed in the power supply's specification.
Commonly specified attributes for a power supply include:

a) Input voltage type (AC or DC) and range.


b) Efficiency of power conversion.
c) The amount of voltage and current it can supply to its load
d) How stable its output voltage or current is under varying line and load conditions.
e) How long it can supply energy without refueling or recharging (applies to power
supplies that employ portable energy sources).
f) Operating and storage temperature ranges.

Department of ECE,MRITS 27
Smart heart rate monitoring using bluetooth module

Features:
a) Simultaneous digital display of both voltage and current.
b) Ten-turn front panel voltage and current controls for high resolution setting of the
output voltage and current from zero to the rated output.
c) Automatic mode crossover into current or voltage mode.
d) Front panel push button control of output standby mode and preview of voltage, current, or
over voltage protection (OVP) set points. Front panel light emitting diode (LED) indicators for
voltage and current mode operation, OVP, remote programming mode, and shutdown. Front
panel control of OVP.
e) Multiple units can be connected in parallel or series to provide increased current or voltage.
f) Thermal shutdown, latching or auto reset.
g) Remote analog voltage and current limit programming with selectable programming ranges.
h) External monitor signals for output voltage and current.
i) Isolated analog remote programming control of the output voltage or current and
isolated readback of output voltage and current with the optional ISOL Interface.
j) Optional internal GPIB or RS-232 computer control for remote digital programming
and readback capability.
k) Rack mount brackets at the front panel are standard.

4.9 CONCLUSION:
In this chapter, the block diagram, sensors(like heart beat sensor) and Modules like bluetooth
module, microcontroller atmega328, Buzzer, LCD diplay, power supply has been discussed.

Department of ECE,MRITS 28
Smart heart rate monitoring using bluetooth module

CHAPTER 5

IMPLEMENTATION OF PATIENT HEALTH MONITORING AND


INFORMATION SYSTEM USING BLUETOOTH MODULE
5.1 INTRODUCTION
In this chapter, block diagram overview of the project, motivation, objectives,
literature survey, tools used and organization of the report are discussed

5.2 BLOCK DIAGRAM FOR INFORMATION PROVIDENCE USING


BLUETOOTH MODULE
The block diagram of patient information providence using zigbee module is shown
in Fig 5.1.

Fig 5.1 Block diagram of smart heart rate monitoring using bluetooth module

Department of ECE,MRITS 29
Smart heart rate monitoring using bluetooth module

5.3 IMPLEMENTATION

Implementing the hospital bed side patient information providence using bluetooth
module, to design this system which is used to monitor the patient condition using Bluetooth
module. By this project the patient in the ICU needs constant monitoring of their heart beat, if
any abnormality felt by the patient is indicated by an buzzer signal.

The project involves any abnormality felt by the patient is indicated through bluetooth
receiver by the help of heart beat sensor by detecting the pulse through plug, then it sends
through LCD display and then it parallel shows in serial monitor. The bluetooth transmitter is
having Vcc 5V and GND, the Tx is connected to arduino 10th pin and Rx is connected to
th
Arduino 9 pin. The bluetooth enable pin connected to the 9th pin of Arduino, Bluetooth reset

pin is connected to 10th pin of Arduino, VCC of heart beat sensor is connected to a intermediate
board and then to the Arduino, as same mentioned before the GND is connected to the arduino .

5.4 INTERFACING HEART BEAT SENSOR WITH ARDUINO

On easy pulse plug-in module , place the 2-pin shunt jumpers JP1 and JP2 to 5v and A0
position , respectively .This configuration will allow the module to use the 5v power supply from
the Arduino Uno board and connect the pulse output signal to the Arduino‟s A0 ADC channel,
when it is plugged into the Arduino Uno board.

Insert the fingertip pulse sensor jack to the 3.5mm stereo socket on the easy pulse plug-in
board. Make sure it is inserted well as shown in the picture below. Then plug-in the sensor
module on to the left headers of the Arduino Uno board such that the A0 and A1 pins of the
sensor module go into the A0 and A1 analog pins of the Arduino. interfacing heart beat sensor
with arduino is shown in fig 4.2

Department of ECE,MRITS 30
Smart heart rate monitoring using bluetooth module

Fig 5.2 interfacing heart beat sensor with arduino

The circuit connections are made as follows:

Pin 2 of Arduino connected to pin2 of heart beat sensor.

GND of Arduino connected to GND of heart beat sensor.

+5V of Arduino connected to VCC of heart beat sensor.

Heart beat sensor is used blood pressure and body temperatures are very important
parameters to known for human body. We go to doctors that use different kinds of apparatuses to
know the heart beat of a human. In this tutorial, we are going to make our own heart beat sensor
that will tell us the heart rate. We will make an Arduino based heart beat sensor that will tell us
the number of pulses in a minute when we will place a finger on it.

The module uses an infrared led (IR) and a photo transistor to detect the pulse of the
finger and whenever a pulse is detected red led flashes. There will be led on the light side of the
finger and a photo transistor on the other side of the finger. Photo transistor is used to obtain the
flux emitted. The resistance of the photo resistor will change when the pulse will change.

5.5 INTERFACING LCD WITH ARDUINO

Interfacing an Arduino microcontroller with an LCD display consists of two parts, wiring
and programming.

Department of ECE,MRITS 31
Smart heart rate monitoring using bluetooth module

5.5.1 LCD WIRING THOUGH ARDUINO

A typical LCD display consists of 16 pins that control various features of the screen. The
Arduino microcontroller can output voltages of either 5V or 3.3V, so the LCD can be powered
by wiring Vss and Vdd to the ground and 5V pins on the microcontroller.

The Hitachi HD44780 chipset or compatible LCD‟s generally have a very standard pin
set . Those without backlights may have only 14 pins, omitting the final two pins powering the
light.

Solder the headers on to the LCD panel and insert the LCD panel into a solder less bread
board.Wire the bread board with 5V and GND from the Arduino

RS pin of the LCD module is connected to digital pin12 of the Arduino.R/W pin of the
LCD is grounded. Enable pin of the LCD module is connected to digital pin11 of the Arduino. In
this project , the LCD module and Arduino are interfaced in the 4-bit mode.

This method is very simple, requires less connections and that can almost utilize the full
potential of the LCD module. LCD through arduino is shown in fig 5.3

Fig 5.3 LCD through arduino

Department of ECE,MRITS 32
Smart heart rate monitoring using bluetooth module

5.5.2 LCD PROGRAMMING

Once all of the wiring us complete the Arduino can write text to the LCD via programs
that are loaded onto the microcontroller. Programs utilizing the JAVA programming language
can be uploaded to the microcontroller via free open source software made by Arduino. A library
made by Arduino called “Liquid Crystal” can download and used in any programs written to
interface with the LCD display. The “Liquid Crystal” library contains a variety of built in
functions that allow an Arduino to control an LCD. These functions allow the user to do things
like print text strings to the screen, initialize the screen cursor to a certain pixel, scroll the screen
left or right, clear the display, as well as a variety of other things. One of the main reasons that
LCD displays have become so common in recent years is due to the ease at which they can be
interfaced with. Although an Arduino microcontroller was used to demonstrate this ability in this
application note, a variety of other microcontrollers can be used to achieve the same result. On a
similar note, much more can be accomplished with an Arduino microcontroller and an LCD
display than what was demonstrated in this application note. By adding further hardware to the
circuit described here things like real time clocks and thermometers can be added, allowing the
LCD to display the current time and temperature. The simplicity of their design and ease of
interface allow for LCD screens to be used in a variety of projects on both a large and small
scale.

5.6 INTERFACING BUZZER WITH ARDIUNO

If a buzzer operates from a low enough voltage and draws low enough current, it can be
interfaced directly to an Arduino Uno pin as shown in Fig 5.6.

The buzzer used in this example can operate from a voltage between 3 to 28V and draws
only 4mA of current at 12V. When the current drawn by the buzzer was measured at 5V, it was
found that it only drew about 1.1mA which is well within the drive capability of an Arduino Uno
pin. Interfacing of buzzer with Arduino is shown in fig 5.4.
5.7 CONCLUSION

In this chapter, Implementation of patient using Arduino and interfacing of modules,


heart beat sensors and lm358 with the Arduino have been discussed.

Department of ECE,MRITS 33
Smart heart rate monitoring using bluetooth module

CHAPTER 6
RESULTS AND DISCUSSION

6.1 INTRODUCTION

In this chapter Results and Discussion of hospital bed side patient information providence
using Bluetooth module are discussed.

6.2 RESULTS

An bed side patient information providence, if the count of the heart beat pulse is less
than the normal pulse per minute then doctor gets alert through the buzzer and message is sent to
his/her owners through bluetooth module. This is the main hardware kit for project. The output
will be shown in LCD connected to the micro controller. The LCD module is connected to the
port P2 Arduino Uno board, as shown in fig 6.1

Fig 6.1 Hardware kit for smart heart rate monitoring system using bluetooth module.

Department of ECE,MRITS 34
Smart heart rate monitoring using bluetooth module

In the fig 6.2, the heart beat sensor that is connected to analog input A0 to the
microcontroller which senses the pulse and displays the reading on LCD module as shown in Fig
6.2.

Fig 6.2 heart beat sensor connected to bluetooth module

The main aim of the project is to know whether patient conditions is critical then heart
beat sensor sense the pulse and Bluetooth module gets activated and is displayed on LCD as
shown in Fig 6.3 and buzzer is alarmed.

Fig 6.3 LCD display the heart rate of patient.

Department of ECE,MRITS 35
Smart heart rate mointoring using bluetooth module

In the project, if the condition of patient is displayed on LCD the information is


also displayed parallel Andriod app in moblie shown in Fig 6.4.

Fig 6.4 patient information in serial monitor.

6.3 CONCLUSION

In this chapter, Results and Discussion hospital bed side patient information
providence using Bluetooth module have been discussed.

Department of ECE,MRITS 36
Smart heart rate monitoring using bluetooth module

CHAPTER 7

CONCLUSION AND FUTURE SCOPE

7.1 CONCLUSION

From the above designed project we can conclude that we are able to transmit the data
which is sensed from remote patient to the doctors PC by using wireless transmission
technology, Bluetooth. Using Bluetooth at receiver the data is received and displayed on the PC.

With the fast development of the industrialization and urbanization process in the world
and hence with the increase of busyness of people it has become difficult To monitor the health
conditions of a patient continuously. Also with the increase in the number senior citizens and
chronic diseases, the number of elderly patients who need constant assistance has increased. One
key point of all critical care for elderly patient is the continuous monitoring of their vital signs.
To avoid unexpected health problems and obtain higher accuracy in diagnosis of the health
conditions of a patient, efficient and comprehensive data collecting, monitoring and control play
an important role to improve the health care system more reliable and effective.

7.2 FUTURE SCOPE

Wireless sensor networks, a well-known technology consist of small, battery-powered


"motes" with limited computation and radio communication capabilities. This technology has the
potential to impact the delivery and study of resuscitative care by allowing vital signs to be
automatically collected and fully integrated into the patient care record and used for real-time
triage, correlation with hospital records, and long-term observation. This network technology
provides a better solution for remote monitoring of post-operative patients in a hospital, elderly
patients at home and patients affected by COPD and PD during their rehabilitation period in
ambulatory environments.
There are many other extensions possible to the current work that can be studied further. The
direct extension is to use artificial intelligence in wireless sensor networks to explore simple
parallel distributed computation, distributed storage, data robustness and auto classification of
sensor readings to help the physicians in the early interpretation of diseases. With sensor

Department of ECE,MRITS 37
Smart heart rate monitoring using bluetooth module

networks on the verge of deployment, security issues pertaining to the sensor networks are in the
limelight. Due to the sensitiveness of medical data, austere privacy and security are inevitable for
all parts of healthcare systems. The IPv6 over Low power Wireless Personal Area Networks
(6LoWPAN) standard offers an alternative because it employs the IPv6 protocol and can operate
equally well over wireless and wired connections. The presence of a single actuator in sensor
networks eliminates the need for coordination and communication between actuators and a
sparsely connected network eliminates the need for location management. Our current work can
also extend further to monitor sports personalities and patients affected by other specific diseases
during their normal routine activities.

Department of ECE,MRITS 38
Smart heart rate monitoring using bluetooth module

REFERENCES
1. J. Salyer, "Neonatal and Pediatric Pulse Oximetry", Respiratory Care, pp. 286-289, 2003.
2. C. Otto, A. Milenkovic, C. Sanders, E. Jovanov, "System architecture of a wireless body area
sensor network for ubiquitous health monitoring", Journal of Mobile Multimedia, vol. 1, pp.
307-326, 2006.
3.. Dusit Niyato, Ekram Hossain, Sergio Camorlinga, "Remote Patient Monitoring Service using
Heterogeneous Wireless Access Networks Architecture and Optimization", IEEE JOURNAL
ON SELECTED AREAS IN COMMUNICATIONS, vol. 27, no. 4, MAY 2009.
4. CC2430 Data Sheet (rev. 2.1) SWRS036F. A True System-on-Chip solution for 2.4 GHz
IEEE 802.15.4 Bluetooth(TM)Texas Instruments..
5. Xiang-dong JIANG, Yu-liang TANG, Ying LEL, Wireless Sensor Networks in Structural
Health Monitoring Based on Bluetooth Technology.

Department of ECE,MRITS 39
Smart heart rate monitoring using bluetooth module

APPENDIX-A

SOURCE CODE
#include <SoftwareSerial.h>

SoftwareSerial mySerial(9, 10); // RX, TX


int sensorPin = A0;
int sensorValue = 0;
float volts = 0.0,temp = 0.0;
int LED = 13; //LED to blink when pulsing
int din = 2; // digital pin 2 to read 0V or 5V
int check; // checks current status of digital pin 2
int prevcheck;// previous check status
int pulsecount = 0; //number of pulses (highs) seen on the digital pin
int BPM = 0; //beats perminute = counter value * 10
unsigned long firstpulse =0; //time of first pulse
unsigned long timecount = 0;//cumulative time of total pulses
unsigned long latestpulse=0;
unsigned long interval = 10000; //setting 10 seconds as max read time
int buzzer = 4;
#include <LiquidCrystal.h> //include LCD

LiquidCrystal lcd(11, 12, 3, 5, 6, 7);

void setup()

{
pinMode(LED, OUTPUT);
pinMode(din,INPUT);
lcd.begin(16, 2);// set up the LCD's number of columns and rows:
lcd.print("AV. HEART RATE:");// Print a message to the LCD.
Serial.begin(9600);
mySerial.begin(9600);
pinMode(buzzer, OUTPUT);
digitalWrite(buzzer, LOW);
Serial.print("AV. HEART RATE:");
mySerial.print("AV. HEART RATE:");
}
void loop()
{
check = digitalRead(din);
delay(100);
if(check != prevcheck)
{
if (check == LOW)
{
digitalWrite(LED, LOW);
Department of ECE,MRITS 40
Smart heart rate monitoring using bluetooth module

{
if (check == HIGH)
{
digitalWrite(LED, HIGH);

if (pulsecount == 0 ) // if this is the first count


{
firstpulse = millis(); // recording time of first pulse
pulsecount = pulsecount +1; //increment the counter
}

if (pulsecount >=1 )
{
pulsecount = pulsecount + 1; // increment pulse counter when detected
latestpulse = millis(); // recording latest pulse time
}
}
}

//-----DISPLAY------///
if (latestpulse - firstpulse > interval) //checking if 6 seconds has elapsed
{
BPM = pulsecount*6;
Serial.println(BPM);
//display the number of counts over 6 second
mySerial.println(BPM);
if( BPM >88)
{
// mySerial.println("Temp is ");
// mySerial.println(temp);
mySerial.println("BPM is high\n\r");
delay(1000);
digitalWrite(buzzer, HIGH);
delay(500);
digitalWrite(buzzer, LOW);
delay(500);
}
pulsecount = 0; // counter restarted
firstpulse = 0; // restart for time of new first-pulse read
latestpulse = 0; // restart for new time readings
lcd.setCursor(0, 1); //setting LCD cursor to 1st column, second row
lcd.print(BPM); // print the HR on the LCD as well
lcd.setCursor(5,1); // setting cursor in 5th column, row 2
lcd.print("BPM"); // printing text next to BPM
//sensorValue = analogRead(sensorPin);
//volts = sensorValue*5.0/1023;

Department of ECE,MRITS 41
Smart heart rate monitoring using bluetooth module

{
// mySerial.println("Temp is ");
// mySerial.println(temp);
mySerial.println("BPM is high\n\r");
delay(1000);
digitalWrite(buzzer, HIGH);
delay(500);
digitalWrite(buzzer, LOW);
delay(500);
}
pulsecount = 0; // counter restarted
firstpulse = 0; // restart for time of new first-pulse read
latestpulse = 0; // restart for new time readings
lcd.setCursor(0, 1); //setting LCD cursor to 1st column, second row
lcd.print(BPM); // print the HR on the LCD as well
lcd.setCursor(5,1); // setting cursor in 5th column, row 2
lcd.print("BPM"); // printing text next to BPM
//sensorValue = analogRead(sensorPin);
//volts = sensorValue*5.0/1023;
//temp=volts*100;
//mySerial.print(“Temp is”);
//mySerialprintln(temp);
If(BPM>85)
{
//mySerial.println(“Temp is”);
//mySerial.println(temp);
mySerial.println(“BPM is high\n\r”);
delay(1000);
digitalWrite(buzzer, HIGH);
delay(500);
}}
Prevcheck=check;
}

Department of EcE, MRITS 42


Smart heart rate monitoring using bluetooth module

APPENDIX-B

ARDUINO SOFTWARE

OVERVIEW

Arduino
Arduino is a tool for making computers that can sense and control more of the physical
world than desktop computer. It's an open source physical computing platform based on a simple
microcontroller board, and a development environment for writing software for the board.

Arduino can be used to develop interactive objects, taking inputs from a variety of
switches or sensors, and controlling a variety of lights, motors, and other physical outputs.
Arduino projects can be stand alone, or they can be communicated with software running on
computer (e.g. Flash, Processing, Max MSP.) The boards can be assembled by hand or
purchased preassembled; the open source IDE can be downloaded for free.

The Arduino programming language is an implementation of Wiring, a similar physical


computing platform, which is based on the Processing multimedia programming environment.

Feature
a) Schematic design of the open source development interface free download, and
also according to the needs of their own changes
b) Download the program is simple and convenient.
c) Simply with the sensor, a wide range of electronic components connection (such as:
LCD, buzzer, etc.), make all sorts of interesting things.
d) Using the high-speed micro-processing controller (ATMEGA328).
e) The development of language and development environment is very simple, easy to
understand, very suitable for beginners to learn.

Performance
a) Digital I/O 0~13.
b) Analog I/O 0~5.( R3 is 0~7 )
c) Support ISP Download Function
d) Input voltage: when connected to the USB without external power supply or

Department of ECE, MRITS 43


Smart arduino based patient health monitoring and information system using zigbee module

external 5 V ~ 9V dc voltage input. Output Voltage: 5V dc voltage output and


3.3V dc voltage output and external power input.

e) Atmel Atmega328 micro-processing controller. Because of its many supporters,


the company has developed 32- bit MCU Arduino platform support.

f) Arduino size: width of 70 mm X high 54 mm.

Special Port

a) 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). The supply voltage through this pin, or, if supplying voltage via the power
jack, access it through this pin.
b) AREF. Reference voltage for the analog inputs. Used with analogReference().

SAINSMART UNO R3
UNO R3
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 a AC-to-DC adapter or battery to get started. Performance Revision 3 is
the last SainSmart UNO development board version.

Parameter

a) 3.3V/5V Supply Voltage and IO Voltage can be switched at the same time.
b) More 3.3V modules supported, such as Xbee module, Bluetooth module, RF
module, GPRS module, GPS module, LCD5110 Backlight and so on, but the
original version can only support 5V IO.

c) Controller uses SMD MEGA328P-AU chip. Add A6/A7 port.

d) 5V Electric current : 500MA

e) 3.3V Electric current : 50MA


f) Input Voltage: 7-12V

Department of ECE,MRITS 44
Smart arduino based patient health monitoring and information system using zigbee module

Improvement of R3
a) Working voltage 3.3V/5V is optional.
b) Arduino can only work at 5V voltage. When it comes to 3.3V Level module, IO
can‟t be connected to it. The Level should be changed, like the SD card, Bluetooth
module and so on.

c) Sainsmart UNO R3 can work at 3.3V voltage by switching on the button. At this
time, IO port is 3.3V and it can work with 3.3V Level module. (R3 can directly use
the electronic building blocks on I / O port and elicit G, V, S).
SAINSMART MEGA2560 R3
Description
This is the new MEGA2560 R3. In addition to all the features of the previous board, the
MEGA now uses an ATMega16U2 instead of the ATMega8U2 chip. This allows for faster
transfer rates and more memory. No drivers needed for Linux or Mac (inf file for Windows is
needed and included in the Arduino IDE), and the ability to have the Uno show up as a keyboard,
mouse, joystick, etc.

The MEGA2560 R3 also adds SDA and SCL pins next to the AREF. In addition, there are
two new pins placed near the RESET pin. One is the IOREF that allow the shields to adapt to the
voltage provided from the board. The other is a not connected and is reserved for future
purposes. The MEGA2560 R3 works with all existing shields but can adapt to new shields which
use these additional pins.

Features

a) Microcontroller ATmega2560
b) Operating Voltage 5V
c) Input Voltage (recommended) 7-12V
d) Input Voltage (limits) 6-20V
e) Digital I/O Pins 54 (of which 15 provide PWM output)
f) Analog Input Pins 16
g) DC Current per I/O Pin 40 mA

h) DC Current for 3.3V Pin 50 mA

Department of ECE,MRITS 45
Smart arduino based patient health monitoring and information system using zigbee module

i) Flash Memory 256 KB of which 8 KB used by bootloader


j) SRAM 8 KB
k) EEPROM 4 KB
l) Clock Speed 16 MHz

ARDUINO C GRAMMAR
Arduino grammar is built on the basis of C/C + +, in fact is also the basic C grammar,
Arduino grammar not only put some related parameters Settings are function change, we have no
need to understand his bottom, let us to know AVR micro control unit (MCU) friend can also
easy to fit in. So here I'll simple comment the Arduino grammar.

Control Structures
a) If
b) if...else
c) for
d) switch case
e) while
f) do... while
g) break
h) continue
i) return
j) goto

Further Syntax
a) ;
b) {}
c) //
d) /* */
Operators
a) ++
b) --
c) +=
d) -=

Department of ECE,MRITS 46
Smart arduino based patient health monitoring and information system using zigbee module

e) *=
f) /=
g) =
h) +
i) -
j) *
k) /
l) %
m) ==
n) !=
o) <
p) >
q) <=
r) >=
s) &&
t) ||
u) !

Data Type

a) boolean
b) char
c) byte
d) int
e) unsigned int
f) long
g) unsigned long
h) float
i) double
j) string
k) array
l) void

Department of ECE,MRITS 47
Smart heart rate monitoring using bluetooth module

Constant

HIGH | LOW Said digital IO port level, HIGH Said high level(1), LOW Said low electric
flat(0).

INPUT | OUTPUT Said digital IO port direction, INPUT Said input (high impedance state)

OUTPUT Said output (AVR can provide 5 v voltage and ma current).

TRUE | FALSE true (1),false (0).

Structure

Voidsetup ()

The setup() function is called when a sketch starts. Use it to initialize variables, pin
modes, start using libraries, etc. The setup function will only run once, after each power up or
reset of the Arduino board.

Voidloop()

After creating a setup() function, which initializes and sets the initial values, the loop()
function does precisely what its name suggests, and loops consecutively, allowing program to
change and respond. Use it to actively control the Arduino board.

Function
a) Digital I/O
pinMode(pin, mode)pin 0~13, mode is input or output.
digitalWrite(pin, value)pin 0~13, value is HIGH or LOW.
intdigitalRead(pin)pin 0~13, value is HIGH or LOW.
b) Analog I/O
IntanalogRead(pin)pin 0~5.
analogWrite(pin, value)pin 3, 5, 6, 9, 10, 11, value is 0 to 255.
Time
a) Delay(ms)Pauses the program for the amount of time (in miliseconds) specified
as parameter. (There are 1000 milliseconds in a second.)(unitms).
b) delayMicroseconds(us).

Department of ECE,MRITS 48
Smart heart rate monitoring using bluetooth module

LCD Program
Here, we will learn use Arduino IDE serial interface tools to show the contents that
we want to display in the computer.
void setup()
{
Serial.begin(9600);// opens serial port, sets data rate to 9600 bps
Serial.println("Hello World!");
}
void loop()

{
}
Explain
Serial.begin(9600); The comment says 9600 bps, and just know bps stands for bits per
second (we will refer to this as the baud rate). Communicate with computer, it may choose
these rate “300, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 115200”. LCD
with Arduino is shown in fig 7.1

Fig 7.1: LCD with Arduino


Operation
1. Download code to Arduino.
2. After download, click “tool”, pick up relevant Arduino board, and relevant
com. Then click “serial Monitor”, on the new open up window‟s bottom
right, choose the relevant rate. LCD Sample Compilation is shown in fig 7.2

Department of ECE,MRITS 49
Smart heart rate monitoring using bluetooth module

Fig 7.2: LCD Sample Compilation


LED Sample Program
Small LED lamp experiment is the basis of comparison of the experimental one, this time
we use the motherboard comes with 13 feet of LED lights to complete the experiment, the
experimental equipment we need is the Arduino which each experiment must have and USB
download cable. LED Connected to Arduino is shown in fig 7.3

Fig 7.3: LED Connected to Arduino

Department of ECE,MRITS 50
Smart heart rate monitoring using bluetooth module

Accordance with the good circuit above figure, start writing programs and we let the
small LED lights flashing. Lighting on for one second and off for one second. This program is
very simple. This is Arduino own routines Blink.

intLedPin =13; //define pin 13

void setup()

pinMode(LedPin,OUTPUT); //define interface is output

void loop()
{

digitalWrite(LedPin,HIGH); //light up led lamp

delay(1000);//delay 1s

digitalWrite(LedPin,LOW);//go out led lamp

delay(1000);// delay 1s }

LIGHT EMITTING DIODE

The light emitting diode referred to as LED. By gallium (Ga) and arsenic (AS) and
phosphorus (P) made of a compound of the diode, when the electron and hole recombination can
radiate visible light, and thus can be used to prepare a light-emitting diode in the circuit and the
instrument as the indicator, or the composition of the text or digital display. GaAs P diode hair
red, gallium phosphide diode green silicon carbide diode yellow. Led and Arduino with LED is
shown in fig 7.4 and 7.5 respectively.

Department of ECE,MRITS 51
1
Smart heart rate monitoring using bluetooth module

Fig 7.4: LED

Fig 7.5: Arduino with LED

intledPin=8; //set IO pin of LED in control

void setup()

pinMode(ledPin,OUTPUT);//set digital pin IO is OUTPUT

Department of ECE,MRITS 52
Smart heart rate monitoring using bluetooth module

void loop()

digitalWrite(ledPin,HIGH); //set PIN8 is HIGH , about 5V

delay(1000); //delay 1000ms, 1000ms = 1s

digitalWrite(ledPin,LOW); //set PIN8 is LOW, 0V

delay(1000); //delay 1000ms, 1000ms = 1s }

setup()

The setup() function is called when a sketch starts. Use it to initialize variables, pin
modes, start using libraries, etc. The setup function will only run once, after each power up or
reset of the Arduino board.

loop()

After creating a setup() function, which initializes and sets the initial values, the loop()
function does precisely what its name suggests, and loops consecutively, allowing the program to
change and respond. Use it to actively control the Arduino board.

Department of ECE,MRITS 53
Smart heart rate monitoring using bluetooth module

Department of ECE,MRITS 59

You might also like