You are on page 1of 65

AUTOMATIC NURSING MANAGEMENT SYSTEM

BY
TADVI VAISHALI P. (106140311120)
CHAUDHARI VARSHA H. (106140311127)

UNDER THE GUIDANCE OF


Internal Guide

External Guide

Ms. Arti Visana

Mr.Rohit Dabhi
NakalanK Microelectronics

Lecturer DECE
Ahmadabad
A PROJECT REPORT SUBMITTED TO

ELECTRONICS AND COMMUNICATION DEPARTMENT


GOVERNMENT POLYTECHNIC FOR GIRLS,
AHMEDABAD
MAY-2015

DEPARTMENT OF ELECTRONICS &COMMUNICATION ENGINEERING


GOVERNMENT POLYTECHNIC FOR GIRLS,AHMEDABAD
(Affiliated to Gujarat Technological University,Ahmedabad

CERTIFICATCE
This is to certify that Project Work entitled AUTOMATIC NURSING
MANAGEMENT SYSTEM is carried out by Tadvi vaishali p. (106140311120),at
Government Polytechnic For Girls ,Ahmedabad(Institute code:614) for Partial fulfillment of
Diploma Electronics &11111Communication degree to be awarded by Gujarat Technological
University. This Project Work has been carried out under my supervision and is to my
satisfaction.

Date:
Place: GPG; Ahmedabad
INTERNAL GUIDE

HOD

Ms.Artimem

Mr.S.S. PATEL

GPG; Ahmedabad

GGP; Ahmedabad

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING


Government Polytechnic for Girls, Ahmedabad
(Affiliated to Gujarat Technological University, Ahmedabad)

II

CERTIFICATCE
This is to certify that Project Work entitled AUTOMATIC NURSING
MANAGEMENT SYSTEM is carried out by Chaudhari varsha h. (106140311127), at
Government Polytechnic For Girls ,Ahmedabad (Institute code:614) for Partial fulfillment of
Diploma Electronics & Communication degree to be awarded by Gujarat Technological
University. This Project Work has been carried out under my supervision and is to my
satisfaction.

Date:
Place: GPG; Ahmedabad
INTERNAL GUIDE
Ms. Arti Visana
GGP; Ahmedabad

HOD
Mr. S.S. PATEL
GGP; Ahmedabad

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING


Government Polytechnic for Girls, Ahmedabad
(Affiliated to Gujarat Technological University, Ahmedabad)

III

ACKNOWLEDGEMENT
It is a privilege for us to have been associated with Ms. Artimem
during this project work. We have been greatly benefited by their valuable suggestions
and ideas. It is with great pleasure that we express our deep sense of gratitude to them for
their valuable guidance, constant encouragement and patience throughout this work.
We express our gratitude to Mr. S.S.PATEL Head of Department of Electronics &
Communications for his constant encouragement, co-operations, and support.
We take this opportunity to thank all our classmates for their company during the course
work and for useful discussion we had with them.
We would be failing in our duties if we do not make a mention of our family members
including our parents for providing moral support without which work would not have
been completed

Tadvi vaishali p. (106140311120)


Chaudhari varsha h. (106140311127)

IV

ABSTRACT

The nurse is confronted daily with the challenge of managing time between different
patients between different rooms. The nursing shortage has only compounded this
problem. So, I want to develop a system which helps to nurse I their work. When any
one patient will press the switch in the emergency condition at that time the led of
that patient will be on in the nurse room this is a done wireless. For one critical case if
more than two patients will press the switch same time then lamps will be on and
emergency buzzer will sound. This facility indicates that more than two nurses are
required to handle the patient .This system is very helpful to big hospitals. It will
improve the management of hospital and save time of nurse.

INDEX
CONTENSTS

PAGE.NO

Title Page

Certificate Page

II

Acknowledgement

IV

Abstract

Chapter 1

1-3

1.1Introduction
1.2Industrial survey
1.3Company introduction

Chapter 2

4-8

2.1 Purpose
2.2 scope
2.3 Technology used
2.4 Hardware used
2.5 software used
2.6 Block diagram
2.7 Block diagram description

Chapter 3

9-14

Power supply
3.1 Circuit diagram
3.2 Circuit diagram description
3.3 7805 IC description

Chapter 4

15-23

Microcontroller
4.1 Introduction
4.2 Pin description

Chapter 5

24-28

Wireless module
5.1RF transceivers
5.1.1 Features
5.1.2 Key specifications
5.1.3 Application ideas
5.2 RF transceivers pin diagram & description
5.2.1 Connecting and testing
5.2.2 Theory of operation
5.2.3 Pin definitions and Ratings
5.2.4 Communication protocol

IV
IV
IV
IV
IV
IV
IV
IV
IV

IV

Chapter 6

29-51

LED
6.1 Figure
6.2 Theory
6.3 LCD Image & description
6.4 Pin description
6.5 LCD Commands

Chapter 7

52-54

7.1 Advantages of project& Application


7.2 Future work
7.3Bibliography

CHAPTER 1

INTRODUCTION

1.1 INTRODUCTION
The nurse is confronted daily with the challenge of managingtime between different patients between
different rooms.
I want to develop a system which helps to nurse in their work.
In this facility more than two nurses are required to handle the patient
This system is very helpful to big hospitals. It will improve the management of hospital and save time of

nurse.

1.2 INDUSTRIAL SURVEY:


We had gone below mentioned companies for project reviews and found company name.
1. NEXTA EMBEDDED TECNOLOAG, NAVRANGPURA, AHMEDABAD.
2. BRIGHT INFOLUTIONS, SHVRANJANI, AHMEDABAD.
3. NAKALANK, VISTA, AHMEDABAD.

In NAKALANK COMPANY we got project AUTOMATIC NURSING MANAGEMENT


SYSTEM link for nursing management. They guided us for this project and we agree.

1.3 COMPANY INTRODUCTION

Our industry is Maven Automation from where we concern for our project work of
AUTOMATIC NURSING MANAGEMENT SYSTEM.
This industry is a multinational industry & the products of this industry is panel,
microcontroller automation etc.
The industry takes the contracts of textile industries. They perform the electric wire connection
and network releases 7 connection from the contract based working. OUR PROJECT WAS
PERMITTED BY Mr. Rohit Dabhi who is the head of the company.

CHAPTER 2
BLOCK DIAGRAM

2.1 Purpose
Make stable the hospital management.
Decrease work load of nurse and doctors .
Make their work easy and fast.

2.2 Scope
Hospital management system

Industrial management system


Bank management system
School & college management system

2.3Technology used
RF Transceiver
8051

2.4 Hardware used


MICROCONTROLLER
RF TRANSMITTER & RECEIVER
SWITCH
POWER SUPPLY
BUZZER
LED
LCD

2.5 Software used

KEIL SOFTWARE

MULTISIM
PROTEUS

2.6 BLOCKDIAGRAM

2.7 BLOCK DIAGRAM EXPLANATION

The block diagram shows the basic structure of wireless nursing system.

The 1st block is the control room which is made of microcontroller, switching system,
reset ckt power supply and wireless module.

The signal trough control room wirelessly transmitted to the nursing room.

The nursing room which also made of microcontroller reset ckt, power supply and LCD
display, led buzzer, wireless module and antenna.

The nursing room receives the signal comings from the control room and its indication of
which patient press the switch and required to the nurse.

CHAPTER 3
CIRCUIT DIAGRAM

3.1 Transmitter Part

Receiver Part

10

3.2 LIST OF COMPONETS


Transformer 12v

11
10

Diode
IC 7805
LCD 162
BC 547
Crystal 11.0592
Pushp switch
CAPACITOR
1000f/25v
100f/25v
33pf
10f/63v
0.1f
LED
RESISTOR
2200hm
1kohm
3k pack 8pin
Wireless module
Buzzer

12

Summary of circuit features

Brief description of operation: Gives out well regulated +5V output, output current
capability of 100 mA

Circuit protection: Built-in overheating protection shuts down output when regulator IC
gets too hot

Circuit complexity: Very simple and easy to build

Circuit performance: Very stable +5V output voltage, reliable operation

Availability of components: Easy to get, uses only very common basic components

Design testing: Based on datasheet example circuit, I have used this circuit successfully
as part of many electronics projects

Applications: Part of electronics devices, small laboratory power supply

Power supply voltage: Unregulated DC 8-18V power supply

Power supply current: Needed output current + 5 mA Component costs: Few dollars for
the electronics components + the input transformer cost

12

3.3 Description

This circuit is a small +5V power supply, which is useful when experimenting with
digital electronics, and easy to build.
Small inexpensive wall tray 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 terminal protection.

3.4 IC 7805:

13
10

1. Unregulated voltage in
2. Ground

3. Regulated voltage out

14

14

CHAPTER 4
MICROCONTROLLER

15
10

4.1 Introduction:
A microcontroller is an economical computer-on-a-chip built for dealing with specific
tasks, such as displaying or receiving information through LEDs or remote controlled
devices.
The most commonly used set of microcontrollers belong to 8051 Family. 8051
Microcontrollers continue to remain a preferred choice for a vast community of
hobbyists and professionals.
Through 8051, the world became witness to the most revolutionary set of
microcontrollers.
A microcontroller is a small and low-cost computer built for the purpose of dealing with
specific tasks, such as displaying information in a microwave LED or receiving
information from a televisions remote control.
Microcontrollers are mainly used in products that require a degree of control to be
exerted by the user.
Microcontrollers are generally built using a technology known as Complementary Metal
Oxide Semiconductor (CMOS). This technology is a competent fabrication system that
uses less power and is more immune to power spikes than other techniques

How does a Microcontroller work?

Microcontroller has an input device in order to get the input and an output device (such as

LED or LCD Display) to exhibit the final process.


Let us look into the illustration of how a microcontroller works in a Television. The
Television has a remote control as an Input device and the TV screen as the output

device.
The signal sent from the remote control is captured by the microcontroller.
The microcontroller controls the channel selection, the amplifier system and picture tube
adjustments such as hue, brightness, contra

16
10

The architecture of a microcontroller depends on the application it is built for. For


example, some designs include usage of more than one RAM, ROM and I/O functionality
integrated into the package

The architecture of a typical microcontroller is complex and may include the following::

GENERAL ARCHITECTURE

17
10

Figure 2

1. A CPU, ranging from simple 4-bit to complex 64-bit processers.


2. Peripherals such as timers, event counters and watchdog.
3.

RAM (volatile memory) for data storage. The data is stored in the form of registers,
and the general-purpose registers store information that interacts with the arithmetic
logical unit (ALU).

ROM, EPROM, EEPROM or flash memory for program and operating parameter storage.
5. Programming capabilities.
6. Serial input/output such as serial ports.
7. A clock generator for resonator, quartz timing crystal or RC circuit.
8. Analog-to-digital convertors.
9. Serial ports.

18
10

10. Data bus to carry information

19
4.2 AT89C52 microcontroller Pin Diagram and Pin Functions:
...................................................................................................................................

10

ALE/PROG: Address Latch Enable output pulse for latching the low byte of the address
d]]]]]]]urinaccesses to external memory. ALE is emitted at a constant rate of 1/6 of the

