Sei sulla pagina 1di 60

ABSTRACT

Nowadays numerous persons are mislaying their life owing to heart attack and shortage of medical
attention to patient at correct stage. Hence, in this project we are implementing heart rate monitoring and
heart attack recognition system using IoT. The patient will carry hardware having sensors with android
application. The heartbeat sensor will allow checking heart beat readings and transmit them over the
internet. The user may set the high and low level of heartbeat limits. Once these limits are set the system
can start monitoring the patient’s heartbeat and as soon as the heart beat readings goes above or below the
limit set by the user the system will send an alert about high or low heartbeat as well about chances of heart
attack.
The Internet of Things (IoT) is inter communication of embedded devices using networking
technologies. The IoT will be one of the important trends in future, can affect the networking, business and
communication. In this paper, proposing a remote sensing parameter of the human body which consists of
pulse and temperature. The parameters that are used for sensing and monitoring will send the data through
wireless sensors. Adding a web based observing helps to keep track of the regular health status of a patient.

1
CHAPTER-1

INTRODUCTION

These days a number of people are losing their life due to heart attack. Heart attack can occur when the
flow of blood to heart is blocked. Owing to late diagnosis of heart attack we are inadequate to save the lives
of many humans. In this paper, we suggest a system that will detect heart attack by monitoring the heart
rate based on IoT (Internet of Things). For a healthy adult, ordinary heartrate is 60 to 100 bpm (beats per
minute). Athlete’s heart beat generally range from 40 to 60 bpm depending upon their fitness. If a person’s
heart rate is constantly over 100 beats per minute then the person is said to be having higher heart rate
which is also notorious as tachyarrhythmia. It can diminution the efficiency of heart by letdown the amount
of blood pumped through the body can result in chest pain and lightheadedness. With the advancement in
technology it is easy to monitor the patient’s heart rate even at home. IoT is dexterity of network
mechanism to intellect and gather information from world ubiquitously us then share the information
athwart internet anywhere it can be managed for some tenacity.

It is estimated that over 20 million deaths all over the world occur due to cardio vascular disorder. Several
people are also disabled by cardio vascular disease. The fatal consequence occurs due to delay in providing
medical assistance. The severity increases due to deployment of resources for early detection and treatment.
In this system, the analog sensors measure the heart rate. An analog to digital converter converts the sensed
analog data into corresponding digital data. This digital data is transmitted over a ZigBee module. The
heart of patients suffering from fatal heart failures is monitored continuously. The control system accepts
and processes the monitored signal. The processed signal is then fed into alert system as an precaution or
detection of heart failure to the patients. This paper aims at reduction in number of deaths due to heart
attack and heart related diseases. The design uses low cost effective ZigBee heart rate monitoring and alert
system. The system can be used in hospitals and for patients who are under continuous monitoring. The
heart attack detection by monitoring the heart rate, helps to inform a person if he is about to have heart
attack. The system uses transmitting and receiving parts of which the transmitter is with the patient and the
receiver is with doctor or nurse. The system uses smart sensor which converts the heart beat into pulses.
When the controller detects heart failure or heart attack, it sends signals to cell phone contained with the
doctor.

2
CHAPTER-2

LITERATURE REVIEW
S. J. Jung and W. Y. Chung studied the Flexible and scalable patient’s health monitoring system in
6LoWPAN . The main advantage of this enabling factor is the combination of some technologies and
communications solution. The results of Internet of Things are synergetic activities gathered in various fields of
knowledge like telecommunications, informatics and electronics.

K. S. Shin and M. J. Mao Kaiver studied a cell phone based health monitoring system with self analysis
which incorporates IoT [13] a new paradigm that uses smart objects which are not only capable of collecting the
information from the environment and interacting the physical world, but also to be interconnected with each other
through internet to exchange data as well as information. Gennaro tartarisco and Tabilo Paniclo had studied a
Maintaining sensing coverage and connectivity in large sensor networks mainly includes the information about how
to build or develop a new computational technology based on clinical decision support systems, information
processing, wireless communication and also data mining kept in new premises in the field of personal health care.
Cristina Elena Turcua studied Health care applications a solution based on the Internet of Things survey aims to
present a detailed information about how radio frequency identification, multi-agent and Internet of Things
technologies can be used to develop and improve people’s access to quality and health care services and to optimize
the health care process.

Gubbi, Jayavardhana, Buyya, Rajkumar, Marusic, Slaven, Palaniswami, Marimuth studied the Internet of
Things (IoT): A vision, architectural elements, and future direction which International Journal of Pure and Applied
Mathematics Special Issue 60 proposes on demand positioning and tracking system. It is based on Global Positioning
enabled devices and suitable for large environments. Smart phones between two terminals are used for making initial
communication. The initial communication is performed by synchronization phase.

J.L. Kalju developed a system, which is capable of measuring different physiological parameters and are
used to design a system for heart rate reconstruction for rate adaptive pacing . Loren Schwiebert, Sandeep K.S. Gupta
and Jennifer Weinmann studied the strength of smart sensors which are developed from the combination of sensing
materials along with combined circuitry for other biomedical applications .

Gentili G.B proposed a simple microwave technique to monitor the cardiac activity. This technique is
dependent on changes in modulation envelope of amplitude modulated waves passing through the body . It explained
the use of wireless microsensors networks for medical monitoring and environmental sensing. Reza
S.Dilmaghani(2016) in their study found the design of Wi-Fi sensor network that is capable of monitoring patient’s
chronic diseases at their home itself via a remote monitoring system. So immerging of wireless sensor technology
individual test like only blood pressure, heart rate, temperature etc. can be measured but this research project enables
all this parameter together to be measured under single system, and also thus all can be worn by patient and
processed data send toward internet through internet of things(IOT).

3
CHAPTER-3

INTERNET OF THINGS (IoT)


3.1. BACKGROUND

The digital space has witnessed major transformations in the last couple of years and as per industry
experts would continue to evolve itself. The latest entrant to the digital space is the Internet of Things
(IoT). IoT can also be defined as interplay for software, telecom and electronic hardware industry and
promises to offer tremendous opportunities for many industries.

With the advent of the Internet of Things (IoT), fed by sensors soon to number in the trillions,
working with intelligent systems in the billions, and involving millions of applications, the Internet of
Things will drive new consumer and business behavior that will demand increasingly intelligent industry
solutions, which, in turn, will drive trillions of dollars in opportunity for IT industry and even more for the
companies that take advantage of the IoT. The number of Internet-connected devices (12.5 billion)
surpassed the number of human beings (7 billion) on the planet in 2011, and by 2020, Internet-connected
devices are expected to number between 26 billion and 50 billion globally. The Indian Government's plan
of developing 100 smart cities in the country, for which Rs. 7,060 crores has been allocated in the current
budget could lead to a massive and quick expansion of IoT in the country. Also, the launch of the Digital
India Program of the Government, which aims at transforming India into digital empowered society and
knowledge economy will provide the required impetus for development of the IoT industry in the country.

The various initiatives proposed to be taken under the Smart City concept and the Digital India
Program to setup Digital Infrastructure in the country would help boost the IoT industry. IoT will be critical
in making these cities smarter.

Some of the key aspects of a smart city will be:

 Smart parking
 Intelligent transport system.
 Tele-care.
 Woman Safety Smart grids.
 Smart urban lighting.
 Waste management.
 Smart city maintenance.
 Digital-signage.
 Water Management
Among other things, IoT can help automate solutions to problems faced by various industries like
agriculture, health services, energy, security, disaster management etc. through remotely connected
devices. IoT offers avenues for telecom operators & system integrators to significantly boost their revenues
4
and this has resulted in their taking lead in adoption of IoT applications and services being offered by the
technology. Apart from direct IoT applications, the IT industry also has an opportunity to provide services,
analytics and applications related to IoT.

