You are on page 1of 59

IoT-Based Healthcare System for

Elderly People

A PROJECT REPORT

submitted by

Ipsita Garnaik (14BCS0064)


Aman Verma (14BCS0136)
Rahul Kumar (14BCS0013)

in partial fulfillment for the award

of

Bachelor of Science
degree in

Computer Science

School of Computer Science and Engineering

May - 2017

i
School of Computer Science and Engineering

DECLARATION

We hereby declare that the project entitled “IoT based healthcare system for elderly
people” submitted by us to the School of Computing Science and Engineering, VIT
University, Vellore-14 in partial fulfillment of the requirements for the award of the degree of
Bachelor of science in Computer Science is a record of bonafide work carried out by us
under the supervision of Anbarasi M, Assistant Professor (Senior). We further declare that
the work reported in this project has not been submitted and will not be submitted, either in
part or in full, for the award of any other degree or diploma of this institute or of any other
institute or university.

Signature
Ipsita Garnaik(14BCS0064)

Signature
Aman Verma(14BCS0136)

Signature
Rahul Kumar(14BCS0013)

ii
School of Computer Science and Engineering

CERTIFICATE

The project report entitled “IoT based healthcare system for elderly people” is prepared
and submitted by Ipsita Garnaik (Register No: 14BCS0064), Aman Verma (Register No:
14BCS0136) and Rahul Kumar (Register No: 14BCS0013). It has been found satisfactory
in terms of scope, quality and presentation as partial fulfillment of the requirements for the
award of the degree of Bachelor of Science in Computer Science in VIT University, India.

(Name & Signature of the Internal Guide)

Internal Examiner External Examiner

iii
ACKNOWLEDGEMENT

We would like to take this opportunity to extend our deepest gratitude to our project
guide, Professor Anbarasi M. for her constant guidance throughout the duration of our
project. We would also wish to acknowledge our head of the department or Program Chair,
Professor Anuradha J. for her never ending support and Dr. Arun Kumar Thangavelu the
Dean, SCOPE for giving us the opportunity to gain practical knowledge of working on a real
life project. Finally, we would like to thank VIT University, all our professors, fellow
students and friends for providing us with the necessary resources and motivation to carry out
our work. It was their constant encouragement and support that helped us to complete our
project successfully.

iv
CONTENTS
Chapter Title Page
Title Page i
Declaration ii
Certificate iii
Acknowledgement iv
Table of Contents v
List of Tables vii
List of Figures vii
List of Abbreviations viii
Abstract ix
1.Introduction 1
1.1 General 1
1.2 Motivation 1
1.3 Aim & Objective-Problem Description 2
1.4 Related Work 2
1.5 System Requirements 4
1.5.1 H/W Requirements 4
1.5.2 S/W Requirements 4
1.6 Report Organization 4
2. Overview of the Proposed System 5
2.1 Introduction of problem and its related concepts 5
2.2 Gaps identified from the existing systems 5
2.3 Proposed solution 6
3. Analysis and Design 7
3.1 Brief Introduction 7
3.2 Requirement Analysis 7
3.2.1 Functional Requirements 7
3.2.1.1 Product Perspective 7
3.2.1.2 Product Features 7
3.2.1.3 User Characteristics 8
3.2.1.4 Operating Requirements 8
3.2.1.5 Assumption & Dependencies 8
3.2.2 Non Functional Requirements 8
3.2.2.1 Security Requirements 8
3.3 Design of the proposed system 9
3.3.1 Design 9
3.3.1.1 Design Overview 9
3.3.2 System Architectural Design 10
3.3.2.1 Chosen System Architecture 10
3.3.3 System Interface Description 11
3.3.3.1 Detailed Description of Components 11
3.3.4 Considered Design Constraints 16
3.3.4.1 Economic 16
3.3.4.2 Environmental 16
3.3.4.3 Social 16
3.3.4.4 Ethical 16
3.3.4.5 Health and Safety 17
3.3.4.6 Sustainability 17
3.3.4.7 Legality 17
3.3.4.8 Inspectability 17

v
4. Implementation 17
4.1 Tools Used 17
4.1.1 General Introduction 17
4.1.2 Reason for selecting tool 19
4.2 Implementation 19
4.2.1 USER INTERFACE DESIGN 19
4.2.1.1 Description of the User Interface 19
4.2.1.2 Screen Images 20
4.2.1.3 Objects and Actions 21
4.3 Testing 22
4.3.1 TEST CASES 22
5. Results and Discussion 23
5.1 Results 23
6. Conclusion and Future Enhancements 26
7. References 27
Appendix - I 28

vi
LIST OF TABLES

Title Page
Table-4.1:- Test Cases and Test Scenario 22

LIST OF FIGURES

Title Page
Fig-1:-Patient Section Block Diagram 10
Fig-2:-Monitoring Section Block Diagram 10
Fig-3:- Arduino Board 11
Fig-4:- Temperature Sensor 12
Fig-5:- ECG Sensor 12
Fig-6:- Glucose (moisture sensor) 13
Fig-7:- Eye Blink Sensor 14
Fig-8:- GSM Module 14
Fig-9:- Circuit of GSM 15
Fig-10:- Male to Male Jumper Wire 15
Fig-11:- Male to Female Jumper Wire 16
Fig-12:- Code Screenshot in Arduino.IDE 18
Fig-13:- Code Screenshot in Microsoft Visual 19
Studio
Fig-14:- Screenshot of Registration Page on Local 20
Server
Fig-15:- Screenshot of Login Page on Local 20
Server
Fig-16:- Result Snapshot from Software 23
Ardiuno.IDE
Fig-17:- Result Snapshot of Message Send to the 24
Registered Mobile Number
Fig-18:- Result Snapshot of IoT on Local Server 25

vii
LIST OF ABBREVIATIONS

Abbreviations Expansion
IoT Internet of Things
LCD Liquid Crystal Display
ECG Electrocardiogram/Electrocardiography
BSN Body Sensor Network
IPDA Intelligent Personal Digital Assistant
RFID Radio Frequency Identification
GSM Global System for Mobile
URL Uniform Resource Locator
IP Internet Protocol
SMS Short Message Service
IR Infrared

viii
ABSTRACT

The Internet has made world a worldwide town and web of things (IoT) is making this
place more brilliant and effective by permitting the assortment of sensors and keen
articles to gather and process the data for different utilize. The Web of Things (IoT)
makes shrewd items a definitive building hinders in the improvement of digital
physical shrewd inescapable structures. The IoT has an assortment of use areas,
including social insurance. It is essential to screen different restorative parameters and
post operational information. To get to the patient's therapeutic parameters in nearby
and remote zone, human services correspondence utilizing Web of Things (IoT)
technique is adjusted. In this paper, we are using remote healthcare service system by
using modern information technology and the latest developments in communication,
as well as remote physiological measurement technology. By methods for coordinated
terminal gear programming and enhanced social insurance modules, remote medicinal
services benefit framework is intended to give "free wellbeing administrations" and
"remote long haul human services administrations" through an entire "remote social
insurance data stage" working instrument. This paper would support the real time
activity and monitor the healthcare system for the elderly citizens. The information
collected by different sensors in real time is stored in local server which thereby
connects people, doctor and practitioner at the time of emergency for the right
information. Along these lines the framework could build availability, productivity
and furthermore bring down the wellbeing costs to enhance the solace and security.
The design and implementation of this system will hopefully improve the healthcare
monitoring of elderly people in future.