oscillator fre
external timing or clocking
purposes, even when there are no accesses to external memory. (However, one ALE
pulsefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

Figure 3

Features:
Compatible with MCS-51 Products
8K Bytes of In-System Reprogrammable Flash Memory
Endurance: 1,000 Write/Erase Cycles
Fully Static Operation: 0 Hz to 24 MHz
Three-level Program Memory Lock
256 x 8-bit Internal RAM
32 Programmable I/O Lines
Three 16-bit Timer/Counters
Eight Interrupt Sources
Programmable Serial Channel
Program Store Enable is the read strobe to external Program Memory. When the
device is executing out of external Program Memory, PSEN is activated twice each n

PIN DESCRIPTION:
20
VCC

10

Supply voltage.
GND
Ground.
Port 0
Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can sink
eight TTL inputs.
When 1sare written to port 0 pins, the pins can be used as high impedance inputs.
Port 0 can also be configured to be the multiplexed low order Address/data bus during
accesses to external program and data memory.
In this mode, P0 has internalpull-ups.Port 0 also receives the code bytes during Flash
programming and outputs the code bytes during program Verification.
External pull-ups are required during program verification.

Port 1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups.The Port 1 output buffers
can sink/source four TTL inputs.
When 1s are written to Port 1 pins, they are pulled high by the internal pull-ups and can
be used as inputs.
Port 2
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups.The Port 2 output buffers
can sink/source four TTL inputs.
When 1s are written to Port 2 pins, they are pulled high by the internal pull-ups and can
be used as inputs.
As inputs, Port 2 pins that are externally being pulled low will source current (IIL)
because of the internal pull-ups.

Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups.The Port 3 output buffers
can sink/source four TTL inputs.
When 1s are written to Port 3 pins, they are pulled high byte internal pull-ups and can be
21
used as inputs.
10

As inputs, Port 3 pins that are externally being pulled low will source current (IIL)
because of the pull-ups.
RST
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device.
ALE/PROG
Address Latch Enable is an output pulse for latching the low byte of the address during
accesses to external memory.
This pin is also the program pulse input (PROG) during Flash programming.
In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and
may be used for external timing or clocking purposes.
Note, however, that one ALE pulse is skipped during each access to external data
memory.
PSEN
Program Store Enable is the read strobe to external program memory.
When the AT89C52 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during each
access to external data memory.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000H up to FFFFH.Note,
However, that if lock bit 1 is programmed, EA will be internally latched on reset. A
should be strapped to VCC for internal program executions.

XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2
Output from the inverting oscillator amplifier.

22
10

4.3 RESET CKT

F
Figure 4
The reset circuit is shown in fig 1 and fig 2.the first circuit is the automatic switching and

the second circuit is manual reset circuit.

23
10

CHAPTER 5
WIRELESS MODULE:

5.1433MHzRFTransceivers
24
23
10
10

The Parallax
data,
robot
wireless
power-down
power state
module).