Internet of Things involves three distinct stages:

1. the sensors which collect data (including identification and addressing the sensor/device,

2. an application which collects and analyzes this data for further consolidation and,

3. Decision making and the transmission of data to the decision-making server.

Analytical engines and Big data may be used for the decision making process. Several countries like US,
South Korea, China among others, have taken lead in their preparedness for taking advantage for IoT. The
key stakeholders in the Internet of things initiatives would be the citizens, the government and the industry.
Participation and collaboration of each of the stakeholder at an appropriate stage is essential. At this
juncture, we require policies for promotion of IoT and selection of e essential domains and then emphasize
on building answers for what Data will Service the Citizens . Internet of Things should clearly strategize
with a simple goal of Value Up and Cost Down models. With industry collaboration, experiences from
global forums, learnings from other countries who are leaders in IoT, active participation of global partners
will help us induce more innovation driven approach. Key to success of Internet of Things would be in
building open platforms for ease of use and low cost, building scalable models and using citizens as
sensors. Data needs to be openly collected and shared between cross functions to bring out maximum
benefits. Participation of start-ups at 4 this stage will help us devise some innovative methods/ concepts
which could be cornerstones for the upcoming overall smart concept .

3.2. DEFINITION

IoT is a seamless connected network of embedded objects/ devices, with identifiers, in which M2M
communication without any human intervention is possible using standard and interoperable
communication protocols. - Phones, Tablets and PCs are not included as part of IoT.

3.3. VISION

“To develop connected and smart IoT based system for our country’s Economy, Society,
Environment and global needs. “

3.4.OBJECTIVES

1. To create an IoT industry in India of USD 15 billion by 2020. This will also lead to increase in the
connected devices from around 200 million to over 2.7 billion by 2020. As per Gartner Report the total
revenue generated from IoT industry would be USD 300 billion and the connected devices would be 27
billion by 2020 globally. It has been assumed that India would have a share of 5-6% of global IoT industry

5
2. To undertake capacity development (Human & Technology) for IoT specific skill-sets for domestic and
international markets.

3. To undertake Research & development for all the assisting technologies.

4. To develop IoT products specific to Indian needs in the domains of agriculture, health, water quality,
natural disasters, transportation, security, automobile, supply chain management, smart cities, Automated
metering and monitoring of utilities, waste management, Oil & Gas) etc.

CHAPTER-4

METHODOLOGY

4.1. EXISTING SYSTEM

In today’s busy and expensive world everyone is so tied up with their daily works that most of the times no
family members can be with the elder people of the family 24/7. The Elder person should be continuously
monitered by other external.Also, external help is not affordable for everyone. Again, there are cases where
elder people are living in their home all alone independently. In all of the above cases, the common
problem is lack of continuous health monitoring of elderly people living alone.

4.2. PROPOSED SYSTEM


In this paper, proposing a remote monitoring and sensing parameter of the human body which consists of
pulse and temperature. The parameters that are used for sensing and observing will send the data through
wireless sensors. Adding a web based observing helps to keep track of the regular health status of a patient.
The sensing data will be collected in database continuously and will be used to inform patient to any
unseen problem to undergo possible diagnosis.
4.3. BLOCK DIAGRAM

Fig. 4.1. Block diagram


6
4.4. HARDWARE REQUIREMENTS
 ARDUINO UNO
 LM35 SENSOR
 ESP8266 WIFI MODULE
 BUZZER
 LCD
 POWER SUPPLY

CHAPTER-5

HARDWARE DESCRIPTION

5.1.ARDUINO UNO

Fig. 5.1.1: Arduino Uno R3 Front Fig. 5.1.2: Arduino Uno R3 Back

Fig. 5.1.3: Arduino Uno R2 Front Fig. 5.1.4: Arduino Uno SMD Fig.5.1.5: Arduino Uno front Fig. 5.1.6: Arduino
Uno Back

7
5.1.1. Overview

The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). 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.

The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip.
Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial
converter.

Revision 2 of the Uno board has a resistor pulling the 8U2 HWB line to ground, making it easier to put into
DFU mode.

Revision 3 of the board has the following new features:

 1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other new pins placed
near to the RESET pin, the IOREF that allow the shields to adapt to the voltage provided from the board. In
future, shields will be compatible both with the board that use the AVR, which operate with 5V and with
the Arduino Due that operate with 3.3V. The second one is a not connected pin, that is reserved for future
purposes.

 Stronger RESET circuit.

 Atmega 16U2 replace the 8U2.

"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, see the index of Arduino boards.

5.1.2. Summary

Microcontroller ATmega328

Operating Voltage 5V

Input Voltage (recommended) 7-12V

Input Voltage (limits) 6-20V


Digital I/O Pins 1(of which 6 provide PWM output)
8
4
Analog Input Pins 6
DC Current per I/O Pin 40 Ma
DC Current for 3.3V Pin 50 mA.
3
Flash Memory 2KB (ATmega328) of which 0.5 KB used by bootloader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
1
Clock Speed 6MHz
5.1.3. Schematic & Reference Design

EAGLE files: arduino-uno-Rev3-reference-design.zip (NOTE: works with Eagle 6.0 and newer)

Schematic: arduino-uno-Rev3-schematic.pdf

Note: The Arduino reference design can use an Atmega8, 168, or 328, Current models use anATmega328,
but an Atmega8 is shown in the schematic for reference. The pin configuration is identical on all three
processors.

5.1.4. Power

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 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. The power pins are
as follows:

 VIN. The input voltage to the Arduino board when it's using an external power source (asopposed
to 5 volts from the USB connection or other regulated power source). You can supply voltage through this
pin, or, if supplying voltage via the power jack, access it through this pin.

 5V.This pin outputs a regulated 5V from the regulator on the board. The board can be suppliedwith
power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-

9
12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We
don't advise it.

 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.

 GND. Ground pins.

5. 1.5. Memory

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).

5.1.6. Input and Output

Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode(),
digitalWrite(), and digitalRead() 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 kOhms. In
addition, some pins have specialized functions:

 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pinsare
connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.

 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a lowvalue, a
rising or falling edge, or a change in value. See the attachInterrupt() function for details.

 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with theanalogWrite()function.

 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communicationusing the
SPI library.

 LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, theLED
is on, when the pin is LOW, it's off.

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 analogReference() function. Additionally, some pins have
specialized functionality:
10
 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using theWire
library.There are a couple of other pins on the board:

 AREF: Reference voltage for the analog inputs. Used withanalogReference().

 Reset: Bring this line LOW to reset the microcontroller. Typically used to add a reset button
toshields which block the one on the board.
See also the mapping between Arduino pins and ATmega328 ports. The mapping for the Atmega8, 168,
and 328 is identical.

5.1.7. Communication

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 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,a .inf file is required. The
Arduino software includes a serial monitor which allows simple textual data to be sent to and from the
Arduino board. The RX and TX LEDs on the board will flash when data is being transmitted via the USB-
to-serial chip and USB connection to the computer (but not for serial communication on pins 0 and 1).

A SoftwareSerial 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.

5.1.8. Programming

The Arduino Uno can be programmed with the Arduino software (download). Select "Arduino Uno from
the Tools > Board menu (according to the microcontroller on your board). For details, see the reference
and tutorials.

The ATmega328 on the Arduino Uno comes preburned with a bootloader that allows you 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).

11
You can also bypass the bootloader and program the microcontroller through the ICSP (In-Circuit Serial
Programming) header; 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 bootloader, which can be activated by:

 On Rev1 boards: connecting the solder jumper on the back of the board (near the map of Italy) and
then resetting the 8U2.

 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.

You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and Linux) to
load a new firmware. Or you can use the ISP header with an external programmer (overwriting the DFU
bootloader). See this user-contributed tutorial for more information.