ix
1. INTRODUCTION
1.1 General
In the past, there have been many attempts at similar such systems for healthcare monitoring
of elderly people. Most of the elderly people today experience loneliness and psychological
depressions, either as a result of living alone (abandonment) or due to reduced connection
with their children and relatives.

In the proposed method we are using Arduino. Here Temperature sensor, ECG sensor, Eye
Blink sensor and Glucose sensor (moisture sensor) are interfaced with arduino. Hence we
propose a Healthcare System for elderly people. Temperature sensor is used to sense the
temperature, eye blink sensor senses when a patient is awake after a dosage of medicine,
ECG sensor is used for recording the electrical activity of the heart over a period of time
using electrodes placed on the skin and glucose sensor is used to check whether the saline
bottle is empty or not. All the values and data is sent to the Arduino. In this system the patient
heath care is monitored and the status is updated in LCD. The data is stored in the IOT.
 Three principle framework level attributes of IoT are:
1. Anything imparts
2. Anything is distinguished
3. Anything cooperates

1.2 Motivation
According to research, it had been found that approximately 2000 people died monthly due to
the only carelessness of their health. This is because they do not have time for themselves and
forget about their health management due to a heavy workload. The reason behind to make
this project is the growing world of technology and people forget their health checkup which
is needed to be done monthly or quarterly. As we all know that internet of things make our
life easier. So, we have decided to make an internet of things based healthcare project for
people which provide them all the personal information about their health on the LCD and
they can check their all historical health data. The best part of this project is that it can be
used by everyone and make our health management easier than available systems. It
empowers regular gadgets to speak with each other and additionally with people, enables
question sense and control frequently is alluded to as the Internet of Things.

1
1.3 Aim & Objective- problem description
Our purpose is to build a Smart Health Care System wherein the elderly people are benefitted
through their continuous monitoring with the help of IoT and sensors. If a person’s health
condition is critical, message is sent to doctor and other family members with the help of
GSM module. It will save a lot of money of user which is going to be spent on curing of any
disease, by giving early warning of health disorder. Thus, our system is an integrated and
updated version of many of these previously developed ideas to further improve the health
condition of elderly people in our society. This project can be easily implemented on
wearable devices. It can help to reduce the life risks of elderly people using sensors and
implementation through IoT.

This help to automate the monitoring process as a doctor or family member need not have to
wait near the patient for each and every check. They are notified of any critical condition of
the patient. Though the life risks cannot be eradicated completely, this project aims to reduce
some health risks to certain stage.

1.4 Related Work


A. The Internet of Things for Health Care: A Comprehensive Survey
S. M. Riazul Islam [1] has audited the cutting edge arrange structures/stages, applications,
and modern patterns in IoT-based human services arrangements. The paper also breaks down
unmistakable IoT security and protection highlights, including security necessities, risk
models, and assault scientific classifications from the human services viewpoint. It also
talked about how diverse developments can be utilized in a medicinal services setting.

B. Highly Secured IoT Based Health Care System for Elderly People using Body Sensor
Network
Snehal Sanjay Kale [2] highlights the real security prerequisites in BSN-based present day
human services framework and a protected IoT-based medicinal services framework utilizing
BSN, called BSN-Mind. Data is uploaded in cloud server and android based mobile app is
used. Use of Raspberry Pi microcontroller and Wi-Fi module can be seen.

C. Secured Smart Healthcare Monitoring System Based on IoT

2
Dr. K N Muralidhara [3] used PIC18F46K22 microcontroller, wifi module. Page or data
refreshes in every 15 seconds which is not a good practice as it would be difficult to refer the
previous or earlier records. Use of sophisticated softwares like MPLAB IDE V8-92,
DIPTRACE, Proteus 7.0 ISIS Professional, and Hi-Tech C Compiler can be seen in the
paper.

D. Wearable Sensors for Remote Healthcare Monitoring System


Narendra Kumar [4] concentrated on wearable and implantable body zone arrange
frameworks for consistent observing of patients. Medicinal sensors were utilized to gather
physiological information from patients and transmitted to (IPDA) Intelligent Personal digital
Assistant. Use of electrodes, sophisticated sensors and biosensors has been done. Radio
transceiver is used for communication and ZigBee as communication protocol.

E. Smart Health Care System Using Internet of Things


K. Natarajan[5] discussed a more proficient machine to machine correspondence which is
accomplished for medicinal services information.

F. A Health-IoT Platform Based on the Integration of Intelligent Packaging,


Unobtrusive Bio-Sensor, and Intelligent Medicine Box
[6] In this venture just therapeutic pieces of information are gathered and advise the data to
the patient. It doesn't give the social insurance based data.

G. RFID Technology for IoT- Based Personal Healthcare in Smart Spaces


[7]Here, remote correspondence is built up in RFID innovation that spreads in just short
territory. Use of three layers is done in this project.

H. IoT-Based Smart Health Unit


Syed Muhammad Waqas Shah, Maruf Pasha[8] proposed a model in which the
country’s(basically for underdeveloped countries) basic health units are converted to smart
health units which are then connected to their respective headquarter hospitals. Government
keeps track of the entire nation’s health. Data is transmitted based on some protocols.
Layered approach (sensor, network access and service layer) is done here.

3
I. IoT for Healthcare
B. Sobhan Babu[9] mainly discussed the different protocols of IoT. Use of motion sensor,
RFID and Raspberry Pi-2 MODB can be seen here.
J. Internet of Things (IoT) Framework for u-healthcare System
Yvette [10] has discussed about pervasive or ubiquitous human healthcare services.

1.5 Sytem Requirements


1.5.1 H/W requirements
 Arduino
 Temperature Sensor
 Eye Blink Sensor
 Glucose(Moisture) Sensor
 ECG Sensor
 GSM
 Male to Male jumper wire
 Male to Female jumper wire

1.5.2 S/W Requirements

 Arduino.IDE

 Microsoft Visual Studio

1.6 Report Organization

The organization of this report is divided into multiple stages, starting from the objective of
this entire experiment. We have given our reasons, aim and motivation behind taking up this
project, to attempt a change at the current scenario of health care facility.

Next, we have explored in details all the previously developed applications that have
similarities to ours and explained on how they could be improved. This includes the literature
survey of all the related work in explicit details to identify what all improvements can be
made to the existing system.

4
This brings us to the section of our proposed system, the detailed system design, architecture
and modules. It explains all the software and hardware components required to make up the
entire system.

Further, it deals with all the improvements and updates we have made to all the existing
systems. We explore the working of our system in step by step manner with results and
conclusions. Finally, we have also included the embedded c programming (for Arduino) and
.net and php code for data base and IoT.

2. Overview of the Proposed System


2.1 Introduction of problem and its related concepts
The entire proposed system comprises of sensors, GSM module, Arduino board,
Arduino.IDE, Microsoft Visual Studio. The system is cost effective, accurate and reliable.
Being a completely integrated and cheaper system, it can be implemented with paralyzed and
elderly people for best results which make it easy to provide a better healthcare facility to the
people.

