You are on page 1of 84

PATIENT MONITORING SYSTEM

USING SMART TECHNOLOGY

A PROJECT REPORT

Submitted by

AMMU R (733117106002)
KANEESIYA S (733117106015)
PARAMESHWARI B (733117106023)
TAMILSELVI P (733117106038)

in partial fulfillment for the award of the degree


of
BACHELOR OF ENGINEERING

in

ELECTRONICS AND COMMUNICATION ENGINEERING

VIDYAA VIKAS COLLEGE OF ENGINEERING AND TECHNOLOGY


TIRUCHENGODE – 637214

ANNA UNIVERSITY :: CHENNAI 600 025

APRIL 2021

1
ANNA UNIVERSITY :: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report “PATIENT MONITORING USING SMART

TECHNOLOGY” is the bonafide work of “AMMU R, KANEESIYA S,

PARAMESHWARI B, TAMILSELVI P ”who carried out the project work

under my supervision.

SIGNATURE SIGNATURE
Dr.K.POORANAPRIYA, M.E., Ph.D., Mr.L.BALACHANDAR, M.E.,
HEAD OF THE DEPARTMENT SUPERVISOR
Professor, Assistant Professor,
Department of ECE, Department of ECE,
Vidyaa Vikas College of Engineering Vidyaa Vikas College of
andTechnology, Engineering and Technology,
Tiruchengode - 637 214. Tiruchengode - 637 214.

Submitted for the university project presentation held on

Internal Examiner External Examiner

2
ACKNOWLEDGEMENT

We extended our sincere thanks to our Managing Trustees,

Dr.S.Gunasekaran, M.Sc., M.Ed., M.Phil., Ph.D., Dr.T.O.Singaravel, M.Sc.,

M.Ed., M.Phil., Ph.D., Dr.S.Ramalingam, M.Sc., M.Ed., Ph.D., and


Dr.M.Muthusamy, M.Sc., M.Ed., Ph.D., Vidyaa Vikas College of Engineering
and Technology, for providing excellent facilities in all aspects for this project.

We express our profound and sincere thanks to our benevolent Principal


Dr.K.Pooranapriya, M.E., Ph.D., AMIETE., MIE., Vidyaa Vikas College of
Engineering and Technology, who supported us in all the endeavours all through
our project.

We are grateful to Dr.K.POORANAPRIYA, M.E., Ph.D., AMIETE., MIE.,

Head of the Department , Electronics and Communication Engineering, for


permitting us to make use of the facilities available in the department to carry out
the project successfully.

We express our profound and sincere thanks to our benevolent supervisor


Mr.L.BALACHANDAR, M.E., Assistant Professor Department of Electronics
and Communication Engineering, for encouraging guidance and suggestions along
with her constant support for our project from time to time.
My sincere thanks to all of my staff members, librarian & lab technicians of
Electronics and Communication Engineering Department for their extended help
and co- operation in making this project a complete shape.

3
ABSTRACT

Smart health is important application in internet of things. Patients with


abnormal health conditions can be quickly monitored through smart health
care system and provide a rapid solution for the patients. Some of the
applications of Internet of Things are smart parking, smart home, smart
city, smart environment, industrial places, agriculture fields and health
monitoring process. One such application is in healthcare to monitor the
patient health status Internet of Things makes medical equipments more
efficient by allowing real time monitoring of patient health, in which sensor
acquire data of patient's and reduces the human error. In Internet of Things
patient's parameters get transmitted through medical devices via a gateway,
where it is stored and analyzed. The popularity of Internet of Things is
increasing day by day in the area of remote monitoring system. The
monitoring systems include, vehicle or assets monitoring, kids/pet
monitoring, fleet management, parking management, water and oil leakage,
energy grid monitoring etc. In this paper, we have proposed an intelligent
patient monitoring system for monitoring the patients’ health condition
automatically through sensors based connected networks. Several sensors
are used for gathering the biological behaviors of a patient. The meaningful
biological information are then forwarded to the IoT cloud. The system is
more intelligent that can able to detect the critical condition of a patient by
processing sensors data and instantly provides push notification to
doctors/nurses as well as hospital in-charge personal. The doctors and
nurses get benefited from this system by observing their corresponding
patients remotely without visiting in person. Patients’ relatives can also get
benefited from this system with limited access.

iii
CHAPTER TABLE OF CONTENTS PAGE
No. TITLE No.
ABSTRACT iii
LIST OF TABLES ix
LIST OF FIGURES x
LIST OF ABBREVIATIONS xi
1 INTRODUCTION 1
1.1 Intensive Care Unit 1
Internet of things(IoT) 1
Basic Definitions 2
State of the Art 3
Proposed System 3
System testing 3
Existing System 4
2 BLOCK DIAGRAM 5
3 CIRCUIT DIAGRAM 6
4 HARDWARE DETAILS 7
4.1 ARDUINO UNO CONTROLLER 7
4.1.1 Arduino 7
4.1.2 Background 8
4.1.3 Technical Specification 9
4.1.4 Pins 10
4.1.5 General Pin Functions 10
4.1.6 Special Pin Function 11
4.1.7 Communication 12

4.1.8 Automatic (Software) Reset 12

4.2 POWER SUPPLY 13

iv
4.3 TRANSFORMER 13

4.3.1 Basic Principles 15

4.3.2 Induction Law 15

4.3.3 Types of Transformers 16

4.3.3.1 Distribution Transformer 17

4.3.3.2 Power Transformer 17

4.3.4 Classifications 17

4.4 Circuit Description 18

4.4.1 Component List 19

4.5 TEMPERATURE SENSOR(LM35) 20

4.5.1 Pin Description 20

4.6 SOUND SENSOR MODULE 21

4.6.1 Difference Between Sensor And 22


Transducer
4.7 TRANSDUCER 24

4.8 MEMS 25

4.8.1 Challenges in Mems Design 27

4.9 SWITCH 29

4.10 LCD 30

4.10.1Specifications 31

4.10.2 Using The LCD Module With An 32


8051 Microcontroller
4.10.3 Pin Description 32

4.10.4 Pin Diagram 33

v
4.11 LED 34

4.11.1 Function 34

4.11.2 Testing An LED 34

4.11.3 Colors of LEDS 34

4.11.4 Tri – Color LEDS 35

4.11.5 Bi – Color LEDS 35

4.11.6 Flashing LEDS 36

4.11.7 LED Displays 37

4.12 BUZZER 38

4.13 RELAY 39

4.14 GSM 41

4.14.1 GSM Modem 41

4.14.2 Technical Description 42

4.14.3 GSM Frequencies 43

4.14.4 Components of a GSM Network 44

4.14.5 Switching System 44

4.14.6 Base Station System 44

4.14.7 Operation And Support System 45

4.14.8 GSM Network 45

4.14.9 AT Commands 46

4.14.10 Sms Technology 50

5 SOFTWARE DETAILS

5.1 EMBEDDED C 52

vi
5.2 EMBEDDED SYSTEMS 53
PROGRAMMING
5.3 EMBEDDED SYSTEM ARE 54

PROGRAMMED USING DIFFERENT 55


TYPE OF LANGUAGES

5.4 USE OF C IN EMBEDDED SYSTEM 55


IS DRIVEN BY FOLLOWING
ADVANTAGES
5.5 DIFFERENCE BETWEEN C AND 57
EMBEDDED C

5.6 EMBEDDED SYSTEM AND 58


MICROCONTROLLER
5.7 APPLICATION OF EMBEDDED 58
SYSTEM
5.8 ROLE OF EMBEDDED SYSTEM 59

5.9 SEGMENT OF EMBEDDED SYSTEM 59

5.10 MICROCONTROLLER Vs 59
MICROPROCESSOR
5.11 CROSS – COMPILER 61

5.12 SIMULATOR 61

5.13 EMULATOR 61

5.14 DEBUGGER 61

6 ADVANTAGES 62

CONCLUSION 63

APPENTIX – I 64

APPENTIX – II 70

REFERRENCE 71

vii
TABLE LIST OF TABLES PAGE

No. TITLE No.

4.5.1 Temperature Sensor Pin Description 17

4.6.1 Difference Between Sensor And Transducer 20

4.10.3 LCD Pin Description 31

viii
FIGURE No. LIST OF FIGURES PAGE No.

TITLE

3.1 CIRCUIT DIAGRAM 2

4.1 ARDUINO UNO 6

4.2 POWER SUPPLY 10

4.3 STEP – DOWN TRANSFORMER 12

4.7 TRANSDUCER 22

4.10 LCD PIN DIAGRAM 23

4.12 BUZZER 38

4.13 RELAY 39

4.14 GSM NETWORK ELEMENTS 45

ix
LIST OF ABBREVIATIONS

AUC Authentication Centre

BSC Base Station Controller

BSS Base Station System

BTS Base Transceiver Station

EIR Equipment Identity Register

GIWU GSM Interworking Unit

GMSC Gateway Mobile Services Switching Centre

GSM Global System for Mobile Communication

HLR Home Location Register

IDE Integrated Development Environment

LCD Liquid Crystal Display

LED Light Emitting Diodes

LPC Linear Predictive Coding

MEMS Micro Electro – mechanical Systems

MS Mobile Station

MSC Mobile Services Switching Centre

MSN Mobile Service Node

MXE Message Centre

PCB Printed Circuit Board

x
PSU Power Supply Unit

PWM Pulse - Width Modulation

RAM Random access Memory

ROM Read Only Memory

SIM Subscriber Identity Module

SMS Short Message Service

SPI Serial Peripheral Interface

SS Switching System

TDMA Time Division Multiple Access

TWI Two Wire Interface

VLR Visitor Location Register

xi
CHAPTER 1
INTRODUCTION
1.1 Intensive Care Unit
The similar name of Intensive Care Unit (ICU) is Critical Care Unit (CCU). It is
also familiar with some others name such as intensive treatment unit. ICU is a
distinct sector of a clinic/hospital that delivers rigorous treatment. Not all the
patients need intensive care. Medical scientist categorized them (patients) who
needs special treatment. Such categories include:
 If the physiological regulatory systems of a patients are not stable
because of drug overdose.
 Patients with Cardiovascular or organ failure disease.
 After critical surgery such as open-heart surgery, single or multiple
organ replacement etc. Those patients are directly transfer to the
ICU unit.
 If a patient suffering malfunction in several organs such as trauma
or septic shock.
 Mother and baby throughout the childbirth process.