5.1.9. Automatic (Software) Reset

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 line of the ATmega328 via a 100
nanofarad 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 you to upload code by simply pressing the upload
button in the Arduino environment. This means that the bootloader can have a shorter timeout, as the
lowering of DTR can be well-coordinated with the start of the upload. This setup has other implications.
When the Uno is connected to either a computer running Mac OS X or Linux, it resets each time a
connection is made to it from software (via USB). For the following half-second or so, the bootloader is
running on the Uno. While it is programmed to ignore malformed data (i.e. anything besides an upload of
new code), it will intercept the first few bytes of data sent to the board after a connection is opened. If a
sketch running on the board receives one-time configuration or other data when it first starts, make sure
that the software with which it communicates waits a second after opening the connection and before
sending this data.

The Uno contains a trace that can be cut to disable the auto-reset. The pads on either side of the trace can
be soldered together to re-enable it. It's labeled "RESET-EN". You may also be able to disable the auto-
reset by connecting a 110 ohm resistor from 5V to the reset line; see this forum thread for details.
12
5.1.10. USB Overcurrent Protection

The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from shorts and
overcurrent. 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.

5.1.11. Physical Characteristics

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.

5.2 .LCD (LIQUID CRYSTAL DISPLAY)

5.2.1. Introduction

A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or
monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a column of liquid
crystal molecules suspended between two transparent electrodes, and two polarizing filters, the axes of
polarity of which are perpendicular to each other. Without the liquid crystals between them, light passing
through one would be blocked by the other. The liquid crystal twists the polarization of light entering one
filter to allow it to pass through the other.

A program must interact with the outside world using input and output devices that communicate directly
with a human being. One of the most common devices attached to an controller is an LCD display. Some of
the most common LCDs connected to the controllers are 16X1, 16x2 and 20x2 displays. This means 16
characters per line by 1 line 16 characters per line by 2 lines and 20 characters per line by 2 lines,
respectively.

Features:

(1) Interface with either 4-bit or 8-bit microprocessor.

(2) Display data RAM

(3 ) Character generator ROM.

(4) Display data RAM and character generator RAM may be Accessed by the microprocessor.

(5) Numerous instructions

(6) Clear Display, Cursor Home, Display ON/OFF, Cursor ON/OFF, Blink Character, Cursor
Shift,Display Shift.
13
(7) Built-in reset circuit is triggered at power ON.
(8) Built-in oscillator

Data can be placed at any location on the LCD. For 16×1 LCD, the address locations are:

Table. 5.1: Address locations for a 1x16 line LCD

Even limited to character based modules there is still a wide variety of shapes and sizes available. Line
lengths of 8,16,20,24,32 and 40 characters are all standard, in one, two and four line versions. Several
different LC technologies exists. “supertwist” types, for example, offer Improved contrast and viewing
angle over the older “twisted nematic” types. Some modules are available with back lighting, so so that
they can be viewed in dimly-lit conditions. The back lighting may be either “electro-luminescent”,
requiring a high voltage inverter circuit, or simple LEDillumination.

5. 2.2. Electrical BlockDiagram:

Fig 5.2: Electrical Block Diagram

14
5.2.3. PinDescription :

Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two pins
are extra in both for back-light LED connections).

Fig 5.2.1: pin diagram of 1x16 lines lcd

15
Table 5.2: Table for LCD

5.2.4. Control Lines

 EN: Line is called "Enable." This control line is used to tell the LCD that you are sending it
data. To send data to the LCD, your program should make sure this line is low (0) and then
set the other two control lines and/or put data on the data bus. When the other lines are
completely ready, bring EN high (1) and wait for the minimum amount of time required by
the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0)again.

 RS: Line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high
(1), the data being sent is text data which sould be displayed on the screen. For example, to
display the letter "T" on the screen you would set RShigh.

 RW: Line is the "Read/Write" control line. When RW is low (0), the information on the data
bus is being written to the LCD. When RW is high (1), the program is effectively querying
(or reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others
are write commands, so RW will almost always below.

Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected by
the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3,
DB4, DB5, DB6, and DB7.

Logic status on control lines:

 E - 0 Access to LCDdisabled

 1 Access to LCDenabled

 R/W - 0 Writing data toLCD

 1 Reading data fromLCD

 RS – 0Instructions

16
 1Character
Writing data to the LCD:

1) Set R/W bit tolow

2) Set RS bit to logic 0 or 1 (instruction orcharacter)

3) Set data to data lines (if it iswriting)

4) Set E line tohigh

5) Set E line tolow

Read data from data lines(if it is reading on LCD) :

1) Set R/W bit tohigh

2) Set RS bit to logic 0 or 1 (instruction orcharacter)

3) Set data to data lines (if it iswriting)

4) Set E line tohigh

5) Set E line tolow

Entering Text:

First, a little tip: it is manually a lot easier to enter characters and commands in hexadecimal
rather than binary (although, of course, you will need to translate commands from binary

17
couple of sub-miniature hexadecimal rotary switches is a simple matter, although a little bit
into hex so that you know which bits you are setting).
5.3. POWER SUPPLY

All digital circuits require regulated power supply. In this article we are going to learn how to get a
regulated positive supply from the mains supply.

Fig 5.3: Basic block diagram of a fixed regulated power supply.

5.4. TRANSFORMER

Fig 5.4: Structure of Transformer

A transformer consists of two coils also called as “WINDINGS” namely PRIMARY &
SECONDARY.

They are linked together through inductively coupled electrical conductors also called as CORE. A
changing current in the primary causes a change in the Magnetic Field in the core & this in turn
induces an alternating voltage in the secondary coil. If load is applied to the secondary then

18
an alternating current will flow through the load. If we consider an ideal condition then all the energy
from the primary circuit will be transferred to the secondary circuit through the magnetic field.

So

The secondary voltage of the transformer depends on the number of turns in the Primary as well as in
the secondary.

5.5. RECTIFIER

A rectifier is a device that converts an AC signal into DC signal. For rectification purpose we use a
diode, a diode is a device that allows current to pass only in one direction i.e. when the anode of the
diode is positive with respect to the cathode also called as forward biased condition & blocks current
in the reversed biased condition.

Rectifier can be classified as follows:

1) Half Wave rectifier.


2) Full Wave rectifier
3) Bridge Rectifier.

5.6. FILTER CAPACITOR

Even though half wave & full wave rectifier give DC output, none of them provides a constant output
voltage. For this we require to smoothen the waveform received from the rectifier. This can be done
by using a capacitor at the output of the rectifier this capacitor is also called as “FILTER
CAPACITOR” or “SMOOTHING CAPACITOR” or “RESERVOIR CAPACITOR”. Even after using
this capacitor a small amount of ripple will remain.

19
We place the Filter Capacitor at the output of the rectifier the capacitor will charge to the peak voltage
during each half cycle then will discharge its stored energy slowly through the load while the rectified
voltage drops to zero, thus trying to keep the voltage as constant as possible.

Fig5.6: Waveforms of Filter Capacitor

If we go on increasing the value of the filter capacitor then the Ripple will decrease. But then the
costing will increase. The value of the Filter capacitor depends on the current consumed by the circuit,
the frequency of the waveform & the accepted ripple.

Where,

Vr= accepted ripple voltage.( should not be more than 10% of  the voltage)

I= current consumed by the circuit in Amperes.

F= frequency of the waveform. A half wave rectifier has only one peak in one cycle so F=25hz

Whereas a full wave rectifier has Two peaks in one cycle so F=100hz.

5.7. VOLTAGE REGULATOR 

A Voltage regulator is a device which converts varying input voltage into a constant regulated output
voltage. Voltage regulator can be of two types

20
1) Linear Voltage Regulator
2) Switching Regulators

Fig 5. 7: circuit diagram of Voltage regulator

5.7.1. Circuit diagram:

Fig 5.7.1: Circuit Diagram of power supply

