Sunteți pe pagina 1din 87

RAGHU INSTITUTE OF TECHNOLOGY

(AUTONOMOUS)
Department of Electrical and Electronics Engineering

CERTIFICATE

This is to certify that the dissertation work entitled on “HEALTH MONITORING SYSTEM USING
IoT” is the bonafide work done by

P. KARTHIK (173J5A0217)
N. AJAY (173J5A0210)
G.SAI SAMEER KUMAR (163J1A0207)
K. ANIL KUMAR (163J1A0209)
J. DURGA PRASAD (173J5A0236)

Submitted in partial fulfillment for the award of the degree of BACHELOR OF TECHNOLOGY in
ELECTRICAL AND ELECTRONICS ENGINEERING from RAGHU INSTITUTE OF
TECHNOLOGY affiliated to JNTUK, KAKINADA.

PROJECT GUIDE HEAD OF THE DEPARTMENT


Dr. G. JOGA RAO, PhD. Dr. G. JOGA RAO, PhD
Associate professor & HOD Associate Professor & HOD
Department of EEE. Department of EEE.
EXTERNAL EXAMINER
DECLARATION

We hereby declare that the project entitled “HEALTH MONITORING SYSTEM USING
IoT” is being submitted to Raghu institute of technology, affiliated to JNTUK University in
partial fulfillment for the award of B. TECH Degree in Electrical & Electronics Engineering.
The work was originally designed and executed by us under the guidance of our supervisor Dr.
G. JOGA RAO (Associate Professor & HOD), and was not a duplication of work done by
someone else. We hold the responsibility of the work incorporated into this thesis.

PROJECT ASSOCIATES:

P. KARTHIK

N. AJAY

G.SAI SAMEER KUMAR

K. ANIL KUMAR

J. DURGA PRASAD
ACKNOWLEDGMENT

 
We articulate our profound gratitude to Dr. G. Joga Rao, Ph.D., Associate Professor &
HOD, Department of EEE for his indispensable encouragement with salient guidelines and
suggestions throughout the work. He helped us in various difficulties and challenges that raised
at various stages of project.

With a great sense of pleasure and privilege, we extend our gratitude to Dr. G. Joga Rao,
Ph.D., Head of Electrical and Electronics Engineering Department, Raghu Institute of
Technology for his co-operation and providing necessary help for completing this project
work.
We convey our special thanks to our beloved and honorable Principal Prof. S.
Satyanarayana, Vice Principal Dr. P.S.R. Chowdary and Management for providing
excellent lab facilities for the completion of project within the campus.

We would also like to acknowledge our project coordinator Mr. G.S.N.M. Venkatesh,
Assistant Professor, Department of EEE who have invested his full effort in achieving our
goal.

We would like to thank all teaching and non-teaching staff for their valuable suggestions and
guidance in successfully completing this project. Finally, we express indebtedness to everyone
even remotely involved in the successful completion of our project.
 

P.Karthik
N. Ajay
G. Sai Sameer
Kumar
K. Anil Kumar
J. Durga Prasad
TABLE OF CONTENTS
ACKNOWLEDGEMENT
ABSTRACT
CONTENTS
LIST OF FIGURES
LIST OF TABLES

CHAPTER-1 INTRODUCTION (1-)


1.1 Introduction
1.2 ESP8266
1.3 IoT
1.4 Application
CHAPTER-2 LITERATURE ()
2.1 History of Health Monitoring System
2.2 Project aim
2.3 Project objective
2.4 Components required
CHAPTER-3 METHODOLOGY ()
3.1 Methodology
3.2 Preliminary considerations
3.3 Selection of implementation platform
3.4 Selection of hardware components
3.5 Block diagram
3.6 Main circuit diagram
3.7 Source code
CHAPTER-4 HARDWARE ()
4.1 NODE MCU
4.2 ESP8266
4.3 Pulse sensor
4.4 Temperature sensor
4.5 Thingspeak
CHAPTER-5 HEALTH MONITORING SYSTEM ()
5.1 What is health monitoring system
5.2 Existing system
5.3 Proposed system
5.4 Health monitoring system related work
5.5 Working principle
5.6 Program
CHAPTER-6 SENSORS ()
6.1 Sensors used
6.2 DS18B20
6.3 Pulse rate
6.4 ECG Sensor
CHAPTER-7 OVERVIEW ()

CHAPTER-8 RESULT ()
CHAPTER-9 CONCLUSION AND FUTURE SCOPE
REFERENCES ()
LIST OF FIGURES

Fig1 Overview
Fig1. Node MCU
Fig1.3 Internet of Things
Fig3.1 Block diagram
Fig 3.2 project Setting
Fig3.3 Circuit diagram
Fig4.1 Node MCU
Fig4.2 Node MCU Layout
Fig4.3 Pin Diagram of node MCU
Fig4.4 ESP8266
Fig4.5Pulse Sensor
Fig4.6 DS18B20 Temperature Sensor
Fig4.7 Thingspeak
Fig5.1 Health monitoring system
Fig5.2 Existing of health monitoring system
Fig5.3 Automatic health monitoring system tx circuit
Fig5.4 Automatic health monitoring system rx circuit
Fig5.5 Method of ecg
Fig5.6 Block diagram of health monitoring system
Fig5.7 Working of system
Fig6.2
Fig8.1 Overview
Fig8.2 installation of thingspeak app
Fig8.3 Opening of thingspeak
Fig8.4 Account creation
Fig8.5 Account login
Fig8.6 click on new project
Fig8.7 creation of new project
Fig8.8 connect to node mcu
Fig8.10 final output

List of tables
4.1 pin description of Esp8266 Wi-Fi module
4.2 specification of system
4.3 comparation of sensors and technology
6.1 pin configuration of Lm35 Temperature sensor
6.2 pin configuration of pulse sensor

ABSTRACT

When there is a need for controlling the speed of a AC


motor in an efficient manner (using Pulse Width
Modulation), driver circuitry can be rather simple, as
shown below. The motor drive circuit ground must of
course, be tied to the microcontroller ground for the circuit
to work. The 1k gate resistor is used to add some degree of
isolation of the motor drive (w. possible damaging back
EMF transient spikes) from the 8052 output pin. The Zener
diode (optional) adds extra protection. But if you really
want to do it right, put an optoisolator between the 8052
output and the motor drive circuit.
CHAPTER
-1
INTRODU
CTION
1. INTRODUCTION

1.1 INTRODUCTION

An AC motor is an electric motor that is driven by an alternating current. It consists of


two basic parts, an outside stationary stator having coils supplied with alternating current
to produce a rotating magnetic field, and an inside rotor attached to the output shaft that
is given a torque by the rotating field.

There are two types of AC motors, depending on the type of rotor used. The first is the
synchronous motor, which rotates exactly at the supply frequency or submultiples of the
supply frequency. The magnetic field on the rotor is either generated by current
delivered through slip rings or by a permanent magnet.

The second type is the induction motor, which runs slightly slower than the supply
frequency. The magnetic field on the rotor of this motor is created by an induced current.

FIGURE 1.1 BLOCK DIAGRAM

1.2 INTRODUCTION TO EMBEDDED SYSTEMS

Embedded systems are a system is which performs a specific or a pre-defined task.


It is the combinations of hardware and software. It is nothing but a computer inside
a product. It is a programmable hardware design nothing but an electronic chip.
A general-purpose definition of embedded systems is that they are
devices used to control, monitor or assist the operation of equipment, machinery or
plant. “Embedded” reflects the fact that they are an integral part of the system. In
many cases their embedded ness may be such that their presence is far from obvious
to the casual observer and even the equipment for some time before being able to
conclude that an embedded control system was involved in its functioning. At the
other extreme a general-purpose computer may be used to control the operation of a
large complex processing plant, and its presence will be obvious.

All embedded systems are or include computers or microprocessors.


Some of these computers are however very simple systems as compared with a
personal computer.

The very simplest embedded systems are capable of performing only


single functions to meet single functions to meet a single predetermined purpose. In
more complex systems an application program that enables the embedded system to
be used for a particular purpose in a specific application determines the functioning
of the embedded systems. The ability to have programs means that the same
embedded system can be used for a variety of different purpose. In some cases a
microprocessor may be designed in such way that application software for a
particular purpose can be added to the basic software in a second process, after
which it is not possible to make further changes. The applications software on such
processors is sometimes referred to as firmware.

The simplest devices consist of a single microprocessor (often called a


“chip”), which may itself be packaged with other chips in a hybrid systems or
Application Specific Integrated Circuit (ASIC). Its input comes from a detector or
sensor and its output goes to a switch or a activator which (for example) may start
or stop the operation of a machine or, operating a value, may control the flow of
fuel to an engine.

PROCESSORS:
Processors are the ones which performs some specific task or
operation. These are divided in to several types like:

1. Digital Signal Processors.

2. Application Specific Integrated Circuits.

3. Micro Processors.

4. Micro Controllers.

Digital Signal Processors:

This is a one which performs scientific and mathematical

Calculations. The output of this type of processors will be in floating point values.
Hence, we can get accurate values as outputs.

Best example of a Digital Signal Processors will be Weather Forecasting.

Applications specific Integrated Circuits:

As the name itself specifies, this is integrated circuit designed for a


specific application. IC designed for one specific application cannot be used in other
applications. Best Example for ASIC will be Cell phone card.

Microprocessors:

These are the ones which perform arithmetic and logical operations

Block Diagram of Microprocessor:


FIGURE 1.2 BLOCK DIAGRAM OF MICRO-PROCESSOR

Arithmetic and logical unit performs arithmetical and logical calculations.


Control unit controls all the peripheral devices connected to the microprocessors.
Memory is a one which is used to store some data or information.

Best Example for a microprocessor will be our Personal Computer.

Micro Controllers:

These are the ones which are similar to that of a microprocessor which
performs arithmetic and logical calculations. These have additional advantage to
that it is having additional inbuilt features like:
FIGURE 1.3 BLOCK OF MICRO CONTROLLERS

1. Electrically Erasable Programmable Read Only Memory (EEPROM)

2. Universal Synchronous Asynchronous Receiver and Transmitter (USART).

3. Analog to Digital Converter (ADC).

4. Digital to Analog Converter (DAC).

5. Oscillators.

6. Timers.

7. Many others.

The output of a microcontroller is a always in integer format only. It cannot provide


accurate values or floating point values.

Best Example for Micro Controller will be Traffic Light Controller.

Out of all these Processors, we are using Micro Controllers.