1.2 Internet of Things(IoT)
The Internet of Things is the connected network between devices (wearable,
portable and house-held devices etc.), which was first proposed by Prof. Aston
while performing the research related to Radio-frequency identification (RFID)
in 1999. The service composition is fully supported by IoT with various
applications. The communication among millions of devices (any type of
internet connected) are possible through IoT. The Three Layer Architecture
(most popular) is illustrated. The layers are: Perception, Network and
Application Layer. Sensors, Actuators, Proximity tags (RFID, NFC etc.) and
other embedded devices such as microcontrollers/microprocessors are connected
to the IoT system via Perception layer. Network layer establish the
communications between Things and users (human or consumers). User
1
interfaces/applications are demanded by Application layer. More details
specifications and applications domain of Internet of Things (IoT) .
1.3 BASIC DEFINITIONS
 Internet of Things (IoT): A network of Internet connected devices
(electrical) able to interchange data between them using sensors and
actuators.
 IoT device: Any type of electrical Internet connected device/s that can be
monitored and/or controlled through Internet from anywhere(remote
location).
 IoT ecosystem: All the components that enable consumers, governments
and businesses to connect with their IoT devices, including remotes,
networks, dashboards, gateways, storage, analytics and security.
 Entity: Mainly includes the users of IoT system such as consumers,
governments and businesses etc.
 The Physical layer: The physical components (hardware) that makes an
Internet of Things (IoT) device which includes sensors, actuators and
networking gear.
 The Network layer: The main duty of network layer is transmitting the
data collected from physical layer to IoT devices.
 The Application layer: All the protocols and interfaces used by the
connected devices for identification and communication.
 Dashboard: The dashboard is used for visualizing the information about
the Internet of Things ecosystem. It also used for controlling the IoT
ecosystem. It acts as a special type of remote control for IoT.
 Analytics: Software systems that analyze the data generated by IoT
connected devices. The analysis can be used for a different purposes, such
as predictive maintenance.
 Storage for IoT: The cloud storage/data bucket, where data from IoT

2
devices are stored temporary or permanently.
 The Networks: The Internet communication layer that enables the entity
to communicate with their embedded devices, and enables devices to
communicate with each other.

1.4 STATE OF THE ART


The popularity of Internet of Things are increasing day by day in the area of
remote monitoring system. The remote monitoring systems include, vehicle or
assets monitoring, kids/pets monitoring, fleet management, parking
management, water and oil leakage, energy grid monitoring etc.
A fixed route, simple bus tracking system has been proposed by Lau. The
system used a smartphone application and LED display panel for displaying the
location after a specific time interval. The system is very useful for
college/university students who attend classes in big campuses. As a result, they
(students) can spend more time in studying, sleeping or relaxing rather than
wasting time through waiting for a bus.

1.5 PROPOSED SYSTEM


We have used an Arduino 101 (IoT development board) as a principle
controller of our proposed monitoring system. The details technical
specifications of Arduino 101 development board. The Arduino board
collected the information about patient health parameter from various sensors,
which were directly connected with principle controller. The thinger.io IoT
cloud platform is used as a IoT cloud for our proposed system.

1.6 SYSTEM TESTING


We used some existing medical devices , that are available in the market for
measuring health parameter of a person. The Blood Pressure monitor device is
already medically certified and the validation of this device. Others sensors
such as Humidity and ECG are not tested since we do not have enough
medical device support. Detecting the patient body movements is an important

3
task. In this regard, Computer Vision based human body movement system
is more accurate than measuring the body movements using low cost sensors
like (accelerometers). On the other hand, integration of vison based system with
low cost microcontroller is more complex than sensors based system. A sensors
(accelerometers) based human body movements measurement system, which
can be easily integrable with our proposed system.

1.7 EXISTING SYSTEM

In the existing system, we use active network technology to network


various sensors to a single PMS. Patients’ various critical parameters are
continuously monitored via single PMS and reported to the Doctors or Nurses in
attendance for timely response in case of critical situations. The sensors are
attached to the body of the patients without causing any discomfort to them. In
this PMS we monitor the important physical parameters like body temperature,
ECG, heart beat rate and blood pressure using the sensors which are readily
available. Thus, the analog values that are sensed by the different sensors are
then given to a microcontroller attached to it. The microcontroller processes
these analog signal values of health parameters separately and converts it to
digital values using ADC converter.
Now, the digitalized values from more than one microcontroller are sent
to the Central PMS. Each of the sensors attached microcontroller with a
transceiver will act as a module which has its own unique ID. Each module
transmits the data wirelessly to the gateway attached to the PC of the Central
PMS. The gateway is attached to the PC i.e. Central PMS which is situated in
the medical center, is capable for selecting different patient IDs and allowing the
gateway to receive different physical parameter values the patient specified by
the ID.

4
CHAPTER 2

BLOCK DIAGRAM

2.1 BLOCK DIAGRAM

POWER

LC
TEMPERATU D
RE SENSOR

BUZZER

RESPIRATO
RY
ARDUINO RELAY
SENSOR

ACCELEROMETER
INDICATI
ON
LIGHT
PANIC SWITCH
GS
M

5
CHAPTER 3
CIRCUIT DIAGRAM

Fig.3.1 Circuit Diagram

6
CHAPTER 4
HARDWARE DETAILS

4.1 ARDUINO UNO CONTROLLER

4.1.1 ARDUINO

The Arduino UNO is an open-source microcontroller board based on


the Microchip ATmega328P microcontroller and developed by Arduino.cc. The
board is equipped with sets of digital and analog input/output (I/O) pins that
may be interfaced to various expansion boards (shields) and other circuits.
The board has 14 Digital pins, 6 Analog pins, and programmable with
the Arduino IDE (Integrated Development Environment) via a type B USB
cable.
It can be powered by a USB cable or by an external 9 volt battery, though
it accepts voltages between 7 and 20 volts. It is also similar to the Arduino Nano
and Leonardo. The hardware reference design is distributed under a Creative
Commons Attribution Share-Alike 2.5 license and is available on the Arduino
website. Layout and production files for some versions of the hardware are also
available. "Uno" means one in Italian and was chosen to mark the release of
Arduino Software (IDE) 1.0. The Uno board and version 1.0 of Arduino
Software (IDE) were the reference versions of Arduino, now evolved to newer
releases.
The Uno board is the first in a series of USB Arduino boards, and the
reference model for the Arduino platform The ATmega328 on the Arduino Uno
comes preprogrammed with a bootloader that allows uploading new code to it
without the use of an external hardware programmer. It communicates using the
original STK500 protocol. The Uno also differs from all preceding boards in
that it does not use the FTDI USB-to-serial driver chip. Instead, it uses the
Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial
converter.

7
4.1.2 BACKGROUND

an early production board


The Arduino project started at the Interaction Design Institute Ivrea (IDII)
in Ivrea, Italy. At that time, the students used a BASIC Stamp microcontroller at
a cost of $100, a considerable expense for many students. In 2003 Hernando
Barragán created the development platform Wiring as a Master's thesis project at
IDII, under the supervision of Massimo Banzi and Casey Reas, who are known
for work on the Processing language. The project goal was to create simple,
low-cost tools for creating digital projects by non-engineers. The Wiring
platform consisted of a printed circuit board (PCB) with an ATmega168
microcontroller, an IDE based on Processing and library functions to easily
program the microcontroller.

In 2003, Massimo Banzi, with David Mellis, another IDII student, and
David Cuartielles, added support for the cheaper ATmega8 microcontroller to
Wiring. But instead of continuing the work on Wiring, they forked the project
and renamed it Arduino. Early arduino boards used the FTDI USB-to-serial
driver chip and an ATmega168. The Uno differed from all preceding boards by
featuring the ATmega328P microcontroller and an ATmega16U2 (Atmega8U2
up to version R2) programmed as a USB-to-serial converter.

8
4.1.3 TECHNICAL SPECIFICATIONS

 Microcontroller: Microchip ATmega328P


 Operating Voltage: 5 Volt
 Input Voltage: 7 to 20 Volts
 Digital I/O Pins: 14 (of which 6 provide PWM output)
 Analog Input Pins: 6
 DC Current per I/O Pin: 20 mA
 DC Current for 3.3V Pin: 50 mA
 Flash Memory: 32 KB of which 0.5 KB used by bootloader
 SRAM: 2 KB
 EEPROM: 1 KB
 Clock Speed: 16 MHz
 Length: 68.6 mm
 Width: 53.4 mm
 Weight: 25 g

9
4.1.4 PINS

Fig 4.1 Arduino Uno

4.1.5 GENERAL PIN FUNCTIONS

 LED: There is a built-in LED driven by digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.
 VIN: The input voltage to the Arduino/Genuino board when it's using
an external power source (as opposed to 5 volts from the USB
connection or other regulated power source). You can supply voltage
through this pin, or, if supplying voltage via the power jack, access it
through this pin.
 5V: This pin outputs a regulated 5V from the regulator on the board.