5.8. IC 7805:
7805 is an integrated three-terminal positive fixed linear voltage regulator. It supports an input voltage
of 10 volts to 35 volts and output voltage of 5 volts. It has a current rating of 1 amp although lower
current models are available. Its output voltage is fixed at 5.0V. The 7805 also has a built-in current
limiter as a safety feature. 7805 is manufactured by many companies, including National
Semiconductors and Fairchild Semiconductors.

The 7805 will automatically reduce output current if it gets too hot.The last two digits represent the
voltage; for instance, the 7812 is a 12-volt regulator. The 78xx series of regulators is designed to work
in complement with the 79xx series of negative voltage regulators in systems that provide both
positive and negative regulated voltages, since the 78xx series can't regulate negative voltages in such
a system.

The 7805 & 78 is one of the most common and well-known of the 78xx series regulators, as it's small
component count and medium-power regulated 5V make it useful for powering TTL devices.

21
Specifications:

SPECIFICATIONS IC 7805

Vout 5V

Vein - Vout Difference 5V - 20V

Operation Ambient Temp 0 - 125°C

Output Imax 1A

Table 5.3: Specifications of IC7805

5.9.TEMPERATURE SENSOR (LM35)

Figure 5.9: Pin out of LM35 Temperature Sensor

The LM35 arrangement are precision integrated-circuit temperature sensors,


whose output voltage is directly relative to the Celsius (Centigrade) temperature. The LM35
hence has leeway over straight temperature sensors aligned in ˚ Kelvin, as the client isn't
required to subtract an expansive steady voltage from its output to acquire advantageous
Centi-review scaling. The LM35 does not require any outside adjustment or trimming to give

22
common correctnesses of ±1⁄4˚C at room temperature and ±3⁄4˚C over a full −55 to +150˚C
temperature extend. Minimal effort is guaranteed by trimming and adjustment at the wafer
level.

The LM35's low output impedance, direct output, and exact inborn adjustment
make interfacing to readout or control circuitry particularly simple. It very well may be
utilized with single power supplies, or with in addition to and less supplies. As it draws just
60 µA from its supply, it has low self-warming, under 0.1˚C in still air. The LM35 is
evaluated to work over a −55˚ to +150˚C temperature go, while the LM35C is appraised for a
−40˚ to +110˚C territory (−10˚ with enhanced precision).

The LM35 arrangement is accessible pack-matured in hermetic TO-46


transistor bundles, while the LM35C, LM35CA, and LM35D are likewise accessible in the
plastic TO-92 transistor bundle. The LM35D is likewise profit capable in a 8-lead surface
mount little diagram bundle and a plastic TO-220 bundle.

Features:

 Calibrateddirectlyin˚Celsius(Centigrade)

 Linear+10.0mV/˚Cscalefactor

 0.5˚Caccuracyguarantable(at+25˚C)

 Ratedforfull−55˚to+150˚Crange

 Suitableforremoteapplications

 Lowcostduetowafer-leveltrimming

 Operatesfrom4to30volts

 Lessthan60µAcurrentdrain

 Lowself-heating,0.08˚Cinstillair

 Nonlinearityonly± 1⁄4˚Ctypical
 Lowimpedanceoutput,0.1 for1mAload

23
Fig.5.12.LM35 Sensor Circuit Schematic

5.10. HEARTBEAT SENSOR

The Heart Rate Ear clip kit contains a ear clip and a receiver module. The heart rate measure
kit can be used to monitor heart rate of patient and athlete. The result can be displayed on a
screen via the serial port and can be saved for analysis. The entire system is a high sensitivity,
low power consumption and portable. 
Model: MED03212P

Fig.5.13. MED03212P Model Heart Beat Sensor

24
Features :

 Low power consumption


 Convenient to use
 High sensitivity
 Fully RoHS compliant

Specifications:

Mi Typic Ma Un
Item
n al x it
5.2
Voltage 3.0 5.0 V
5
Work Current 6.5 mA
Length of ear clip wire 120 cm
Measures Range ≥30/min -

Table 5.4. Specifications of Heart Beat Sensor


Application Ideas:

 Heart rate monitor.

Usage:

The following sketch demonstrates a simple application of using the Ear-clip Heart Rate
Sensor to measure heart rate.

 Connect this module to the digital port D2 on Grove-Base shield. And connect Grove-
LED to Digital port 4.
 Plug the Base Shield into Arduino/Seeeduino.

25
Fig.5.14. Heart beat sensor schematic

5.11. HUMIDITY SENSOR

HumiditysensorsaregainingmoresignificanceindiverseareasofmeasurementandC
ontroltechnology.Humidityisaimportantfactorinpersonalcomfortandinqualitycon
trolformaterials,machineryetc.NowweareusingSYH2andSYH-
2Shumiditysensorsinmostofthecircuit

Fig. 5.11. Humidity sensor

Specifications :

 Items - SYH2 and SYH2S


 Rated voltage - AC 1Vrms (1KHz)
 Rated power - AC 0.22Mw
 Operating temperature - 0 to 60 degree centigrade
 Operating humidity - 20 to 95%
 Humidity response time - <60sec

5.12. BUZZER

A buzzer or beeper is a signaling device, usually electronic, typically used in


automobiles, household appliances such as a microwave oven, or game shows.

It most commonly consists of a number of switches or sensors connected to a


control unit that determines if and which button was pushed.

A present time has lapsed, and usually illuminates a light on the appropriate
button or control panel, and sounds a warning in the form of a continuous or
intermittent buzzing or beeping sound.

26
Initially this device was based on an electromechanical system which was
identical to an electric bell without the metal going. Often these units were anchored
to a wall or ceiling and used the ceiling or wall as a sounding board.

Another implementation with some AC-connected devices was to implement a


circuit to make the AC current into a noise loud enough to drive a loudspeaker and
hook this circuit up to a cheap 8-ohm speaker.

Nowadays, it is more popular to use a ceramic-based piezoelectric sounder like


a Son alert which makes a high-pitched tone. Usually these were hooked up to
"driver" circuits which varied the pitch of the sound or pulsed the sound on and off.

A present time has lapsed, and usually illuminates a light on the appropriate
button or control panel, and sounds a warning in the form of a continuous or
intermittent buzzing or beeping sound.

Initially this device was based on an electromechanical system which was


identical to an electric bell without the metal going. Often these units were anchored
to a wall or ceiling and used the ceiling or wall as a sounding board.

In game shows it is also known as a "lockout system," because when one


person signals ("buzzes in"), all others are locked out from signaling. Several game
shows have large buzzer buttons which are identified as "plungers".

The word "buzzer" comes from the rasping noise that buzzers made when they
were electromechanical devices, operated from stepped-down AC line voltage at 50 or
60 cycles. Other sounds commonly used to indicate that a button has been pressed are
a ring or a beep.

27
Fig. 5.12. Buzzer

5.13. ESP8266 WIFI MODULE

Fig. 5.13. ESP8266 WIFI Module