The process model that we have used for our project is an agile model. An agile methodology
is a combination of the incremental and iterative processes. In this, the existing methods are
altered to best suit the project requirements. The entire project will be divided into smaller
time frames and each release will deliver specific features. An iterative approach is thus
followed and each build is incremental in terms of its features. The final result will include all
the features as required by the project.

It is considered to be one of the most realistic approaches to development in healthcare


facility. In our project, this is particularly useful as we are attempting to tackle a real world
problem. Also, in an agile methodology, the functionality can be developed rapidly and
demonstrated.

2.2 Gaps identified from the existing systems


While most of the above mentioned applications or projects (discussed in related work) have
some flaws contained in them. Some applications used RFID technology, some used motion
sensors and most of the projects used Raspberry Pi. At the same time, some used

5
sophisticated sensors and the whole project cost was expensive. Some of the projects used a
layered approach.

The system in [3] used PIC18F46K22 microcontroller, wifi module. Page or data refreshes in
every 15 seconds which is not a good practice as it would be difficult to refer the previous or
earlier records. Use of sophisticated softwares like MPLAB IDE V8-92, DIPTRACE, Proteus
7.0 ISIS Professional, and Hi-Tech C Compiler can be seen in the paper.

In the venture mentioned in [6] just therapeutic pieces of information are gathered and advise
the data to the patient. It doesn't give the social insurance based data.

The system in [8] proposed a model in which the country’s(basically for underdeveloped
countries) basic health units are converted to smart health units which are then connected to
their respective headquarter hospitals. Government keeps track of the entire nation’s health.
Data is transmitted based on some protocols. Layered approach (sensor, network access and
service layer) is done here.

The system in [2] highlights the real security prerequisites in BSN-based present day human
services framework and a protected IoT-based medicinal services framework utilizing BSN,
called BSN-Mind. Data is uploaded in cloud server and android based mobile app is used.
Use of Raspberry Pi microcontroller and Wi-Fi module can be seen.

2.3 Proposed solution


Our system is an integration of all these above developments. Moreover, ours is a low cost
system and is very easy to implement. We are using local server for maintaining data of
patient. Adding to that the detailed data collected from the sensors attached to the patient’s
body is also being sent to the people’s mobile phone which is registered in the GSM module.
In our model the sensors that are being used are cheap. The data is directly fetched into
computers which reduces the man power. We are using Arduino which is cheaper than
raspberry pi.

6
3. Analysis and Design
3.1 Brief Introduction
The main idea of the designed system is continuous monitoring of the patients over internet.
IoT monitored patient has 4 sensors. First one is a temperature sensor, second is ECG, third
one is glucose or moisture sensor and the fourth one is eye blink sensor. This project is very
useful since the doctor can monitor patient health parameters just by visiting 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 health through the Internet. The Arduino board
continuously reads input from these 4 sensors. Then it sends this data to the cloud by sending
the same 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.

3.2 Requirement Analysis


3.2.1 Functional Requirements
3.2.1.1 Product Perspective
The embedded system is a standalone system that provides the functionality of reading data
from the sensors and reporting the health status of the patient. It includes all the modules
needed to fulfill the requirements. The module mainly comprises a GSM modem, sensors and
arduino board. It also interfaces to systems such as LCD to display the required data as well
as memory modules to store the phone numbers. The main aim of this project is to provide
the basic healthcare facility to the elderly and paralyzed people by decreasing the man power
in that situation.

3.2.1.2 Product features


The following are the key features that are included in the system:-
1. The GSM module retains connectivity with the cellular networks. It acts as a SMS
receiver which is used to send the data related to the patient’s health.
2. The LCD displays the data which can be seen by family members and doctor as well
through the IoT part.
3. The four different sensors are being used here to collect the respective data from
patient’s body.
4. The arduino board is used to dump the code and for connection of all sensors and is
being programmed accordingly.

7
3.2.1.3 User characteristics
 The use should be well versed with the English language to interact with the working
of the system and to be able to read and understand the messages received.
 The user must have the basic knowledge of working in a computer with an internet
connection.

3.2.1.4 Operating requirements


For the system to operate properly and effectively, first of all the sensors should be properly
connected to the arduino board and also the wires. Then the code written in Arduino.IDE
needs to be dumped in the arduino before running the program. The ideal environment of
opera ability of the system would require an active GSM connection for sending the SMS
regarding the patient’s health status.

3.2.1.5 Assumption & Dependencies


 This system assumes that the patient will be willing to carry the wearable around
him/her on which the sensors would be attached.
 The GSM module is able to communicate with the cellular towers and have enough
signal strength to send the SMS. If the module is out of tower reach, it will transmit
the signal again the moment it regains the signal.
 The system heavily depends on the response time of the sensors as well as on the
reactions of family members.

3.2.2 Non Functional Requirements


3.2.2.1 Security requirements
The safety and security of the proposed system is quite apt. The data related to the patient’s
health can only be seen through registered user or the family member or say the doctor. No
other person can fetch the data. So the data remains secured and undeleted. The best part is
that the older data records does not get deleted rather it appears with the newer data for a
particular user. But there is a choice to delete the previous data.

8
3.3 Design of the proposed system
3.3.1 Design
3.3.1.1 Design Overview
This Health Care system is the complete system that provides full way communication of
user and health care provider. For this system eye blink sensor, glucose sensor, temperature
sensor and ECG sensor is used. They sense body parameter according to their function and
then with the help of micro controller we can have the data, which can be processed further.
Detailed description and function of these devices is given below.

(a) Eye Blink Sensor


This Eye Blink sensor is IR based. The Variation Across the eye will vary as per eye
blink. If the eye is closed means the output is high otherwise output is low. This is to
know whether the eye is in closed or opened position. This output is given to logic
circuit. The variation across the eye will vary as per eye blink. As per the project, if
the eye is closed the output is “PATIENT SLEPT”.
(b) Glucose level sensor
Blood glucose monitoring reveals individual patterns of blood glucose
changes and helps in the planning of meals, activities and medication times.
Sensors from patients are linked through IPv6 connectivity to relevant healthcare
providers.
(c) ECG sensor
ECG records the electrical activity generated by heart muscle depolarisations, which
propagate in pulsating electrical waves towards the skin. Although the electricity is in
fact very small, it can be picked up reliably with ECG electrodes attached to
the skin.
(d) Temperature sensor
The LM35 series are precision integrated circuit temperature devices with an output
voltage linearly proportional to the centigrade temperature. The LM35 device has an
advantage over linear temperature, as the user is not required to subtract a large
constant voltage from the output to obtain convenient centigrade scaling.

9
3.3.2 System Architectural Design
3.3.2.1 Chosen System Architecture

Block diagram

Patient Section

Power supply

TEMP Sensor

Arduino
ECG Sensor IOT

Glucose Sensor

GSM Module
Eye Blink Sensor

Fig-1
Monitoring Section:

Cloud server

IOT

Fig-2