Coming to the software point of View, we have many software languages. Out of
all, we are using Assembly Level Language to load the program in to the controller.

ALP coding is done and loaded into the microcontroller. These are different
companies that manufacture Microcontrollers like Atmel, Motorola, Intel, Philips,
PIC, etc.

We are using Atmel manufactured microcontrollers. Atmel Company manufactures


different series of microcontrollers like

AT89C, AT90S, AT Mega, ATCAN. Here we are using AT Mega


Microcontrollers. Again in AT Mega we are having different AT Mega 8, AT Mega
8515, AT Mega 16, AT Mega 32,

AT Mega 162v, etc. Here, in this project we are using AT89c51 Microcontroller.

Applications of Embedded System:

Embedded Controllers may be found in many different kinds of system and are
used for many different applications. The list, which follows, is a indicative rather
than exhaustive. An item in the list may be relevant to a particular company because
either

(a) It is or involves a core process or product,

(b) It is or involves an ancillary function or services performed by the company or

(c) It refers to a product or services provided by a contractor under some form of


agreement and the vulnerability of the supplier may need to be considered.

List of Applications of Embedded Systems:

(a) Manufacturing and process control:

 Manufacturing plants.

 Water and sewage systems.


 Power stations.

 Power grid systems.

 Oil refineries and related storage facilities.

 Bottling plants.

 Automated factories.

 Simulators.

 Test equipment for control system development, maintenance and testing.

(b) Construction industry:

 Surveying and location Equipment.

 Construction Plant.

(c) Transport:

 Aero planes

 Trains and Buses.

 Marine craft (known cases include: radar mapping; ballast monitoring; cargo
loading; ship main control system)

 Automobiles

 Fuel services.

 Air Traffic Control Systems.

 Signalling system.

 Radar Systems.

 Traffic Lights.
 Ticketing systems and Machines.

 Car Parking and other meters.

(d) Buildings and premises:

 Electrically supply- supply, measurement, control, protection.

 Backing lighting and generators.

 Fire control systems.

 Heating and ventilating systems.

 Lifts Elevators, escalators.

 Security Systems.

 Security Cameras.

 Door locks.

(e) Domestic service:

 Catering.

 Cleaning.

(f) Communications:

 Telephone.

 Cable systems.

 Telephone switches.

 Satellites.

(g) Office systems and mobile management:

 Telephone systems
 Faxes and Copier.

 Time recording systems.

 Mobile telephones

 Still and Video Cameras.

(h) Banking, Finance and Commercial:

 Automated teller systems.

 Credit card Systems.

 Point of scale systems including scanner / cash systems.

1.3 Introduction to ac motors

Custom AC motors fall into two main categories: synchronous and


asynchronous. The most common type of asynchronous motor is the AC induction
motor, which custom motor manufacturers make using an AC transformer with a
rotating secondary. In this type of motor, the primary winding, or stator, connects
to the power source while the shorted secondary member, or rotor, carries the
induced secondary current. The action of rotor currents on the air-gap flux
produces torque. An asynchronous motor, on the other hand, is in a separate AC
motor class because of the differences in de made by our AC motor manufacturers
that can be tailored to your exact specifications.

1.3.1 Asynchronous VS Synchronous AC Motors


Asynchronous Induction AC Motors Overview

Figure 1.4 asynchronous machines

Asynchronous AC Motors
All induction motors are asynchronous motors. As one of the simplest, most
rugged electric motors, AC induction motors have two basic electrical assemblies:
a wound stator and rotor assembly. The motor derives its name from the currents
flowing into the rotor, which alternating currents flowing in the primary member,
or stator, induce. The combined magnetic effects of stator and rotor currents
produce the force needed to create a rotation.

AC motors, including, AC induction motors, have rotors with laminated,


cylindrical iron cores with slots for receiving conductors. The most common type
of rotor made by AC motor manufacturers is sometimes referred to as a “squirrel
cage,” which has cast-aluminum conductors and short-circuiting end rings. The
squirrel cage rotates when the moving magnetic field creates a current in the
shortened conductors.

In an AC motor, the speed at which the magnetic field rotates is referred to as the
synchronous speed (ns). This speed is determined by the number of poles in the
stator and the power supply’s frequency. The formula to calculate an AC motor’s
synchronous speed is ns = 120f/p.
 ns: synchronous speed in rpm
 f: line voltage frequency in Hz
 p: number of poles

Synchronous speed is the absolute upper limit of an AC motor’s speed. If a rotor


turns exactly as fast as the rotating magnetic field, the rotor conductors cut no lines
of force and produces no torque.

As an AC motor runs, the rotor always rotates slower than the magnetic field. The
rotor’s speed is just slow enough to cause the proper amount of rotor current flow
to allow the resulting torque to be sufficient enough to drive the load and overcome
windage and friction losses.

The speed difference between an AC motor’s rotor and magnetic field is referred to
as “slip.” Slip is the percentage of synchronous speed. The formula to calculate slip
is s = 100 (ns – na)/ns.
 s = slip
 ns = synchronous speed
 na = actual speed

Synchronous Motors Overview


Synchronous motors have a special rotor construction that allows them to rotate at
the same speed as the stator field. In other words, they operate in absolute
synchronism with line frequency. The major types of synchronous motors include
nonexcited and direct-current-excited motors. Similar to induction AC motors, the
speed of synchronous motors is determined by the number of pairs of poles. It’s
calculated by the ratio of the line frequency.

Custom motor manufacturers design synchronous motors in a range of sizes, from


subfractional self-excited units to large-horsepower, direct-current-excited AC
motors for industrial drives. In the fractional-horsepower range, synchronous
motors serve to provide precise constant speed.

When applied to industrial loads, synchronous motors with large horsepower


ratings serve two important functions:
 Provide a highly efficient means of converting AC energy into mechanical
power
 Operate at leading or unity power factor, thus providing power-factor
correction

Synchronous Non-Excited Electric Motors

AC motor manufacturers create nonexcited electric motors using reluctance and


hysteresis designs. They use a self-starting circuit and require no external
excitation supply.

Synchronous Direct-Current-Excited Electric Motors

DC-excited electric motors are available in sizes larger than 1 hp. To operate, they
require a direct current supplied through slip rings for excitation. The motor
receives a direct current from a separate source or a DC generator connected to the
AC motor shaft.

Single-phase and polyphase synchronous motors must be driven or have their rotor
connected in the form of a self-starting circuit in order to start. Because the electric
motor field rotates at a synchronous speed, the electric motor must be accelerated
before it can pull into synchronism. Accelerating from zero speed requires slip
until achieving synchronism. Consequently, it’s important to employ a separate
means to start.

In self-starting electric custom AC motor designs, fhp sizes use starting methods
common to induction electric motors, such as split-phase, capacitor-start,
repulsion-start, and shaded-pole. The motors automatically switch to synchronous
operation because of the electrical characteristics.

DC-excited motors use a squirrel cage called an amortisseur or damper winding to


start. Incidentally, the motor’s inherent low starting torque and need for a DC
power source require a starting system that:
 Provides full electric motor protection while starting
 Applies DC field excitation at the proper time
 Removes field excitation at rotor pull out (maximum torque)
 Protects the electric motor’s squirrel-cage winding against thermal damage
during out-of-step conditions
A Look at Torque in Direct-Current-Excited Electric Motors

Pull-Up Torque

An electric motor’s pull-up torque is defined as the minimum torque created from


a standstill to the pull-in point. This torque must exceed the load torque enough to
maintain a satisfactory acceleration rate under normal voltage conditions.

Reluctance Torque

A motor’s reluctance torque is the result of the rotor pole pieces’ saliency, which is
the preferred direction of magnetization. It pulsates at speeds below synchronous.

Reluctance torque influences the motor’s pull-in and pull-out torques as the
unexcited salient-pole rotor tends to align with the stator electric motor’s magnetic
field to maintain minimum magnetic reluctance. An electric motor’s reluctance
may be enough to pull a lightly loaded, low-inertia system into synchronism and
develop a pull-out torque of approximately 30 percent.

Synchronous Torque

An electric motor’s synchronous torque is the torque created after the application
of excitation. It represents the total steady-state toque available to drive a load. The
torque maxes out at about 70 lag of the rotor behind the rotating stator magnetic
field. The maximum value, however, is the pull-out torque.

Pull-Out Torque

Pull-out torque is the maximum sustained torque an electric motor develops at a


synchronous speed for one minute with rated frequency and normal excitation.
Normal pull-out torque is typically 150 percent of full-load torque for unity-power-
factor electric motors. It’s 175 to 200 percent for 0.8-leading-power-factor electric
motors.

Pull-In Torque

A synchronous motor’s pull-in torque is the torque developed when pulling the
connected inertia load into synchronism upon the application of excitation. It’s
developed during the transition from slip speed to synchronous speed, as electric
motors change from induction to synchronous operation. This tends to be the most
critical period when starting a synchronous motor. At synchronous speed, the
torque developed by the amortises and field windings becomes zero. As a result,
only the reluctance and synchronizing torque provided by exciting the field
windings are effective at the pull-in point.

Additional Custom AC Motor Design Types

Polyphase AC Motors

Polyphase squirrel-cage AC motors, such as three-phase motors, are constant-


speed machines. They have some degree of flexibility in operating characteristics
when modifying the rotor slot design. Variations in AC motors produce changes in
current, torque and full-load speed. Standardization and innovation have produced
four fundamental types of AC motors:

Designs A and B Characteristics


 General-purpose AC motor with normal starting torques and currents, as
well as low slip
 Fractional polyphase AC motors are generally design B
 Because design B has drooping characteristics, a polyphase AC motor with
the same breakdown, or maximum, torque as a single-phase AC motor can’t
attain the same speed-torque point for a full-load speed as single-phase custom
AC motor designs
 Breakdown torque must be higher for comparable full-load speeds (a
minimum of 140 percent of the breakdown torque of single-phase, general-
purpose AC motors)

Design C Characteristics
 High starting torque with a normal starting current and low slip
 Used where breakaway loads are high at starting, but normally run at the
rated full load
 Not subject to high overload demands after reaching the running speed

Design D Characteristics
 High slip that allows speed to drop when encountering fluctuating loads
 Low starting current
 Low full-load speed
 This design can be divided into several sub-groups that vary by slip or the
shape of the speed-torque curve

Design F Characteristics
 Low starting torque
 Low starting current
 Low slip
 Custom motor manufacturers build the AC motors to obtain low locked-
rotor current
 Locked-rotor and breakdown torque are low
 The motors are generally used when the starting torque is low and high