The ESP8266 WiFi Module is a self contained SOC with integrated TCP/IP protocol stack
that can give any microcontroller access to your WiFi network. The ESP8266 is capable of
either hosting an application or offloading all Wi-Fi networking functions from another
application processor. Each ESP8266 module comes pre-programmed with an AT command
set firmware, meaning, you can simply hook this up to your Arduino device and get about as
much WiFi-ability as a WiFi Shield offers (and that's just out of the box)! The ESP8266
module is an extremely cost effective board with a huge, and ever growing, community.
This module has a powerful enough on-board processing and storage capability that allows it
to be integrated with the sensors and other application specific devices through its GPIOs
with minimal development up-front and minimal loading during runtime. Its high degree of
on-chip integration allows for minimal external circuitry, including the front-end module, is
designed to occupy minimal PCB area. The ESP8266 supports APSD for VoIP applications
and Bluetooth co-existance interfaces, it contains a self-calibrated RF allowing it to work
under all operating conditions, and requires no external RF parts.
Features :

 802.11 b/g/n
 Wi-Fi Direct (P2P), soft-AP
 Integrated TCP/IP protocol stack

28
 Integrated TR switch, balun, LNA, power amplifier and matching network
 Integrated PLLs, regulators, DCXO and power management units
 +19.5dBm output power in 802.11b mode
 Power down leakage current of <10uA
 1MB Flash Memory
 Integrated low power 32-bit CPU could be used as application processor
 SDIO 1.1 / 2.0, SPI, UART
 STBC, 1×1 MIMO, 2×1 MIMO
 A-MPDU & A-MSDU aggregation & 0.4ms guard interval
 Wake up and transmit packets in < 2ms
 Standby power consumption of < 1.0mW (DTIM3)

CHAPTER-6

SOFTWARE DESCRIPTION

6.1.ARDUINO SOFTWARE(IDE)

The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a


text editor for writing code, a message area, a text console, a toolbar with buttons for
common functions and a series of menus. It connects to the Arduino and Genuine hardware to
upload programs and communicate with them.

6.2. WRITING SKETCHES

Programs written using Arduino Software (IDE) are called sketches. These sketches are


written in the text editor and are saved with the file extension .ino. The editor has features for
cutting/pasting and for searching/replacing text. The message area gives feedback while
saving and exporting and also displays errors. The console displays text output by
the Arduino Software (IDE), including complete error messages and other information. The

29
bottom corner of the window displays the configured board and serial port. The toolbar
buttons allow you to verify and upload programs, create, open, and save sketches, and open
the serial monitor.

NB: Versions of the Arduino Software (IDE) prior to 1.0 saved sketches with the extension
.pde. It is possible to open these files with version 1.0, you will be prompted to save the
sketch with the .ino extension on save.

 Verify:
Checks your code for errors compiling it.

 Upload:
Compiles your code and uploads it to the configured board.
See uploading below for details.

Note: If you are using an external programmer with your board, you can hold down
the "shift" key on your computer when using this icon. The text will change to
"Upload using Programmer"

 New:
Creates a new sketch.

 Open:
Presents a menu of all the sketches in your sketchbook. Clicking one will
open it within the current window overwriting its content.

Note: due to a bug in Java, this menu doesn't scroll; if you need to open a sketch
late in the list, use the File | Sketchbookmenu instead.

 Save:
Saves your sketch.

 Serial monitor:
Opens the serial monitor.

30
Additional commands are found within the five menus: File, Edit, Sketch, Tools, Help. The
menus are context sensitive, which means only those items relevant to the work currently
being carried out are available.

6.3. FILE

 New:
Creates a new instance of the editor, with the bare minimum structure of a sketch already in
place.
 Open:
Allows to load a sketch file browsing through the computer drives and folders.
 Open Recent:
Provides a short list of the most recent sketches, ready to be opened.
 Sketch book:
Shows the current sketches within the sketchbook folder structure; clicking on any name
opens the corresponding sketch in a new editor instance.
 Examples:
Any example provided by the Arduino Software (IDE) or library shows up in this menu item.
All the examples are structured in a tree that allows easy access by topic or library.
 Close:
Closes the instance of the Arduino Software from which it is clicked.
 Save:
Saves the sketch with the current name. If the file hasn't been named before, a name will be
provided in a "Save as.." window.
 Saveas:
Allows to save the current sketch with a different name.
 Pagesetup:
It shows the Page Setup window for printing.
 Print:
Sends the current sketch to the printer according to the settings defined in Page Setup.
 Preferences:
Opens the Preferences window where some settings of the IDE may be customized, as the
language of the IDE interface.

31
 Quit:
Closes all IDE windows. The same sketches open when Quit was chosen will be
automatically reopened the next time you start the IDE.

6.4. EDIT

 Undo/Redo:
Goes back of one or more steps you did while editing; when you go back, you may go
forward with Redo.
 Cut:
Removes the selected text from the editor and places it into the clipboard.
 Copy:
Duplicates the selected text in the editor and places it into the clipboard.
 CopyasForum:
Copies the code of your sketch to the clipboard in a form suitable for posting to the forum,
complete with syntax color
 CopyasHTML:
Copies the code of your sketch to the clipboard as HTML, suitable for embedding in web
pages.
 Paste:
Puts the contents of the clipboard at the cursor position, in the editor.
 SelectAll:
Selects and highlights the whole content of the editor.
 Comment/Uncomment:
Puts or removes the // comment marker at the beginning of each selected line.
 Increase/Decreaseindent:
Adds or subtracts a space at the beginning of each selected line, moving the text one space on
the right or eliminating a space at the beginning.
 Find:
Opens the Find and Replace window where you can specify text to search inside the current
sketch according to several options.
 FindNext:
Highlights the next occurrence - if any - of the string specified as the search item in the Find
window, relative to the cursor position.

32
 Findprevious:
Highlights the previous occurrence - if any - of the string specified as the search item in the
Find window relative to the cursor position.

6.5. Sketch

 Verify/Compile:
Checks your sketch for errors compiling it; it will report memory usage for code and
variables in the console area.
 Upload:
Compiles and loads the binary file onto the configured board through the configured Port.
 Uploadusingprogrammer:
This will overwrite the bootloader on the board; you will need to use Tools > Burn
Bootloader to restore it and be able to Upload to USB serial port again. However, it allows
you to use the full capacity of the Flash memory for your sketch. Please note that this
command will NOT burn the fuses. To do so a Tools -> Burn bootloadercommand must be
executed.
 Exportcompiledbinary:
Saves a .hex file that may be kept as archive or sent to the board using other tools.
 ShowSketchFolder:
Opens the current sketch folder.
 Includelibrary:
Adds a library to your sketch by inserting #include statements at the start of your code. For
more details, see libraries below. Additionally, from this menu item you can access the
Library Manager and import new libraries from .zip files.
 Add File:
Adds a source file to the sketch (it will be copied from its current location). The new file
appears in a new tab in the sketch window. Files can be removed from the sketch using the
tab menu accessible clicking on the small triangle icon below the serial monitor one on the
right side of the toolbar.

6.6. TOOLS

33
 Autoformat:
This formats your code nicely: i.e. indents it so that opening and closing curly braces line up,
and that the statements inside curly braces are indented more.
 Archivesketch:
Archives a copy of the current sketch in .zip format. The archive is placed in the same
directory as the sketch.
 Fixencoding&Reload:
Fixes possible discrepancies between the editor char map encoding and other operating
systems char maps.
 SerialMonitor:
Opens the serial monitor window and initiates the exchange of data with any connected board
on the currently selected Port. This usually resets the board, if the board supports Reset over
serial port opening.
 Board:
Select the board that you're using. See below for descriptions of the various boards.
 Port:
This menu contains all the serial devices (real or virtual) on your machine. It should
automatically refresh every time you open the top-level tools menu.
 Programmer:
For selecting a hardware programmer when programming a board or chip and not using the
onboard USB-serial connection. Normally you won't need this, but if you're burning a
bootloader to a new microcontroller, you will use this.
 BurnBootloader:
The items in this menu allow you to burn a bootloader onto the microcontroller on
an Arduino board. This is not required for normal use of an Arduino or Genuino board but is
useful if you purchase a new ATmega microcontroller (which normally come without a
bootloader). Ensure that you've selected the correct board from the Boards menu before
burning the bootloader on the target board. This command also set the right fuses.

6.7. HELP

Here you find easy access to a number of documents that come with the Arduino Software
(IDE). You have access to Getting Started, Reference, this guide to the IDE and other

34
documents locally, without an internet connection. The documents are a local copy of the
online ones and may link back to our online website.

 FindinReference: :
This is the only interactive function of the Help menu: it directly selects the relevant page in
the local copy of the Reference for the function or command under the cursor.
 Sketch book:

The ArduinoSoftware (IDE) uses the concept of a sketchbook: a standard place to store your
programs (or sketches). The sketches in your sketchbook can be opened from the File >
Sketchbook menu or from the Open button on the toolbar. The first time you run
the Arduino software, it will automatically create a directory for your sketchbook. You can
view or change the location of the sketchbook location from with the Preferences dialog.

Beginning with version 1.0, files are saved with a .ino file extension. Previous versions use
the .pde extension. You may still open .pde named files in version 1.0 and later, the software
will automatically rename the extension to .ino.

 Tabs,multiple files, compilations:

Allows you to manage sketches with more than one file (each of which appears in its own
tab). These can be normal arduino code files (no visible extension), C files (.c extension), C+
+ files (.cpp), or header files (.h).

6.8. UPLOADING

Before uploading your sketch, you need to select the correct items from the Tools >
Board and Tools > Port menus. The boards are described below. On the Mac, the serial port
is probably something like /dev/tty.usbmodem241 (for an Uno or Mega2560 or Leonardo)
or /dev/tty.usbserial-1B1 , or /dev/tty.USA19QW1b1P1.1 (for a serial board connected with a
Keyspan USB-to-Serial adapter). On Windows, it's probably COM1 or COM2 (for a serial
board) or COM4, COM5, COM7, or higher (for a USB board) - to find out, you look for USB
serial device in the ports section of the Windows Device Manager. On Linux, it should
be /dev/ttyACMx , /dev/ttyUSBx or similar. Once you've selected the correct serial port and
board, press the upload button in the toolbar or select the Upload item from the Sketch menu.