1
3.3.3 System Interface Description
3.3.3.1 Detailed Description of
Components Arduino:
Arduino/Genuino Uno is a microcontroller board in view of the ATmega328P. It has 14
advanced information/yield pins (of which 6 can be utilized as PWM yields), 6 simple data
sources, a 16 MHz quartz precious stone, a USB association, a power jack, an ICSP header
and a reset catch. It contains everything expected to bolster the microcontroller; just associate
it to a PC with a USB link or power it with an AC-to-DC connector or battery to begin. You
can tinker with your UNO without agonizing excessively over accomplishing something
incorrectly, most dire outcome imaginable you can trade the chip for a couple of dollars and
begin once again once more.
"Uno" implies one in Italian and was denoted the arrival of Arduino Software (IDE) 1.0. The
Uno board and form 1.0 of Arduino Software IDE were the reference adaptations of Arduino.
The Uno board is the first in a progression of USB Arduino sheets, and the reference display
for the Arduino stage.

Fig-3

1
Temperature sensor:
Temperature is the most-measured process variable in mechanical computerization. Usually,
a temperature sensor is utilized to change over temperature incentive to an electrical esteem.
Temperature Sensors are the way to peruse temperatures effectively and to control
temperature in industrials applications. A large distinction can be made between temperature
sensor types. Sensors differ a lot in properties such as contact-way, temperature range,
calibrating method and sensing element. The temperature sensors contain a sensing element
enclosed in housings of plastic or metal. With the help of conditioning circuits, the sensor
will reflect the change of environmental temperature.

Fig-4
ECG Sensor:
Electrocardiography (ECG) is the way toward recording the electrical movement of the heart
over a timeframe utilizing anodes set on the skin. These terminals recognize the minor
electrical changes on the skin that emerges from the heart muscle's electro physiologic
example of depolarizing amid every pulse. It is a usually performed cardiology test.

Fig-5

1
Glucose Sensor (moisture sensor):
This sensor is dipped into the saline bottle which is fully filled while we attach that to patient.
And detects whether the saline bottle is empty or not.

Fig-6

EYE Blink Sensor:


The eye is lit up by an IR drove, which is fueled by the +5v control supply and the reflected
light is recorded by an IR photograph diode. This eye squint sensor is IR based; the variety
over the eye will fluctuate according to eye flicker. The correct usefulness depends
significantly on the situating and pointing of the producer and indicator as for the eye. In the
event that the eye is shut means the yield is high generally yield is low. This to know the eye
is shutting or opening position. This yield is providing for rationale circuit to show the alert.
This can be utilized for venture includes controlling mischance because of oblivious through
eye squint.

Associate directed DC control supply of 5 Volts. Dark wire is Ground, Next center wire is
Brown which is yield and Red wire is certain supply. These wires are likewise set apart on
PCB. To test sensor you just need control the sensor by interface two wires +5V and GND.
You can leave the yield wire as it may be. At the point when Eye shut, LED is off and the
yield is at 0V.Put Eye flicker sensor glass on the face inside 15mm separation, and you can

1
see the LED squinting on each Eye flicker. The yield is dynamic high for Eye close and can
be offered straightforwardly to microcontroller for interfacing applications.

Fig-7

GSM Module:
A GSM modem is a remote modem that works with a GSM remote system. A remote modem
carries on like a dial-up modem. The primary contrast between them is that a dial-up modem
sends and gets information through a settled phone line while a remote modem sends and gets
information through radio waves. The working of GSM modem depends on charges, the
summons dependably begin with AT (which implies ATtention) and complete with a <CR>
character. For instance, the dialing charge is ATD<number>; ATD3314629080; here the
dialing order closes with semicolon.

Fig-8

1
The AT orders are given to the GSM modem with the assistance of PC or controller. The
GSM modem is serially interfaced with the controller with the assistance of MAX 232. Here
max 232 goes about as driver which changes over TTL levels to the RS 232 levels. For serial
interface GSM modem requires the flag in view of RS 232 levels. The T1_OUT and R1_IN
stick of MAX 232 is associated with the TX and RX stick of GSM modem.

CIRCUIT:

Fig-9

Male to Male jumper wire:


A jumper wire is a leading wire used to exchange electrical flags between two focuses in a
circuit. The wires can either be utilized to change circuits or to analyze issues inside a circuit.

Fig-10

1
Male to Female jumper wire:
There is also a very useful cable that plugs into a Sensor Shield on one end, but has separate
female sockets on the other end.

Fig-11
3.3.4 Considered Design Constraints
3.3.4.1 Economic
The proposed system is efficient, responds in quick real-time as well as low cost as it is an
integrated package with basic components.

3.3.4.2 Environmental
None of the components used in the project would be harmful to the environment, either
directly or indirectly. No module needs to be discarded after, can be reused and integrated
into another system if need be. There is no such emission related in this project which is
harmful to the surrounding.

3.3.4.3 Social
This would be beneficial in providing healthcare to elderly and paralyzed people in your
neighbor or in your family. The society is also benefitted at large.

3.3.4.4 Ethical
All the software and hardware that are to be used in the project should be licensed and no
pirated software should be used.

1
3.3.4.5 Health and Safety
It provides an advanced way of handling and monitoring of patients which decreases the
threat to life and property. Thus it ensures the safety and security of patient’s health related
data in and around of the patient.

3.3.4.7 Sustainability
This project can be termed as sustainable as it will be working fine till the end for the
hardware is reached. Failure of any one component would not damage the other component,
thus the system or project still remains partially working. Even if one of the sensors stops
working, the other three will work and the LCD screen would still show the data except the
data of the faulty sensor. If the internet connection is not there, still the registered numbers
would receive the message.

3.3.4.8 Legality
The access to the login page can only be done by the registered users and the data is
confidential. The SMS also goes to the registered mobile number.

3.3.4.9 Inspectability
The GSM board could be updated with the advancements in technology to further reduce the
size and improve the sensitivity of the sensors.

4- Implementation
4.1 Tools Used
4.1.1- General Introduction

Arduino.IDE
A program for Arduino may be written in any programming language for a compiler that
produces binary machine code for the target processor. The Arduino project provides the
Arduino integrated development environment (IDE), which is a cross-platform application
and can be written in any language. It originated from the IDE for the
languages Processing and Wiring. It includes a code editor with features such as text cutting
and pasting, searching and replacing text, automatic indenting, brace matching, and syntax
highlighting, and provides simple one-click mechanisms to compile and upload programs to
an Arduino board. It also contains a message area, a text console, a toolbar with buttons for

1
common functions and a hierarchy of operation menus. A program written with the IDE for
Arduino is called a sketch.

Fig-12

Microsoft Visual Studio

Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It


is used to develop computer programs for Microsoft Windows, as well as web sites, web
apps, web services and mobile apps. Visual Studio uses Microsoft software development
platforms such as Windows API, Windows Forms, Windows Presentation
Foundation, Windows Store and Microsoft Silverlight. It can produce both native
code and managed code. Visual Studio supports different programming languages and allows
the code editor and debugger to support nearly any programming language.

1
Fig-13

4.1.2 Reason for selecting tool

As we are using Arduino board, it’s mandatory to use Arduino.IDE software to dump the
code.
We used Microsoft Visual Studio for the.NET and PHP part as it is an integrated platform to
create computer programs. Also it supports any type of programming language.