overloads aren’t imposed after reaching the running speed

Wound-Rotor AC Motors

Squirrel-cage AC motors are relatively inflexible in regard to speed and torque


characteristics. A special wound-rotor AC motor, however, has controllable speed
and torque. The applications of wound-rotor AC motors are markedly different
from squirrel-cage AC motors because of the rotor circuit’s accessibility.
Obtaining the AC motor’s performance characteristic is a matter of inserting
different resistance values in the rotor circuit.

A secondary resistance in the rotor circuit generally starts wound-rotor AC motors.


The AC motor’s resistance is then sequentially reduced to allow the motor to come
up to speed. As a result, AC motors can develop significant torque while limiting
the locked-rotor current. AC motor manufacturers can design this secondary motor
resistance for continuous service to dissipate the heat produced by continuous
operation at reduced speeds, frequent acceleration, or acceleration with large
inertia loads.
External resistance gives AC motors a characteristic that results in large drops in
rpm for a small change in load. Reduced AC motor speed is provided down to
about 50 percent rated speed, but efficiency remains low.
Multi-Speed AC Motors

Custom motor manufacturers design consequent-pole AC motors to operate at one


speed. By physically reconnecting the leads, they can achieve a 2:1 speed ratio.
Typical speeds for 60-Hz AC motors are:
 3,600/1,800 rpm (2/4 pole)
 1,800/900 rpm (4/8 pole)
 1,200/600 rpm (6/12 pole)

Two-winding AC motors have two individual windings that manufacturers can


wind for any number of poles to facilitate obtaining other speed ratios. Ratios
greater than 1:4, however, are impractical because of an AC motor’s size and
weight. Single-phase AC motors generally have a variable-torque design.
However, constant-torque and constant-horsepower AC motors are also available.

The power output of AC motors can be proportioned to each different speed. Such
custom AC motor designs have output horsepower capacity in accordance with one
of the following load characteristics:
 Variable torque: These AC motors have speed-torque characteristics that
vary with the square of the speed. For instance, a 1,800/900-rpm electrical motor
that develops 10 hp at 1,800 rpm produces 2.5 hp at 900 rpm. Because AC
motors face loads—such as centrifugal pumps, fans and blowers—their torque
requirement vary with the square or cube of the speed. This motor characteristic
is generally adequate.
 Constant torque: These AC motors can develop the same torque at each
speed. As a result, the power output varies directly with speed. For example, an
AC motor rated at 10 hp at 1,800 rpm produces 5 hp at 900 rpm. You’ll find
these motors in applications with constant torque requirements, such as mixers,
conveyors and compressors.
 Constant horsepower: These AC motors develop the same horsepower at
each speed. Torque is inversely proportional to speed. Applications for such AC
motors include machine tools, including drills, milling machines and lathes.
Single-Phase AC Motors

Single-phase induction AC electric motors are commonly fractional-horsepower


types. However, single-phase integral-horsepower is available in the lower
horsepower range. The most common fractional-horsepower single-phase AC
motors are:
 Split-phase
 Capacitor-smart
 Permanent split-capacitor
 Shaded pole

This custom AC motor design is available in multi-speed types, but there are
practical limits to the number of speeds obtained. Those with two-, three- and four-
speed motors are available. Consequent-pole or two-winding methods may
accompany speed selection.

Figure 1. Universal Motors

Universal Motors

Universal motors operate with nearly equivalent performance on direct or


alternating currents up to 60 Hz. AC motors differ from DC motors because of
their winding ratios and thinner iron laminations. DC motors can run on an
alternating current, but with poor efficiency. Universal motors may operate on a
direct current with an essentially equivalent AC motor performance. However,
they have poorer commutation and brush life compared to an equivalent DC motor.
An important characteristic of universal AC motors is they have the highest
horsepower-per-pound ratio of any AC motor because they operate at speeds many
times higher than that of any 60-Hz electric motor.

When operated without a load, universal motors tend to run away. Speed is limited
only by windage, friction and commutation. Therefore, large universal motors are
almost always connected directly to the load to limit speed. On portable tools, such
as electric saws, the load imposed by the gears, bearings and cooling fan is enough
to hold the no-load speed down to a safe value.

With a universal motor, speed control is simple because the electric motor speed is
sensitive to voltage and flux changes. A rheostat or adjustable autotransformer
allows the AC motor’s speed to be readily varied from top speed to zero.
Timing Electric Motors

Timing electric motors are rated under 1/10 hp and are used as the prime movers
for timing devices. Because the motor is used as a timer, it must run at a constant
speed.

AC and DC electric motors may be used as timing motors. DC electric timing


motors serve portable applications or when high acceleration and low speed
variations are required. While some form of mechanical or electrical speed
governor is required, such electric motors offer advantages, including:
 50 to 70 percent efficiency
 Starting torque as high as 10 times the running torque
 Relatively easy speed control

AC Servo Motors
Servo motors are used in AC servomechanisms and computers that require rapid,
accurate response characteristics. To obtain these characteristics, servo motors
have small-diameter, high-resistance rotors. The smaller diameter provides low
inertia for fast starts, stops and reversals. The high resistance allows for a nearly
linear speed-torque relationship for accurate control.

Custom motor manufacturers wind servo motors with two phases physically at
right angles or in-space quadrature. The motors feature a fixed or reference
winding that’s excited from a fixed voltage source. The control winding is excited
by an adjustable or variable control voltage, usually from a servoamplifier.
Engineers design servo motor windings with the same voltage-turn ratio so the
power inputs at maximum fixed-phased excitation and the maximum control-phase
signal are balanced.

In an ideal servo motor, torque at any speed is directly proportional to the motor’s
control-winding voltage. However, this relationship only exists at zero speed
because of the inherent inability of an induction servo motor to respond to voltage
input changes under light load conditions.
The inherent damping of servo motors decrease as ratings increase, and the motors
have a reasonable efficiency at the sacrifice of speed-torque linearity. Many larger
servo motors have integral auxiliary blowers to maintain temperatures within safe
operating ranges. AC servo motors are available in power ratings from less than 1
to 750 W, in sizes ranging from 0.5- to 0.7-inch OD. Most AC servo motors are
with modular or built-in gearheads.
CHAPTER-2
LITERATURE
2.1 HISTORY OF HEALTH MONITORING SYSTEM

In the first demo showed a calendar type navigation which included the daily heart rate and stress
level graph. We also computed the minimum, maximum and average heart rate and showed it in the
form of a dial. There was a comparison graph shown between a user heart rate and heart rates for a
good, average and athletic heart rate for the person of the same age. The basic of login, profile update
and delete were done in this demo.
In the final demo, all the various components were completed, integrated and tested together. The
File upload module was made fool proof so that user can upload only.csv file. The monthly heart rate
and calories computation were made functional. As suggested by Dr. Marsic the calendar style
navigation was scrapped and the new timeline navigation system was implemented to improve the
visual appeal of the system. We also computed the calories burnt for an activity e.g. for exercising,
sleeping and resting. The heart condition which was the crux of our system was also made available
to the user. We were not able to implement the monthly stress level as we were unable to quantify as
to how more variation in heart rate corresponds to lesser stress.

We took Dr. Marsic’s testing and exercising heart rate and fed it into the system. These records were
analyzed by our system which gave us three results. First, that Dr. Marsic’s heart condition is normal
(and not Tachycardia or Bradycardia), secondly that the professor has athletic heart rate and lastly
that during the exercise the maximum heart rate went up to 125bpm which was less than the
maximum bpm for the person of his age and he could push himself more during the exercise.
Some our key accomplishments are:
● We could show the raw data in a graphical representation
● We could compare the raw data with the data present in the literature
● We could show the heart condition (Normal, Tachycardia and Bradycardia) for the user
● We could foolproof the system of upload file.
● We implemented all Use Cases into the website.

It is an object of the present invention to provide a system for monitoring an individual that measures
the acceleration of at least one body part of the person.

It is also an object of the present invention to transmit or otherwise communicate the acceleration
data, or interpret these data and transmit the result, to a remote location.

It is also an object of the present invention to measure the acceleration in three dimensions and in
magnitude such that the direction and severity of the acceleration can be determined.

It is also an object of the present invention to provide an interpretive algorithm to determine whether
a person wearing a system has fallen.

It is another object of the present invention to provide such a system for monitoring individuals that
is inexpensive and easy to operate.
It is yet another object of the present invention to provide a system for monitoring an individual
which is ergonomically designed so it will not interfere or will minimally interfere with the mobility
of the individual in the performance of exercise or other tasks.

It is yet another object of the invention to provide a system for monitoring an individual which can be
used in both an unsupervised (e.g. home) and a supervised (e.g. hospital, nursing home) environment.

It is still another object of the present invention to provide such a monitoring system which will
identify the user in need of attention.

These and other objects not specifically recited are realized in a system for monitoring physical
activity of a person in accordance with the principles of the present invention. The system generally
comprises sensor means disposed on at least one body part of the person for measuring a magnitude
and relative direction of acceleration of movement of the body part and generating a signal indicative
of the measured acceleration, a processing means associated with the sensor means for receiving the
signal from the sensor means and converting the signal into data, means for interpretation of said
data, a first communication means associated with the processor means for sending the data to a
remote location, and a second communication means for receiving the data from the first
communication means at some remote location.

Preferably, the sensor means comprises at least one accelerometer, such as a multi-dimensional
accelerometer capable of measuring acceleration in more than one direction. Alternatively, the sensor
means could be comprised of a plurality of accelerometers positioned in different orientations such
that an acceleration in any direction can be extrapolated by the accelerations indicated by each of the
accelerometers.

In addition, it is preferable that the processing means comprises a microprocessor and further
includes software and/or firmware capable of determining whether a fall has occurred, the severity of
a fall, and the body position of the person after the fall.

It is also preferable that the communications mean comprises a device capable of communicating by
local RF, cellular networks, and/or telephone land lines. Likewise, the second communications mean
can receive signals by local RF, cellular networks, and/or telephone land lines.

In a preferred embodiment, the processing means can compare the sensor data with predetermined
acceptable ranges and storing the sensor data. The stored data can be transmitted on schedule, upon
detection of a predetermined state, or can be retrieved on demand. If the sensor data is outside the
acceptable ranges, the system further may include an alarm for generating a humanly perceptible
alarm. In a preferred embodiment, the alarm is associated with the second communications means.