The board can be supplied with power either from the DC power jack
(7 - 20V), the USB connector (5V), or the VIN pin of the board (7-
20V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage the board.
 3V3: A 3.3 volt supply generated by the on-board regulator.
Maximum current draw is 50 mA.
 GND: Ground pins.
10
 IOREF: This pin on the Arduino/Genuino board provides the voltage
reference with which the microcontroller operates. A properly
configured shield can read the IOREF pin voltage and select the
appropriate power source or enable voltage translators on the outputs
to work with the 5V or 3.3V.
 Reset: Typically used to add a reset button to shields which block the
one on the board.

4.1.6 SPECIAL PIN FUNCTIONS

Each of the 14 digital pins and 6 Analog pins on the Uno can be used as
an input or output, using pinMode(),digitalWrite(), and digitalRead() functions.
They operate at 5 volts. Each pin can provide or receive 20 mA as recommended
operating condition and has an internal pull-up resistor (disconnected by default)
of 20-50k ohm. A maximum of 40mA is the value that must not be exceeded on
any I/O pin to avoid permanent damage to the microcontroller.

The Uno has 6 analog inputs, labeled A0 through A5, each of which
provide 10 bits of resolution (i.e. 1024 different values). By default they
measure from ground to 5 volts, though is it possible to change the upper end of
their range using the AREF pin and the analog Reference() function.

In addition, some pins have specialized functions:

 Serial / UART: pins 0 (RX) and 1 (TX). Used to receive (RX) and
transmit (TX) TTL serial data. These pins are connected to the
corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
 External Interrupts: pins 2 and 3. These pins can be configured to
trigger an interrupt on a low value, a rising or falling edge, or a change in
value.
 PWM (Pulse Width Modulation): 3, 5, 6, 9, 10, and 11 Can provide 8-
bit PWM output with the analogWrite() function.
11
 SPI (Serial Peripheral Interface): 10 (SS), 11 (MOSI), 12 (MISO), 13
(SCK). These pins support SPI communication using the SPI library.
 TWI (Two Wire Interface) / I²C: A4 or SDA pin and A5 or SCL pin.
Support TWI communication using the Wire library.
 AREF (Analog Reference): Reference voltage for the analog inputs.

4.1.7 COMMUNICATION

The Arduino/Genuino Uno has a number of facilities for communicating


with a computer, another Arduino/Genuino board, or other microcontrollers. The
ATmega328 provides UART TTL (5V) serial communication, which is
available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board
channels this serial communication over USB and appears as a virtual com port

to software on the computer. The 16U2 firmware uses the standard USB COM
drivers, and no external driver is needed. However, on Windows, a .inf file is
required. The Arduino Software (IDE) includes a serial monitor which allows
simple textual data to be sent to and from the board. The RX and TX LEDs on
the board will flash when data is being transmitted via the USB-to-serial chip
and USB connection to the computer (but not for serial communication on pins
0 and 1). A Software Serial library allows serial communication on any of the
Uno's digital pins.

4.1.8 AUTOMATIC (SOFTWARE) RESET

Rather than requiring a physical press of the reset button before an


upload, the Arduino/Genuino Uno board is designed in a way that allows it to be

reset by software running on a connected computer. One of the hardware flow


control lines (DTR) of the ATmega8U2/16U2 is connected to the reset line of
the ATmega328 via a 100 nanofarad capacitor. When this line is asserted (taken
low), the reset line drops long enough to reset the chip.

12
This setup has other implications. When the Uno is connected to either a
computer running Mac OS X or Linux, it resets each time a connection is made
to it from software (via USB). For the following half-second or so, the
bootloader is running on the Uno. While it is programmed to ignore malformed
data (i.e. anything besides an upload of new code), it will intercept the first few
bytes of data sent to the board after a connection is opened.

4.2 POWER SUPPLY

A power supply (sometimes known as a power supply unit or PSU) is a


device or system that supplies electrical or other types of energy to an output
load or group of loads. The term is most commonly applied to electrical energy
supplies, less often to mechanical ones, and rarely to others.

Figure 4.2 power supply


4.3 TRANSFORMER

A transformer is a device that transfers electrical energy from one circuit


to another through inductively coupled wires. A changing current in the first
circuit (the primary) creates a changing magnetic field; in turn, this magnetic
field induces a changing voltage in the second circuit (the secondary).

13
By adding a load to the secondary circuit, one can make current flow in
the transformer, thus transferring energy from one circuit to the other. The
secondary induced voltage VS is scaled from the primary VP by a factor ideally
equal to the ratio of the number of turns of wire in their respective windings:

By appropriate selection of the numbers of turns, a transformer thus


allows an alternating voltage to be stepped up — by making NS more than NP or
stepped down, by making it less.

A key application of transformers is to reduce the current before


transmitting electrical energy over long distances through wires. Most wires
have resistance and so dissipate electrical energy at a rate proportional to the
square of the current through the wire. By transforming electrical power to a
high-voltage, and therefore low-current form for transmission and back again
afterwards, transformers enable the economic transmission of power over long
distances. Consequently, transformers have shaped the electricity supply
industry, permitting generation to be located remotely from points of demand.
All but a fraction of the world's electrical power has passed through a series of
transformers by the time it reaches the consumer.

Transformers are some of the most efficient electrical 'machines', with


some large units able to transfer 99.75% of their input power to their output.
Transformers come in a range of sizes from a thumbnail-sized coupling
transformer hidden inside a stage microphone to huge gigavolt-ampere-rated
units used to interconnect portions of national power grids. All operate with the
same basic principles, though a variety of designs exist to perform specialized
roles throughout home and industry.

14
4.3.1 BASIC PRINCIPLES

The transformer is based on two principles: first, that an electric current


can produce a magnetic field (electromagnetism) and, second, that a changing
magnetic field within a coil of wire induces a voltage across the ends of the coil
(electromagnetic induction). By changing the current in the primary coil, one
changes the strength of its magnetic field; since the secondary coil is wrapped
around the same magnetic field, a voltage is induced across the secondary.

Fig 4.3 Step-Down Transformer

A current passing through the primary coil creates a magnetic field. The
primary and secondary coils are wrapped around a core of very high magnetic
permeability, such as iron; this ensures that most of the magnetic field lines
produced by the primary current are within the iron and pass through the
secondary coil as well as the primary coil.

4.3.2 INDUCTION LAW

The voltage induced across the secondary coil may be calculated from
Faraday's law of induction, which states that

15
Where VS is the instantaneous voltage, NS is the number of turns in the
secondary coil and Φ equals the total magnetic flux through one turn of the coil.
If the turns of the coil are oriented perpendicular to the magnetic field lines, the
flux is the product of the magnetic field strength B and the area A through which
it cuts. The area is constant, being equal to the cross-sectional area of the
transformer core, whereas the magnetic field varies with time according to the
excitation of the primary.

Since the same magnetic flux passes through both the primary and
secondary coils in an ideal transformer, the instantaneous voltage across the
primary winding equals

Taking the ratio of the two equations for VS and VP gives the basic
equation for stepping up or stepping down the voltage

4.3.3 TYPES OF TRANSFORMERS


Transformers are constructed so that their characteristics match the
application for which they
are intended. The differences in construction may involve the size of the
windings or the relationship between the primary and secondary
windings. Transformer types are also designated by the function the transformer
serves in a circuit, such as an isolation transformer.

16
4.3.3.1 DISTRIBUTION TRANSFORMER

Distribution transformers are generally used in electrical power distribution


and transmission systems. This class of transformer has the highest power, or
volt-ampere ratings, and the highest
continuous voltage rating. The power rating is normally determined by th
e type of cooling methods the transformer may use. Some commonly-used
methods of cooling are by using oil or some other heat-conducting
material. Ampere rating is increased in a distribution transformer by increasing
the size of the primary and secondary windings; voltage ratings are increased by
increasing the voltage rating of the insulation used in making the transformer.

4.3.3.2 POWER TRANSFORMER

Power transformers are used in electronic circuits and come in many diffe
rent types and
applications. Electronics or power transformers are sometimes considered
to be those with ratings of 300 volt-amperes and below. These transformers
normally provide power to the power supply of an electronic device, such as in
power amplifiers in audio receivers.

4.3.4 CLASSIFICATION

The many uses to which transformers are put lead them to be classified in a
number of different ways:

 By power level: from a fraction of a volt-ampere (VA) to over a thousand


MVA;

17
 By frequency range: power-, audio-, or radio frequency;
 By voltage class: from a few volts to hundreds of kilovolts;
 By cooling type: air cooled, oil filled, fan cooled, or water cooled;
 By application function: such as power supply, impedance matching,
output voltage and current stabilizer, or circuit isolation;
 By end purpose: distribution, rectifier, arc furnace, amplifier output;
 By winding turns ratio: step-up, step-down, isolating (near equal ratio),
variable.

4.4 CIRCUIT DESCRIPTION

This circuit is a small +5V power supply, which is useful when


experimenting with digital electronics. Small inexpensive wall transformers with
variable output voltage are available from any electronics shop and supermarket.
Those transformers are easily available, but usually their voltage regulation is
very poor, which makes then not very usable for digital circuit experimenter
unless a better regulation can be achieved in some way. The following circuit is
the answer to the problem.

This circuit can give +5V output at about 150 mA current, but it can be
increased to 1 A when good cooling is added to 7805 regulator chip. The circuit
has over overload and therminal protection.

Circuit diagram of the power supply

18
The capacitors must have enough high voltage rating to safely handle the
input voltage feed to circuit. The circuit is very easy to build for example into a
piece of Vero board.

Pinout of the 7805 regulator IC

1. Unregulated voltage in

2. Ground

3. Regulated voltage out

4.4.1 COMPONENT LIST

7805 regulator IC
100 uF electrolytic capacitor, at least 25V voltage rating
10 uF electrolytic capacitor, at least 6V voltage rating
100 nF ceramic or polyester capacitor

OUTPUT CURRENT

If you need more than 150 mA of output current, you can update the output
current up to 1A doing the following modifications:

 Change the transformer from where you take the power to the circuit to a
model which can give as much current as you need from output
 Put a heat sink to the 7805 regulator (so big that it does not overheat
because of the extra losses in the regulator)

19
OUTPUT VOLTAGES

If you need other voltages than +5V, you can modify the circuit by
replacing the 7805 chips with another regulator with different output voltage
from regulator 78xx chip family. The last numbers in the chip code tells the
output voltage. Remember that the input voltage must be at least 3V greater than
regulator output voltage to otherwise the regulator does not work well.

4.5 TEMPERATURE SENSOR (LM35)

4.5.1 PIN DESCRIPTION


Pin
Function Name
No
1 Supply voltage; 5V (+35V to -2V) Vcc
2 Output voltage (+6V to -1V) Output
3 Ground (0V) Ground

LM35 is a precision IC temperature sensor with its output proportional to


the temperature (in oC). The sensor circuitry is sealed and therefore it is not
subjected to oxidation and other processes. With LM35, temperature can be
measured more accurately than with a thermistor. It also possess low self
heating and does not cause more than 0.1 oC temperature rise in still air.
Temperature is the most-measured process variable in industrial
automation. Most commonly, a temperature sensor is used to convert
temperature value to an electrical value. Temperature Sensors are the key to read
temperatures correctly 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
20
sensing element enclosed in housings of plastic or metal. With the help of
conditioning circuits, the sensor will reflect the change of environmental
temperature.

4.6 SOUND SENSOR MODULE


Sound sensor is used to receive acoustic wave and display the vibration
image of sound. It has a build-in capacitively electret microphone that is
sensitive to sound. The electret fill min microphone vibrates with the acoustic
wave resulting in the change of capacitance and the subsequent micro voltage.
Then the micro voltage is sent to LM393 comparator on the module before
being compared with the threshold set by the blue potentiometer. When the
sound intensity in the surroundings doesn’t reach the threshold, OUT interface
outputs high level signals; otherwise, outputs low level signals
Main Features
1. Measuring the intensity of sound (Note: only detect the existence of sound
according to the principle of vibration);

2. Adjustable sensitivity (you can use the blue potentiometer shown in the
picture);

3. Working Voltage: 3.3V~5V;

4. Output Mode: Digital Switch Output (low level under working mode);

5. Mounting Hole;

6. Size of PCB: 3.2cm x 1.7cm

A sensor converts the physical action to be measured into an electrical


equivalent and processes it so that the electrical signals can be easily sent and
further processed. The sensor can output whether an object is present or not
present (binary) or what measurement value has been reached (analog or
digital).
21
4.6.1 DIFFERENCE BETWEEN SENSOR AND TRANSDUCER
One of the significant difference between the sensor and the transducer is
that the sensor senses the physical changes occur in the surrounding whereas
the transducer converts the physical quantity or nonelectrical into another
signal or electrical signal. Some other differences between the sensor and
transducer are explained below in the comparison chart.
he transducer and sensor both are the physical devices used in electrical and
electronic instruments for measuring the physical quantities. The sensor detects
the energy level and changes it into an electrical signal which is easily measured
by the digital meters. The transducer transfers the energy either in the same form
or another.
Content: Sensor Vs Transducer
1. Comparison Chart

2. Definition

3. Key Differences

4. Conclusion

5. Comparison Chart

Basis For
Sensor Transducer
Comparison

Definition Senses the physical changes occurs The transducer is a


in the surrounding and converting it device which, when
into a readable quantity. actuates transforms the
energy from one form to
another.

Components Sensor itself Sensor and signal


conditioning

23
Basis For
Sensor Transducer
Comparison

Function Detects the changes and induces Conversion of one form


the corresponding electrical signals. of energy into another.

Examples Proximity sensor, Magnetic sensor, Thermistor,


Accelerometer sensor, Light sensor Potentiometer,
etc. Thermocouple, etc.

6. Definition of Sensor
7. The sensor is a device that measures the physical quantity (i.e. Heat, light,
sound, etc.) into an easily readable signal (voltage, current etc.). It gives
accurate readings after calibration.
8. Examples – The mercury used in the thermometer converts the measurand
temperature into an expansion and contraction of the liquid which is
easily measured with the help of a calibrated glass tube. The
thermocouple also converts the temperature to an output voltage which is
measured by the thermometer.

9. The sensors have many applications in the electronics equipment. The few
of them are explained below.

10.The motion sensors are used in the home security system and the
automation door system.
11.The photo sensor senses the infrared or ultraviolet light.
12.The accelerometer sensor use in the mobile for detecting the screen
rotations.
24
4.7 TRANSDUCER

The transducer is a device that changes the physical attributes of the non-
electrical signal into an electrical signal which is easily measurable. The process
of energy conversion in the transducer is known as the transduction. The
transduction is completed into two steps. First by sensing the signal and the
strengthening it for further processing.

Fig 4.7 Transducer

The transducer has three major components; they are the input device,
signal conditioning or processing device and an output device.

The input devices receive the measured quantity and transfer the proportional
analogue signal to the conditioning device. The conditioning device modified,
filtered, or attenuates the signal which is easily acceptable by the output devices.

KEY DIFFERENCES BETWEEN SENSOR AND TRANSDUCER

The following are the key differences between the sensor and transducer.

1. The sensor senses the physical change across the surrounding whereas the
transducer transforms the one form of energy into another.

2. The sensor itself is the major component of the sensor, whereas the sensor
and the signal conditioning are the major elements of the sensor.

25
3. The primary function of the sensor is to sense the physical changes,
whereas the transducer converts the physical quantities into an electrical
signal.

4. The accelerometer, barometer, gyroscope are the examples of the sensors


whereas the thermistor, and thermocouple is the examples of the
transducer.

4.8 MEMS

MEMS (micro electro-mechanical systems) technology has gone from an


interesting academic exercise to an integral part of many common products. But
as with most new technologies, the practical implementation of MEMS
technology has taken a while to happen. The design challenges involved in
designing a successful MEMS product (the ADXL2O2E) are described in this
article by Harvey Weinberg from Analog Devices.

In early MEMS systems a multi-chip approach with the sensing element


(MEMS structure) on one chip, and the signal conditioning electronics on
another chip was used. While this approach is simpler from a process standpoint,
it has many disadvantages:

 The overall silicon area is generally larger.


 Multi chip modules require additional assembly steps.
 Yield is generally lower for multi chip modules.
26
 Larger signals from the sensor are required to overcome the stray
capacitance of the chip to chip interconnections, and stray fields
necessitating a larger sensor structure.
 Larger packages are generally required to house the two-chip structure.

Of course, history teaches us that integration is the most cost effective and
high performance solution. So Analog Devices pursued an integrated approach
to MEMS where the sensor and signal conditioning electronics are ononechip.

The latest generation ADXL2O2E is the result of almost a decades worth


of experience building integrated MEMS accelerometers. It is the world's
smallest mass-produced, low g, low cost, integrated MEMS dual axis
accelerometer.

The mechanical structure of the ADXL2O2E is shown in Figure along


with some key dimensions.

Polysilicon springs suspend the MEMS structure above the substrate such
that the body of the sensor (also known as the proof mass) can move in the X
and Y axes. Acceleration causes deflection of the proof mass from its centre
position. Around the four sides of the square proof mass are 32 sets of radial
fingers.

These fingers are positioned between plates that are fixed to the substrate.
Each finger and pair of fixed plates make up a differential capacitor, and the
27
deflection of the proof mass is determined by measuring the differential
capacitance.

This sensing method has the ability of sensing both dynamic acceleration
(i.e. shock or vibration) and static acceleration (i.e. inclination or gravity).

The differential capacitance is measured using synchronous


modulation/demodulation techniques. After amplification, the X and Y axis
acceleration signals each go through a 32KOhm resistor to an output pin (Cx
and Cy) and a duty cycle modulator (the overall architecture can be seen in the
block diagram in Figure 3). The user may limit the bandwidth, and thereby
lower the noise floor, by adding a capacitor at the Cx and Cy pin.

The output signals are voltage proportional to acceleration and pulse-width-


modulation (PWM) proportional to acceleration.
Using the PWM outputs, the user can interface the ADXL2O2 directly to the
digital inputs of a microcontroller using a counter to decode the PWM.

4.8.1 CHALLENGES IN MEMS DESIGN

The mechanical design of microscopic mechanical systems, even simple


systems, first requires an understanding of the mechanical behaviour of the
various elements used. While the basic rules of mechanical dynamics are still
followed in the miniaturised world, many of the materials used in these
structures are not well mechanically characterised. For example, most MEMS
systems use polysilicon to build mechanical structures. Polysilicon is a familiar
material in the IC world, and is compatible with IC manufacturing processes.

Until recently, little work has been done to fully understand polysilicon's
mechanical properties. In addition, many materials mechanical properties
change in the microscopic world. Again, polysilicon is a good example. In the
macro world it is rarely used as a mechanical element. It is too brittle and fragile
28
to withstand all but small mechanical deflections. But in the
extremely small movements of MEMS structures (less than a few pm), it turns
out to be an almost ideal material.

The electronic design of MEMS sensors is very challenging. Most MEMS


sensors (the ADXL2O2E included) mechanical systems are designed to realise a
variable capacitor. Electronics are used to convert the variable capacitance to a
variable voltage or current, amplify, linearise, and in some cases, temperature
compensate the signal. This is a challenging task as the signals involved are very
minute.
In the case of the ADXL2O2E for example, the smallest resolvable signal is
approximately 2OzF and this is on top of a common mode signal several orders
of magnitude greater than that! Of course, for cost reasons the
electronics must be made as compact as possible at the same time.

The integrated approach presented further challenges.


Many standard production steps that improve the mechanical structure degrade
the electronics and vice versa. For example, the usual method for flattening out
the Polysilicon mechanical structure is annealing (where the structure is exposed
to controlled high temperatures). While the annealing process is beneficial to the
mechanical structure, it can degrade or destroy the BiMOS transistors used in
the signal conditioning electronics. So compatible mechanical and electronic
process methods had to be devised.

Another roadblock for the MEMS designer has been the unavailability of
standard design software. Modern integrated circuits are rarely designed by
hand. Complex CAD and simulation software is used to help design and
optimise the designers concepts.

29
MEMS design software is still in its infancy, and most MEMS
manufacturers develop part or all of their CAD and simulation software to suit
their particular needs.

The fabrication process design challenge is perhaps the greatest one.


Techniques for building three-dimensional MEMS structures had to be devised.
Chemical and trench etching can be used to "cut out" structures from solid
polysilicon, but additional process steps must be used to remove the material
underneath the patterned polysilicon to allow it to move freely.

Standard plastic injection molded IC packaging cannot be used because of


the moving parts of the MEMS structure. A cavity of some type must be
maintained around the mobile MEMS structure. So alternative low-cost cavity
packaging was developed.

In addition, this package must also be mechanically stable as external


mechanical stress could result in output changes. Even mundane tasks, such as
cutting the wafer up into single die, becomes complicated. In a standard IC the
particle residue created by the sawing process does not effect the IC. In a
moving MEMS structure these particles can ruin a device.

4.9 SWITCH

In electrical engineering, a switch is an electrical component that can


break an electrical circuit, interrupting the current or diverting it from one
30
conductor to another. The mechanism of a switch may be operated directly by a
human operator to control a circuit (for example, a light switch or a keyboard
button), may be operated by a moving object such as a door-operated switch, or
may be operated by some sensing element for pressure, temperature or flow.
A relay is a switch that is operated by electricity. Switches are made to handle a
wide range of voltages and currents; very large switches may be used to isolate
high-voltage circuits in electrical substations.
The most familiar form of switch is a manually operated
electromechanical device with one or more sets of electrical contacts, which are
connected to external circuits. Each set of contacts can be in one of two states:
either "closed" meaning the contacts are touching and electricity can flow
between them, or "open", meaning the contacts are separated and the switch is
non-conducting. The mechanism actuating the transition between these two
states (open or closed) can be either a "toggle" (flip switch for continuous "on"
or "off") or "momentary" (push-for "on" or push-for "off") type.
4.10 LCD

A liquid crystal display (commonly abbreviated LCD) is a thin, flat


display device made up of any number of color or monochrome pixels arrayed
in front of a light source or reflector. It is often utilized in battery-powered
electronic devices because it uses very small amounts of electric power.

31
4.10.1 SPECIFICATIONS

Important factors to consider when evaluating an LCD monitor:

 Resolution: The horizontal and vertical size expressed in pixels (e.g.,


1024x768). Unlike CRT monitors, LCD monitors have a native-supported
resolution for best display effect.
 Dot pitch: The distance between the centers of two adjacent pixels. The
smaller the dot pitch size, the less granularity is present, resulting in a
sharper image. Dot pitch may be the same both vertically and
horizontally, or different (less common).
 Viewable size: The size of an LCD panel measured on the diagonal (more
specifically known as active display area).
 Response time: The minimum time necessary to change a pixel's color or
brightness.
 Matrix type: Active or Passive.
 Viewing angle: (coll., more specifically known as viewing direction).
 Color support: How many types of colors are supported (coll., more
specifically known as color gamut).
 Brightness: The amount of light emitted from the display (coll., more
specifically known as luminance).
 Contrast ratio: The ratio of the intensity of the brightest bright to the
darkest dark.
 Aspect ratio: The ratio of the width to the height (for example, 4:3, 16:9
or 16:10).
 Input ports (e.g., DVI, VGA, LVDS, or even S-Video and HDMI).

32
4.10.2 USING THE LCD MODULE WITH AN 8051
MICROCONTROLLER

The LCD Module can easily be used with an 8051 microcontroller such as
the AT89C2051 included with the microcontroller beginner kit. The LCD
Module comes with a 16 pin connector. This can be plugged into the breadboard
as shown below.

The pins on the 16 pin connector of the LCD Module are defined below.
The table also shows how to connect each pin to the 2051 microcontroller. To

connect the LCD Module to a standard 40 pin 8051, use the pin names listed
below to find the correct pin number on the 8051 microcontroller. The example
programs below do not need to be modified to work with a 40 pin 8051.

4.10.3 PIN DESCRIPTION

Pin
Function Name
No
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V – 5.3V) Vcc
3 Contrast adjustment; through a variable resistor VEE