5.1.1

433 MHz RF Transmitter allows users to easily send serial


control data or other information wirelessly. Reliable
communication is as effortless as sending serial data. The
(PDN) pin may be used to place the module into a low
(active low), or left floating (it is pulled high on the

Features
HighSIP

speed data transfer rates (1200 ~ 9600 baud)


header allows for ease of use with breadboards
Compatible with most microcontrollers including the
Propeller chip and all BASIC stamp models
As easy to use as simple SEROUT/SERIN PBASIC instructions
Power-down mode for conservative energy usage
(Longer battery life)
Line-of-sight range up to 250 feet (depending on conditions)

5.1.2 Key Specifications

Power requirements: 3.3 5 VDC @ ~10 mA (~4 mA in power-down mode)


Communication: asynchronous serial @ 1200 9600 bps
Operating temperature: 32 to 158 F (0 to 70 C)
Dimensions: 3.82 H x 0.94 W x 0.41 D (97.0 mm H x 24.0 mm W x 10.5 mm D)

5.1.3 Application Ideas

Remote controlled Boe-Bot robot


Wireless data acquisition
Remote signal beacon for adventure seekers
Remote industrial monitoring
Lighting control
Keyless entry

25
10

5.2 RF Transceiver pin Diagram & Description

Figure 1: Pin Connections

5.2.1 Connecting and Testing


Connect the I/O pins above to your microcontroller as needed to use the BASIC Stamp example
code you will use P0 for DATA and P1 for TX-RX. PDN and RSSI are optional and described in
more detail on the following page.

5.2.2 Theory of Operation


26

Short for Radio Frequency, RF refers to the frequencies that fall within the electromagnetic
spectrum associated with radio wave propagation. When applied to an antenna, RF current 10
creates electromagnetic fields that propagate the applied signal through space. Any RF field has a
wavelength that is inversely proportional to the frequency. This means that the frequency of an
RF signal is inversely proportional to the wavelength of the field. The Parallax 433 MHz RF
Transceiver utilizes a frequency of433 MHz; this works out to be a wavelength of approximately
0.69 meters.

Precautions
The DATA and TX-RX pins are connected on the module to MOSFETs, which are highly
sensitive to static electricity. It is advised not to touch these pins unless necessary.

5.2.3 Pin Definitions and Ratings


Pin Name Function
1 GND Ground: 0V (VSS)
2 VIN Power: 3.3 to 5 VDC
3 Serial Data Serial Data Input/output; direction depends on T/R line
4 T/R Transmit/Receive Select: LOW/Floating = Receive; HIGH = Transmit
5 PDN Power Down: LOW = Power Down Mode; HIGH/Floating = Normal
6 RSSI Received Signal Strength Indicator

PDN
Pulling the PDN pin low puts the transceiver into low-power mode where it uses < 4 mA current.
Leaving it floating places the transceiver into normal mode where it will draw ~10 mA.

RSSI
The RSSI pin provides an analog voltage relative to what the transceiver is picking up
(receiving). Note that this signal is modulated and the voltage will vary with the rising and
falling of the DATA line.

Synchronization:
When initiating communication between two RF Transceiver modules, a sync pulse should be
sent to reestablish the radio connection between the modules. Sending several characters can
accomplish this, however sending a pulse (which maintains a high state during the
synchronization) is more efficient:

5.2.4 Communication Protocol:


27

The 433 MHz RF Transceivers do not have a built-in protocol and therefore are not immune to
noise and errors in the signal. To account for this it is recommended that you initiate error 10
checking on your microcontroller to be sure the packets are valid. You could even create a
simple protocol that could be used to verify each transmission arrives at its destination intact. For
error checking examples please see the code example downloads on the product page of our
website, www.parallax.com. You can find this by typing 27982 into the search box and clicking

28

CHAPTER 6
LED

6.1 Figure
29
10

6.2
Theory:

A Light emitting diode (LED) is essentially a pn junction diode. When carriers are
injected across a forward-biased junction, it emits incoherent light. Most of the
commercial LEDs are realized using a highly doped n and a p Junction.

To understand the principle, lets consider an unbiased pn+ junction (Figure1 shows the
pn+ energy band diagram). The depletion region extends mainly into the p-side. There is
a potential barrier from Ec on the n-side to the Ec on the p-side, called the built-in
voltage, V0.

This potential barrier prevents the excess free electrons on the n+ side from diffusing into
the p side. When a Voltage V is applied across the junction, the built-in potential is
reduced from V0to V0 V.

5.3 Applications: LED have a lot of applications

Devices, medical applications, clothing, to


Remote Controls (TVs, VCRs)
Lighting

LCD (Liquid Crystal Display)

30

6.3 16x2 LCD Image & Description

10

LCD (Liquid Crystal Display) is an electronic display module. A 16x2 LCD display is a very
basic module and commonly used in various devices and circuits. These modules are preferred
over seven segments and other multi segment LEDs. The reasons being:

LCDs are economical.


They are easily programmable.
They have no limitation of displaying special & even custom characters (unlike in seven
segments),animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD
each character is displayed in 5x7 pixel matrix. LCD has two registers, namely, Command and
Data registers. The command register stores the command instructions given to the LCD.
A command is an instruction given to LCD to do a predefined task like initializing it,
clearing its screen, setting the cursor position, controlling display etc. The data register
stores the data to be displayed on the LCD.
The data is the ASCII value of the character to be displayed on the LCD.

31

6.4 PIN DISCRIPTION

PIN NO
1
2
3

FUNCTION
Ground (0V)
Supply voltage; 5V (4.7V 5.3V)
Contrast adjustment; through a variable resistor

NAME
Ground(Vss)
Vcc
VEE

Selects command register when low; and data register


when high

Register Select
(RS)

Read/write(RW)

Low to write to the register; High to read from the


register
Sends data to data pins when a high to low pulse is
given
8 bit data bits 1

8 bit data bits 2

DB1

8 bit data bits 3

DB2

10

8 bit data bits 4

DB3

11

8 bit data bits 5

DB4

12

8 bit data bits 6

DB5

13

8 bit data bits 7

DB6

14

8 bit data bits 8

DB7

Enable(EN)
DB0

32
10

CODING
/*TX*/
#define PT_1 P2_0
#define

PT_2 P2_1

#define

PT_3 P2_2

#define

PT_4 P2_3

#define

PT_5 P2_4

#include<AT89X52.H>

#define TRUE

#define FALSE

#define ON

#define OFF

code unsigned char Line[][16]=


{

"G.P.G Ahmedabad..", //Line 0


33
10

"=*=*=*=*=*=*=*=*", //Line 1
"

",

//Line 2

"

",

//Line 3

" P1 P2 P3 P4 P5 ",
"

",

//Line 4

//Line 5

" E1 E2 E3 E4 E5 ",

//Line 6

" E1

",

//Line 7 //E1

" E2

",

//Line 8 //E2

"

",

//Line 9 //E3

",

//Line 10 //E4

E5 ",

//Line 11 //E5

E3

"
"

E4

"Gamit Sejal H. ",

//Line 12

"Kokni Martha g. ",

//Line 13

"Prepared By:

",

//Line 14

" Automatic ",

//Line 15

" Nursing System ",

//Line 16

}; //LCD

Bit bdata flg_p1,flg_p2,flg_p3, flg_p4,flg_p5;

34
10

Bit bdata E1_p1,E1_p2,E1_p3,E1_p4,E1_p5;

unsigned char Next,*p,i,Byte;

/
******************************************************************
*******************
MAIN ROUTINE STARTS HERE
******************************************************************
********************/

void MAIN(void)
{

P0 = 0X00;

//AS AN OUTPUT PORT

P1 = 0XFF;

//AS AN INPUT PORT

P2 = 0XFF;

//AS INPUT PORT

P3 = 0xFF;

//AS INPUT PORT

Lcd_On();
35
10

Delay(100); //This delay is nacessary

Display (Line[0],LINE1,16);
Displa(Line[1],LINE2,16);

Delay(2000);

Display(Line[15],LINE1,16);
Display(Line[16],LINE2,16);

Delay(2000);

Display(Line[14],LINE1,16);
Display(Line[13],LINE2,16);

Delay(2000);

Display(Line[14],LINE1,16);
Display(Line[12],LINE2,1s6);

Delay(2000);

Display(Line[4],LINE1,16);

36
10

Display(Line[5],LINE2,16);

Delay(2000);

EA = 1;

while(1)
{
ROOM_COMsMAND();
CHECK_COMMAND();
if(update==TRUE)
{

SBUF = 'O';
while(!TI);
TI = 0;
SBUF = 'o';
while(!TI);
TI = 0;
for(i=0;i<5; i++)
{
SBUF = XmitBuff[i]+0X30;

37
12
10
10

while(!TI);
TI = 0;
}

update=FALSE;
}

}
}
void CHECK_COMMAND()
{
if(E3_p1==TRUE)
{XmitBuff[0]=1;}
else
{XmitBuff[0]=0;}

if(E3_p2==TRUE)
{XmitBuff[1]=1;}
else
{XmitBuff[1]=0;}

if(E3_p3==TRUE)

38
37
10
10

{XmitBuff[2]=1;}
else
{XmitBuff[2]=0;}

if(E3_p4==TRUE)
{XmitBuff[3]=1;}
else
{XmitBuff[3]=0;}

if(E3_p5==TRUE)
{XmitBuff[4]=1;}
else
{XmitBuff[4]=0;}
}
void ROOM_COMMAND()
{
if(flg_p1==TRUE)
{
Display(Line[7],LINE2,16);
E3_p1=TRUE;
Delay(1200);
flg_p1=FALSE;
}

39
10

else if(flg_p2==TRUE)
{
Display(Line[8],LINE2,16);
E3_p2=TRUE;
Delay(1200);
flg_p2=FALSE;
}
else if(flg_p3==TRUE)
{
Display(Line[9],LINE2,16);
E3_p3=TRUE;
Delay(1200);
flg_p3=FALSE;
}
else if(flg_p4==TRUE)
{
Display(Line[10],LINE2,16);
E3_p4=TRUE;
Delay(1200);
flg_p4=FALSE;
}
else if(flg_p5==TRUE)
{

40
10

Display(Line[11],LINE2,16);
E3_p5=TRUE;
Delay(1200);
flg_p5=FALSE;
}
else
{
Display(Line[5],LINE2,16);
}
}
void keyfunction()
{
if(!PT_1)
{
flg_p1=TRUE;
}
else if(!PT_2)
{
flg_p2=TRUE;
}
else if(!PT_3)
{
flg_p3=TRUE;

41
10

}
else if(!PT_4)
{
flg_p4=TRUE;

}
else if(!PT_5)
{
flg_p5=TRUE;

42
10

/*RX*/
#define EMERGENCY_SW P2_1
#define RST

P2_0

#include<AT89X52.H>

sbit EMER_LIGHT=P3^2;

//sbit RST=P2^1;

sbit PRIMARY_BUZZER =P3^3;//LCD


sbit E1_P1=P1^0;
sbit E1_P2=P1^1;
sbit E1_P3=P1^2;
sbit E1_P4=P1^3;
sbit E1_P5=P1^4;

43

bit bdata
R1_LED1_FLG,R1_LED2_FLG,R1_LED3_FLG,R1_LED4_FLG,R1_LED5_FL
G;
unsigned char Next,*p,DataTime=0,UartInbuff[17],i,Byte,UartIncount=0;

/
******************************************************************
*******************
MAIN ROUTINE STARTS HERE
******************************************************************
********************/

void MAIN(void)
{

P0 = 0X00;

//AS AN OUTPUT PORT

P1 = 0X00;

//AS AN OUTPUT PORT

P2 = 0XFF;

//AS OUTPUT PORT

P3 = 0xFF;

Sei();

E1_P1=0;E1_P2=0;E1_P3=0;E1_P4=0;E1_P5=0;

PRIMARY_BUZZER=0;
EMER_LIGHT=0;
Delay(100); //This delay is nacessary

EA = 1;

while(1)
{
ROOM_LED_CHECK();

if(PRIMARY_BUZZER_DATA>3)
{
PRIMARY_BUZZER=1;
EMER_LIGHT=1;
}
if(flg_RST==TRUE)
{
SBUF = '1';

44

while(!TI);
TI = 0;

PRIMARY_BUZZER_DATA=0;

EMER_LIGHT=0;
flg_EMERGENCY_SW=FALSE;
PRIMARY_BUZZER=0;

EMER_LIGHT=0;

E1_P1=0;E1_P2=0;E1_P3=0;E1_P4=0;E1_P5=0;

flg_RST=FALSE;

SBUF = '1';
while(!TI);
TI = 0;
}
}
}
void SERIAL_ISR() interrupt 4 using 3
{

45

unsigned char i=0;


46
if(RI)
{
RI = 0;
Byte = SBUF;
if(Byte=='O' || Byte=='o')
{
UartIncount = 0;
}
UartInbuff[UartIncount] = Byte;
UartIncount++;
if(UartIncount>5)
{
UartIncount=0;
CHECK_ROOM_DATA();

}
}
if (TI)
{
}

47

void CHECK_ROOM_DATA() /*receive*/


{
if(UartInbuff[1]==49)
{
R1_LED1_FLG=1;
PRIMARY_BUZZER_DATA++;
}
else
{
R1_LED1_FLG=0;
}

if(UartInbuff[2]==49)
{
R1_LED2_FLG=1;
PRIMARY_BUZZER_DATA++;
}
else
{
R1_LED2_FLG=0;

}
48
if(UartInbuff[3]==49)
{
R1_LED3_FLG=1;
PRIMARY_BUZZER_DATA++;
}
else
{
R1_LED3_FLG=0;
}

if(UartInbuff[4]==49)
{
R1_LED4_FLG=1;
PRIMARY_BUZZER_DATA++;
}
else
{
R1_LED4_FLG=0;
}

if(UartInbuff[5]==49)

{
R1_LED5_FLG=1;
PRIMARY_BUZZER_DATA++;
}
else
{
R1_LED5_FLG=0;
}
}

void ROOM_LED_CHECK()
{
if(R1_LED1_FLG==1)
E1_P1=1;
else
E1_P1=0;

if(R1_LED2_FLG==1)
E1_P2=1;
else
E1_P2=0;

if(R1_LED3_FLG==1)

49

E1_P3=1;
else

50

E1_P3=0;

if(R1_LED4_FLG==1)
E1_P4=1;
else
E1_P4=0;

if(R1_LED5_FLG==1)
E1_P5=1;
else
E1_P5=0;
}

51

CHAPTER 7
conclusion

52

7.1 Advantages of Project


Easy installation
Less time
Make stable the hospital management.
Decrease work load
make their work easy and fast

Application:
Hospital management system
Industrial management system
Bank management system
School & college management system

7.2 Future works


It is best for the automatic control .we think this hospital has nursing in the future. At the
moment the components are a bit to high able to hospital these devices for an nursing
management. It is also used for hospital management.

53

7.3Bibliography
1. The 8051 Microcontroller And Embedded Systems using Assembly and C
Muhammad Ali Mazidi | Janice Gillespie Mazidi| Rolin D.McKinlays
2. www.8051projects.com
3. www.encyclopedia.com
4. www.wikipedia.com

54
53

You might also like