In yet another preferred embodiment, the second communications means further includes a display
for displaying information indicative of the data such as the severity of the fall and the current
position of the person.
It is also contemplated that the second communications mean includes a data storage mechanism
storing a plurality of acceptable ranges of accelerations and a processor for comparing data received
from the first communications means with the acceptable ranges stored in the data storage
mechanism. Likewise, the data storage mechanism may include storage means for storing sensor data
received from the first communications means. In yet another preferred embodiment, the system in
accordance with the present invention includes at least one physiological sensor for being disposed
on the person capable of generating a signal indicative of the physiological condition. The
physiological sensor is in communication with the processing device preferably by means of a
wireless local area network relative to the body of the user. The physiological sensor may comprise a
pulse sensor, a blood pressure sensor and/or a temperature sensors.

In traditional method, doctors play an important role in health checkup. For this process requires a
lot of time for registration, appointment and then checkup. Also, reports are generated later. Due to
this lengthy process working people tend to ignore the checkups or postpone it. This modern
approach reduces time consumption in the process.

In the recent years use of wireless technology is increasing for the need of upholding various sectors.
In these recent years IoT groped the most of industrial area specially automation and control. Biomedical
is one of recent trends to provide better health care. Not only in hospitals but also the personal health care
facilities are opened by the IoT technology. So, having a smart system, various parameters are observed
that consume power, cost and increase efficiency. In accordance with this smart system, this paper is
reviewed.
2.2 PROJECT AIM

The Aim of this project is to develop a microcontroller based health monitoring system to find out the
patient parameters.; Temperature, Pulse rate and ECG by using IoT Technology with a cloud.

2.3 PROJECT OBJECTIVE

The objective of this project is to implement a low cost, compact, reliable wireless health monitoring
system which can monitor the patient parameters using an android BLYNK app.

2.4 Components required

● Node MCU
● Pulse sensor
● ECG sensor
● Temperature sensor
● THINGSPEAK(cloud)
CHAPTER-3
METHODOLOGY
3.1 METHODOLOGY

GSM, Global System for Mobile communications, is today the most successful digital
mobile telecommunication system. This second-generation (2G) system provides voice and
limited data services and uses digital modulation with improved audio quality.

3.2 PRELIMINARY CONSIDERATIONS

Before the actual design of the project work, specific deliberate choices in selection, appropriate
implementation platform and hardware components were made. Priority was given to low cost
availability, reliability, flexibility and simplicity in all these selections.

3.3 SELECTION OF IMPLEMENTATION PLATFORM

There are many platforms over which a speed control of an ac motor can be implemented. Of the
currently available platforms is too expensive and complex for a health monitoring system. While
infrared, Bluetooth and GSM are more reliable due to their small bandwidth and network coverage
range. So, we would prefer for GSM technology which is rather a new and emerging technology in
the field of wireless communication.
It is also found more appropriate due to their low-cost availability, reliability and simplicity when
used for a health monitoring system.

3.4 SELECTION OF HARDWARE COMPONENTS


Each platform has a set of hardware components over which it is implemented. For serial
communication, we will be using the MAX232 which is compatible for serial communication and the
desired one for most of the speed control of ac motor due to its advanced features. For the wireless
communication, we would be using a GSM module. It is low cost, reliable and capability which is
more advanced and desired
3.5 BLOCK DIAGRAM

Figure 3.1. BLOCK DIAGRAM OF SYSTEM


.

CHAPTER-4
HARDWARE
4.1 GSM module
GSM Mobile communication system can be intelligently used by electronic devices that can collect some
data and send it to the central place using SMS or GSM data call. It’s required In-Vehicle Tracking
Systems because GPS (Global Positioning System) can normally only receive location information from
the satellites but cannot communicate back with them. Hence we need some other communication system
like GSM to send this location information to the central control room. Other technologies can also be used
but they are more costly.

 AT - Returns a "OK" to confirm that modem is working


 ATD - Mobile originated call to dial able number
 ATH - disconnect existing connection
 AT+CMGS - send the SMS message to
 AT+CMGF=1 - Select format for incoming and outgoing messages: zero for PDU
mode, one for Text mode.
 AT+CMGD=1- delete the SMS message
 AT+CMGR - read the SMS message
 AT+IPR - baud rate setting

4.1.0 Versions of gsm

 The different versions of GSM are:

 GSM 900 band (850-915MHz up-link frequency and 935-960MHz downlink frequency)

 GSM 1800 band or digital cellular system (DCS) 1800 band (1710-1785MHz up-link frequency and
1805-1880MHz downlink frequency)

 Personal Communication service (PCS) 1900 band (1850-1910MHz up-link frequency and 1930-
1990MHz downlink frequency)
Figure.4.2 Layout of generic GSM network.
4.2 MAX232 :

The MAX232 is an integrated circuit first created in 1987 by Maxim Integrated Products that


converts signals from a TIA-232 (RS-232) serial port to signals suitable for use in TTL-compatible
digital logic circuits. The MAX232 is a dual transmitter / dual receiver that typically is used to
convert the RX, TX, CTS, and RTS signals.

The drivers provide TIA-232 voltage level outputs (about ±7.5 volts) from a single 5-volt supply by
on-chip charge pumps and external capacitors. This makes it useful for implementing TIA-232 in
devices that otherwise do not need any other voltages.

The receivers reduce TIA-232 inputs, which may be as high as ±25 volts, to standard 5
volt TTL levels. These receivers have a typical threshold of 1.3 volts and a typical hysteresis of 0.5
volts.

The MAX232 replaced an older pair of chips MC1488 and MC1489 that performed similar RS-232
translation. The MC1488 quad transmitter chip required 12 volt and -12 volt power,[1] and MC1489
quad receiver chip required 5 volt power.[2] The main disadvantages of this older solution was the
+/- 12 volt power requirement, only supported 5 volt digital logic, and two chips instead of one.

4.2.1 Versions

The later MAX232A is backward compatible with the original MAX232 but may operate at
higher baud rates and can use smaller external capacitors – 0.1 μF in place of the 1.0 μF capacitors
used with the original device.[3] The newer MAX3232 and MAX3232E are also backwards
compatible, but operates at a broader voltage range, from 3 to 5.5 V.[4][5]

Pin-to-pin compatible versions from other manufacturers are ICL232, SP232, ST232, ADM232 and
HIN232. Texas Instruments makes compatible chips, using MAX232 as the part number.

Voltage level

The MAX232 translates a TTL logic 0 input to between +3 and +15 V, and changes TTL logic 1
input to between −3 and −15 V, and vice versa for converting from TIA-232 to TTL. (Note that TIA-
232 uses opposite voltages for data and control lines, see RS-232 voltage levels.)

TABLE 4.1 VOLTAGE LEVEL OF MAX232


TIA-232 TTL voltage to/from
TIA-232 line type and logic level
voltage MAX232

Data transmission (Rx/Tx) logic 0 +3 V to +15 V 0 V

Data transmission (Rx/Tx) logic 1 −3 V to −15 V 5 V


Control signals (RTS/CTS/DTR/DSR)
−3 V to −15 V 5 V
logic 0

Control signals (RTS/CTS/DTR/DSR)


+3 V to +15 V 0 V
logic 1

Figure.4.3 MAX232
4.3 ATEL AT89S52 MICROCONTROLLER

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-
system programmable Flash memory. The device is manufactured using Atmel’s high-density
nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction
set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system
or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with
in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful
microcontroller which provides a highly-flexible and cost-effective solution to many embedded
control applications. The AT89S52 provides the following standard features: 8K bytes of Flash,
256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters,
a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock
circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency
and supports two software selectable power saving modes. The Idle Mode stops the CPU while
allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning.
The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other
chip functions until the next interrupt or hardware reset.

4.3.1 FEATURES

1. Compatible with MCS-51 Products

2. 8K Bytes of In-System Programmable (ISP) Flash Memory Endurance: 1000 Write/Erase


Cycles

3. 4.0V to 5.5V Operating Range

4. Fully Static Operation: 0 Hz to 33 MHz


5. Three-level Program Memory Lock

6. 256 x 8-bit Internal RAM

7. 32 Programmable I/O Lines

8. Three 16-bit Timer/Counters

9. Eight Interrupt Sources

10. Full Duplex UART Serial Channel

11. Low-power Idle and Power-down Modes

12. Interrupt Recovery from Power-down Mode

13. Watchdog Timer

14. Dual Data Pointer

15. Power-off Flag

A micro-controller can be compared to a small standalone computer; it is a very powerful device,


which is capable of executing a series of pre-programmed tasks and interacting with other hardware
devices. Being packed in a tiny integrated circuit (IC) whose size and weight is usually negligible,
it is becoming the perfect controller for robots or any machines requiring some kind of
intelligent automation. A single microcontroller can be sufficient to control a small mobile robot,
an automatic washer machine or a security system. Any microcontroller contains a memory to
store the program to be executed, and a number of input/output lines that can be used to interact with
other devices, like reading the state of a sensor or controlling a motor.

Nowadays, microcontrollers are so cheap and easily available that it is common to use them instead
of simple logic circuits like counters for the sole purpose of gaining some design flexibility
and saving some space. Some machines and robots will even rely on a multitude of microcontrollers,
each one dedicated to a certain task. Most recent microcontrollers are 'In System Programmable',
meaning that you can modify the program being executed, without removing the microcontroller
from its place.

Today, microcontrollers are an indispensable tool for the robotics hobbyist as well as for the
engineer. Starting in this field can be a little difficult, because you usually can't understand
how everything works inside that integrated circuit, so you have to study the system gradually, a
small part at a time, until you can figure out the whole image and understand how the system
works.
Figure 4.3 BLOCK DIAGRAM

4.3.2 PIN DISCRIPTION

SYMBOL PIN DIP-40 TYPE DESCRIPTION