33
Selects command register when low; and data register
4 Register Select
when high
Low to write to the register; High to read from the
5 Read/write
register
Sends data to data pins when a high to low pulse is
6 Enable
given
7 DB0
8 DB1
9 DB2
10 DB3
8-bit data pins
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-

4.10.4 PIN DIAGRAM

Fig 4.10 LCD Pin Diagram

34
After you have built a basic 2051 configuration as shown above, you can
connect the LCD Module as shown in the table above. In addition, you need to
add the following connections.
Connect LCD Pin 3 to Vcc (5 Volts). Connect LCD Pin 8 to Ground.
Connect a 510 ohm resistor between LCD Pin 5 and ground. Connect a 2.2k
ohm resistor from LCD Pin 2 and Vcc. Connect a 2.2k ohm resistor from LCD
Pin 13 to Vcc.
4.11 LIGHT EMITTING DIODES (LEDS)

Circuit symbol:

Fig 4.11 LED and Circuit Symbol

4.11.1 FUNCTION

LEDs emit light when an electric current passes through them.

4.11.2 TESTING AN LED


Never connect an LED directly to a battery or power supply!
It will be destroyed almost instantly because too much current will pass through
and burn it out. LEDs must have a resistor in series to limit the current to a safe
value, for quick testing purposes a 1k resistor is suitable for most LEDs if your
supply voltage is 12V or less. Remember to connect the LED the correct way
round! For an accurate value please see calculating an LED resistor value below.
4.11.3 COLORS OF LEDS
LEDs are available in red, orange, amber, yellow, green, and blue and
white. Blue and white LEDs are much more expensive than the other colors. The
color of an LED is determined by the semiconductor material, not by the
coloring of the 'package' (the plastic body). LEDs of all colors are available in