4.2 Implementation
4.2.1. USER INTERFACE DESIGN
4.2.1.1 Description of the User Interface
The user interfaces in this case are basically the SMS service on the mobile phone through
GSM, the Login page for registered user and the Register page for new user.
The registered user or the family member or the doctor will get a notification SMS on their
cell phones about the health status of the patient. The login and register html web pages acts
as an interface between the user and the system.

1
4.2.1.2 Screen Images

Fig-14

Fig-15

2
4.2.1.3. Objects and Actions

Connections of Sensors:-
Temperature Sensor(LM 35) :-
Pin 1 of the LM35 goes into +5V of the arduino
Pin 2 of the LM35 goes into simple stick A0 of the arduino
Pin 3 of the LM35 goes into ground (GND) of the arduino
ECG sensor:-
1 pin to 5v
2 pin to GND
3pin to Analog 1 of Arduino
Glucose Sensor:-
1 pin to 5v
2 pin to GND
3pin to Analog 2 of Arduino
Eye Blink Sensor
1 pin to 5v
2 pin to GND
3pin to Analog 3 of Arduino

The Microcontroller is connected to GSM modem which provides information to


doctor/caretaker when the temperature is greater than 50. LCD is connected to
microcontroller to display the transaction process and healthcare data. And the user interface
html web page will automatically refresh for every 25-30 seconds hence patient health status
is continuously sent to the doctor. Hence continuous monitoring of patient data is achieved.
The protected data sent can be accessed anytime by the doctors by typing the corresponding
unique IP address in any of the Internet Browser at the end user device(ex: Laptop, Desktop,
Tablet, Mobile phone).

Automatic alert system enabled by arduino gives intimation to user. GSM interfacing
provides a feature of remote monitoring of patient parameters. The system determines the
required data for each sensor and then sends short message service (SMS) alert to the mobile
phone on top of displaying it on a LCD. It is also cost effective and portable. It is easy to

2
handle and efficient. It is not as complex as the current systems. This system is fully
automated system and does not require any human attention.

4.3 Testing
4.3.1 TEST CASES

Test Scenario Test Cases


1. Access to providers system  Provider system should let us
enter, edit and save provider's data

2. Positive flow system testing  It includes scenarios to enter


different types of provider,
change providers details, save and
inquire them

3. Negative flow system testing  Allows to save a provider


information with incomplete
data, contract's effective date,
entering details about existing
providers in the system

4. System integration testing  Validate the feed to members


system. Also, validate if the changes
from user are entered into the
respective user's record

5. Positive flow providers portal  Login and view providers


testing details, and patient health related
details
 Make change request to change
the email and password.

6. Negative flow providers portal  View the member details with


testing an invalid ID
 Login with invalid credentials

Table-4.1

2
5. Results and Discussions
5.1 Results:-
After the completion and successful working of the system, the following results can be
incorporated from the same.

Result from the software Arduino.IDE:-

Fig-16

2
Result of the message sent to the registered mobile no. through GSM module:-

Fig-17

2
Result for .NET coding of IoT part:-

Fig-18

2
6. Conclusion and Future Enhancements

There are a few issues found in IoT and existing wellbeing checking. New advancements
could limit them by accomplishing the better quality and online security idea. Scientists over
the world have begun to investigate different mechanical answers for improving human
services arrangement in a way that supplements existing administrations by activating the
capability of the IoT. With the wide utilization of web this work is engaged to actualize the
web innovation to build up a framework which would convey through web for better
wellbeing. Web of things is relied upon to administer the world in different fields yet more
advantage would be in the field of social insurance. Consequently present work is done to
outline an IOT based savvy human services framework utilizing a PIC.Our proposed model is
specific for giving fundamental wellbeing administrations to the elderly people living at far
separation from their near and dear ones. In entirety, the consequences of this overview are
relied upon to be helpful for scientists, engineers, wellbeing experts, and policymakers
working in the zone of the IoT and medicinal services advancements and the elderly people at
large.

We are likewise exploring more issues to give IoT-based savvy wellbeing administrations
where web office is not accessible in provincial regions. The future work of the project is
very essential in order to make the design system more advanced. In the designed system the
enhancement would be connecting more sensors to internet which measures various other
health parameters and would be beneficial for patient monitoring i.e. connecting all the
objects to internet for quick and easy access. We can add a GPS module in IOT patient
monitoring using Arduino Uno and WiFi module project. This GPS module will find out the
position or the location of the patient using the longitude and latitude received. Then it will
send this location to the cloud that is the IOT using the Wi-Fi module. Then doctors can find
out the position of the patient in case they have to take some preventive action or if they have
to travel to the patient.

2
REFERENCES:-
1- S. M. RIAZUL ISLAM1, (Member, IEEE), DAEHAN KWAK2, MD. HUMAUN
KABIR1, MAHMUD HOSSAIN3 AND KYUNG-SUP KWAK “The Internet of
Things for Health Care:AComprehensive Survey”, Digital Object Identifier
10.1109/ACCESS.2015.2437951
2- Snehal Sanjay Kale 1, D. S. Bhagwat 2 ”Highly Secured IoT Based Health Care
System for Elderly People using Body Sensor Network “ in International Journal of
Innovative Research in Science, Engineering and Technology (An ISO 3297: 2007
Certified Organization) Vol. 5, Issue 10, October 2016 ISSN(Online) : 2319-875
ISSN (Print) : 2347-6710
3- Bhoomika.B.K and Dr. K N Muralidhara “Secured Smart Healthcare Monitoring
System Based on Iot” International Journal on Recent and Innovation Trends in
Computing and Communication ISSN: 2321-8169 Volume: 3 Issue: 7 4958 - 4961
4- Narendra Kumar3, Alok Aggrawal2 and Nidhi Gupta1” Wearable Sensors for Remote
Healthcare Monitoring System” in International Journal of Engineering Trends and
Technology- Volume3Issue1- 2012
5- K. Natarajan ,B. Prasath, P. Kokila “ Smart Health Care System Using Internet of
Things” Journal of Network Communications and Emerging Technologies (JNCET)
Volume 6, Issue 3, March (2016)
6- R. L. Richesson and J. Krischer, “Data standards in clinical research: Gaps, overlaps,
challenges and future directions,” J Amer. Med. Informat. Assoc.,vol. 14, no. 6, pp.
687–696, 2007.
7- R. Want, ―An introduction to RFID technology,‖ IEEE Pervasive Comput., vol. 5,
no. 1, pp. 25–33, Jan.–Mar. 2006.
8- Syed Muhammad Waqas Shah, Maruf Pasha” IoT-Based Smart Health Unit”
in Journal of Software.
9- B. Sobhan Babu1, K. Srikanth2, T. Ramanjaneyulu3, I. Lakshmi Narayana4 “
IoT for Healthcare” International Journal of Science and Research (IJSR) ISSN
(Online): 2319-7064 Index Copernicus Value (2013): 6.14 | Impact Factor (2014):
5.611
10- Yvette E. Gelogo, Ha Jin Hwang and Haeng-Kon Kim, “Internet of Things (IoT)
Framework for u-healthcare System”, International Journal of Smart Home, Vol. 9,
No. 11, 2015.
.