35
Current Arduino boards will reset automatically and begin the upload. With older boards
(pre-Diecimila) that lack auto-reset, you'll need to press the reset button on the board just
before starting the upload. On most boards, you'll see the RX and TX LEDs blink as the
sketch is uploaded. The Arduino Software (IDE) will display a message when the upload is
complete, or show an error.

When you upload a sketch, you're using the Arduino bootloader, a small program that has
been loaded on to the microcontroller on your board. It allows you to upload code without
using any additional hardware. The bootloader is active for a few seconds when the board
resets; then it starts whichever sketch was most recently uploaded to the microcontroller. The
bootloader will blink the on-board (pin 13) LED when it starts (i.e. when the board resets).

6.9. LIBRARIES

Libraries provide extra functionality for use in sketches, e.g. working with hardware or
manipulating data. To use a library in a sketch, select it from the Sketch > Import
Library menu. This will insert one or more #include statements at the top of the sketch and
compile the library with your sketch. Because libraries are uploaded to the board with your
sketch, they increase the amount of space it takes up. If a sketch no longer needs a library,
simply delete its #includestatements from the top of your code.

There is a  list of libraries in the reference. Some libraries are included with the  arduino
software. Others can be downloaded from a variety of sources or through the Library
Manager. Starting with version 1.0.5 of the IDE, you do can import a library from a zip file
and use it in an open sketch. See these instructions for installing a third-party library.

To write your own library, see this tutorial.

6.10. SERIAL MONITOR

Displays serial data being sent from the Arduino or Genuino board (USB or serial board). To
send data to the board, enter text and click on the "send" button or press enter. Choose the
baud rate from the drop-down that matches the rate passed to Serial.begin in your sketch.
Note that on Windows, Mac or Linux, the  arduino or Genuino board will reset (rerun your

36
sketch execution to the beginning) when you connect with the serial monitor.You can also
talk to the board from Processing, Flash, MaxMSP, etc (see the interfacing page for details).

6.11. PREFERNCES

Some preferences can be set in the preferences dialog (found under the Arduino menu on the
Mac, or File on Windows and Linux). The rest can be found in the preferences file, whose
location is shown in the preference dialog.

6.12. LANGUAGE SUPPORT

Fig.6.1. Arduino language support

 Since version 1.0.1 , the Arduino Software (IDE) has been translated into 30+ different
languages. By default, the IDE loads in the language selected by your operating system.
(Note: on Windows and possibly Linux, this is determined by the locale setting which
controls currency and date formats, not by the language the operating system is displayed in.)

If you would like to change the language manually, start the Arduino Software (IDE) and
open the Preferences window. Next to the Editor Language there is a dropdown menu of
currently supported languages. Select your preferred language from the menu, and restart the

37
software to use the selected language. If your operating system language is not supported,
the Arduino Software (IDE) will default to English.

You can return the software to its default setting of selecting its language based on your
operating system by selecting System Default from the Editor Language drop-down. This
setting will take effect when you restart the Arduino Software (IDE). Similarly, after
changing your operating system's settings, you must restart the Arduino Software (IDE) to
update it to the new default language.

6.13. BOARDS

The board selection has two effects: it sets the parameters (e.g. CPU speed and baud rate)
used when compiling and uploading sketches; and sets and the file and fuse settings used by
the burn bootloader command. Some of the board definitions differ only in the latter, so even
if you've been uploading successfully with a particular selection you'll want to check it before
burning the bootloader. You can find a comparison table between the various boards here.

Arduino Software (IDE) includes the built in support for the boards in the following list, all
based on the AVR Core. The Boards Manager included in the standard installation allows to
add support for the growing number of new boards based on different cores
like Arduino Due, ArduinoZero, Edison, Galileo and so on.

Arduino IDE: Initial Setup

Download Arduino Integrated Design Environment (IDE) here (Most recent version: 1.6.5):
https://www.arduino.cc/en/Main/Software This is the Arduino IDE o lnce it’s been opened. It
opens into a blank sketch where you can start programming immediately. First, we should
configure the board and port settings to allow us to upload code. Connect your Arduino board
to the PC via the USB cable.

38
Fig. 6.2. Arduino IDE default window

IDE: Board Setup

You have to tell the Arduino IDE what board you are uploading to. Select the Toolspulldown
menu and go to Board.This list is populated by default with the currently available Arduino
Boards that are developed by Arduino. If you are using an Uno or an Uno-Compatible Clone
(ex. Funduino, SainSmart, IEIK, etc.), select Arduino Uno. If you are using another
board/clone, select that board.

39
Fig. 6.3. Arduino IDE : Board setup procedure

IDE: COM Port Setup

If you downloaded the Arduino IDE before plugging in your Arduino board, when you
plugged in the board, the USB drivers should have installed automatically. The most recent
Arduino IDE should recognize connected boards and label them with which COM port they
are using. Select the Tools pulldown menu and then Port.Here it should list all open COM
ports, and if there is a recognized Arduino Board, it will also give it’s name. Select the
Arduino board that you have connected to the PC. If the setup was successful, in the bottom
right of the Arduino IDE, you should see the board type and COM number of the board you
plan to program. Note: the Arduino Uno occupies the next available COM port; it will not
always be COM3.

40
Fig. 6.4. Arduino IDE : Com port setup

At this point, your board should be set up for programming, and you can begin writing and
uploading code.

Testing Your Settings: Uploading Blink

One common procedure to test whether the board you are using is properly set up is to upload
the “Blink” sketch. This sketch is included with all Arduino IDE releases and can be accessed
by the Filepull-down menu and going to Examples, 01.Basics, and then select Blink.
Standard Arduino Boards include a surface-mounted LED labeled “L” or “LED” next to the
“RX” and “TX” LEDs, that is connected to digital pin 13. This sketch will blink the LED at a
regular interval, and is an easy way to confirm if your board is set up properly and you were
successful in uploading code. Open the “Blink” sketch and press the “Upload” button in the
upper-left corner to upload “Blink” to the board.

41
Fig. 6.5. Arduino IDE: Loading Blink Sketch

Fig. 6.6. Arduino IDE : Uploading Blink

42
Guide Summary:

1. Download and install Arduino IDE (https://www.arduino.cc/en/Main/Software)

2. Plug in your Arduino Board

3. Select the proper board in the IDE (Tools>Boards>Arduino Uno)

4. Select the proper COM port (Tools>Port>COMx (Arduino Uno))

5. Open the “Blink” sketch (File>Examples>Basics>01.Blink)

6. Press the Upload button to upload the program to the board

7. Confirm that your board is working as expected by observing LED

Troubleshooting Uploading Errors:

Arduino has lots of community support and documentation. Your best bet when running into
unexpected problems is to search online for help. You should be able to find a forum where
someone had the same problem you are having, and someone helped them fix it. If you don’t
find results, try modifying your search, or post on the Arduino forums.

● My board isn’t listed under devices and is not recognized by IDE:

○ Most likely, this means that the ATMega328p chip is not programmed with the Arduino
firmware. If you have a separate working Uno available, you can program the unprogrammed
chip using this guide and a few jumper cables:
https://www.arduino.cc/en/Tutorial/ArduinoISP

○ If you don’t have a separate Arduino available, let me know and I can use an Atmel
Programmer to upload the firmware.

○ There may be hardware damage if you had the board plugged into USB and external
power at the same time. You may have to replace the chip if this is the case.

● Error Message: avrdude: stk500_recv(): programmer is not responding

○ Double-check that you are using the correct COM port.

○ Make sure that your Arduino Board is plugged into the computer.

● The IDE says “Uploading…” after pressing the upload button, but nothing is happening.

○ Double-check that you have the correct board selected in the Tools menu.

43
○ Depending on the size of your program, it may take a few seconds to upload. If you feel
like it is taking too long, it may be encountering an error and you can try unplugging and
plugging in the Arduino board.

CHAPTER-7

WORKING AND RESULT

7.1. CIRCUIT DIAGRAM FOR IOT BASED HEALTH MONITORING SYSTEM

Fig. 7.1. Circuit diagram

Below are the connections:

 Signal pin of pulse sensor -> A0 of arduino


 Vcc pin of pulse sensor -> 5V of arduino
 GND pin of pulse sensor -> GND of arduino
 Vout of LM35 -> A1 of Arduino
 Tx of ESP8266 -> pin 10 of arduino
 Rx of ESP8266 -> pin 11 of arduino
 CH_PD and Vcc of ESP8266 -> 3.3 V of arduino
 GND of ESP8266 -> GND of arduino
 Push button -> digital pin 8 of arduino

44
Working of the project:

IOT patient monitoring has 3 sensors. The first one is a temperature sensor, the second is the
Heartbeat sensor and the third one is humidity sensor. This project is very useful since the
doctor can monitor patient health parameters just by visiting a website or URL. And
nowadays many IOT apps are also being developed. So now the doctor or family members
can monitor or track the patient’s health through the Android apps.To operate

To operate IOT based health monitoring system project, you need a WiFi connection. The
microcontroller or the Arduino board connects to the Wi-Fi network using a Wi-Fi module.
This project will not work without a working WiFi network. You can create a WiFi zone
using a WiFi module or you can even create a WiFi zone using Hotspot on your smartphone.
The Arduino UNO board continuously reads input from these 3 senses. Then it sends this
data to the cloud by sending this data to a particular URL/IP address. Then this action of
sending data to IP is repeated after a particular interval of time. For example in this project,
we have sent data after every 30 seconds.

7.2. CONFIGURING THINGSPEAK TO RECORD PATIENT DATA ONLINE

ThingSpeak provides very good tool for IoT based projects. By using ThingSpeak site, we
can monitor our data and control our system over the Internet, using the Channels and
webpages provided by ThingSpeak. ThingSpeak ‘Collects’ the data from the sensors,
‘Analyze and Visualize’ the data and ‘Acts’ by triggering a reaction. We have previously
used ThingSpeak in Weather station project using Raspberry Pi and using Arduino, check
them to learn more about ThingSpeak. Here we are briefly explaining to use ThingSpeak for
this IoT Patient Monitoring Project.

We will use ThingSpeak to monitor patient heartbeat and temperature online using internet.
We will also use IFTTT platform to connect ThingSpeak to email/message service so that
alert message can be sent whenever the patient is in critical state.

Step1:-
Firstofall,userneedstoCreateaAccountonThingSpeak.com,thenSignInandclickonGetStarted.

45
Fig. 7.2. Creating an account on thingspeak

Step 2:- Now go to the ‘Channels’ menu and click on New Channel option on the same page
for further process.

Fig. 7.3. Selecting channel option

Step 3:- Now you will see a form for creating the channel, fill in the Name and Description
as per your choice. Then fill ‘Pulse Rate’, ‘Temperature’ and ‘Panic’ in Field 1, Field 2 and
Field 3 labels, tick the checkboxes for the Fields. Also tick the check box for ‘Make Public’
option below in the form and finally Save the Channel. Now your new channel has been
created.

46
Fig.7.4. Form for creating the channel

Step 4:- You will see three charts as shown below. Note the Write API key, we will use this
key in our code.

Fig. 7.5. Charts for patient monitoring

Code

LiquidCrystal lcd(10, 11, 4, 5, 6, 7);

SoftwareSerial wifi(8, 9); // RX, TX

47
String apiKey = "DGJA0LFYAFNDDDFP"; ///

int heartrate;

int temp,x,i;

int tempurature;

const int hbs=2;

const int buzzer = 13;

void setup()

Serial.begin(9600);

wifi.begin(115200);

lcd.begin(16, 2);

pinMode(buzzer, OUTPUT);

digitalWrite(buzzer, LOW);

project_name();

lcd.clear();

wifi_init();

48
void loop(){

tempurature = analogRead(A0);

tempurature = tempurature/2;

lcd.setCursor(0,0);

lcd.print("Temp: ");

lcd.setCursor(0,1);

lcd.print("HB: ");

lcd.setCursor(5,0);

lcd.print(tempurature);

get_heartbeat();

delay(1000);

if(tempurature > 55)

buzzer_Sound(2);

data_sms();

lcd.setCursor(15, 1);

lcd.print("*");

SendWiFi_Data();

lcd.clear();

void get_heartbeat()

49
int cnt=0;

double tempv=millis();

while(millis()<(tempv+5000))

if((digitalRead(hbs)) == LOW)

cnt++;

delay(200);

cnt=cnt*4;

heartrate=cnt;

if(heartrate>130)

heartrate = 0;

cnt=0;

lcd.setCursor(3,1);

lcd.write(heartrate/100+48);

lcd.write((heartrate/10)%10+48);

lcd.write((heartrate/1)%10+48);

lcd.print(" /min");

if(heartrate>90)

buzzer_Sound(2);

data_sms();

50
}

void SendWiFi_Data(){

String cmd = "AT+CIPSTART=

cmd += "184.106.153.149"; // api.thingspeak.com

cmd += "\",80";

wifi.println(cmd);

delay(1500);

String getStr ="GET /update?api_key=";

getStr += apiKey;

getStr +="&field1=";

getStr += String(tempurature);

getStr +="&field2=";

getStr += String(heartrate);

getStr += "\r\n\r\n";

// send data length

cmd = "AT+CIPSEND=";

cmd += String(getStr.length());

wifi.println(cmd);

delay(1500);

51
wifi.println(getStr);

delay(1000);

void wifi_init()

lcd.setCursor(0,0);

lcd.print("WiFi module ");

lcd.setCursor(0,1);

lcd.print("Initilizing.... ");

wifi.begin(115200);

wifi.println("AT+RST");

delay(4000);

wifi.println("AT+CWMODE=3");

delay(4000);

wifi.print("AT+CWJAP=");

wifi.write('"');

wifi.print("a");

wifi.write('"');

wifi.write(',');

wifi.write('"');

wifi.print("1234567890");

wifi.write('"');

wifi.println();

52
delay(1000);

lcd.setCursor(0,0);

lcd.print("WiFi Module ");

lcd.setCursor(0,1);

lcd.print("Initilized..... ");

delay(1000);

lcd.clear();

void data_sms()

lcd.setCursor(0,0);

lcd.print("Message sending ");

lcd.setCursor(0,1);

lcd.print("please wait.... ");

init_sms();

delay(2000);

Serial.println("Helth Data: ");

Serial.print("T: ");

Serial.println(tempurature);

Serial.print("HB: ");

Serial.print(heartrate);

delay(2000);

send_sms();

53
delay(2000);

init_sms2();

delay(2000);

Serial.println("Helth Data: ");

Serial.print("T: ");

Serial.println(tempurature);

Serial.print("HB: ");

Serial.print(heartrate);

delay(2000);

send_sms();

lcd.setCursor(0,0);

lcd.print("Message Sent ");

lcd.setCursor(0,1);

lcd.print("Sucessfully.... ");

delay(2000);

void init_sms()

Serial.println("AT+CMGF=1");

delay(2000);

Serial.println("AT+CMGS=\"+918019210411\""); // use 10 digit cell no. here

delay(2000);

54
void init_sms2()

Serial.println("AT+CMGF=1");

delay(2000);

Serial.println("AT+CMGS=\"+918500080285\""); // use 10 digit cell no. here

delay(2000);

void send_data(String message)

Serial.println(message);

delay(1000);

void send_sms()

Serial.write(26);

void buzzer_Sound(unsigned char Ntimes){

unsigned char i;

for(i=0; i<Ntimes; i++)

digitalWrite(buzzer, HIGH);

55
delay(1000);

digitalWrite(buzzer, LOW);

delay(800);

void project_name()

lcd.setCursor(0,0);

lcd.print("IOT HEART RATE ");

lcd.setCursor(0,1);

lcd.print("MONITORING SYSTM");

delay(3000);

lcd.clear();

Fig. 7.6. Outputs on lcd

56
CHAPTER-8

DRAW BACKS AND ADVANTAGES

DRAWBACKS OF EXISTED SYSTEM

 In Existed method we use GSM which needs maintainance (SIM)


 Low Speed Communication
 NO continues monitoring of data

ADVANTAGES OF PROPOSED SYSTEM

 We use WIFI, So less maintainance


 High speed Communication
 Continuous monitoring of health data
 We can send multiple patient data at same time

CHAPTER-9

CONCLUSION
This research led to the development of a system which measured heartbeat and temperature
of a patient and sent it to a remoteend by the use of a Arduino and Atmega328
microcontroller at a reasonable cost with great effect. It utilized remote patientmonitoring
system technology which enabled the monitoring of patients outside of clinical settings
and leads to increasing access tohealth care as well as decreasing the health care delivery
costs. Nowadays, most of the systems work in offline mode. The researchutilized two sensors

57
for measuring heartbeat and temperature of a body. These sensors are controlled by the
Atmega328microcontroller. For measurement of heartbeat, we used fingertip to measure it
accurately. The device uses the optical technologyto detect the flow of blood through the
finger. The heart beat monitor in our research counts the heart beat rate in beats per
minute(bpm) for specific interval and transfers the calculated rate via Wi-Fi module and
sends it to a remote end where it displays theobserved data in the website called
Thingspeak.com.. The microcontroller processes the input and calculates heart beat rate in
beats per minute. Thus,calculated heart beat rate is displayed in liquid crystal display (LCD).
The data is also displayed on the screen of a mobile device orPC by using WiFi module

CHAPTER-10

FUTURE WORK
The proposed system of patient health monitoring can be highly used in emergency situations
as it can be daily monitored, recorded and stored as a database. In future the IOT device can
be combined with the cloud computing so that the database can be shared in all the hospitals
for the intensive care and treatment.

CHAPTER-11

REFERENCES
[1] S. J. Jung and W. Y. Chung, “Flexible and scalable patient’s health monitoring system in
6LoWPAN,” Sensor Lett., vol. 9,no. 2, pp. 778–785, Apr. 2011.

58
[2] W. Y. Chung, C. Yau, K. S. Shin, and R. Myllylä, “A cell phone based health monitoring
system with selfanalysis processor using wireless sensor network technology,” in Proc. 29th
Annu. Int. Conf. Eng. Med. Biol. Soc., Lyon, France, 2007, pp.

[3] G. Lawton, “Machine-to-machine technology gears up for growth,” Computer, vol. 37,
no. 9, pp. 12–15, Sep. 2004.

[4] C. Kim, A. Soong, M. Tseng, and X. Zhixian, “Global wireless machineto- machine
standardization,” IEEE Internet Comput., vol. 15, no. 2, pp. 64–69, Mar.–Apr. 2011.

[5] Real time wireless health monitoring application using mobile devices, International
Journal of Computer Networks & Communications (IJCNC) Vol.7, No.3, May 2015, Amna
Abdullah, Asma Ismael, Aisha Rashid, Ali Abou-ElNour, and Mohammed Tarique.

[6] Secured Smart Healthcare Monitoring System Based on Iot, International Journal on
Recent and Innovation Trends in Computing and Communication Volume: 3 Issue: 7,
Bhoomika.B.K, Dr. K N Muralidhara.

[7] Real time wireless health monitoring application using mobile devices, International
Journal of Computer Networks & Communications (IJCNC) Vol.7, No.3, May 2015, Amna
Abdullah, Asma Ismael, Aisha Rashid, Ali Abou-ElNour, and Mohammed ,Tarique.

[8] Secured Smart Healthcare Monitoring System Based on Iot, International Journal on
Recent and Innovation Trends in Computing and Communication Volume: 3 Issue: 7,
Bhoomika.B.K, Dr. K N Muralidhara.

[9] Goutam Motika, Abinash Prusty,” Wireless FetalHeartbeat Monitoring System Using
ZigBee & IEEE 802.15.4 Standard”, 2011 Second International Conference on Emerging
Applications of Information Technology, 978-0- 7695-4329-1/11, 2011 IEEE DOI
10.1109/EAIT.2011.89 .

[10] S. M. Mahalle, P. V. Ingole, “Design and Implementation of Wireless Body Area Sensor
Network Based Health Monitoring System”, International Journal of Engineering Research &
Technology, Vol. 2 Issue 6, pp. 105- 113, June 2013.

[11] M.Prakash, CJ Kavitha Priya, “An Analysis of Types of Protocol Implemented in


Internet of Things Based on Packet Loss Ratio”, Proceedings of International Journal of
Information and Communication Technology for Competitive Strategies, ISBN: 978-1-4503-
3962-9, DOI: https://doi.org/10.1145/2905055.2905085, 4th – 5 th Mar 2016

59
[12] M. Prakash, U. Gowshika, T. Ravichandran, “A Smart Device Integrated with an
Android for Alerting a Person’s Health Condition: Internet of Things” Indian Journal of
Science and Technology, Vol 9 (6), February 2016. DOI:
https://doi.org/10.17485/ijst/2016/v9i6/69545

[13] Dr.A.Sabanayagam, G.Anish Girija,” DESIGN AND MODELING OF MOBILE


HEALTH MONITORING SYSTEM”, International Journal of Innovations in Scientific and
Engineering Research (IJISER),vol4,no 2,pp.63- 65,2017.

[14] “Healthcare Monitoring System Using Wireless Sensor Network”, D. Mahesh Kumar,
Department of Electronics, PSG College of Arts and Science, Coimbatore - 641 014.Volume
04, Issue 01 Pages:1497-1500 (2012), ISSN:0975-0290.

[15] https://www.ibm.com/blogs/internet-of-things/6-benefits-of-iot-for-healthcare/

60

Potrebbero piacerti anche