35
uncolored packages which may be diffused (milky) or clear (often described as
'water clear'). The colored packages are also available as diffused (the standard
type) or transparent.

4.11.4 TRI-COLOR LEDS


The most popular type of tri-color LED has a red and a green LED
combined in one package with three leads. They are called tri-color because
mixed red and green light appears to be yellow and this is produced when both
the red and green LEDs are on. The diagram shows the construction of a tri-
color LED. Note the different lengths of the three leads. The centre lead (k) is
the common cathode for both LEDs, the outer leads (a1 and a2) are the anodes
to the LEDs allowing each one to be lit separately, or both together to give the
third color.

4.11.5 BI-COLOR LEDS


Bi-color LED has two LEDs wired in 'inverse parallel' (one forwards, one
backwards) combined in one package with two leads. Only one of the LEDs can
be lit at one time and they are less useful than the tri-color LEDs described
above. LEDs are available in a wide variety of sizes and shapes.
The 'standard' LED has a round cross-section of 5mm diameter and this is
probably the best type for general use, but 3mm round LEDs are also popular.
Round cross-section LEDs are frequently used and they are very easy to install
on boxes by drilling a hole of the LED diameter, adding a spot of glue will help
to hold the LED if necessary. LED clips are also available to secure LEDs in
holes. Other cross-section shapes include square, rectangular and triangular.
As well as a variety of colors, sizes and shapes, LEDs also vary in their
viewing angle. This tells you how much the beam of light spreads out. Standard
LEDs have a viewing angle of 60° but others have a narrow beam of 30° or less.
Rapid Electronics stock a wide selection of LEDs and their catalogue is a good
guide to the range available.

36
CALCULATING AN LED RESISTOR VALUE
An LED must have a resistor connected in series to limit the current
through the LED; otherwise it will burn out almost instantly.

The resistor value, R is given by:

R = (VS - VL) / I

VS = supply voltage
VL = LED voltage (usually 2V, but 4V for blue and white LEDs)
I = LED current (e.g. 10mA = 0.01A, or 20mA = 0.02A)

WORKING OUT THE LED RESISTOR FORMULA USING OHM’S LAW


Ohm's law says that the resistance of the resistor, R = V/I, where:
V = voltage across the resistor (= VS - VL in this case)
I = the current through the resistor

So R = (VS - VL) / I

CONNECTING LEDS IN SERIES


If you wish to have several LEDs on at the same time it may be possible
to connect them in series. This prolongs battery life by lighting several LEDs
with the same current as just one LED. All the LEDs connected in series pass
the same current so it is best if they are all the same type. The power supply
must have sufficient voltage to provide about 2V for each LED (4V for blue and
white) plus at least another 2V for the resistor. To work out a value for the
resistor you must add up all the LED voltages and use this for VL.
4.11.6 FLASHING LED
Flashing LEDs look like ordinary LEDs but they contain an integrated
circuit (IC) as well as the LED itself. The IC flashes the LED at a low
frequency, typically 3Hz (3 flashes per second). They are designed to be

37
connected directly to a supply, usually 9 - 12V, and no series resistor is required.
Their flash frequency is fixed so their use is limited and you may prefer to build
your own circuit to flash an ordinary LED, for example our Flashing LED
project which uses a 555 astable circuit.

4.11.7 LED DISPLAYS


LED displays are packages of many LEDs arranged in a pattern, the most
familiar pattern being the 7-segment displays for showing numbers (digits 0-
9). The pictures below illustrate some of the popular designs:

Bargraph 7-segment Starburst Dot matrix


Photographs © Rapid Electronics

PIN CONNECTIONS OF LED


DISPLAYS
There are
many types of Pin connections diagram
LED display © Rapid Electronics
and a
supplier's catalogue should be
consulted for the pin connections. The diagram on the right shows an example
from the Rapid Electronics catalogue. Like many 7-segment displays, this
example is available in two versions: Common Anode (SA) with all the LED
38
anodes connected together and Common Cathode (SC) with all the cathodes
connected together. Letters a-g refer to the 7 segments, A/C is the common
anode or cathode as appropriate (on 2 pins). Note that some pins are not
present (NP) but their position is still numbered.

CALCULATING AN LED RESISTOR VALUE

An LED must have a resistor connected in series to limit the current


through the LED; otherwise it will burn out almost instantly.
The resistor value, R is given by:

R = (VS - VL) / I

VS=supplyvoltage
VL = LED voltage (usually 2V, but 4V for blue and white LEDs)
I = LED current (e.g. 10mA = 0.01A, or 20mA = 0.02A)
Make sure the LED current you choose is less than the maximum permitted and
convert the current to amps (A) so the calculation will give the resistor value in
ohms ( ).

To convert mA to A divide the current in mA by 1000 because 1mA = 0.001A.

If the calculated value is not available choose the nearest standard resistor value
which is greater, so that the current will be a little less than you chose. In fact
you may wish to choose a greater resistor value to reduce the current (to increase
battery life for example) but this will make the LED less bright.

4.12 BUZZER

A buzzer or beeper is an audio signalling device, which may


be mechanical, electromechanical, or piezoelectric. Typical uses of buzzers and

39
beepers include alarm devices, timers and confirmation of user input such as a
mouse click or keystroke.

Fig 4.12 Buzzer

This novel buzzer circuit uses a relay in series with a small audio
transformer and speaker. When the switch is pressed, the relay will operate via
the transformer primary and closed relay contact. As soon as the relay operates
the normally closed contact will open, removing power from the relay, the
contacts close and the sequence repeats, all very quickly...so fast that the pulse
of current causes fluctuations in the transformer primary, and hence secondary.
The speakers tone is thus proportional to relay operating frequency. The
capacitor C can be used to "tune" the note. The nominal value is 0.001uF,
increasing capacitance lowers the buzzers tone.

4.13 RELAY
A relay is an electrical switch that opens and closes under the control of
another electrical circuit. In the original form, the switch is operated by an
electromagnet to open or close one or many sets of contacts. It was invented by
Joseph Henry in 1835. Because a relay is able to control an output circuit of
higher power than the input circuit, it can be considered, in a broad sense, to be

40
a form of an electrical amplifier.

Fig 4.13 Relay

Relays are components which allow a low-power circuit to switch a


relatively high current on and off, or to control signals that must be electrically
isolated from the controlling circuit itself.
To make a relay operate, you have to pass a suitable pull-in and holding
current (DC) through its energizing coil. And generally relay coils are designed
to operate from a particular supply voltage - often 12V or 5V, in the case of
many of the small relays used for electronics work. In each case the coil has a
resistance which will draw the right pull-in and holding currents when it is
connected to that supply voltage.
So the basic idea is to choose a relay with a coil designed to operate from
the supply voltage you’re using for your control circuit (and with contacts
capable of switching the currents you want to control),
and then provide a suitable relay driver circuit so that your low-power circuitry
can control the current through the relay coil. Typically this will be somewhere
between 25mA and 70mA.Often your relay driver can be very simple, using
little more than an NPN or PNP transistor to control the coil current.

41
4.14 GSM
4.14.1 GSM MODEM

Applications

 SMS based Remote Control & Alerts


 Security Applications
 Sensor Monitoring
 GPRS Mode Remote Data Logging

Features

 Status of Modem Indicated by LED


 Simple to Use & Low Cost
 On board switching type power supply regulator
 RS232 output

A GSM modem is a wireless modem that works with a GSM wireless