P0.0 TO 39-32 I/O Port 0: Port 0 is an 8-bit open drain
P0.7 bidirectional I/O port. As an output port,
each pin can sink eight TTL inputs. When
1s are written to port 0 pins, the pins can
be used as high-impedance inputs. Port 0
can also be configured to be the
multiplexed low-order address/data bus
during accesses to external program and
data memory. In this mode, P0 has
internal pull-ups. Port 0 also receives the
code bytes during Flash programming and
outputs the code bytes during program
verification. External pull-ups are required
during program verification.
P1.0 TO 01-08 I/O with Port 1: Port 1 is an 8-bit bidirectional I/O
P1.7 internal port with internal pull-ups. The Port 1
pull-up output buffers can sink/source four TTL
inputs. When 1s are written to Port 1 pins,
they are pulled high by the internal
pullups and can be used as inputs. As
inputs, Port 1 pins that are externally
being pulled low will source current (IIL)
because of the internal pull-ups. In
addition, P1.0 and P1.1 can be
configured to be the timer/counter 2
external count input (P1.0/T2) and the
timer/counter 2 trigger input (P1.1/T2EX),
respectively, as shown in the following
table. Port 1 also receives the low-order
address bytes during Flash programming
and verification.
P1.0 1 I/O T2: External count input to Timer/Counter
2 or Clock-out from Timer/Counter 2
P1.1 2 I T2EX: Timer/Counter 2 capture/reload
trigger and
direction control
P1.2 3 I ECI: External clock input. This signal is the
external
Clock input for the PCA.
P1.3 4 I/O CEX0: Capture/compare external I/O for
PCA Module 0. Each capture/compare
module connects to a Port 1 pin for
external I/O. When not used by the PCA,
this pin can handle standard I/O.
P1.4 5 I/O SS: Slave port select input for SPI CEX1:
Capture/compare external I/O for PCA
Module 1
P1.5 6 I/O MOSI: Master Output Slave Input for SPI
CEX2: Capture/compare external I/O for
PCA Module 2
P1.6 7 I/O MISO: Master Input Slave Output for SPI
CEX3: Capture/compare external I/O for
PCA Module 3
P1.7 8 I/O SCK: Master Output Slave Input for SPI
CEX4: Capture/compare external I/O for
PCA Module 4
P2.0 TO 21-28 I/O Port 2: Port 2 is an 8-bit bi-directional I/O
P2.7 with port with Internal pull-ups. Port 2 pins are
internal pulled HIGH by the Internal pull-ups when
pull-up ‘1’s are written to them and can be used
as inputs in this state. As inputs, Port 2
pins that are externally pulled LOW will
source current (IIL) because of the
internal pull-ups. Port 2 sends the high-
order address byte during fetches from
external program memory and during
accesses to external Data Memory that
use 16-bit address (MOVX@DPTR). In this
application, it uses strong internal pull-ups
when transitioning to ‘1’s. Port 2 also
receives some control signals and a partial
of high-order address bits during the
external host mode programming and
verification.
P3.0 TO 10-17 I/O Port 3: Port 3 is an 8-bit bidirectional I/O
P3.7 with port with internal pull-ups. Port 3 pins are
internal pulled HIGH by the internal pull-ups when
pull-up ‘1’s are written to them and can be used
as inputs in this state. As inputs, Port 3
pins that are externally pulled LOW will
source current (IIL) because of the
internal pull-ups. Port 3 also receives
some control signals and a partial of high-
order address bits during the external
host mode programming and verification.
P3.0 10 I RXD: serial input port
P3.1 11 O TXD: serial output port
P3.2 12 I INT0: external interrupt 0 input
P3.3 13 I INT1: external interrupt 1 input
P3.4 14 I T0: external count input to Timer/Counter
0
P3.5 15 I T1: external count input to Timer/Counter
1
P3.6 16 O WR: external data memory write strobe
P3.7 17 O RD: external data memory read strobe
PSEN 29 I/O Program Store Enable: PSEN is the read
strobe for external program memory.
When the device is executing from
internal program memory, PSEN is
inactive (HIGH). When the device is
executing code from external program
memory, PSEN is activated twice each
machine cycle, except that two PSEN
activations are skipped during each access
to external data memory. A forced HIGH-
to-LOW input transition on the PSEN pin
while the RST input is continually held
HIGH for more than 10 machine cycles will
cause the device to enter external host
mode programming.
FIGURE 4.5 PIN DIADRAM
4.4 MICROCONTROLLER:
A microcontroller is an integrated chip with minimum required devices. The microcontroller includes a
CPU: ALU, PC,SP and registers, RAM, ROM, I/O ports, and timers like a standard computer, but because they are
designed to execute only a single specific task to control a single system, they are much smaller and simplified so
that they can include all the functions required on a single chip.

Fig 4.7: Microcontroller Block Diagram.

Most microcontrollers will also combine other devices such as:


 A Timer module to allow the microcontroller to perform tasks for certain time periods.
 A serial I/O port to allow data to flow between the microcontroller and other devices such as a PC or
another microcontroller.
 An ADC to allow the microcontroller to accept analogue input data for processing.
I/O
ALU TIMER/COUNTER PORTS

ACCUMULATOR
I/O
REGISTERS
PORTS
INTERNAL
RAM INTERNAL
CIRCUITS

INTERNAL
STACK POINTER ROM CLOCK CIRCUIT

PROGRAM COUNTER

Fig 4.8: Functional Block Diagram of Microcontroller.

4.5. MICROCONTROLLER vs. MICROPROCESSOR:


1. A microcontroller is meant to be more self-contained and independent, and functions as a tiny, dedicated
computer than microprocessor.
2. The microcontroller may function as a computer with addition of external digital parts; the microprocessor must
have many additional parts to be operational.
3. Most microprocessors have many operational codes (op codes) for moving data from external memory to the
CPU; microcontrollers may have one or two.
4. Microcontrollers are designed by using CMOS (complementary metal oxide semiconductor) technology, an
efficient fabrication technique that uses less power and is more immune to power spikes than other techniques.
4.6. ADVANTAGES OF MICROCONTROLLERS:
Their powerful, cleverly chosen electronics is able to control a variety of processes and devices (industrial
automatics, voltage, temperature, engines, etc) independently or by means of I/O instruments such as switches,
buttons, sensors, LCD screens, relays etc.
4.7. TYPES OF 8051 MICROCONTROLLER:
The 8051 has the widest range of variants of any embedded controller on the market. The smallest device is the
Atmel 89c1051, a 20 Pin FLASH variant with 2 timers, UART, 20mA. The fastest parts are from Dallas, with
performance close to 10 MIPS! The most powerful chip is the Intel Technologies 80C517A, with 32 Bit ALU, 2
UARTS, 2K RAM, PLCC84 package, 8 x 16 Bit PWMs, and other features.
Among the MAJOR manufacturers are:
AMD - Enhanced 8051 parts (no longer producing 80x51 parts)
Atmel - FLASH and semi-custom parts
Cygnal - Fastest 8051 with Flash with 12-bit 1LSB A/D. 20MHz internal clock
Dallas -Fast variant. Also battery backed
Intel -8051 through 80C51GB / 80C51Sl. They invented the 8051
ISSI -IS80C51/31 runs up to 40MHz
Matra - 80C154, low voltage static variants
OKI -80C154, mask parts
Philips -87C748 thru 89c588, mostly old legacy 8051 parts from
Signetics.
Infineon -80C501 through 80C517A, and a wide variety of CAN devices.
SMC - COM20051 with ARCNET token bus network engine
SSI - 80x52, 2 x HDLC variant for MODEM use
Microcontroller Architectural Block Diagram:
Atmel At89c51 Pin out and Description:
The smallest current device is the ATMEL 89c51, a 40 Pin FLASH variant with 2 timers, UART, 500mA. ATMEL
was the first with standard FLASH, and with more program cycles than other custom FLASH. These parts
compete with OTP and MASK product on price, but eliminate inventory problems and the hidden costs of OTP
development.
Why we go for AT89C51?
The AT89C51 is a low power, high performance CMOS 8-bit microcontroller with 4Kbytes of Flash
programmable and erasable read only memory (PEROM). This device is compatible with the industry standard
8051 instruction set and pinout. The on-chip Flash allows the program memory to be quickly reprogrammed using
a nonvolatile memory programmer such as the PG302 (with the ADT87 adapter). By combining an industry
standard 8-bit CPU with Flash on a monolithic chip, the 8951 is a powerful microcomputer which provides a
highly flexible and cost effective solution to many embedded control applications.

Features of AT89C51:
1. It is a 8-bit microcontroller.
2. It has a flash memory of 4KB for storing the program.
3. It has RAM of 128 bytes.
4. It has 32 I/O ports .
-Port 0 (pin 39 to pin 32).
-Port 1 (pin 1 to pin 8).
-Port 2 (pin 21 to pin 28).
-Port 3 (pin 10 to pin 17).
5. It has four register banks.
6. It has two 16-bit timers.
- Timer 0
- Timer 1
7. It has full duplex asynchronous serial port.
8. It can support up to 64KB of external memory with the help of PC and DPTR.
9. It has 16-bit address bus.
10. Six interrupts with two priority levels
-2 general purpose interrupts (INT0, INT1).
-4 preprogrammed interrupt ( Timer0,Timer1,Serial interrupt, Reset interrupt).
11. Wide range of frequency of operation (0 to 24 MHz).
12. It will operate on 5V dc supply.
13. It can support maximum of 500mA of current.
In addition, the 8951 is designed with static logic for operation down to zero frequency and supports two software
selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port
and interrupt system to continue functioning. The Power Down Mode saves the RAM contents but freezes the
oscillator disabling all other chip functions until the next hardware reset.

PINOUT DIAGRAM:
Fig : Microcontroller Pin Diagram.

.1–8: Port 1: Each of these pins can be used as either input or output. Also, pins 1 and 2 (P1.0 and P1.1) have
special functions associated with Timer 2.
.9: Reset Signal: High logical state on this input halts the MCU and clears all the registers. Bringing this pin back
to logical state zero starts the program anew as if the power had just been turned on. In another words, positive
voltage impulse on this pin resets the MCU. Depending on the device's purpose and environs, this pin is usually
connected to the push-button, reset-upon-start circuit or a brown out reset circuit. The image shows one simple
circuit for safe reset upon starting the controller. It is utilized in situations when power fails to reach its optimal
voltage.
Fig : Reset Circuit
.10-17: Port 3: As with Port 1, each of these pins can be used as universal input or output. However, each pin of
Port 3 has an alternative function:
.Pin 10: RXD - Serial input for asynchronous communication or serial output for synchronous communication.
 Pin 11: TXD - Serial output for asynchronous communication or clock output for synchronous
communication
 Pin 12: INT0 - Input for interrupt 0
 Pin 13: INT1 - Input for interrupt 1
 Pin 14: T0 - Clock input of counter 0
 Pin 15: T1 - Clock input of counter 1
 Pin 16: WR - Signal for writing to external (add-on) RAM memory
 Pin 17: RD - Signal for reading from external RAM memory
 18-19: X2 and X1: Input and output of internal oscillator. Quartz crystal controlling the frequency