2
Appendix:-
This section comprises of the codes written to configure the Arduino board and the code for
IoT.
Arduino Code:-
#include <SoftwareSerial.h>
#define LED 13
int ecg=1;
int tem=2;
int eye=3;
int gul=4;
int b1;
SoftwareSerial iot(9,10);
SoftwareSerial mySerial(7, 8);
int b;
int c;
int d;
int d1;
int a;
int x;
void setup() {
pinMode(ecg, INPUT);
pinMode(eye, INPUT);
pinMode(tem, INPUT);
pinMode(LED,OUTPUT);q23
Serial.begin(9600);
iot.begin(9600);
mySerial.begin(9600);
}
void loop() {
x=(millis() / 1000);
a=analogRead(gul);
b=analogRead(ecg);
c=analogRead(eye);
d=analogRead(tem);

2
d1=(d/2)-3;
if(c<300)
{
b1 = b1 + 1;
if (b1 > 1)
{
Serial.println("patient slept");
Serial.println("");
iot.println("patient slept");
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"8870855099"); // Replace x with mobile number
mySerial.write(0x22);
mySerial.write(0x0D); // hex equivalent of Carraige return
mySerial.write(0x0A); // hex equivalent of newline
delay(2000);
mySerial.println("patient slept");
delay(500);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
delay(5000);
}
}
if (c>300)
{
b1 = 0;
}
if(a>600)
{
Serial.println("LOW GLUCOSE LEVEL");
Serial.println("");
iot.println("*LOW GLUCOSE LEVEL#");
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second

2
mySerial.println("AT+CMGS=\"8870855099"); // Replace x with mobile number
mySerial.write(0x22);
mySerial.write(0x0D); // hex equivalent of Carraige return
mySerial.write(0x0A); // hex equivalent of newline
delay(2000);
mySerial.println("LOW GLUCOSE LEVEL");
delay(500);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
delay(5000);
}
if(b<700)
{
Serial.println("ECG LEVEL LOW");
Serial.println("");
iot.println("*ECG LEVEL LOW#");
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"8870855099"); // Replace x with mobile number
mySerial.write(0x22);
mySerial.write(0x0D); // hex equivalent of Carraige return
mySerial.write(0x0A); // hex equivalent of newline
delay(2000);
mySerial.println("ECG LEVEL LOW");
delay(500);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
delay(5000);
}
if(d1>40)
{
Serial.println("HIGH TEMPERATURE");
Serial.println("");
iot.println("*HIGH TEMPERATURE#");

3
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"8870855099"); // Replace x with mobile number
mySerial.write(0x22);
mySerial.write(0x0D); // hex equivalent of Carraige return
mySerial.write(0x0A); // hex equivalent of newline
delay(2000);
mySerial.println("HIGH TEMPERATURE");
delay(500);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
delay(5000);
}
if(x>10)
{
Serial.print("TEMPERATURE=");
Serial.println(d1);
Serial.println("");
delay(2000);
}
}

3
Code for IoT:-
A. Login Activity- The code for login into local server website (Front End)
<%@ Page Title="Log in" Language="C#" MasterPageFile="~/Site.Master"
AutoEventWireup="true" CodeBehind="Login.aspx.cs"
Inherits="IntegratingArudinoUNO.Account.Login" %>

<%@ Register Src="~/Account/OpenAuthProviders.ascx" TagPrefix="uc"


TagName="OpenAuthProviders" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">


<hgroup class="title">
<h1><%: Title %>.</h1>
</hgroup>
<section id="loginForm">

<%--<h2>Use a local account to log in.</h2>--%>


<%--<asp:Login runat="server" ViewStateMode="Disabled"
RenderOuterTable="false">
<LayoutTemplate>
<p class="validation-summary-errors">
<asp:Literal runat="server" ID="FailureText" />
</p>
<fieldset>
<legend>Log in Form</legend>
<ol>
<li>
<asp:Label runat="server" AssociatedControlID="UserName">User
name</asp:Label>
<asp:TextBox runat="server" ID="UserName" />
<asp:RequiredFieldValidator runat="server"
ControlToValidate="UserName" CssClass="field-validation-error" ErrorMessage="The user
name field is required." />
</li>

3
<li>
<asp:Label runat="server"
AssociatedControlID="Password">Password</asp:Label>
<asp:TextBox runat="server" ID="Password" TextMode="Password" />
<asp:RequiredFieldValidator runat="server"
ControlToValidate="Password" CssClass="field-validation-error" ErrorMessage="The
password field is required." />
</li>
<li>
<asp:CheckBox runat="server" ID="RememberMe" />
<asp:Label runat="server" AssociatedControlID="RememberMe"
CssClass="checkbox">Remember me?</asp:Label>
</li>
</ol>
<asp:Button runat="server" ID="btnLogin" OnClick="btnLogin_Click"
Text="Log in" />
</fieldset>
</LayoutTemplate>
</asp:Login>--%>

<table>
<tr>
<td>
<legend>Log in Form</legend>
<ul>
<li>
<asp:Label ID="Label1" runat="server"
AssociatedControlID="UserName">User name</asp:Label>
<asp:TextBox runat="server" ID="UserName" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="UserName" CssClass="field-validation-error" ErrorMessage="The user
name field is required." />
</li>
<li>

3
<asp:Label ID="Label2" runat="server"
AssociatedControlID="Password">Password</asp:Label>
<asp:TextBox runat="server" ID="Password" TextMode="Password" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="Password" CssClass="field-validation-error" ErrorMessage="The
password field is required." />
</li>
<%--<li>
<asp:CheckBox runat="server" ID="RememberMe" />
<asp:Label ID="Label3" runat="server"
AssociatedControlID="RememberMe" CssClass="checkbox">Remember me?</asp:Label>
</li>--%>
</ul>
<asp:Button runat="server" ID="btnLogin" OnClick="btnLogin_Click"
Text="Log in" /></td>
<td></td>
</tr>
</table>
<p>
<asp:HyperLink runat="server" ID="RegisterHyperLink"
ViewStateMode="Disabled">Register</asp:HyperLink>
if you don't have an account.
</p>
</section>

<section id="">
<%--<h2>Use another service to log in.</h2>--%>
<uc:OpenAuthProviders runat="server" ID="OpenAuthLogin" />
</section>
</asp:Content>

3
B. Code for Registration page (Front End)

<%@ Page Title="Register" Language="C#" MasterPageFile="~/Site.Master"


AutoEventWireup="true" CodeBehind="Register.aspx.cs"
Inherits="IntegratingArudinoUNO.Account.Register" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">


<table>
<tr>
<td>
<%-- <hgroup class="title">
<h1><%: Title %>.</h1>
<h2>Use the form below to create a new account.</h2>
</hgroup>--%>
</td>
<td>
<asp:Label runat="server" ID="lbltitle" Style="font-weight: bold" Text="">
</asp:Label>
</td>
</tr>
</table>
<table style="vertical-align: central">
<tr>
<td>
<legend>Registration Form</legend>
<ul>
<li>
<asp:Label ID="Label1" runat="server"
AssociatedControlID="UserName">User name</asp:Label>
<asp:TextBox runat="server" ID="UserName" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="UserName"
CssClass="field-validation-error" ErrorMessage="The user name field is
required." />