network. A wireless modem behaves like a dial-up modem. The main difference
between them is that a dial-up modem sends and receives data through a fixed
telephone line while a wireless modem sends and receives data through radio
waves.
A GSM modem can be an external device or a PC Card / PCMCIA Card.
42
Typically, an external GSM modem is connected to a computer through a serial
cable or a USB cable. A GSM modem in the form of a PC Card / PCMCIA Card
is designed for use with a laptop computer. It should be inserted into one of the
PC Card / PCMCIA Card slots of a laptop computer. Like a GSM mobile phone,
a GSM modem requires a SIM card from a wireless carrier in order to operate.

4.14.2 TECHNICAL DESCRIPTION

GSM is a cellular network, which means that mobile phones connect to it


by searching for cells in the immediate vicinity. GSM networks operate in four
different frequency ranges. Most GSM networks operate in the 900 MHz .GSM-
900 uses 890–915 MHz to send information from the mobile station to the base
station (uplink) and 935–960 MHz for the other direction (downlink).This
25MHz band width is subdivided into 124 carrier frequency channels, each
spaced 200 KHz apart.
The channel data rate is 270.833Kbit/s .GSM has used a variety of voice
codec’s to squeeze 3.1 kHz audio into between 5.6 and 13 kbit/s. Originally, two
codec’s, named after the types of data channel they were allocated, were used,
called Half Rate (5.6 kbit/s) and Full Rate (13 kbit/s). These used a system based
upon linear predictive coding (LPC). In addition to being efficiency with bit
rates, these codec’s also made it easier to identify more important parts of the
audio.
The modulation used in GSM is Gaussian minimum-shift keying
(GMSK), a kind of continuous-phase frequency shift keying. In GMSK, the
signal to be modulated onto the carrier is first smoothed with a Gaussian low-
pass filter prior to being fed to a frequency modulator, which greatly reduces the
interference to neighboring.

43
4.14.3 GSM FREQUENCIES

GSM networks operate in a number of different frequency ranges


(separated into GSM frequency ranges for 2G and UMTS frequency bands for
3G). Most 2G GSM networks operate in the 900 MHz or 1800 MHz bands.
Some countries in the Americas (including Canada and the United States) use
the 850 MHz and 1900 MHz bands because the 900 and 1800 MHz frequency
bands were already allocated. Most 3G GSM networks in Europe operate in the
2100 MHz frequency band.

The rarer 400 and 450 MHz frequency bands are assigned in some
countries where these frequencies were previously used for first-
generation systems.

GSM-900 uses 890–915 MHz to send information from the mobile station
to the base station (uplink) and 935–960 MHz for the other direction (downlink),
providing 124 RF channels (channel numbers 1 to 124) spaced at 200 kHz.
Duplex spacing of 45 MHz is used.

In some countries the GSM-900 band has been extended to cover a larger
frequency range. This 'extended GSM', E-GSM, uses 880–915 MHz (uplink)
and 925–960 MHz (downlink), adding 50 channels (channel numbers 975 to
1023 and 0) to the original GSM-900 band. Time division multiplexing is used
to allow eight full-rate or sixteen half-rate speech channels per radio frequency
channel.

There are eight radio timeslots (giving eight burst periods) grouped into
what is called a TDMA frame. Half rate channels use alternate frames in the
same timeslot. The channel data rate for all 8 channels is 270.833 kbit/s, and the
frame duration is 4.615 ms. The transmission power in the handset is limited to a
maximum of 2 watts in GSM850/900 and 1 watt in GSM1800/1900.

44
4.14.4 COMPONENTS OF A GSM NETWORK

Subcriber Equipment

Mobile Station (MS) - The mobile telephone.

4.14.5 SWITCHING SYSTEM (SS)

Home Location Register (HLR) - A database which stores data about


GSM subscribers, including the Individual Subscriber Authentication Key (Ki)
for each Subscriber Identity Module (SIM).Mobile Services Switching Center
(MSC) - The network element which performs the telephony switching
functions of the GSM network. The MSC is responsible for toll ticketing,
network interfacing, common channel signaling.

Visitor Location Register (VLR) - A database which stores temporary


information about roaming GSM subscribers. Authentication Center (AUC) - A
database which contains the International Mobile Subscriber Identity (IMSI) the
Subscriber Authentication key (Ki), and the defined algorithms for encryption.
Equipment Identity Register (EIR) - A database which contains information
about the identity of mobile equipment in order to prevent calls from stolen,
unauthorized, or defective mobile stations.

4.14.6 BASE STATION SYSTEM (BSS)

Base Station Controller (BSC) - The network element which provides all
the control functions and physical links between the MSC and BTS. The BSC
provides functions such as handover, cell configuration data, and control of
radio frequency (RF) power levels in Base Transceiver Stations.

Base Transceiver Station (BTS) - The network element which handles the
radio interface to the mobile station. The BTS is the radio equipment
(transceivers and antennas) needed to service each cell in the network.
45
4.14.7 OPERATION AND SUPPORT SYSTEM (OSS)

Message Center (MXE) - A network element which provides Short


Message Service (SMS), voice mail, fax mail, email, and paging. Mobile
Service Node (MSN) - A network element which provides mobile intelligent
network (IN) services. Gateway Mobile Services Switching Center (GMSC) - A
network element used to interconnect two GSM networks. GSM Interworking
Unit (GIWU) - The network element which interfaces to various data networks.

4.14.8 GSM NETWORK


Global System for Mobile communication (GSM) is a standard for digital
communication. GSM uses the Time Division Multiple Access (TDMA). The
switching system is responsible for performance call processing and subscriber-
related functions. The concept of cellular service is the use of low - power
transmitters where frequencies can be reused within a geographic area.

Figure 4.14 GSM Network Elements

46
All radio-related functions are performed in the Base Station System
(BSS), which consist of Base Station Controllers (BSCs), and the base
Transceiver Stations (BTSs).
BSC provides all the control function and physical links between the
MSC and BTS. It is a high-capability switch that provides functions such as
handover, cell configuration data, and control of Radio Frequency (RF) power
levels in base transceiver stations. A number of BSCs are served by an MSC.
Operation and Maintenance Center (OMC) is connected to all equipment
in the switching system and to the BSC [Albert treytl, et al, 2003]. The
implementation of OMC is called the Operation and Support System (OSS). The
OSS is the functional entity from which the network operates monitors and
controls the system.
The purpose of OSS is to offer the customer cost-effective support for
centralized, region, and local operational and maintenance activities that are
required for a GSM network. An important function of OSS is to provide a
network overview and support the maintenance activities of different operation
and maintenance organizations.
4.14.9 AT COMMANDS
AT commands are used to exchange the information with the mobile
telephone and PC or microcontroller.
 Uses of AT Commands
o It configures the mobile telephone and PC.
o It requests the information about the current configuration or the
operational status of the mobile phone.
o Test availability and request the range of valid parameters, when
applications, for an AT command.
 Modes of Operation
The modem can be operated in any one of three operations.

47
 OFF-LINE COMMAND MODE - The modem is placed in off-
line command mode when first powered up and is ready for
entry of AT commands.
 ON-LINE DATA MODE - This allows “normal” operation of
the mobile, exchanging data with the remote modem.
 ON-LINE COMMAND MODE - We can switch to the on-line
command mode when we want send AT command while still
remaining connected the remote modem.
The operation of AT commands can be done in common mode, there are
four types of command we can issue
 A set command to adjust the modem’s operating parameters.
 An execute command which directs action without the need of any
parameters.
 A read command to view the current command settings.
 A test command to view the available command parameters.
All these AT commands can be split into three categories
 Basic AT commands.
 S parameter AT commands.
 Extended AT commands.
Some Example of AT Commands
RDY will be displayed when the modem is connected to COM port 1 and
hyper terminal is initiated.
 AT (Attention command)
It determines the presence of a mobile.
COMMAND: AT
OUTPUT : OK
Selecting a Sms Format
 To select SMS format.
Test command:
48
AT+ CMGF=<mode>
<mode>: 0 - Pdu format.
1 - Text format.
Command : AT+CMGF=?
Response : OK.
For text format,
Command : AT+CMGF=1
Response : OK.

List Sms Message


It returns message with status value <stat> from preferred message
storage the mobile.
COMMAND : AT +CMGL= [<STAT>]
If text mode
<stat> _ “REC UNREAD" Received unread messages (default).
"REC READ" Received read messages.
"STO UNSENT" Stored unsent messages.
"STO SENT" Stored sent messages.
"ALL" All messages.
Response:
TA returns messages with status value <stat> from message storage
<mem1> to the TE. . If status of the message is ' received unread ', then the
status in the storage changes to 'received read'.
To list the received SMS
AT+CMGL (Command)
+CMGL: 1, “REC UNREAD”, “+919865078509”,”07/05/09,
14:39:40+22”
“HI” (SMS in the inbox).
OK (Response).

49
To Read a Sms
 +CMGR - Read message
It returns message with location value <index> from preferred message
storage to the mobile.
COMMAND: AT+CMGR=<index> [, <mode>]
<index> - integer type; value in the range of location numbers
Supported by the associated memory.
<mode> - 0 : normal.
1: not change status of the specified SMS record.
Response:
TA returns SMS message with location value <index> from message
storage <mem1> to the TE. If status of the message is 'received unread', then the
status in the storage is changed to 'received read'.
When a SMS is received, a message will be displayed as
+CMTI:”SM”, 1
To read that SMS
COMMAND : AT+ CMGR= 2
OUTPUT : OK
To Delete a Sms
It deletes a message from preferred message storage <mem1> location
<index>.
COMMAND : AT +CMCD=<index>
<index> - integer value in the range of location number supported by the
associated memory.
COMMAND : AT+CMGD = 2
OUTPUT : OK (deletes the message at the index)
These are some of the examples of AT commands that are used for the
communication between the microcontroller or PC and the mobile telephone.

50
Subcriber Identity Module

One of the key features of GSM is the Subscriber Identity Module (SIM),
commonly known as a SIM card. The SIM is a detachable smart card containing
the user's subscription information and phone book. This allows the user to
retain his or her information after switching handsets. Alternatively, the user can
also change operators while retaining the handset simply by changing the SIM.
Some operators will block this by allowing the phone to use only a single SIM,
or only a SIM issued by them; this practice is known as SIM locking, and is
illegal in some countries.
4.14.10 SMS TECHNOLOGY
The SMS (Short Message Service) [Bernard J. Bennington, 1998] is used
to send the energy meter reading to the host computer when requested. SMS is
essentially similar to paging, SMS message do not require the mobile phone to
be active within range, as they will be held for a number of days until the phone
is active and within range. SMS message are transmitted within the same cell or
to anyone with roaming capability. They can also be sent to digital phones from
a web site equipped with a PC Link or from one digital phone to another.
An SMS gateway is a web site that lets you enter an SMS message to
someone within the served by that gateway or acts as an international gateway
for users with roaming capability. The SMS is a store and forward service. In
other words, Short messages are not sent directly from sender to recipient, but
via an SMS center. Each mobile telephone network that supports SMS has one
or more messaging centers to handle and manage the short message. The SMS
features confirmation of message delivery.