commonly connects to these pins. Capacitances within the oscillator mechanism (see the image) are not
critical and are normally about 30pF. New MCUs work at frequencies from 0Hz to 50MHz+.
Fig : Clock Circuit.
.20: GND: Ground
 21- 28: Port 2: If external memory is not present, pins of Port 2 act as universal input/output. If external
memory is present, then these pins serve as the location of the higher address byte, i.e. addresses A8 – A15.
It is important to note that in cases when not all the 8 bits are used for addressing the memory (i.e. memory
is smaller than 64kB), the rest of the unused bits are not available as input/output.
 29: PSEN: MCU activates this bit (brings to low state) upon each reading of byte (instruction) from
program memory. If external ROM is used for storing the program, PSEN is directly connected to its
control pins.
 30: ALE: Before each reading of the external memory, MCU sends the lower byte of the address register
(addresses A0 – A7) to port P0 and activates the output ALE. External register (74HCT373 or 74HCT375
circuits are common), memorizes the state of port P0 upon receiving a signal from ALE pin, and uses it as
part of the address for memory chip. During the second part of the mechanical MCU cycle, signal on ALE
is off, and port P0 is used as Data Bus. In this way, by adding only one cheap integrated circuit, data from
port can be multiplexed and the port simultaneously used for transferring both addresses and data.
 31: EA: Bringing this pin to the logical state zero designates the ports P2 and P3 for transferring addresses
regardless of the presence of the internal memory. This means that even if there is a program loaded in the
MCU it will not be executed, but the one from the external ROM will be used instead. Conversely, bringing
the pin to the high logical state causes the controller to use both memories, first the internal, and then the
external (if present).
 32-39: Port 0: Similar to Port 2, pins of Port 0 can be used as universal input/output, if external memory is
not used. If external memory is used, P0 behaves as address output (A0 – A7) when ALE pin is at high
logical level, or as data output (Data Bus) when ALE pin is at low logical level.
 40: VCC: Power +5V
INPUT – OUTPUT (I/O) PORTS:
Every MCU from 8051 family has 4 I/O ports of 8 bits each. This provides the user with 32 I/O lines for
connecting MCU to the environs.
Port 0:
Port 0 has two fold role: if external memory is used, it contains the lower address byte (A0-A7), otherwise all
bits of the port are either input or output. Another feature of this port comes to play when it has been designated as
output. Port 0 lacks the "pull up" resistor (resistor with +5V on one end). Therefore, to get one (5V) on the output,
external "pull up" resistor needs to be added for connecting the pin to the positive pole.
Port 1:
This is "true" I/O port, devoid of dual function characteristic for Port 0. Having the "pull up" resistor, Port 1
is fully compatible with TTL circuits.
Port 2:
When using external memory, this port contains the higher address byte (addresses A8–A15). Otherwise, it can be
used as universal I/O port.
Port 3:
Beside its role as universal I/O port, each pin of Port 3 has an alternate function. In order to use one of these
functions, the pin in question has to be designated as input, i.e. the appropriate bit of register P3 needs to be set.
From a hardware standpoint, Port 3 is similar to Port 0.
Memory in 8051 Microcontroller:
The 8051 has three very general types of memory. The memory types are illustrated in the following figure: On-
Chip Memory, External Code Memory, and External RAM.
Fig : Memory Block Diagram.
On-Chip Memory refers to any memory (Code, RAM, or other) that physically exists on the microcontroller itself.
External Code Memory is code (or program) memory that resides off-chip. This is often in the form of an external
EPROM. External RAM is RAM memory that resides off-chip. This is often in the form of standard static RAM or
flash RAM.
During the runtime, microcontroller uses two different types of memory: one for holding the program being
executed (ROM memory), and the other for temporary storage of data and auxiliary variables (RAM memory).
ROM memory:
In this MCU contain 4 kilobytes of the flash memory on the chip. It is of EEPROM. We can use 12v to program
MCU. This option is cost-effective only for large series. The main purpose of ROM is to store the programs to be
executed.
RAM memory:
RAM is used for storing temporary data and auxiliary results generated during the runtime. Apart from that, RAM
comprises a number of registers: hardware counters and timers, I/O ports, buffer for serial connection, etc. With
older versions, RAM spanned 256 locations, while new models feature additional 128 registers. First 256 memory
locations form the basis of RAM (addresses 0 – FFh) of every 8051 MCU. Locations that are available to the user
span addresses from 0 to 7Fh, i.e. first 128 registers, and this part of RAM is split into several blocks as can be
seen in the following figure.
Fig: Ram Memory.
The main purpose of RAM is to provide synchronization between ROM and CPU so as to increase the speed of
microcontroller.

Bit Memory:
The 8051, being a communications-oriented microcontroller, gives the user the ability to access a number of bit
variables. These variables may be either 1 or 0. There are 128 bit variables available to the user, numbered 00h
through 7Fh.
Special Function Register (SFR) Memory:
Special Function Registers (SFRs) are areas of memory that control specific functionality of the 8051 processor. It
may appear that SFR is part of Internal Memory. However, when using this method of memory access (its called
direct address), any instruction that has an address of 00h through 7Fh refers to an Internal RAM memory address;
any instruction with an address of 80h through FFh refers to an SFR control register.
Register Banks:
General Purpose registers:
The 8051 uses 8 "R" registers which are used in many of its instructions. These "R" registers are numbered from 0
through 7 (R0, R1, R2, R3, R4, R5, R6, and R7). These registers are generally used to assist in manipulating values
and moving data from one memory location to another.
SFR Registers (Special Function Registers):
SFR registers can be seen as a sort of control panel for managing and monitoring the microcontroller.
Fig : Special Function Registers.

TIMERS:
The 8051 comes equipped with two timers, both of which may be controlled, set, read, and configured
individually. The 8051 timers have three general functions:
1) Keeping time and/or calculating the amount of time between events,
2) Counting the events themselves, or
3) Generating baud rates for the serial port.
USING TIMERS TO MEASURE TIME:
Obviously, one of the primary uses of timers is to measure time. When a timer is used to measure time it is
also called an "interval timer" since it is measuring the time of the interval between two events. .
Timer SFRs:
The 8051 has two timers which each function essentially the same way. One timer is TIMER0 and the other is
TIMER1. The two timers share two SFRs (TMOD and TCON) which control the timers, and each timer also has
two SFRs dedicated solely to itself (TH0/TL0 and TH1/TL1).
An SFR has a numeric address. It is often useful to know the numeric address that corresponds to an SFR name.
When you enter the name of an SFR into an assembler, it internally converts it to a number.
THE TMOD SFR (Timer Mode):
The TMOD SFR is used to control the mode of operation of both timers. Each bit of the SFR gives the
microcontroller specific information concerning how to run a timer. The high four bits (bits 4 through 7) relate to
Timer 1 whereas the low four bits (bits 0 through 3) perform the exact same functions, but for timer 0.
The individual bits of TMOD have the following functions:

Bit Name Explanation of Function Timer


When this bit is set the timer will only run when INT1
7 GATE1 (P3.3) is high. When this bit is clear the timer will run 1
regardless of the state of INT1.
When this bit is set the timer will count events on T1
6 C/T1 (P3.5). When this bit is clear the timer will be 1
incremented every machine cycle.
5 T1M1 Timer mode bit (see below) 1
4 T1M0 Timer mode bit (see below) 1
When this bit is set the timer will only run when INT0
3 GATE0 (P3.2) is high. When this bit is clear the timer will run 0
regardless of the state of INT0.
When this bit is set the timer will count events on T0
2 C/T0 (P3.4). When this bit is clear the timer will be 0
incremented every machine cycle.
1 T0M1 Timer mode bit (see below) 0
0 T0M0 Timer mode bit (see below) 0

The Four bits (two for each timer) are used to specify a mode of operation. modes of operation are:
TxM1 TxM0 Timer Mode Description of Mode
0 0 0 13-bit Timer.
0 1 1 16-bit Timer
1 0 2 8-bit auto-reload
1 1 3 Split timer mode
.
The TCON SFR:
There is one more SFR that controls the two timers and provides valuable information about them. The TCON SFR
has the following structure:

TCON (88h) SFR:


Bit Name Bit Explanation of Function Timer
Address
Timer 1 Overflow. This bit is set by the microcontroller
7 TF1 8Fh 1
when Timer 1 overflows.
Timer 1 Run. When this bit is set Timer 1 is turned on.
6 TR1 8Eh 1
When this bit is clear Timer 1 is off.
Timer 0 Overflow. This bit is set by the microcontroller
5 TF0 8Dh 0
when Timer 0 overflows.

Timer 0 Run. When this bit is set Timer 0 is turned on.


4 TR0 8Ch 0
When this bit is clear Timer 0 is off.

Only four bits of SFR are used for timers, the remaining four are used for interrupts.
RST 9 I Reset: While the oscillator is running, a HIGH
logic state on this pin for two machine cycles will
reset the device. If the PSEN pin is driven by a
HIGH-to-LOW input transition while the RST
input pin is held HIGH, the device will enter the
external host mode; otherwise the device will
enter the normal operation mode.
EA 31 I External Access Enable: EA must be connected to
VSS in order to enable the device to fetch code
from the external program memory. EA must be
strapped to VDD for internal program execution.
However, Security lock level 4 will disable EA,
and program execution is only possible from
internal program memory. The EA pin can
tolerate a high voltage of 12 V.
ALE/PROG 30 I/O Address Latch Enable: ALE is the output signal
for latching the low byte of the address during an
access to external memory. This pin is also the
programming
Pulse input (PROG) for flash programming.
Normally the ALE [1] is emitted at a constant rate
of 1⁄6 the crystal frequency [2] and can be used
for external timing and clocking. One ALE pulse
is skipped during each access to external data
memory. However, if AO is set to ‘1’, ALE is
disabled.
XTAL1 19 I Crystal 1: Input to the inverting oscillator
amplifier and input to the internal clock generator
circuits.
XTAL2 18 O Crystal 2: Output from the inverting oscillator
amplifier.
VDD 40 I Power supply
VSS 20 I Ground

CHAPTER-5

POWER SUPPLY AND LCD DISPLAY


Power supply:
Any invention of latest technology cannot be activated without the source of power. So in
this fast moving world we deliberately need a proper power source which will be apt for a
particular requirement. All the electronic components starting from diode to is only work with a
DC supply ranging from 5V to 12V.We are utilizing for the same, the cheapest and commonly
available energy source of 230V-50Hz and stepping down, rectifying, filtering and regulating the
voltage.

REGULATED POWER SUPPLY:

INTRODUCTION: In general electronic circuits like amplifiers, oscillators require a source of