3
</li>
<li>
<asp:Label ID="Label2" runat="server" AssociatedControlID="Email">Email
address</asp:Label>
<asp:TextBox runat="server" ID="Email" TextMode="Email" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="Email"
CssClass="field-validation-error" ErrorMessage="The email address field is
required." />
</li>
<li>
<asp:Label ID="Label3" runat="server"
AssociatedControlID="Password">Password</asp:Label>
<asp:TextBox runat="server" ID="Password" TextMode="Password" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="Password"
CssClass="field-validation-error" ErrorMessage="The password field is
required." />
</li>
<li>
<asp:Label ID="Label4" runat="server"
AssociatedControlID="ConfirmPassword">Confirm password</asp:Label>
<asp:TextBox runat="server" ID="ConfirmPassword" TextMode="Password"
/>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ControlToValidate="ConfirmPassword"
CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The
confirm password field is required." />
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="Password" ControlToValidate="ConfirmPassword"
CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The
password and confirmation password do not match." />
</li>
</ul>

3
<asp:Button runat="server" ID="btnRegister" OnClick="btnRegister_Click"
Text="Register" />

</td>
</tr>
</table>

<%--<asp:CreateUserWizard runat="server" ID="RegisterUser"


ViewStateMode="Disabled" OnCreatedUser="RegisterUser_CreatedUser">
<LayoutTemplate>
<asp:PlaceHolder runat="server" ID="wizardStepPlaceholder" />
<asp:PlaceHolder runat="server" ID="navigationPlaceholder" />
</LayoutTemplate>
<WizardSteps>
<asp:CreateUserWizardStep runat="server" ID="RegisterUserWizardStep">
<ContentTemplate>
<p class="message-info">
Passwords are required to be a minimum of <%:
Membership.MinRequiredPasswordLength %> characters in length.
</p>

<p class="validation-summary-errors">
<asp:Literal runat="server" ID="ErrorMessage" />
</p>

<fieldset>
<legend>Registration Form</legend>
<ol>
<li>
<asp:Label runat="server" AssociatedControlID="UserName">User
name</asp:Label>

<asp:TextBox runat="server" ID="UserName" />


<asp:RequiredFieldValidator runat="server"
ControlToValidate="UserName"
3
CssClass="field-validation-error" ErrorMessage="The user name field
is required."
/>
</li>
<li>
<asp:Label runat="server" AssociatedControlID="Email">Email
address</asp:Label>
<asp:TextBox runat="server" ID="Email" TextMode="Email" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="Email"
CssClass="field-validation-error" ErrorMessage="The email address
field is required." />
</li>
<li>
<asp:Label runat="server"
AssociatedControlID="Password">Password</asp:Label>
<asp:TextBox runat="server" ID="Password" TextMode="Password" />
<asp:RequiredFieldValidator runat="server"
ControlToValidate="Password"
CssClass="field-validation-error" ErrorMessage="The password field
is required."
/>
</li>
<li>
<asp:Label runat="server"
AssociatedControlID="ConfirmPassword">Confirm password</asp:Label>
<asp:TextBox runat="server" ID="ConfirmPassword"
TextMode="Password" />
<asp:RequiredFieldValidator runat="server"
ControlToValidate="ConfirmPassword"
CssClass="field-validation-error" Display="Dynamic"
ErrorMessage="The confirm password field is required." />
<asp:CompareValidator runat="server" ControlToCompare="Password"
ControlToValidate="ConfirmPassword"
CssClass="field-validation-error" Display="Dynamic"
ErrorMessage="The password and confirmation password do not match." />
</li>
3
</ol>
<asp:Button runat="server" ID="btnRegister" OnClick="btnRegister_Click"
Text="Register" />

</fieldset>
</ContentTemplate>
<CustomNavigationTemplate />
</asp:CreateUserWizardStep>
</WizardSteps>
</asp:CreateUserWizard>--%>
</asp:Content>

C. Code for Register external coding (Front End)

<%@ Page Language="C#" Title="Register an external login"


MasterPageFile="~/Site.Master" AutoEventWireup="true"
CodeBehind="RegisterExternalLogin.aspx.cs"
Inherits="IntegratingArudinoUNO.Account.RegisterExternalLogin" %>
<asp:Content ContentPlaceHolderID="MainContent" runat="server">
<hgroup class="title">
<h1>Register with your <%: ProviderDisplayName %> account</h1>
<h2><%: ProviderUserName %>.</h2>
</hgroup>
<asp:ModelErrorMessage runat="server" ModelStateKey="Provider" CssClass="field-
validation-error" />
<asp:PlaceHolder runat="server" ID="userNameForm">
<fieldset>
<legend>Association Form</legend>
<p>
You've authenticated with <strong><%: ProviderDisplayName %></strong> as
<strong><%: ProviderUserName %></strong>. Please enter a user name below for
the current site
and click the Log in button.
</p>

3
<ol>
<li class="email">
<asp:Label runat="server" AssociatedControlID="userName">User
name</asp:Label>
<asp:TextBox runat="server" ID="userName" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="userName"
Display="Dynamic" ErrorMessage="User name is required"
ValidationGroup="NewUser" />

<asp:ModelErrorMessage runat="server" ModelStateKey="UserName"


CssClass="field-validation-error" />
</li>
</ol>
<asp:Button runat="server" Text="Log in" ValidationGroup="NewUser"
OnClick="logIn_Click" />
<asp:Button runat="server" Text="Cancel" CausesValidation="false"
OnClick="cancel_Click" />
</fieldset>
</asp:PlaceHolder>
</asp:Content>

D. Code for login page (Back End)


using IntegratingArudinoUNO.Entities;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace IntegratingArudinoUNO.Account
{

4
public partial class Login : Page
{
public string connectionString = null;
public string SP_GetLoginDetails = "SP_LoginAuthentication";
public ConnectionStringSettings connectionSettings = null;
public DBFactory.DBFactory dbFactory = null;
public UserDetailsEntity userDetails = null;
public List<UserDetailsEntity> usersDetail = new List<UserDetailsEntity>();

protected void Page_Load(object sender, EventArgs e)


{
RegisterHyperLink.NavigateUrl = "Register.aspx";
OpenAuthLogin.ReturnUrl = Request.QueryString["ReturnUrl"];

var returnUrl = HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);


if (!String.IsNullOrEmpty(returnUrl))
{
RegisterHyperLink.NavigateUrl += "?ReturnUrl=" + returnUrl;
}
}

protected void btnLogin_Click(object sender, EventArgs e)


{
connectionSettings =
ConfigurationManager.ConnectionStrings["DefaultConnection"];
connectionString = connectionSettings.ConnectionString;
dbFactory = new DBFactory.DBFactory();
DataSet dsUserDetails = new DataSet();
userDetails = new UserDetailsEntity();

Dictionary<string, string> sqlParameters = new Dictionary<string, string>();


userDetails.EmailAddress = UserName.Text; userDetails.Password = Password.Text;
sqlParameters.Add("@EmailAddress", userDetails.EmailAddress);
sqlParameters.Add("@Password", userDetails.Password);

4
dsUserDetails = dbFactory.GetData(SP_GetLoginDetails, connectionString,
sqlParameters);
if (dsUserDetails.Tables[0].Rows.Count > 0)
{
Session["LoginID"] = dsUserDetails.Tables[0].Rows[0][1];
Response.Redirect("../Default.aspx");
}
}
}
}
E. Code for Managing the Password is correct or not (Back End)