51
Short message can be sent and received simultaneously with GSM voice,
data and fax calls. This is possible because whereas voice, data and fax calls
take over a dedicated radio channels for the duration of calls, short message
travel over and above the radio channel using the signaling path. As such, user
of SMS rarely, if ever, gets a busy or engaged signal as they can do during peak
network usage times.
Types of sending multiple short messages are available. They are
 SMS concatenation (stringing several short messages together),
 SMS compression (getting more than 160 characters of information
within a single short message) have been defined and incorporated in the
GSM SMS standard.

52
CHAPTER 5
SOFTWARE DETAILS
5.1 EMBEDDED C
Looking around, we find ourselves to be surrounded by various types
of embedded systems. Be it a digital camera or a mobile phone or a washing
machine, all of them has some kind of processor functioning inside it.
Associated with each processor is the embedded software. If hardware forms the
body of an embedded system, embedded processor acts as the brain, and
embedded software forms its soul. It is the embedded software which primarily
governs the functioning of embedded systems.
During infancy years of microprocessor based systems, programs were
developed using assemblers and fused into the EPROMs. There used to be no
mechanism to find what the program was doing. LEDs, switches, etc. were used
to check correct execution of the program. Some ‘very fortunate’ developers had
In-circuit Simulators (ICEs), but they were too costly and were not quite reliable
as well.
As time progressed, use of microprocessor-specific assembly-only as the
programming language reduced and embedded systems moved onto C as the
embedded programming language of choice. C is the most widely used
programming language for embedded processors/controllers. Assembly is also
used but mainly to implement those portions of the code where very high timing
accuracy, code size efficiency, etc. are prime requirements.
Initially C was developed by Kernighan and Ritchie to fit into the space of
8K and to write (portable) operating systems. Originally it was implemented on
UNIX operating systems.

53
As it was intended for operating systems development, it can manipulate
memory addresses. Also, it allowed programmers to write very compact codes.
This has given it the reputation as the language of choice for hackers too.As
assembly language programs are specific to a processor, assembly language
didn’t offer portability across systems. To overcome this disadvantage, several
high level languages, including C, came up. Some other languages like PLM,
Modula-2, Pascal, etc. also came but couldn’t find wide acceptance.
Amongst those, C got wide acceptance for not only embedded systems,
but also for desktop applications. Even though C might have lost its sheen as
mainstream language for general purpose applications, it still is having a strong-
hold in embedded programming. Due to the wide acceptance of C in the
embedded systems, various kinds of support tools like compilers & cross-
compilers, ICE, etc. came up and all this facilitated development of embedded
systems using C. Subsequent sections will discuss what is Embedded C, features
of C language, similarities and difference between C and embedded C, and
features of embedded C programming.

5.2 EMBEDDED SYSTEMS PROGRAMMING


Embedded systems programming is different from developing
applications on a desktop computers.
Key characteristics of an embedded system such as :
 Embedded devices have resource constraints(limited ROM, limited RAM,
limited stack space, less processing power)
 Components used in embedded system and PCs are different;
 Embedded systems typically uses smaller, less power consuming
components.

54
 Embedded systems are more tied to the hardware.
Two salient features of Embedded Programming are code speed and code
size. Code speed is governed by the processing power, timing constraints,
whereas code size is governed by available program memory and use of
programming language. Goal of embedded system programming is to get
maximum features in minimum space and minimum time.
5.3 EMBEDDED SYSTEM ARE PROGRAMMED USING DIFFERENT
TYPE OF LANGUAGES

 Machine Code
 Low level language, i.e., assembly
 High level language like C, C++, Java, Ada, etc.
 Application level language like Visual Basic, scripts, Access, etc.
Assembly language maps mnemonic words with the binary machine
codes that the processor uses to code the instructions. Assembly language seems
to be an obvious choice for programming embedded devices. However, use of
assembly language is restricted to developing efficient codes in terms of size and
speed. Also, assembly codes lead to higher software development costs and code
portability is not there.
Developing small codes are not much of a problem, but large
programs/projects become increasingly difficult to manage in assembly
language.
Finding good assembly programmers has also become difficult
nowadays. Hence high level languages are preferred for embedded systems
programming.

55
5.4 USE OF C IN EMBEDDED SYSTEM IS DRIVEN BY
FOLLOWING ADVANTAGES
 It is small and reasonably simpler to learn, understand, program and debug.
 C Compilers are available for almost all embedded devices in use today, and
there is a large pool of experienced C programmers.
 Unlike assembly, C has advantage of processor-independence and is not
specific to any particular microprocessor/ microcontroller or any system.
This makes it convenient for a user to develop programs that can run on
most of the systems.
 As C combines functionality of assembly language and features of high level
languages, C is treated as a ‘middle-level computer language’ or ‘high level
assembly language’
 It is fairly efficient
 It supports access to I/O and provides ease of management of large
embedded projects.
Many of these advantages are offered by other languages also, but what
sets C apart from others like Pascal, FORTRAN, etc. is the fact that it is a
middle level language; it provides direct hardware control without sacrificing
benefits of high level languages. Compared to other high level languages, C
offers more flexibility because C is relatively small, structured language; it
supports low-level bit-wise data manipulation.
Compared to assembly language, C Code written is more reliable and
scalable, more portable between different platforms (with some changes).
Moreover, programs developed in C are much easier to understand, maintain
and debug. Also, as they can be developed more quickly, codes written in C
offers better productivity.

56
C is based on the philosophy ‘programmers know what they are doing’;
only the intentions are to be stated explicitly. It is easier to write good code in C
& convert it to an efficient assembly code (using high quality compilers) rather
than writing an efficient code in assembly itself. Benefits of assembly language
programming over C are negligible when we compare the ease with which C
programs are developed by programmers.
Objected oriented language, C++ is not apt for developing efficient
programs in resource constrained environments like embedded devices. Virtual
functions & exception handling of C++ are some specific features that are not
efficient in terms of space and speed in embedded systems. Sometimes C++ is
used only with very few features, very much as C.
Ada, also an object-oriented language, is different than C++. Originally
designed by the U.S. DOD, it didn’t gain popularity despite being accepted as an
international standard twice (Ada83 and Ada95). However, Ada language has
many features that would simplify embedded software development. Java is
another language used for embedded systems programming. It primarily finds
usage in high-end mobile phones as it offers portability across systems and is
also useful for browsing applications. Java programs require Java Virtual
Machine (JVM), which consume lot of resources. Hence it is not used for
smaller embedded devices.
Dynamic C and B# are some proprietary languages which are also being
used in embedded applications.
Efficient embedded C programs must be kept small and efficient; they
must be optimized for code speed and code size. Good understanding of
processor architecture embedded C programming and debugging tools facilitate
this.

57
5.5 DIFFERENCE BETWEEN C AND EMBEDDED C
Though C and embedded C appear different and are used in different
contexts, they have more similarities than the differences. Most of the constructs
are same; the difference lies in their applications.
C is used for desktop computers, while embedded C is for microcontroller
based applications. Accordingly, C has the luxury to use resources of a desktop
PC like memory, OS, etc. While programming on desktop systems, we need not
bother about memory. However, embedded C has to use with the limited
resources (RAM, ROM, I/Os) on an embedded processor. Thus, program code
must fit into the available program memory. If code exceeds the limit, the
system is likely to crash.
Compilers for C (ANSI C) typically generate OS dependant
executables. Embedded C requires compilers to create files to be downloaded to
the microcontrollers/microprocessors where it needs to run. Embedded
compilers give access to all resources which is not provided in compilers for
desktop computer applications.
Embedded systems often have the real-time constraints, which is usually
not there with desktop computer applications. Embedded systems often do not
have a console, which is available in case of desktop applications. So, what
basically is different while programming with embedded C is the mindset; for
embedded applications, we need to optimally use the resources, make the
program code efficient

58
5.6 EMBEDDED SYSTEM AND MICROCONTROLLER

Embedded systems are controllers with on chip control. They consist of


microcontrollers, input and output devices, memories etc., on chip and they can
be used for a specific application.
A small computer designed in a single chip is called a single chip
microcomputer. A single chip microcomputer typically includes a
microprocessor RAM, ROM, timer, interrupt and peripheral controller in a
single chip. This single chip microcomputer is also called as microcontroller;
These Microcontrollers are used for variety of applications where it replaces the
computer. The usage of this microcomputer for a specific application, in which
the microcontrollers a part of application, is called embedded systems.
Embedded systems are used for real time applications with high
reliability, accuracy and precision, Embedded systems are operated with Real
Time Operating systems like WinCE, RT Linux, VxWorks, PSOS, etc..,
Embedded systems are very popular these days Most of the Electrical,
Electronics, Mechanical;, Chemical, Industrial, Medical, Space and many more
areas have the embedded systems in their applications

5.7 APPLICATION OF EMBEDDED SYSTEM

 Embedded systems are used in the following areas;


 Robotics
 Aviation
 Telecommunication and Broadcasting
 Mobile Phones and mobiles networking
 Wires Application
 Satellite Communication

59
 Military Application
 Medical Instruments
 Toy industries
 Blue Tooth
 Electronic sensors
 Home Appliances etc
5.8 ROLE OF EMBEDDED SYSTEMS
Embedded systems are compact, smart, efficient, and economical and user
friendly, they are closed systems and respond to the real world situation very
fast, closed system means, everything required for a specific application is
embedded on the chip and hence, they do not call for external requirement for
their functioning.
5.9 SEGMENTS OF EMBEDDED SYSTEMS
Embedded systems basically consists of the following four segments
 Embedded Controllers (8-bit,16-bit,32-bit,64-bit,128-bit,..)
 Embedded software’s (RTOS)
 Embedded Memories (DRAM, SRAM, EPROM, Flashetc)
 Embedded Boards
5.10 MICROCONTROLLER VERSUS MICROPROCESSORS
Microcontrollers differ from a microprocessor in many ways, first and the
most important is its functionality. In order for a microprocessor to be used,
other components for receiving and sending data must be added to it, In short
that means that microprocessor is the very heart of the computer.
On the other hand, microcontroller is designed to be all of that in one, No other
external components are needed for its application because all necessary
peripherals are already built into, thus, we save the time and space needed to
construct device.