DC power. Batteries, no doubt may be used for power supply in portable electronic equipment.
But, batteries are rarely used for this purpose as they are costly and require frequency
replacement. In practice, DC power for electronic circuits is most conveniently obtained from
commercial AC lines by using rectifier-filter-regulator, called a power supply.
DESCRIPTION: A DC power supply, which converts AC into DC and maintains the output
voltage constants irrespective of AC mains fluctuations or load variations, is known as regulated
DC power supply
The block diagram of regulated power supply is shown below. A power supply consists of
rectifier, filter and regulator. The conversion of alternating voltage in to steady voltage by means
of rectifier, In order to remove the alternating component of the rectified output (ripples), we
need a filter. To obtain constant output voltage irrespective of load variations or supply
variations we need a regulator.

12v
Bridge 5v
1 2 1 2
Rectifier 7812 7805

3 3

1000uf 330 100


uf uf

230V/12
AC step-down transformer

Transformer:
A bridge rectifier coupled with a step down transformer is used for our design. The voltage
rating of transformer used is 0-12V and the current rating is 500mA. When AC voltage of 230V
is applied across the primary winding an output AC voltage of 12V is obtained. One alteration of
input causes the top of transformer to be positive and the bottom negative. The next alteration
will temporarily cause the reverse.
Rectifier:
In the power supply unit, rectification is normally achieved using a solid state diode. Diode has
the property that will let the electron flow easily at one direction at proper biasing condition.
Bridge rectifiers of 4 diodes are used to achieve Bridge wave rectification. Two diodes will
conduct during the negative cycle and the other two will conduct during the positive half cycle.
Filtering unit:
Filter circuit which is usually a capacitor acts as a surge arrester always follows the rectifier unit.
This capacitor is also called as a decoupling capacitor or a bypass capacitor, is used not only to
short the ripple with frequency to ground but also leave the frequency of the DC to appear at the
output.
Regulators:
The voltage regulators play an important role in any power supply unit. The primary
purpose of a regulator is to aid the rectifier and filter circuit in providing a constant DC voltage
to the device. Power supplies without regulators have an inherent problem of changing DC
voltage values due to variations in the load or due to fluctuations in the AC line voltage. With a
regulator connected to DC output, the voltage can be maintained within a close tolerant region of
the desired output. IC 7805 and 7812 regulators are used in this project for providing a DC
voltage of +5V and +12V respectively.
VOLTAGE REGULATORS:
(MC78XX/LM78XX/MC78XXA)
(3-Terminal 1A Positive Voltage Regulator)
DESCRIPTION

The MC78XX/LM78XX/MC78XXA series of three terminal positive regulators are available in


the TO-220/D-PAK package and with several fixed output voltages, making them useful in a
wide range of applications. Each type employs internal current limiting, thermal shut down and
safe operating area protection, making it essentially indestructible. If adequate heat sinking is
provided, they can deliver over 1A output current. Although designed primarily as fixed voltage
regulators, these devices can be used with external components to obtain adjustable voltages and
currents. This voltage regulators offers impressive performance advantages over old-fashioned
zener diode-resistor combinations, providing lower output impedance and reduced quiescent
current.

FEATURES

1. Output Current up to 1A
2. Output Transistor Safe Operating Area Protection
3. Output Voltages 5V, 6V, 8V, 9V, 10V, 12V, 15V, 18V and24V
4. 3- Terminal Regulators
5. No External Components Required
6. Internal Thermal Overload Protection
7. Internal Short Circuit Current-Limiting
8. Available in TO-92, SOT-89 and SOP-8 packages
9. Suitable for C-MOS, TTL, the other Digital IC’s power supply

MAXIMUM RATINGS (Ta=25˚C)


CHARACTERISTIC SYMBOL RATING UNIT

LM7805~LM7815 35
Input Voltage VIN V
LM7818~LM7824 40

Power Dissipation (Tc=25˚C) PD 20.8 W


Power Dissipation
(Without Heatsink) LM7805~LM7824 PD 2.0 W

Operating Junction Temperature Tj -30~150 ˚C

Storage Temperature Tstg -55~150 ˚C

BLOCK DIAGRAM FOR REGULATED POWER SUPPLY:


INPUT 230V AC STEP DOWN
RECTIFIER
50Hz TRANSFORMER

REGULATED DC
VOLTAGE
FILTER OUTPUT
REGULATOR
(STEADY OUTPUT)

INPUT – Domestic power supply 230v AC, 50Hz frequency.

STEP DOWN TRANSFORMER – Primary side (Input-230v AC, 50Hz), secondary side
(output-12v AC 500mA). The name itself represents, it steps down from higher voltage to lower
voltage according to the transformer rating we used. The step down transformers are available
from 1.5v AC – 110v AC with different current ratings. This step down transformer is connected
the AC input 230v (mains) to one end of the transformer, which was the primary side and the
output low voltages from the secondary side. It is measured in AC. Primary side resistance will
be more, while at secondary side the resistance will be less.
RECTIFIER – Here we use a W10M bridge diode, it contains four diodes internally and
connected in wheat stone bridge form. This bridge diode can with stand up to 700V AC and
current carrying up to 1 Ampere. A rectifier may be defined as an electronic device, such as a
semiconductor diode, used for converting AC voltage or current into unidirectional voltage or
current. In other words, which converts AC to DC is called a rectifier.
FILTER – From the previous discussions, it was found that the output of rectifier is pulsating
DC i.e., it is clear that output of a rectifier is combination of desired DC and undesired AC
(ripples). It contains AC and DC components. Hence, we have to remove this unwanted AC
ripples. A network, which removes/ reduces unwanted AC component from the output of a
rectifier is called filter. We use 1000uF/25V electrolytic capacitor. It is a polar capacitor.
VOLTAGE REGULATOR OR STABILIZATION – It is observed that output voltage of a
power supply decreases with increase in the current drawn by the load. As the current increases,
the drop across the diodes, transformer windings. Thus, the voltage available at the output
decreases. Also, there is a possibility of voltage fluctuations in the mains power supply due to
distribution/ transmission. But, the electronic devices/ circuits are very sensitive to DC voltage
increase, the device/ circuit/ equipment may get damaged. When the DC voltage decreases below
the stipulated value, the equipment/ circuit may not perform properly. Hence, the fluctuations in
the DC voltages had to be regulated. In order to ensure this, a voltage stabilizer (IC
REGULATOR) circuit is used
SINGLE-PHASE GLASS PASSIVATED SILICON BRIDGE RECTIFIER
VOLTAGE RANGE 50 to 1000 Volts CURRENT 1.5 Amperes
FEATURES
1. High reverse voltage to 1000V
2. Surge overload ratings to 50 amperes peak
3. Good for printed circuit board assembly
4. Mounting position: Any
5. Weight: 1.20 grams
6. Diffused Junction
7. Low Forward Voltage Drop
8. High Current Capability
9. High Reliability.

MAXIMUM RATINGS (At TA = 25˚C unless otherwise noted)


RATINGS SYMB W005 W01 W02 W04 W06 W08 W10
OL M M M M M M M
Maximum Recurrent Peak Reverse
Voltage RRMV 50 100 200 400 600 800 1000
Maximum RMS Bridge Input VRMS 35 70 140 280 420 560 700
Voltage
Maximum DC Blocking Voltage VDC 50 100 200 400 600 800 1000
Maximum Average Forward
Rectified Output Current at TA = IO 1.5 Amps
25˚C
Peak Forward Surge Current 8.3 ms
single half sine-wave
superimposed on rated load (JEDEC
method) IFSM 50 Amps
Operating Temperature Range TJ -55 to +125˚C
Storage Temperature Range TSTG -55 to +150˚C
HEALTH MONITORING SYSTEM USING IOT
LCD DISPLAY UNIT

In our project we use an intelligent LCD display of two lines,20 character per line,that is interfaced to the 8051.
The display contains two internal byte-wide registers, one for commands(RS=0) and the second for the characters
to be displayed(RS=1). It also contains a user-programmed RAM area that can be programmed to generate any
desired character that can be formed using a dot matrix.To distinguish between these two data areas, the hex
command byte 80 will be used to signify that the display RAM address 00h is choosen.
Port 1 is used to furnish the command or data type , and ports 3.2 to 3.4 furnish register select and read/write
levels.
The display takes varying amounts of time to accomplish the functions listed in the table.LCD bit 7 is monitored
for a logic high (busy) to ensure the display is not overwritten. A slightly more complicated LCD display (4
linesX40 characters ) is currently being used in medical diagnostic systems to run a very similar program.

67
HEALTH MONITORING SYSTEM USING IOT

Fig 6.1: Pin Diagram and instructions of LCD Display.

68
HEALTH MONITORING SYSTEM USING IOT

69
CHAPTER-6
RESULT
PRINICIPAL OF OPERATION:
Pulse width modulation (PWM), or pulse-duration modulation (PDM), is a method of
reducing the average power delivered by an electrical signal, by effectively chopping it up into
discrete parts. The average value of voltage (and current) fed to the load is controlled by turning
the switch between supply and load on and off at a fast rate. The longer the switch is on
compared to the off periods, the higher the total power supplied to the load. Along with
MPPT maximum power point tracking, it is one of the primary methods of reducing the output of
solar panels to that which can be utilized by a battery.[1] PWM is particularly suited for running
inertial loads such as motors, which are not as easily affected by this discrete switching, because
they have inertia to react slow. The PWM switching frequency has to be high enough not to
affect the load, which is to say that the resultant waveform perceived by the load must be as
smooth as possible.

The rate (or frequency) at which the power supply must switch can vary greatly depending on
load and application. For example, switching has to be done several times a minute in an electric
stove; 120 Hz in a lamp dimmer; between a few kilohertz (kHz) and tens of kHz for a motor
drive; and well into the tens or hundreds of kHz in audio amplifiers and computer power
supplies. The main advantage of PWM is that power loss in the switching devices is very low.
When a switch is off there is practically no current, and when it is on and power is being
transferred to the load, there is almost no voltage drop across the switch. Power loss, being the
product of voltage and current, is thus in both cases close to zero. PWM also works well with
digital controls, which, because of their on/off nature, can easily set the needed duty cycle. PWM
has also been used in certain communication systems where its duty cycle has been used to
convey information over a communications channel.

Duty cycle