using IntegratingArudinoUNO.Entities;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace IntegratingArudinoUNO.Account
{
public partial class Login : Page
{
public string connectionString = null;
public string SP_GetLoginDetails = "SP_LoginAuthentication";
public ConnectionStringSettings connectionSettings = null;
public DBFactory.DBFactory dbFactory = null;
public UserDetailsEntity userDetails = null;
public List<UserDetailsEntity> usersDetail = new List<UserDetailsEntity>();

4
protected void Page_Load(object sender, EventArgs e)
{
RegisterHyperLink.NavigateUrl = "Register.aspx";
OpenAuthLogin.ReturnUrl = Request.QueryString["ReturnUrl"];

var returnUrl = HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);


if (!String.IsNullOrEmpty(returnUrl))
{
RegisterHyperLink.NavigateUrl += "?ReturnUrl=" + returnUrl;
}
}

protected void btnLogin_Click(object sender, EventArgs e)


{
connectionSettings =
ConfigurationManager.ConnectionStrings["DefaultConnection"];
connectionString = connectionSettings.ConnectionString;
dbFactory = new DBFactory.DBFactory();
DataSet dsUserDetails = new DataSet();
userDetails = new UserDetailsEntity();

Dictionary<string, string> sqlParameters = new Dictionary<string, string>();


userDetails.EmailAddress = UserName.Text; userDetails.Password = Password.Text;
sqlParameters.Add("@EmailAddress", userDetails.EmailAddress);
sqlParameters.Add("@Password", userDetails.Password);

dsUserDetails = dbFactory.GetData(SP_GetLoginDetails, connectionString,


sqlParameters);
if (dsUserDetails.Tables[0].Rows.Count > 0)
{
Session["LoginID"] = dsUserDetails.Tables[0].Rows[0][1];
Response.Redirect("../Default.aspx");
}
}}}

4
F. Code for open authorized provider(Back End)

<%@ Control Language="C#" AutoEventWireup="true"


CodeBehind="OpenAuthProviders.ascx.cs"
Inherits="IntegratingArudinoUNO.Account.OpenAuthProviders" %>

<fieldset class="open-auth-providers">
<legend>Log in using another service</legend>

<asp:ListView runat="server" ID="providerDetails"


ItemType="Microsoft.AspNet.Membership.OpenAuth.ProviderDetails"
SelectMethod="GetProviderNames" ViewStateMode="Disabled">
<ItemTemplate>
<button type="submit" name="provider" value="<%#: Item.ProviderName %>"
title="Log in using your <%#: Item.ProviderDisplayName %> account.">
<%#: Item.ProviderDisplayName %>
</button>
</ItemTemplate>

<EmptyDataTemplate>
<%--<div class="message-info">
<p>There are no external authentication services configured. See <a
href="http://go.microsoft.com/fwlink/?LinkId=252803">this article</a> for details on
setting up this ASP.NET application to support logging in via external services.</p>
</div>--%>
</EmptyDataTemplate>
</asp:ListView>
</fieldset>

4
G. Code for Web configuration (Connecting String)
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit
http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework"
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,
EntityFramework, Version=5.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" requirePermission="false" />

</configSections>
<connectionStrings>
<add name="DefaultConnection" providerName="System.Data.SqlClient"
connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\
IntegratingArudinoUNO\IntegratingAru dinoUNO\App_Data\Arudino.mdf;Integrated
Security=True;Connect Timeout=30" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<pages>
<namespaces>
<add namespace="System.Web.Optimization" />
</namespaces>
<controls>
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms"
namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
</controls>
</pages>

4
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<profile defaultProvider="DefaultProfileProvider">
<providers>
<add name="DefaultProfileProvider"
type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
connectionStringName="DefaultConnection" applicationName="/" />
</providers>
</profile>
<membership defaultProvider="DefaultMembershipProvider">
<providers>
<add name="DefaultMembershipProvider"
type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
connectionStringName="DefaultConnection" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="false"
requiresUniqueEmail="false" maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<roleManager defaultProvider="DefaultRoleProvider">
<providers>
<add name="DefaultRoleProvider"
type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
connectionStringName="DefaultConnection" applicationName="/" />
</providers>
</roleManager>
<sessionState mode="InProc" customProvider="DefaultSessionProvider">
<providers>

4
<addname="DefaultSessionProvider"
type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
connectionStringName="DefaultConnection" />
</providers>
</sessionState>
</system.web>
<entityFramework>
<defaultConnectionFactory
type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>
H. Code for Inheriting the Integrating ArudinoUNO Software

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs"


Inherits="IntegratingArudinoUNO.SiteMaster" %>

<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
<title><%: Page.Title %> - My ASP.NET Application</title>
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/modernizr") %>
</asp:PlaceHolder>
<webopt:BundleReference runat="server" Path="~/Content/css" />
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
<asp:ContentPlaceHolder runat="server" ID="HeadContent" />
</head>

4
<body>
<form runat="server">
<asp:ScriptManager runat="server">
<Scripts>
<%--Framework Scripts--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="jquery.ui.combined" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web"
Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web"
Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web"
Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web"
Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web"
Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web"
Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web"
Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web"
Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="WebFormsBundle" />
<%--Site Scripts--%>
</Scripts>
</asp:ScriptManager>
<header>
<div class="content-wrapper">
<%--<div class="float-left">
<p class="site-title">
<a runat="server" href="~/">your logo here</a>
</p>

4
</div>--%>
<div class="float-right">
<section id="login">
<asp:LoginView runat="server" ViewStateMode="Disabled">
<AnonymousTemplate>
<ul>
<li><a id="registerLink" runat="server"
href="~/Account/Register.aspx">Register</a></li>
<li><a id="loginLink" runat="server"
href="~/Account/Login.aspx">Log in</a></li>
</ul>
</AnonymousTemplate>
<LoggedInTemplate>
<p>
Hello, <a runat="server" class="username"
href="~/Account/Manage.aspx" title="Manage your account">
<asp:LoginName runat="server" CssClass="username" />
</a>!
<asp:LoginStatus runat="server" LogoutAction="Redirect"
LogoutText="Log off" LogoutPageUrl="~/" />
</p>
</LoggedInTemplate>
</asp:LoginView>
</section>
<nav>
<%--<ul id="menu">
<li><a runat="server" href="~/">Home</a></li>
<li><a runat="server" href="~/About.aspx">About</a></li>
<li><a runat="server" href="~/Contact.aspx">Contact</a></li>
</ul>--%>
</nav>
</div>
</div>
</header>

4
<div id="body">
<asp:ContentPlaceHolder runat="server" ID="FeaturedContent" />
<section class="content-wrapper main-content clear-fix">
<asp:ContentPlaceHolder runat="server" ID="MainContent" />
</section>
</div>
<footer>
<div class="content-wrapper">
<%--<div class="float-left">
<p>&copy; <%: DateTime.Now.Year %> - My ASP.NET Application</p>
</div>--%>
</div>
</footer>
</form>
</body>
</html>

You might also like