60
The difference can be highlighted as follows:

MICROPROCESSORS MICROCONTROLLER

Contains ALU,GP registers, SP, PC, In addition, it contains inbuilt


clock timing circuit and interrupts ROM, RAM I/O devices,
Timers/Counters, etc..,

Many instructions to move data One or two instructions to move


between Memory and CPU data between memory and CPU

One or two bit handling instructions Powerful Boolean processor


are available instruction set is available

Access time for memory and I/O Less access time for inbuilt
devices are more memory and I/O devices

Requires more hardware, increase in Requires less hardware, reduced


PCB size PCB size and increased reliability

More flexible from design point of Less Flexible


view

Single memory map for data and Separate memory Map for data
code and code

Few pins are multifunctional More pins are multifunctional

Microprocessor based computers are Microcontroller based systems are


normally operated with general normally operated with RTOS like
purpose operating systems like tiny RTOS, VxWorks, PSOS, RT
Windows, Unix etc.., Linux, etc..,

61
5.11 CROSS-COMPILER

Cross-compiler is a software program, which is used to convert high –


level language program like C to machine language of a specific
Microcontroller, using cross-compiler user can write programs in C language,
which speeds up the development process.

5.12 SIMULATOR

Simulator is software, which implements the features of a specific


Microcontroller on PC. It helps in testing and debugging the programs and
interfaces that are to be actually implemented on a Microcontroller at a later
stage. Using simulator, the program can be executed and tested without using
the evaluation kit, usually the program is simulated under pc environment.

5.13 EMULATOR

Emulator is an in-circuit Microcontroller emulation probe, which provides


the user with substantial control over all of the Microcontroller functions and
responsibilities. It provides hardware assistance for debugging the most difficult
real time problems. Emulators offer visibility into system initialization, before
software based debuggers can function, Emulators can identify the code
corrupting a data structure, it can also be used to determine how often a
particular function is invoked,

5.14 DEBUGGER

It is a software tool used to debug the programs. A debugger detects the


non-workability of the program by detecting the errors online (i.e. while the
program is running in the target it has the capability to detect proper functioning
of the application program.)

62
CHAPTER 6
ADVANTAGES

 Wireless communication
 Real time sms notification
 Pre – detection and control
 Remote monitoring
 Prevention

63
CONCLUSION

Many patients died in ICU unit due to the careless of in- charge personal. In
traditional system is not able to provides constant monitoring facilities. Our
proposed system described in this paper allows doctors or nurses, as well as
hospital in-charge personal allows them to monitor the patient in ICU unit in
real time, which improves the efficiency and service quality. There is a huge
opportunity to modify this system as a wearable device, that allows us to
monitor the older people or babies remotely from any place.

64
APPENDIX - I
PROGRAM CODING

#include <SoftwareSerial.h>
//#include "dht.h"
#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
SoftwareSerial mySerial(3,2);
//dht DHT;
//int humty;
//int temp;
//#de
fine dht_apin A1
int temp_level = A0;
int res_level = A2;
int mems_level = A1;
int swt = A3;
int buzzer= 6;
int relay= 7;
int flag1 = 0;
int flag2 = 0;
int flag3 = 0;
int flag4 = 0;
int flag5 = 0;
int
temperature,temperature_level,respitarory,respitarory_level,aclero,aclero_level,
button;
void setup()
{

65
pinMode(swt, INPUT);
pinMode(buzzer, OUTPUT);
pinMode(relay, OUTPUT);
//digitalWrite(buzzer, LOW);
digitalWrite(relay, LOW);
Serial.begin(9600);
mySerial.begin(9600);
delay(100);
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0, 0);
lcd.write(" PATIENT ");
lcd.setCursor(0, 1);
lcd.write("MONITORING SYSM ");
delay(2000);
lcd.clear();
}
void loop()
{
//DHT.read11(dht_apin);
//humty = (DHT.humidity);
//temp = (DHT.temperature);
temperature = analogRead(temp_level);
respitarory = analogRead(res_level);
aclero = analogRead(mems_level);
button = digitalRead(swt);
temperature_level=(temperature/2);

66
respitarory_level=(respitarory/20);
aclero_level=(aclero/5);
lcd.setCursor(0,0);
lcd.write("TMP:");
lcd.print(temperature_level);
lcd.setCursor(8,0);
lcd.write("RES:");
lcd.print(respitarory_level);
lcd.setCursor(0,1);
lcd.write("MNT:");
lcd.print(aclero_level);
lcd.setCursor(8,1);
lcd.write("SWT:");
if(temperature_level >= 40 && flag1 == 0)
{
//digitalWrite(buzzer, HIGH);
//digitalWrite(relay, HIGH);
mySerial.print("7603974520,HIGH TEMPERATURE,SMS\r\n");
delay(2000);
flag1 = 1 ;
}
else if(temperature_level <= 40)
{
//digitalWrite(buzzer, LOW);
//digitalWrite(relay, LOW);
flag1 = 0 ;
}
if(respitarory_level <= 40 && flag2 == 0)
{

67
//digitalWrite(buzzer, HIGH);
//digitalWrite(relay, HIGH);
mySerial.print("7603974520,ABNORMAL RESIPIRATORY,SMS\r\n");
delay(2000);
flag2 = 1;
}
else if(respitarory_level>= 40)
{
//digitalWrite(buzzer, LOW);
//digitalWrite(relay, LOW);
flag2 = 0 ;
}
//else
if(aclero_level <= 80 || aclero_level >= 85 && flag3 == 0)
{
// digitalWrite(buzzer, HIGH);
//digitalWrite(relay, HIGH);
mySerial.print("7603974520,DETECT BODY
MOVEMENT,SMS\r\n");
delay(2000);
flag3 = 1;
}
else if(aclero_level >= 75 && aclero_level <= 85)
{
//digitalWrite(buzzer, LOW);
//digitalWrite(relay, LOW);
flag3 = 0;
}
//else

68
if( button == LOW && flag4 == 0)
{
//digitalWrite(buzzer, HIGH);
// digitalWrite(relay, HIGH);
lcd.setCursor(12,1);
lcd.write("ON ");
mySerial.print("7603974520,ALERT.NEED HELP,SMS\r\n");
delay(2000);
flag4 = 1;
}
else if(button == HIGH )
{
lcd.setCursor(12,1);
lcd.write("OFF");
//digitalWrite(buzzer, LOW);
//digitalWrite(relay, LOW);
flag4 = 0 ;
}
// else
if((temperature_level >= 40 || respitarory_level <= 40 || aclero_level <= 75
|| aclero_level >= 85 || button == LOW) && flag5 == 0)
{
//digitalWrite(buzzer, HIGH);
digitalWrite(relay, HIGH);
delay(3000);
flag5 = 1 ;
}
else //if((temp <= 40 || humty <= 50 || co2 <= 150 || ch4 <= 100) &&
flag5 == 1)

69
{
digitalWrite(buzzer, LOW);
digitalWrite(relay, LOW);
flag5 = 0 ;
}
}

70
APPENDIX II

71
REFERENCE

1. Bhilare.R and Mali.S, “Iot based smart home with real time e-metering
using e-controller,” 2015 India Council International Conference
(INDICON), IEEE.
2. Congress on Information and Communication Technologies.
3. Dohr.A, Modre-Opsrian.R, Drobics.M, Hayn.D, and Schreier.G, “The
internet of things for ambient assisted living,” 2010 Seventh International
Conference on Information Technology.
4. E. C.-W. Lau, “Simple Bus Tracking System,” Journal of Advanced
Computer Science and Technology Research, vol. 3, no. 1, 2013.
5. (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom).
6. Jain.P.N and Agarkar.T.P, “An embedded, gsm based, multi- parameter,
realtime patient monitoring system and control; an implementation for icu
patients,” 2012 World Congress on Information and Communication
Technologies.
7. Jassas.M.S, Qasem, and Mahmoud.Q.H, “A smart system connecting e-
health sensors and the cloud,” 2015 IEEE 28th Canadian Conference on
Electrical and Computer Engineering (CCECE).
8. Kumar.K.M and Venkatesan.R.S, “A Design Approach To Smart Health
Monitoring Using Android Mobile Devices,” 2014 IEEE International
Conference on Advanced Communications, Control and Computing
Technologies.
9. Kumar.R and Rajasekaran.M.P, “An IoT based patient monitoring system
using raspberry pi,” 2016 International Conference on Computing
Technologies and Intelligent Data Engineering (ICCTIDE’16).
10. Malhi.K, Mukhopadhyay.S.C, Schnepper.J, Haefke.M, and Ewald.H, “A
zigbee-based wearable physiological parameters monitoring system,”
72
IEEE Sensors Journal, vol. 12, no. 3, pp. 423–430, March 2012.

11. Mansor.H, Shukor.M.H.A, Meskam.S.S, Rusli.N.Q.A.M and Zamery.N.S,


“Body temperature measurement for remote health monitoring system,”
2013 IEEE International Conference on Smart Instrumentation,
Measurement and Applications (ICSIMA).
12. Mohammed.J, Lung.C.H, Ocneanu.A, Thakral.A, Jones.C and Adler.A,
“Internet of things: Remote patient monitoring using web services and
cloud computing,” 2014 IEEE International Conference on Internet of
Things (iThings), and IEEE Green Computing and Communications
13. Piyare.R, “Internet of things: ubiquitous home control and monitoring
system using android based smart phone,” International Journal of
Internet of Things, vol. 2, no. 1, pp. 5–11, 2013.
14. Rahmat.R.F, Athmanathan, Syahputra.M.F and Lydia.M.S, "Real time
monitoring system for water pollution in Lake Toba," 2016 International
Conference on Informatics and Computing (ICIC).
15. Roy.S and Gupta.R, “Short range centralized cardiac health monitoring
system based on zigbee communication,” 2014 IEEE Global
Humanitarian Technology Conference - South Asia Satellite (GHTC-
SAS.
16. Salman.L, Salman.S, Jahangirian.S, Abraham.M, German.F, Blair.C and
Krenz.P, “Energy Efficient IoT-Based Smart Home,” 2016 IEEE 3rd
World Forum on. IEEE.
17. Srinivasa.K.G, Siddiqui.N, and Kumar.A, “Parasense – a sensor
integrated cloud based internet of things prototype for real time
monitoring applications,” 2015 IEEE Region 10th Symposium.

73

You might also like