The term duty cycle describes the proportion of 'on' time to the regular interval or 'period' of
time; a low duty cycle corresponds to low power, because the power is off for most of the time.
Duty cycle is expressed in percent, 100% being fully on. When a digital signal is on half of the
time and off the other half of the time, the digital signal has a duty cycle of 50% and resembles a
"square" wave. When a digital signal spends more time in the on state than the off state, it has a
duty cycle of >50%. When a digital signal spends more time in the off state than the on state, it
has a duty cycle of <50%. Here is a pictorial that illustrates these three scenarios:
FIGURE 6.1OUTPUT WAVEFORM
CIRCUIT DIAGRAM:
PROGRAM:
#include<reg51.h> //speed control of DC motor
#define lcd_data P2
sbit lcd_rs = P2^0;
sbit lcd_en = P2^1;
unsigned char lvl='x',ms='x',chr='x',chr1='x',chr2='x',chra='x',chrb='x',pastnumber[11],rcg,rcv;
void delay(unsigned int value)
{
unsigned int x,y;
for(x=0;x<value;x++)
for(y=0;y<200;y++);
}
void serinit()
{
TMOD=0x20;
TH1=0xFD; //9600
SCON=0x50;
TR1=1;
}
unsigned char receive()
{
unsigned char rx;
while(RI == 0);
rx=SBUF;
RI=0;
return rx;
}
void sertxs(unsigned char *tx)
{
for(;*tx != '\0';tx++)
{
SBUF=*tx;
while(TI == 0);
TI=0;
}
}
void sertx(unsigned char tx)
{
SBUF=tx;
while(TI == 0);
TI=0;
}
void okcheck()
{

Do
{
rcv=receive();
} while(rcv!='K');

}
void lcdcmd(unsigned char value) // LCD COMMAND
{
lcd_data=value&(0xf0); //send msb 4 bits
lcd_rs=0; //select command register
lcd_en=1; //enable the lcd to execute command
delay(3);
lcd_en=0;
lcd_data=((value<<4)&(0xf0)); //send lsb 4 bits
lcd_rs=0; //select command register
lcd_en=1; //enable the lcd to execute command
delay(3);
lcd_en=0;
}
void lcddata(unsigned char value)
{
lcd_data=value&(0xf0); //send msb 4 bits
lcd_rs=1; //select data register
lcd_en=1; //enable the lcd to execute data
delay(3);
lcd_en=0;
lcd_data=((value<<4)&(0xf0)); //send lsb 4 bits
lcd_rs=1; //select data register
lcd_en=1; //enable the lcd to execute data
delay(3);
lcd_en=0;
delay(3);
}
void lcd_int(void)
{
lcdcmd(0x28); //intialise the lcd in 4 bit mode*/
lcdcmd(0x0e); //cursor blinking
lcdcmd(0x06); //move the cursor to right side
lcdcmd(0x01); //clear the lcd
}
void msgdisplay(unsigned char b[]) // send string to lcd
{

unsigned char s,count=0;


for(s=0;b[s]!='\0';s++)
{
count++;
if(s==16)
lcdcmd(0xc0);
if(s==32)
{
lcdcmd(1);
count=0;
}
lcddata(b[s]);
}
}
unsigned char flag;
void pwm(unsigned int);
void config(unsigned int value);
sbit motor12=P3^2;
unsigned char vall;
unsigned char a;unsigned int keypress;
void main()
{
int count=0;
unsigned int count=0,st1=0,st2=0,st3=0;
lcd_init();
msgdisplay("SPEED CTL OF AC ");
lcdcmd(0xc0);
msgdisplay("MOTOR IN SPINNING");
delay(200);
lcdcmd(0x01);
serinit();
sertxs("AT\r\n");okcheck();
sertxs("ATE0\r\n");okcheck();
sertxs("AT+CMGF=1\r\n");okcheck();
lcdcmd(0x01);
lcdcmd(0x80);
msgdisplay("SEND A MESSAGE TO STORE MOB. NO:");
do{
rcg=receive();
}
while(rcg != '+');
for(count=0;count<9;count++)
{
rcg=receive();
}

for(count=0;count<10;count++)
{
pastnumber[count]=receive();
}
lcdcmd(1);
msgdisplay(pastnumber);
sertxs("AT+CMGS=\"");
sertxs(pastnumber);
sertxs("\"\r\n"); delay(200);
sertxs("Mobile no. registered\r\n");
sertx(0x1A);
okcheck();
delay(10);
lcdcmd(0x01);
lcdcmd(0x80);
msgdisplay("MOBILE NUMBER IS REGISTERED");
delay(400);
lcdcmd(0x01);
lcdcmd(0x80);
msgdisplay("SPEED:STOP");//0x86
while(1)
{
{
pwm(keypress);
}
if(chr2 == '1')
{
flag=0;
keypress=1;
}
if(chr2 == '2')
{
flag=0;
keypress=2;
}
if(chr2 == '3')
{
flag=0;
keypress=3;
}
if(chr2 == '4')
{
flag=0;
keypress=4;

}
if(chr2 == '5')
{
flag=0;
keypress=5;
}
delay(200);
}
if(chr1 == 'c' || chr1 == 'C')
{ ms='c';
lcdcmd(0xc6);msgdisplay("C ");
}
if(chr1 == 'a' || chr1 == 'A')
{
ms='a';
lcdcmd(0xc6);msgdisplay("AC ");
}

if(chr1 == '0' && chr2 == '0')


{ ms='x';m1=m2=0;
lcdcmd(0x86);
msgdisplay("STOP");
lcdcmd(0xc6);
msgdisplay("STOP");
}
if(chr2 == '1')
{
lcdcmd(0x86);
msgdisplay("1 ");
}
if(chr2 == '2')
{
lcdcmd(0x86);
msgdisplay("2 ");
}
if(chr2 == '3')
{
lcdcmd(0x86);
msgdisplay("3 ");
}
if(chr2 == '4')
{
lcdcmd(0x86);

msgdisplay("4 ");
}
if(chr2 == '5')
{
lcdcmd(0x86);
msgdisplay("STOP ");
}
}
}
void serial_int (void) interrupt 4
{
if (RI == 1)
{
chr = SBUF;
RI = 0;
if(chr == '*')
{
//chr1 =while(RI == 0)//receive();
//chr2 = receive();
while(RI == 0);
chr1 = SBUF;
RI=0;
while(RI == 0);
chr2 = SBUF;
RI=0;
}
}
}
void pwm(unsigned int d)
{
switch (d)
{
case 1:
//delay_ms(5);
motor12=1;
config(90);
motor12=0;
config(10);
if(flag==0)
{
//cmd_lcd(0x01);
//cmd_lcd(0x80);
//display_lcd("Motor rotating");
//cmd_lcd(0xc0);

//display_lcd("with speed1");
flag++;
d=0;
}
break;
case 2:
//delay_ms(5);
motor12=1;
config(50);
motor12=0;
config(50);
if(flag==0)
{
//cmd_lcd(0x01);
//cmd_lcd(0x80);
//display_lcd("Motor rotating");
//cmd_lcd(0xc0);
//display_lcd("with speed2");
flag++;d=0;
}
break;
case 3:
//delay_ms(5);
motor12=1;
config(30);
motor12=0;
config(70);
if(flag==0)
{
//cmd_lcd(0x01);
//cmd_lcd(0x80);
//display_lcd("Motor rotating");
//cmd_lcd(0xc0);
//display_lcd("with speed3");
flag++;d=0;
}
break;
case 4:
//delay_ms(500);
//motor12=1;
//config(5);
motor12=0;
//config(995);
if(flag==0)

{
//cmd_lcd(0x01);
//cmd_lcd(0x80);
//display_lcd("Motor rotating");
//cmd_lcd(0xc0);
//display_lcd("with speed4");
flag++;d=0;
}
break;
case 5:
//delay_ms(500);
motor12=1;
//config(90);
//motor12=0;
//config(10);
if(flag==0)
{
//cmd_lcd(0x01);
//cmd_lcd(0x80);
//display_lcd("Motor rotating");
//cmd_lcd(0xc0);
//display_lcd("with speed5");
flag++;d=0;
}
break;
break;
default:
break;
}
}
void config(unsigned int value )
{
unsigned int i;
while(value) {
i = 115;
while(i>0) i--;
value--;
}
}
void delay_ms(int cnt)
{
int i;
while(cnt--)
for(i=0;i<500;i++);
}
OUTPUT WAVEFORM:
CHAPTER-7
CONCLUSION AND FUTURE SCOPE
CONCLUSION AND FUTURE SCOPE

FUTURE SCOPE

We can add a GPS module in IOT patient monitoring using Node MCU and Wi-Fi 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 so that they can take some
preventive action.
REFERENCES

1. Ebrahim Al Alkeem1, Dina Shehada1, Chan Yeob Yeun1,M. Jamal Zemerly ,Jiankun Hu “New
secure health-care system using cloud of things”, Springer
2. S. M. Riazul islam, Daehan kwak, MD. Humaun kabir, Mahmud hossain, and Kyung-sup kwak,”
The Internet of Things for Health Care:A Comprehensive Survey” , DOI
10.1109/TDSC.2015.2406699, IEEE Transactions
3. Afef Mdhaffar, Tarak Chaari , Kaouthar Larbi,Mohamed Jmaiel and Bernd Freisleben “IoT- based
Health Monitoring via LoRaWAN”, IEEE EUROCON 2017.

4. Mohammad M. Masud, Mohamed Adel Serhani, and Alramzana Nujum Navaz “Resource- Aware
Mobile-Based Health Monitoring”, 2168-2194 (c) 2015 IEEE

5. Daneil Teichmann, Dennis De Matteis, T horsten Bartelt, Marian Walter and Steffen Leonhardt,“
A Bendable and Wearable Cardiorespiratory Monitoring Device Fusing Two Noncontact Sensor
Principles”, IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL
19,NO.3, p no 784-793,MAY2015.
6. Paola Pierleoni, Luca Pernini, Alberto Belli and Lorenzo Palma, “An Android-Based Heart
Monitoring System for the Elderly and for Patients with Heart Disease”,HINDAWI, International
Journal of Telemedicine and Applications Volume, pp1-12, 2014.
7. Deep Modi, JigneshVyas, Priyank Shah, “Android Based Patient Monitoring System”,
International Journal For Technological Research In Engineering Volume 1, Issue 9, ISSN
(Online): 2347 – 4718 , May-2014
8. Nitha V Panicker, Sukesh Kumar A, “Development of a Blood Pressure Monitoring System for
Home health Application”, International Conference on Circuit, Power and Computing
Technologies [ICCPCT], 2015

S-ar putea să vă placă și