Вы находитесь на странице: 1из 79

DIGITAL AUTOMATED HOSPITAL

ROBOT

CONTENTS
CHAPTER No

TITLE

ABSTRACT

INTRODUCTION
HARDWARE

BLOCK DIAGRAM

BLOCK DIAGRAM DESCRIPTION


4.1 ABOUT MICROCONTROLER
4.2 LIQUID CRYSTAL DISPLAY
4.3 ENCODER
4.4 DECODER
4.5 RF TX AND RF RX

OVERALL CIRCUIT DIAGRAM

OVERALL CIRCUIT DIAGRAM DESCRIPTION


6.1 POWER SUPPLY CIRCUIT
6.2 MICROCONTROLLER CIRCUIT
6.3

ENCODER WITH RF TX

6.4 DECODER WITH RF RX


6.5 TEMPERATURE CIRCUIT
6.6 RELAY
6.7 DC MOTOR
6.8 HEART BEAT

6.9 APR9600
7

PCB DESIGN
7.1

INTRODUCTION

7.2

SOFTWARE

7.3

MANUFACTURING

7.4

PANELISATION

7.5

PLATING

7.6

ETCHING

7.7

SOLDER MASK

7.8

HOT AIR LEVELING

SOFTWARE
8

PIC SOFTWARE TOOLS


8.1 PIC SOFT
8.2

SIMULATOR

PROGRAM

10

ADVANTAGES

11

APPLICATIONS

12

CONCLUSION

13

REFERENCES

1. ABSTRACT

2. INTRODUCTION

Present industry is increasingly shifting towards automation. Two

principle

components of todays industrial automations are programmable controllers and


robots. In order to aid the tedious work and to serve the mankind, today there is a
general tendency to develop an intelligent operation.
The proposed system DIGITAL AUTOMATED HOSPITAL
ROBOT is designed and developed to accomplish the various tasks in an adverse
environment of an industry. The intelligent machine is loaded with several units such
as Pic microcontroller, high purchase equipment, relay and driver circuit, ,Heartbeat
Sensor, Temperature sensor, LDR, Dc Motor which synchronously work with the help
of a start-of-the-art Atmel microcontroller. This fire fighter system is to the technical
advancement. This prototype system can be applied effectively and efficiently in an
expanded dimension to fit for the requirement of industrial, research and commercial
applications.

Microcontroller is the heart of the device which handles all the sub devices
connected across it. We have used as Atmel microcontroller. It has flash type
reprogrammable memory. It has some peripheral devices to play this project perform.
It also provides sufficient power to inbuilt peripheral devices. We need not give
individually to all devices. The peripheral devices also activates as low power
operation mode. These are the advantages are appear here.

3. BLOCK DIAGRAM

4. BLOCK DIAGRAM DESCRIPTION


4. 1 2.

MICRO CONTROLLER

2.1 CONCEPTS OF MICROCONTROLLER :


Microcontroller is a general
purpose

device, which

integrates a number of the components of a

microprocessor system on to single chip. It has inbuilt

CPU, memory and

peripherals to make it as a mini computer. A microcontroller combines on to the


same microchip:
The CPU core
Memory(both ROM and RAM)
Some parallel digital i/o
Microcontrollers will combine other devices such as:
A timer module to allow the microcontroller to perform tasks for certain
time periods.
A serial i/o port to allow data to flow between the controller and other
devices such as a PIC or another microcontroller.
An ADC to allow the microcontroller to accept analogue input data for
processing.
Microcontrollers are :
Smaller in size
Consumes less power
Inexpensive

Micro controller is a stand alone unit ,which can perform functions


on its own without any requirement for additional hardware like i/o ports and
external memory.
The heart of the microcontroller is the CPU core. In the past, this has traditionally
been based on a 8-bit microprocessor unit. For example Motorola uses a basic
6800 microprocessor core in their 6805/6808 microcontroller devices.
In the recent years, microcontrollers have been
developed around specifically designed CPU cores, for example the microchip
PIC range of microcontrollers.
2.2 INTRODUCTION TO PIC :
The microcontroller that has been used for this
project is from PIC series. PIC microcontroller is the first RISC based
microcontroller

fabricated

in

CMOS

(complimentary

metal

oxide

semiconductor) that uses separate bus for instruction and data allowing
simultaneous access of program and data memory.
The main advantage of CMOS and RISC
combination is low power consumption resulting in a very small chip size with a
small pin count. The main advantage of CMOS is that it has immunity to noise
than other fabrication techniques.
PIC (16F877) :
Various microcontrollers offer different kinds
of memories. EEPROM, EPROM, FLASH etc. are some of the memories of
which FLASH is the most recently developed. Technology that is used in

pic16F877 is flash technology, so that data is retained even when the power is
switched off. Easy Programming and Erasing are other features of PIC 16F877.
PIC START PLUS PROGRAMMER :
The PIC start plus development system from
microchip technology provides the product development engineer with a highly
flexible low cost microcontroller design tool set for all microchip PIC micro
devices. The picstart plus development system includes PIC start plus
development programmer and mplab ide.
The PIC start plus programmer gives the product developer
ability to program user software in to any of the supported microcontrollers. The
PIC start plus software running under mplab provides for full interactive control
over the programmer.
2.3 SPECIAL FEATURES OF PIC MICROCONTROLLER :
CORE FEATURES :
High-performance RISC CPU
Only 35 single word instructions to learn
All single cycle instructions except for program branches which are two cycle
Operating speed: DC - 20 MHz clock input
DC - 200 ns instruction cycle
Up to 8K x 14 words of Flash Program Memory,
Up to 368 x 8 bytes of Data Memory (RAM)
Up to 256 x 8 bytes of EEPROM data memory
Pin out compatible to the PIC16C73/74/76/77
Interrupt capability (up to 14 internal/external
Eight level deep hardware stack
9

Direct, indirect, and relative addressing modes


Power-on Reset (POR)
Power-up Timer (PWRT) and Oscillator Start-up Timer (OST)
Watchdog Timer (WDT) with its own on-chip RC Oscillator for reliable
operation
Programmable code-protection
Power saving SLEEP mode
Selectable oscillator options
Low-power, high-speed CMOS EPROM/EEPROM technology
Fully static design
In-Circuit Serial Programming (ICSP) via two pins
Only single 5V source needed for programming capability
In-Circuit Debugging via two pins
Processor read/write access to program memory
Wide operating voltage range: 2.5V to 5.5V
High Sink/Source Current: 25 mA
Commercial and Industrial temperature ranges
Low-power consumption:
< 2mA typical @ 5V, 4 MHz
20mA typical @ 3V, 32 kHz
< 1mA typical standby current
PERIPHERAL FEATURES :
Timer0: 8-bit timer/counter with 8-bit prescaler
Timer1: 16-bit timer/counter with prescaler, can be incremented during sleep
via external crystal/clock
Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
10

Two Capture, Compare, PWM modules


Capture is 16-bit, max resolution is 12.5 ns,
Compare is 16-bit, max resolution is 200 ns,
PWM max. resolution is 10-bit
10-bit multi-channel Analog-to-Digital converter
Synchronous Serial Port (SSP) with SPI.

(Master Mode) and I2C.

(Master/Slave)
Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI)
with
9- bit address detection.
Brown-out detection circuitry for Brown-out Reset (BOR)

2.4 ARCHITECTURE OF PIC 16F877 :


The complete architecture of PIC
16F877 is shown in the fig 2.1. Table 2.1 gives details about the specifications of
PIC 16F877. Fig 2.2 shows the complete pin diagram of the IC PIC 16F877.

FIG 2.1 ARCHITECTURE OF PIC 16F877

11

12

TABLE 2.1 SPECIFICATIONS

DEVICE
PIC
16F877

PROGRAM FLASH
8K

DATA

DATA

MEMORY

EEPROM

368 Bytes

256 Bytes

FIG 2.2 PIN DIAGRAM OF PIC 16F877

13

TABLE 2.2 PIN OUT DESCRIPTION

14

Legend:

I = input O = output I/O = input/output P = power


= Not used TTL = TTL input

ST = Schmitt Trigger input

Note
1. This buffer is a Schmitt Trigger input when configured as an external interrupt
2. This buffer is a Schmitt Trigger input when used in serial programming mode.
3. This buffer is a Schmitt Trigger input when configured as general purpose I/O
and a TTL

15

input when used in the Parallel Slave Port mode (for interfacing to a
microprocessor bus).
4. This buffer is a Schmitt Trigger input when configured in RC oscillator mode
and a
CMOS input otherwise.

Legend:

I = input O = output I/O = input/output P = power


= Not used TTL = TTL input ST = Schmitt Trigger input

Note :
16

1. This buffer is a Schmitt Trigger input when configured as an external interrupt.


2. This buffer is a Schmitt Trigger input when used in serial programming mode.
3. This buffer is a Schmitt Trigger input when configured as general purpose I/O
and a TTL
input when used in the Parallel Slave Port mode (for interfacing to a
microprocessor bus).
4. This buffer is a Schmitt Trigger input when configured in RC oscillator mode
and a
CMOS input otherwise.
2.5 I/O PORTS :
Some pins for these I/O ports are multiplexed with an
alternate function for the peripheral features on the device. In general, when a
peripheral is enabled, that pin may not be used as a general purpose I/O pin.
Additional Information on I/O ports may be found in the IC
micro Mid-Range Reference Manual,
PORTA AND THE TRISA REGISTER :
PORTA is a 6-bit wide bi-directional port. The corresponding
data direction register is TRISA. Setting a TRISA bit (=1) will make the
corresponding PORTA pin an input, i.e., put the corresponding output driver in a
Hi-impedance mode. Clearing a TRISA bit (=0) will make the corresponding
PORTA pin an output, i.e., put the contents of the output latch on the selected pin.
Reading the PORTA register reads the status of the
pins whereas writing to it will write to the port latch. All write operations are
read-modify-write operations. Therefore a write to a port implies that the port
pins are read; this value is modified, and then written to the port data latch. Pin
17

RA4 is multiplexed with the Timer0 module clock input to become the
RA4/T0CKI pin. The RA4/T0CKI pin is a Schmitt Trigger input and an open
drain output. All other RA port pins have TTL input levels and full CMOS output
drivers. Other PORTA pins are multiplexed with analog inputs and analog VREF
input. The operation of each pin is selected by clearing/setting the control bits in
the ADCON1 register (A/D Control Register1).
The TRISA register controls the direction of the RA pins, even when they
are being used as analog inputs. The user must ensure the bits in the TRISA
register are maintained set when using them as analog inputs.

TABLE 2.3 PORT A FUNCTION

Legend: TTL = TTL input, ST = Schmitt Trigger input


TABLE 2.4 SUMMARY OF REGISTERS ASSOCIATED WITH PORTA

18

Legend:

x = unknown, u = unchanged, - = unimplemented locations

read as '0'. Shaded cells are not used by PORTA.


PORTB AND TRISB REGISTER :
PORTB is an 8-bit wide bi-directional port.
The corresponding data direction register is TRISB. Setting a TRISB bit (=1) will
make the corresponding PORTB pin an input, i.e., put the corresponding output
driver in a hi-impedance mode. Clearing a TRISB bit (=0) will make the
corresponding PORTB pin an output, i.e., put the contents of the output latch on
the selected pin. Three pins of PORTB are multiplexed with the Low Voltage
Programming function; RB3/PGM, RB6/PGC and RB7/PGD. The alternate
functions of these pins are described in the Special Features Section. Each of the
PORTB pins has a weak internal pull-up. A single control bit can turn on all the
pull-ups.
This

is

performed

by

clearing

bit

RBPU

(OPTION_REG<7>). The weak pull-up is automatically turned off when the port
pin is configured as an output. The pull-ups are disabled on a Power-on Reset.
Four of PORT Bs pins, RB7:RB4, have an interrupt on
change feature. Only pins configured as inputs can cause this interrupt to occur
(i.e. any RB7:RB4 pin configured as an output is excluded from the interrupt on
change comparison). The input pins (of RB7:RB4) are compared with the old
value latched on the last read of PORTB. The mismatch outputs of RB7:RB4
are ORed together to generate the RB Port Change Interrupt with flag bit RBIF
(INTCON<0>). This interrupt can wake the device from SLEEP. The user, in the
interrupt service routine, can clear the interrupt in the following manner:
19

a) Any read or write of PORTB. This will end the mismatch


condition.
b) Clear flag bit RBIF. A mismatch condition will continue to set flag
bit RBIF. Reading PORTB will end the mismatch condition, and allow flag bit
RBIF to be cleared. The interrupt on change feature is recommended for wake-up
on key depression operation and operations where PORTB is only used for the
interrupt on change feature. Polling of PORTB is not recommended while using
the interrupt on change feature. This interrupt on mismatch feature, together with
software configurable pull-ups on these four pins, allow easy interface to a
keypad and make it possible for wake-up on key depression

TABLE 2.5 PORT B FUNCTIONS

20

TABLE 2.6 SUMMARY OF REGISTERS ASSOCIATED WITH PORTB

PORTC AND THE TRISC REGISTER :


PORTC is an 8-bit wide bi-directional port.
The corresponding data direction register is TRISC. Setting a TRISC bit (=1)
will make the corresponding PORTC pin an input, i.e., put the corresponding
output driver in a hi-impedance mode. Clearing a TRISC bit (=0) will make the
corresponding PORTC pin an output, i.e., put the contents of the output latch on

21

the selected pin. PORTC is multiplexed with several peripheral functions.


PORTC pins have Schmitt Trigger input buffers.
When the I2C module is enabled,
the PORTC (3:4) pins can be configured with normal I2C levels or with SMBUS
levels by using the CKE bit (SSPSTAT <6>). When enabling peripheral
functions, care should be taken in defining TRIS bits for each PORTC pin. Some
peripherals override the TRIS bit to make a pin an output, while other peripherals
override the TRIS bit to make a pin an input. Since the TRIS bit override is in
effect while the peripheral is enabled, read-modify write instructions (BSF, BCF,
XORWF) with TRISC as destination should be avoided. The user should refer to
the corresponding peripheral section for the correct TRIS bit settings.
TABLE 2.7 PORTC FUNCTIONS

TABLE 2.8 SUMMARY OF REGISTERS ASSOCIATED WITH PORTC

22

PORTD AND TRISD REGISTERS :


This section is not applicable to the 28-pin
devices. PORTD is an 8-bit port with Schmitt Trigger input buffers. Each pin is
individually configurable as an input or output. PORTD can be configured as an
8-bit wide microprocessor Port (parallel slave port) by setting control bit
PSPMODE (TRISE<4>). In this mode, the input buffers are TTL.
TABLE 2.9 PORTD FUNCTIONS

TABLE 2.10 SUMMARY OF REGISTERS ASSOCIATED WITH PORTD

23

PORTE AND TRISE REGISTER :


PORTE

has

three

pins

RE0/RD/AN5,

RE1/WR/AN6 and RE2/CS/AN7, which are individually configurable as inputs


or outputs. These pins have Schmitt Trigger input buffers.
The PORTE pins become control inputs for the
microprocessor port when bit PSPMODE (TRISE<4>) is set. In this mode, the
user must make sure that the TRISE<2:0> bits are set (pins are configured as
digital inputs). Ensure ADCON1 is configured for digital I/O. In this mode the
input buffers are TTL.
PORTE pins are multiplexed with analog inputs.
When selected as an analog input, these pins will read as '0's. TRISE controls the
direction of the RE pins, even when they are being used as analog inputs. The
user must make sure to keep the pins configured as inputs when using them as
analog inputs.
TABLE 2.11 PORTE FUNCTIONS

24

TABLE 2.12 SUMMARY OF REGISTERS ASSOCIATED WITH PORTE

2.6 MEMORY ORGANISATION :


There are three memory blocks in each of
the PIC16F877 MUCs. The program memory and Data Memory have separate
buses so that concurrent access can occur.
PROGRAM MEMORY ORGANISATION :
The PIC16f877 devices have a 13-bit
program counter capable of addressing 8K *14 words of FLASH program
memory. Accessing a location above the physically implemented address will
25

cause a wraparound. The RESET vector is at 0000h and the interrupt vector is at
0004h.
DATA MEMORY ORGANISTION :
The data memory is partitioned into
multiple banks which contain the General Purpose Registers and the special
functions Registers. Bits RP1 (STATUS<6) and RP0 (STATUS<5>) are the bank
selected bits.
RP1:RP0

Banks

00

01

10
11

2
3
Each bank extends up to 7Fh (1238 bytes).

The lower locations of each bank are reserved for the Special Function Registers.
Above the Special Function Registers are General Purpose Registers,
implemented as static RAM. All implemented banks contain special function
registers. Some frequently used special function registers from one bank may be
mirrored in another bank for code reduction and quicker access.

PIC16F877 REGISTER FILE MAP

26

27

GENERAL PURPOSE REGISTER FILE :


The register file can be accessed either
directly or indirectly through the File Selected Register (FSR). There are some
Special Function Registers used by the CPU and peripheral modules for
controlling the desired operation of the device. These registers are implemented
as static RAM. The Special Function Registers can be classified into two sets;
core (CPU) and peripheral. Those registers associated with the core functions.
2.7 INSTRUCTION SET SUMMARY :
Each PIC 16f877 instruction is a 14-bit
word, divided into an OPCODE which specifies the instruction type and one or
more operand which further specify the operation of the instruction.
PIC16F877 instruction set summary in Table 2.13

The

lists byte-oriented, bit-

oriented, and literal and control operations. It shows the opcode Field
descriptions.
TABLE 2.13 OPCODE FIELD DESCRIPTIONS

28

For

byte-oriented

instructions,

represents a file register designator and d represents a destination designator.


The file register designator specifies which file register is to be used by the
instruction. The destination designator specified where the result of the operation
is to be placed. If d is zero, the result is placed in the w register. If d is one,
the result is placed in the file register specified in the instruction.
For

bit-oriented

instructions,

represents a bit field designator which selects the number of the bit affected by
the operation, which f represents the address of the file in which the bits is
located. For literal and control operations, k represents an eight or eleven bit
constant or literal value.

29

The instruction set is highly orthogonal and is grouped into three basic
categories:
Byte-oriented operations
Bit-oriented operations
Literal and control operations
All instructions are executed within one
single instruction cycle, unless a conditional test is true or the program counter is
changed as a result of an instruction. In this case, the execution takes two
instruction cycles with the second cycle executed as a NOP. One instruction cycle
consists of four oscillator periods. Thus, for an oscillator frequency of 4 MHz, the
normal instruction execution time is 1 ms. If a conditional test is true or the
program counter is changed as a result of an instruction, then the instruction
execution time is 2 ms.

TABLE 2.14 16F877 INSTRUCTION SET

30

31

GENERAL FORMAT FOR INSTRUCTIONS :

32

4.2 LIQUID CRYSTAL DISPLAY (LCD)


Liquid crystal displays (LCDs) have materials, which combine the properties of
both liquids and crystals. Rather than having a melting point, they have a temperature
range within which the molecules are almost as mobile as they would be in a liquid,
but are grouped together in an ordered form similar to a crystal.
An LCD consists of two glass panels, with the liquid crystal material sand
witched in between them. The inner surface of the glass plates are coated with
transparent electrodes which define the character, symbols or patterns to be displayed
polymeric layers are present in between the electrodes and the liquid crystal, which
makes the liquid crystal molecules to maintain a defined orientation angle.
One each polarizes are pasted outside the two glass panels. These polarizes
would rotate the light rays passing through them to a definite angle, in a particular
direction. When the LCD is in the off state, light rays are rotated by the two polarizes
and the liquid crystal, such that the light rays come out of the LCD without any
orientation, and hence the LCD appears transparent.
When sufficient voltage is applied to the electrodes, the liquid crystal molecules
would be aligned in a specific direction. The light rays passing through the LCD would
be rotated by the polarizes, which would result in activating / highlighting the desired
characters. The LCDs are lightweight with only a few millimeters thickness. Since the
LCDs consume less power, they are compatible with low power electronic circuits,
and can be powered for long durations.

33

The LCD does not generate light and so light is needed to read the display. By
using backlighting, reading is possible in the dark. The LCDs have long life and a
wide operating temperature range. Changing the display size or the layout size is
relatively simple which makes the LCDs more customers friendly.
The LCDs used exclusively in watches, calculators and measuring instruments
are the simple seven-segment displays, having a limited amount of numeric data. The
recent advances in technology have resulted in better legibility, more information
displaying capability and a wider temperature range. These have resulted in the LCDs
being extensively used in telecommunications and entertainment electronics. The
LCDs have even started replacing the cathode ray tubes (CRTs) used for the display
of text and graphics, and also in small TV applications.
Crystalonics dotmatrix (alphanumeric) liquid crystal displays are available in
TN, STN types, with or without backlight. The use of C-MOS LCD controller and driver
ICs result in low power consumption. These modules can be interfaced with a 4-bit or
8-bit microprocessor /Micro controller.

The built-in controller IC has the following features:

Correspond to high speed MPU interface (2MHz)

80 x 8 bit display RAM (80 Characters max)

9,920-bit character generator ROM for a total of 240 character fonts. 208

character fonts (5 x 8 dots) 32 character fonts (5 x 10 dots)

64 x 8 bit character generator RAM 8 character generator RAM 8 character fonts

(5 x 8 dots) 4 characters fonts (5 x 10 dots)

Programmable duty cycles

1/8 for one line of 5 x 8 dots with cursor

1/11 for one line of 5 x 10 dots with cursor

1/16 for one line of 5 x 8 dots with cursor

Wide range of instruction functions display clear, cursor home, display on/off,

cursor on/off, display character blink, cursor shift, display shift.

34

Automatic reset circuit, which initializes the controller / driver ICs after power on.

35

4.3 ENCODER
An encoder is a device used to change a signal (such as a bit stream) or data
into a code. The code may serve any of a number of purposes such as compressing
information for transmission or storage, encrypting or adding redundancies to the input
code, or translating from one code to another. This is usually done by means of a
programmed algorithm, especially if any part is digital, while most analog encoding is
done with analog circuitry.
Example

A compressor is used to encode data into a smaller form.

A multiplexer combines multiple inputs into one output.

A rotary encoder is a sensor, transducer for converting rotary motion or

position to a code of electronic pulses.

A linear encoder is a sensor, transducer or readhead paired with a scale

that encodes position.

4.4 DECODER
A decoder is a device which does the reverse of an encoder, undoing the
encoding so that the original information can be retrieved. The same method used to
encode is usually just reversed in order to decode.
In digital electronics this would mean that a decoder is a multiple-input,
multiple-output logic circuit that converts coded inputs into coded outputs, where the
input and output codes are different. e.g. n-to-2n, BCD decoders.

36

Enable inputs must be on for the decoder to function, otherwise its outputs
assume a single "disabled" output code word. Decoding is necessary in applications
such as data multiplexing, 7 segment display and memory address decoding.
The simplest decoder circuit would be an AND gate because the output of an
AND gate is "High" (1) only when all its inputs are "High".
Example: A 2-to-4 Line Single Bit Decoder
A slightly more complex decoder would be the n-to-2n type binary decoders.
These type of decoders are combinational circuits that convert binary information from
'n' coded inputs to a maximum of 2n unique outputs. We say a maximum of 2n outputs
because in case the 'n' bit coded information has unused bit combinations, the
decoder may have less than 2n outputs. We can have 2-to-4 decoder, 3-to-8 decoder
or 4-to-16 decoder. We can form a 3-to-8 decoder from two 2-to-4 decoders (with
enable signals).

4.5 RF TRANSMITTER AND RECEIVER


Radio frequency, or RF, is a frequency or rate of oscillation within the range of
about 3 Hz and 300 GHz. This range corresponds to frequency of alternating current
electrical signals used to produce and detect radio waves. Since most of this range is
beyond the vibration rate that most mechanical systems can respond to, RF usually
refers to oscillations in electrical circuits.
Electrical currents that oscillate at RF have special properties not shared by
direct current signals. One such property is the ease with which it can ionize air to
create a conductive path through air. This property is exploited by 'high frequency'
units used in electric arc welding. Another special property is an electromagnetic force
that drives the RF current to the surface of conductors, known as the skin effect.

37

Another property is the ability to appear to flow through paths that contain insulating
material, like the dielectric insulator of a capacitor. The degree of effect of these
properties depends on the frequency of the signals.
RF transmitter and receiver are available for operation in the 868-870MHz band
in Europe and the 902928MHz band in North America, both modules combine full
screening with internal filtering to ensure EMC compliance by minimizing spurious
radiation and susceptibility.
These RF transmitter & receiver will suit one-to-one and multi-node wireless
links in such applications as car and building security, EPOS and inventory tracking,
remote industrial process monitoring and data networks. Because of their small size
and low power requirements, both Modules are ideal for use in portable, batterypowered applications such as handheld terminals.

38

5. OVERALL CIRCUIT DIAGRAM

39

40

6. OVERALL CIRCUIT DIAGRAM DESCRIPTION


6.1 POWER SUPPLY DESCRIPTION
Block diagram
The ac voltage, typically 220V rms, is connected to a transformer, which steps
that ac voltage down to the level of the desired dc output. A diode rectifier then
provides a full-wave rectified voltage that is initially filtered by a simple capacitor filter
to produce a dc voltage. This resulting dc voltage usually has some ripple or ac
voltage variation.
A regulator circuit removes the ripples and also remains the same dc value
even if the input dc voltage varies, or the load connected to the output dc voltage
changes. This voltage regulation is usually obtained using one of the popular voltage
regulator IC units.

TRANSFORMER

RECTIFIER

FILTER

Block diagram (Power supply)

41

IC REGULATOR

LOAD

Working principle
Transformer
The transformer will step down the power supply voltage (0-230V) to (0-6V) level.
Then the secondary of the potential transformer will be connected to the precision
rectifier, which is constructed with the help of opamp. The advantages of using
precision rectifier are it will give peak voltage output as DC; rest of the circuits will give
only RMS output.

Bridge rectifier
When four diodes are connected as shown in figure, the circuit is called as
bridge rectifier. The input to the circuit is applied to the diagonally opposite corners of
the network, and the output is taken from the remaining two corners.
Let us assume that the transformer is working properly and there is a positive
potential, at point A and a negative potential at point B. the positive potential at point A
will forward bias D3 and reverse bias D4.
The negative potential at point B will forward bias D1 and reverse D2. At this
time D3 and D1 are forward biased and will allow current flow to pass through them;
D4 and D2 are reverse biased and will block current flow.
The path for current flow is from point B through D1, up through RL, through
D3, through the secondary of the transformer back to point B. this path is indicated by
the solid arrows. Waveforms (1) and (2) can be observed across D1 and D3.

42

One-half cycle later the polarity across the secondary of the transformer
reverse, forward biasing D2 and D4 and reverse biasing D1 and D3. Current flow will
now be from point A through D4, up through RL, through D2, through the secondary of
T1, and back to point A. This path is indicated by the broken arrows. Waveforms (3)
and (4) can be observed across D2 and D4. The current flow through RL is always in
the same direction. In flowing through RL this current develops a voltage
corresponding to that shown waveform (5). Since current flows through the load (RL)
during both half cycles of the applied voltage, this bridge rectifier is a full-wave
rectifier.
One advantage of a bridge rectifier over a conventional full-wave rectifier is that
with a given transformer the bridge rectifier produces a voltage output that is nearly
twice that of the conventional full-wave circuit.
This may be shown by assigning values to some of the components shown in
views A and B. assume that the same transformer is used in both circuits. The peak
voltage developed between points X and y is 1000 volts in both circuits. In the
conventional full-wave circuit shownin view A, the peak voltage from the center tap
to either X or Y is 500 volts. Since only one diode can conduct at any instant, the
maximum voltage that can be rectified at any instant is 500 volts.
The maximum voltage that appears across the load resistor is nearly-but never
exceeds-500 v0lts, as result of the small voltage drop across the diode. In the bridge
rectifier shown in view B, the maximum voltage that can be rectified is the full
secondary voltage, which is 1000 volts. Therefore, the peak output voltage across the
load resistor is nearly 1000 volts. With both circuits using the same transformer, the
bridge rectifier circuit produces a higher output voltage than the conventional full-wave
rectifier circuit.

43

IC voltage regulators
Voltage regulators comprise a class of widely used ICs. Regulator IC
units contain the circuitry for reference source, comparator amplifier, control device,
and overload protection all in a single IC. IC units provide regulation of either a fixed
positive voltage, a fixed negative voltage, or an adjustably set voltage. The regulators
can be selected for operation with load currents from hundreds of milli amperes to
tens of amperes, corresponding to power ratings from milli watts to tens of watts.

Circuit diagram (Power supply)


A fixed three-terminal voltage regulator has an unregulated dc input voltage, Vi,
applied to one input terminal, a regulated dc output voltage, Vo, from a second
terminal, with the third terminal connected to ground.

44

The series 78 regulators provide fixed positive regulated voltages from 5 to 24


volts. Similarly, the series 79 regulators provide fixed negative regulated voltages from
5 to 24 volts.

For ICs, microcontroller, LCD --------- 5 volts

For alarm circuit, op-amp, relay circuits ---------- 12 volts

45

6.2 MICROCONTROLLER CIRCUIT

The microcontroller circuit is connected with reset circuit, crystal oscillator


circuit, lcd circuit the reset circuit is the one which is an external interrupt which is
designed to reset the program. And the crystal oscillator circuit is the one used to
generate the pulses to microcontroller and it also called as the heart of the
microcontroller here we have used 12mhz crystal which generates pulses upto
12000000 frequency which is converted it machine cycle frequency when divided by

46

12 which is equal to 1000000hz to find the time we have to invert the frequency so
that we get one micro second for each execution of the instruction.

The lcd that is liquid crystal display which is used to display the what we need the lcd
has fourteen pins in which three pins for the command and eight pins for the data. If
the data is given to lcd it is write command which is configured by the programmer
otherwise it is read command in which data read to microcontroller the data pins are
given to the to port0 and command pins are given to the port2.
Other than these pin a one pin configured for the contrast of the lcd. Thus the
microcontroller circuit works

47

6.3 ENCODER WITH RF TRANSMITTER CIRCUIT

ENCODER:

In this circuit HT 640 is used as encoder. The 318 encoders are a series of CMOS
LSIs for remote control system application. They are capable of encoding 18 bits of
information which consists of N address bit and 18-N data bits. Each address/data
input is externally trinary programmable if bonded out. It is otherwise set floating
48

internally. Various packages of the 318 encoders offer flexible combination of


programmable address/data is transmitted together with the header bits via an RF or
an infrared transmission medium upon receipt of a trigger signal. The capability to
select a TE trigger type further enhances the application flexibility of the 3 18 series of
encoders.
In this circuit the input signal to be encoded is given to AD7-AD0 input pins of
encoder. Here the input signal may be from key board, parallel port, microcontroller or
any interfacing device. The encoder output address pins are shorted so the output
encoded signal is the combination of (A0-A9) address signal and (D0-D7) data signal.
The output encoded signal is taken from 8 th which is connected to RF transmitter
section.
RF TRANSMITTER:
When ever the high output pulse is given to base of the transistor BF
494, the transistor is conducting so tank circuit is oscillated. The tank circuit is consists
of L2 and C4 generating 433 MHz carrier signal. Then the modulated signal is given
LC filter section. After the filtration the RF modulated signal is transmitted through
antenna.

6.4 DECODER WITH RF RECEIVER CIRCUIT

49

RF RECEIVER:

The RF receiver is used to receive the encoded data which is transmitted by


the RF transmitter. Then the received data is given to transistor which acts as
amplifier. Then the amplified signal is given to carrier demodulator section in which
transistor Q1 is turn on and turn off conducting depends on the signal. Due to this the
capacitor C14 is charged and discharged so carrier signal is removed and saw tooth
signal is appears across the capacitor. Then this saw tooth signal is given to
comparator. The comparator circuit is constructed by LM558.
The comparator is used to convert the saw tooth signal to exact square pulse. Then
the encoded signal is given to decoder in order to get the decoded original signal.

50

DECODER:
In this circuit HT648 is used as decoder. The 3 18 decoder are a series of
CMOS LSIs for remote control system application. They are paired with 3 18 series of
encoders. For proper operation a pair of encoder/decoder pair with the same number
of address and data format should be selected. The 3 18 series of decoder receives
serial address and data from that series of encoders that are transmitted by a carrier
using an RF or an IR transmission medium. It then compares the serial input data
twice continuously with its local address. If no errors or unmatched codes are
encountered, the input data codes are decoded and then transferred to the output
pins. The VT pin also goes high to indicate a valid transmission.
The 318 decoders are capable of decoding 18 bits of information that consists of N
bits of address and 18-N bits of data. To meet various applications they are arranged
to provide a number of data pins whose range is from 0 t08 and an address pin whose
range is from 8 to 18. In addition, the 3 18 decoders provide various combinations of
address/ data numbering different package.
In this circuit the received encoded signal is 9th pin of the decoder. Now the decoder
separate the address (A0-A9) and data signal (D0-D7). Then the output data signal is
given to microcontroller or any other interfacing device.

51

6.5 TEMPEARURE SENSOR


Temperature measurement Using Thermistor
Schematic diagram :

Schematic Explanation:
In this circuit the thermistor is used to measure the temperature. Thermistor
is nothing but temperature sensitive resistor. There are two type of thermistor
available such as positive temperature co-efficient and negative temperature coefficient. Here we are using negative temperature co-efficient in which the
resistance value is decreased when the temperature is increased.
Potential divider form:

If the R1 and R2 value is equal means


the output is half of the Vcc supply. In this
circuit output is a variable one. So the output

is

depending upon the R2 resistance value.


Resistance value will be varied depend upon
the Temperature level. Temperature varied
means the resistance value also varied. If
resistance value increased means output also increased. The resistance value and
52

output is a directly proportional one. Then the final voltage is given to ADC for
convert the analog signal to digital signal. Then the corresponding digital signal
is taken to process in microcontroller.
The ADC value will increase if the temperature increased. We can
measure the temperature only with the help of any controller or processor.
PCB LAYOUT :

THERMISTOR :
A thermistor is a type of resistor used to measure temperature changes,
relying on the change in its resistance with changing temperature. Thermistor is a
combination of the words thermal and resistor. If we assume that the relationship
between resistance and temperature is linear (i.e. we make a first-order
approximation), then we can say that:
R = kT
Where
R = change in resistance
T = change in temperature
k = first-order temperature coefficient of resistance

53

Thermistors can be classified into two types depending on the sign of k. If


k is positive, the resistance increases with increasing temperature, and the device
is called a positive temperature coefficient (PTC) thermistor, Posistor. If k is
negative, the resistance decreases with increasing temperature, and the device is
called a negative temperature coefficient (NTC) thermistor. Resistors that are not
thermistors are designed to have the smallest possible k, so that their resistance
remains almost constant over a wide temperature range.

Symbol:

6.6 RELAY CIRCUIT

54

Relay:
A relay is an electrically operated switch. Current flowing through the coil of the relay
creates a magnetic field which attracts a lever and changes the switch contacts. The coil current
can be on or off so relays have two switch positions and they are double throw (changeover)
switches. Relays allow one circuit to switch a second circuit which can be completely separate
from the first. For example a low voltage battery circuit can use a relay to switch a 230V AC
mains circuit. There is no electrical connection inside the relay between the two circuits; the
link is magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but
it can be as much as 100mA for relays designed to operate from lower voltages. Most ICs
(chips) cannot provide this current and a transistor is usually used to amplify the small IC
current to the larger value required for the relay coil. The maximum output current for the
popular 555 timer IC is 200mA so these devices can supply relay coils directly without
amplification.

55

Relays are usually SPDT or DPDT but they can have many more sets of switch
contacts, for example relays with 4 sets of changeover contacts are readily available. Most
relays are designed for PCB mounting but you can solder wires directly to the pins providing
you take care to avoid melting the plastic case of the relay. The animated picture shows a
working relay with its coil and switch contacts. You can see a lever on the left being attracted
by magnetism when the coil is switched on. This lever moves the switch contacts. There is one
set of contacts (SPDT) in the foreground and another behind them, making the relay DPDT.

The relay's switch connections are usually labeled COM, NC and NO:

COM = Common, always connect to this, it is the moving part of the switch.

NC = Normally Closed, COM is connected to this when the relay coil is off.

NO = Normally Open, COM is connected to this when the relay coil is on.

Circuit description:
This circuit is designed to control the load. The load may be motor or any other load.
The load is turned ON and OFF through relay. The relay ON and OFF is controlled by the pair
of switching transistors (BC 547). The relay is connected in the Q2 transistor collector
terminal. A Relay is nothing but electromagnetic switching device which consists of three pins.
They are Common, Normally close (NC) and Normally open (NO).

56

The relay common pin is connected to supply voltage. The normally open (NO) pin
connected to load. When high pulse signal is given to base of the Q1 transistors, the transistor
is conducting and shorts the collector and emitter terminal and zero signals is given to base of
the Q2 transistor. So the relay is turned OFF state.
When low pulse is given to base of transistor Q1 transistor, the transistor is turned
OFF. Now 12v is given to base of Q2 transistor so the transistor is conducting and relay is
turned ON. Hence the common terminal and NO terminal of relay are shorted. Now load gets
the supply voltage through relay.
Voltage Signal from
Microcontroller or PC

Transistor Q1

Transistor Q2

Relay

on

off

off

off

on

on

6.7 DC MOTOR
DC MOTOR FORWARD REVERSE CONTROL

57

Circuit working Description:


This circuit is designed to control the motor in the forward and reverse direction. It
consists of two relays named as relay1, relay2. The relay ON and OFF is controlled by the pair
of switching transistors. A Relay is nothing but electromagnetic switching device which
consists of three pins. They are Common, Normally close (NC) and normally open (NO). The
common pin of two relay is connected to positive and negative terminal of motor through
snubber circuit respectively. The relays are connected in the collector terminal of the transistors
T2 and T4.
When high pulse signal is given to either base of the T1 or T3 transistors, the transistor is
conducting and shorts the collector and emitter terminal and zero signals is given to base of the
T2 or T4 transistor. So the relay is turned OFF state.
When low pulse is given to either base of transistor T1 or T3 transistor, the
transistor is turned OFF. Now 12v is given to base of T2 or T4 transistor so the transistor is
conducting and relay is turn ON. The NO and NC pins of two relays are interconnected so only
one relay can be operated at a time.

58

The series combination of resistor and capacitor is called as snubber circuit. When the
relay is turn ON and turn OFF continuously, the back emf may fault the relays. So the back
emf is grounded through the snubber circuit.
When relay 1 is in the ON state and relay 2 is in the OFF state, the motor is running
in the forward direction.
When relay 2 is in the ON state and relay 1 is in the OFF state, the motor is running
in the reverse direction.

6.8 HEART BEAT HEART BEAT MONITOR

Heart Rate:
Heart rate is a term used to describe the frequency of the cardiac cycle. It is considered
one of the four vital signs. Usually it is calculated as the number of contractions (heart beats)
of the heart in one minute and expressed as "beats per minute" (bpm). See "Heart" for
information on embryofetal heart rates. The heart beats up to 120 times per minute in

59

childhood. When resting, the adult human heart beats at about 70 bpm (males) and 75 bpm
(females), but this rate varies among people. However, the reference range is normally between
60 bpm (if less termed bradycardia) and 100 bpm (if greater, termed tachycardia). Resting heart
rates can be significantly lower in athletes. The infant/neonatal rate of heartbeat is around 130150 bpm, the toddler's about 100130 bpm, the older child's about 90110 bpm, and the
adolescent's about 80100 bpm.
The pulse is the most straightforward way of measuring the heart rate, but it can be
deceptive when some heart beats do not have much cardiac output. In these cases (as happens
in some arrhythmias), the heart rate may be considerably higher than the pulse rate.
Measuring of Heart Rate:

The pulse rate (which in most people is identical to the heart rate) can be measured at
any point on the body where an artery is close to the surface. Such places are wrist
(radial artery), neck (carotid artery), elbow (brachial artery), and groin (femoral artery).
The pulse can also be felt directly over the heart. NOTE: The thumb should never be
used for measuring heart rate.

Producing an electrocardiogram, or ECG (also abbreviated EKG), is one of the most


precise methods of heart rate measurement. Continuous electrocardiographic
monitoring of the heart is routinely done in many clinical settings, especially in critical
care medicine. Commercial heart rate monitors are also available, consisting of a chest
strap with electrodes. The signal is transmitted to a wrist receiver for display. Heart rate
monitors allow accurate measurements to be taken continuously and can be used during
exercise when manual measurement would be difficult or impossible (such as when the
hands are being used).

It is also common to find heart rate by listening, via a stethoscope, to the movement
created by the heart as it contracts within the chest.
60

Circuit Working Description:


This circuit is designed to measure the heart rate. The heart rate is measured by IR
transmitter and receiver.
Infrared transmitter is one type of LED which emits infrared rays generally called as IR
Transmitter. Similarly IR Receiver is used to receive the IR rays transmitted by the IR
transmitter. One important point is both IR transmitter and receiver should be placed straight
line to each other. The IR transmitter and receiver are placed in the pulse rate sensor. When you
want measure the pulse rate, the pulse rate sensor has to be clipped in the finger. The IR
receiver is connected to the Vcc through the resistor which acts as potential divider. The
potential divider output is connected to amplifier section.
When supply is ON the IR transmitter passes the rays to the receiver. Depending on the
blood flow, the IR rays are interrupted. Due to that IR receiver conduction is interrupted so
variable pulse signals are generated in the potential divider point which is given to A1
amplifier through the capacitor C1. The coupling capacitor C1 is used to block the DC
component because the capacitor reactance is depends on the frequency. For DC component
the frequency is zero so the reactance is infinity now capacitor acts as open circuit for DC
component.
The amplifier section is constructed by the LM 324 quad operational amplifier. It
consists of four independent, high gains and internally frequency compensated operational
amplifiers named as A1, A2, A3 and A4 amplifiers. The varying pulse from the potential
divider is amplified by the A1 amplifier. In this amplifier the capacitor C2 is connected in
parallel with feedback resistor to filter the any DC component in the amplified signal. If any
spikes in the amplified signals, they are further filtered by the C3 and C4 capacitors. After
filtration the signal is again amplified by the A2 amplifier.
Then amplified signal is given to inverting input terminal of comparator. The
comparator is constructed by the A4 amplifier in which the reference voltage is given to non
inverting input terminal. The reference voltage is generated by the A3 amplifier. Then the
comparator compares the two signal and delivered the +12v to -12v square wave pulse at its
output.
Then the square wave signal is given to base of the BC 557 and BC547 switching
transistors in order to convert the TTL voltage 0 to 5v level. Finally the TTL output is given to

61

MM 74C04 inverter to invert the square pulse. Then the final square wave signal is given to
microcontroller or other interfacing circuit in order to monitor the heart rate.

6.9 APR9600 APR9600

This circuit is designed to record the voice signal. The microphone is used to pick up
the voice signal. Then the signal is given to APR 600 multi section sound record and replay IC.
APR 9600 is a low cost high performance sound record/reply IC incorporating flash analogue
storage technique. Record sound is retained even after power supply is removed from the
module. The replayed sound exhibits high quality with low noise level. Total sound recording
time can be varied from 32 seconds to 60 seconds by changing the value of a single resistor.
The IC can operate in two mode such as serial mode and parallel mode.
In serial access mode, sound can be recorded in 256 sections. In parallel access mode,
sound can be recorded in 2, 4 and 8 section. The IC can be controlled simply using push button

62

keys. It is also possible to control the IC using external digital circuitry such as
microcontrollers and computers.
During sound recording, sound is picked up by the microphone. A microphone preamplifier amplifies the voltage signal from the microphone. An AGC circuit is included in the
pre-amplifier, the extent of which is controlled by an external capacitor and resistor. If the
voltage level of a sound signal is around 100mv peak to peak, the signal can be fed directly
into the IC through ANA IN pin (pin 20). The sound signal passes through a filter and a
sampling and hold circuit. The analogue voltage is then written into non volatile flash analogue
RAMs.
There are two kinds of modes available. They are Record and Play mode. RE pin is pulled
low to enable recording and pulled high for playback. During record mode, we write the
processed voice signal into the memory and read the same from memory during the play mode.
If the circuit is busy in Reading or Writing, the LED glows indicating that the circuit is busy.
This LED is driven by transistor Q1. For recording into memory, MS1 and MS2 are pulled
high. To enable recording of message from the microphone, the RE pin goes low. The
maximum length of eight sound track is 7.5 seconds each. When LED2 blinks we can speak
into the mic. The recording will be terminated if the recording time exceeds 7.5 sec. Similarly
for playbacks, RE pin goes high.
M1-M8 is the eight memories that are available; each pin is connected to a push button.
The buttons are set initially in a high state. For example, if Button 1 is pressed, the state of the
button becomes low and depending on the mode whether it is the play mode or record mode,
the memory 1 is chosen to read or write. MS1 and MS2 Pins are used to indicate the part of the
memory and number of the memory to be chosen whether its one full memory or half the
memory or a quarter of the memory etc. The Audio amplifier is used to amplify the signal that
is to be played and an amplified output is obtained from the loud speaker. If the circuit is busy
in Reading or Writing, the LED glows to indicating that the Circuit is Busy.

7. PCB DESIGN

63

Design and Fabrication of Printed circuit boards


7.1 INTRODUCTION:
Printed circuit boards, or PCBs, form the core of electronic equipment domestic
and industrial. Some of the areas where PCBs are intensively used are computers,
process control, telecommunications and instrumentation.

7.2 MANUFATCURING:
The manufacturing process consists of two methods; print and etch, and print,
plate and etch. The single sided PCBs are usually made using the print and etch
method. The double sided plate through hole (PTH) boards are made by the print
plate and etch method.
The production of multi layer boards uses both the methods. The inner layers
are printed and etch while the outer layers are produced by print, plate and etch after
pressing the inner layers.

7.3 SOFTWARE:
The software used in our project to obtain the schematic layout is MICROSIM.

64

7.4 PANELISATION:
Here the schematic transformed in to the working positive/negative films. The
circuit is repeated conveniently to accommodate economically as many circuits as
possible in a panel, which can be operated in every sequence of subsequent steps
in the PCB process. This is called penalization. For the PTH boards, the next
operation is drilling.

7.5 DRILLING:

PCB drilling is a state of the art operation. Very small holes are drilled with high
speed CNC drilling machines, giving a wall finish with less or no smear or epoxy,
required for void free through hole plating.

7.6 PLATING:
The heart of the PCB manufacturing process. The holes drilled in the board are
treated both mechanically and chemically before depositing the copper by the electro
less copper platting process.

7.7 ETCHING:
Once a multiplayer board is drilled and electro less copper deposited, the
image available in the form of a film is transferred on to the out side by photo printing
using a dry film printing process. The boards are then electrolytic plated on to the
circuit pattern with copper and tin. The tin-plated deposit serves an etch resist when
copper in the unwanted area is removed by the conveyors spray etching machines
with chemical etch ants. The etching machines are attached to an automatic dosing
equipment, which analyses and controls etch ants concentrations

65

7.8 SOLDERMASK:
Since a PCB design may call for very close spacing between conductors, a
solder mask has to be applied on the both sides of the circuitry to avoid the bridging of
conductors. The solder mask ink is applied by screening. The ink is dried, exposed to
UV, developed in a mild alkaline solution and finally cured by both UV and thermal
energy.

7.9 HOT AIR LEVELLING:


After applying the solder mask, the circuit pads are soldered using the hot air
leveling process. The bare bodies fluxed and dipped in to a molten solder bath. While
removing the board from the solder bath, hot air is blown on both sides of the board
through air knives in the machines, leaving the board soldered and leveled. This is
one of the common finishes given to the boards. Thus the double sided plated through
whole printed circuit board is manufactured and is now ready for the components to be
soldered.

66

8 PIC SOFTWARE TOOLS8 SOFTWARE TOOLS


8.1 MPLAB
MPLAB IDE is an integrated development environment that provides
development engineers with the flexibility to develop and debug firmware for various
Microchip devices
MPLAB IDE is a Windows-based Integrated Development Environment for the
Microchip Technology Incorporated PICmicrocontroller (MCU) and dsPIC digital signal
controller (DSC) families. In the MPLAB IDE, you can:

Create source code using the built-in editor.

Assemble, compile and link source code using various language tools. An
assembler, linker and librarian come with MPLAB IDE. C compilers are
available from Microchip and other third party vendors.

Debug the executable logic by watching program flow with a simulator, such as
MPLAB SIM, or in real time with an emulator, such as MPLAB ICE. Third party
emulators that work with MPLAB IDE are also available.

Make timing measurements.

View variables in Watch windows.

Program firmware into devices with programmers such as PICSTART Plus or


PRO MATE II.

Find quick answers to questions from the MPLAB IDE on-line Help.

67

8.2 MPLAB SIMULATOR


MPLAB SIM is a discrete-event simulator for the PIC microcontroller (MCU) families.
It is integrated into MPLAB IDE integrated development environment. The MPLAB
SIM debugging tool is designed to model operation of Microchip Technology's PIC
microcontrollers to assist users in debugging software for these devices

8.3 IC PROG
The PRO MATE II is a Microchip microcontroller device programmer. Through
interchangeable programming socket modules, PRO MATE II enables you to quickly
and easily program the entire line of Microchip PICmicro microcontroller devices and
many of the Microchip memory parts.
PRO MATE II may be used with MPLAB IDE running under supported Windows OS's
(see Read me for PRO MATE II.txt for support list), with the command-line controller
PROCMD or as a stand-alone programmer

8.4 COMPILER-HIGH TECH C


A program written in the high level language called C; which will be converted into
PICmicro MCU machine code by a compiler. Machine code is suitable for use by a
PICmicro MCU or Microchip development system product like MPLAB IDE.

68

8.5 PIC START PLUS PROGRAMMER:


The PIC start plus development system from microchip technology provides
the product development engineer with a highly flexible low cost microcontroller
design tool set for all microchip PIC micro devices. The pic start plus development
system includes PIC start plus development programmer and MPLAB IDE.
The PIC start plus programmer gives the product developer ability to program
user software in to any of the supported microcontrollers. The PIC start plus software
running under MPLAB provides for full interactive control over the programmer.

9. PROGRAM:

69

10. ADVANTAGES
11. Low power consumption
12. It provides the easy access over
13. Reduced the time
14. Low cost to design the circuit, maintenance of the circuit is good
15. By using this microcontroller ic we can create many more control to the
appliances
16.
17. Reliability
18. Compatibility
19. Easy convenience to handle
20. Good security for appliances

12. APPLICATIONS
#include<pic.h>
#include"pic_adc.h"
#include"pic_lcd8.h"
#define set RB7
#define mov RB6
#define inc RB5
#define dec RB4
#define ent RB3
#define heartbeat RB0

70

#define r1 RB1
#define r2 RB2
#define r3 RC6
#define r4 RC7
#define b0 RC0
#define b1 RC1
#define b2 RC2
#define play RC3
unsigned char m=0;
unsigned char heartsense=0;
unsigned char sec;
unsigned char tempp,set_tempp,beat_low,beat_high;
unsigned char aa=1,bb=1;
void keypad_tempp();
void keypad_beat();
void voice(unsigned char);
void forward();
void backward();
void left();
void right();
void stop();
void main()
{
TRISA=0xff;

71

TRISB=0b11111001;
TRISC=0x00;
TRISD=0x00;
r1=1;r2=1;r3=1;r4=1;
Lcd8_Init();
GIE=1;
PEIE=1;
TMR1L=0xaf;
TMR1H=0x3C;
TMR1IE=1;
Lcd8_Display(0x80,"DIGITAL AUTOMATD",16);
Lcd8_Display(0xc0,"

HOSPITAL

",16);

Delay(65000);Delay(65000);
Lcd8_Command(0x01);
keypad_tempp();
keypad_beat();
Lcd8_Display(0xcd,"TI:",3);
Lcd8_Display(0x80,"TEM:",4);
Lcd8_Display(0x88,"HEA:",4);
TMR1ON=1;
while(1)
{
tempp=Adc8_Cha(0);
Lcd8_Decimal3(0x84,tempp);

72

Lcd8_Decimal2(0xd0,sec);
if(!set && aa==1){aa=2;while(!set);keypad_tempp();}
if(!set && aa==2){aa=1;while(!set);keypad_beat();}
if(!mov && bb==1){bb=2;while(!mov);forward();}
if(!mov && bb==2){bb=1;while(!mov);backward();}
if(!inc){while(!inc);left();}
if(!dec){while(!dec);right();}
if(!ent){while(!ent);stop();}
if(sec>=0 && sec<=59)
{
if(heartbeat==0 )
{
while(heartbeat==0);
heartsense++;
}
}
if(sec>59)
{
TMR1ON=0;
sec=0;
Lcd8_Decimal3(0x8c,heartsense);
if(heartsense>=beat_high)
{voice(1);Delay(50000);

else if(heartsense<=beat_low)
{voice(2);Delay(50000);
if(tempp>set_tempp)

73

{voice(3);Delay(50000); }
heartsense=0;
TMR1ON=1;
}

}
}
void interrupt timer1()
{
if(TMR1IF==1)
{
m++;
if(m>19)
{
sec++;
m=0;
}
TMR1L=0xaf;
TMR1H=0x3C;
TMR1IF=0;
}
}
void keypad_tempp()
{
TMR1ON=0;
Lcd8_Display(0xc0,"set tem:",8);
while(ent)
{

74

if(!mov){while(!mov);set_tempp+=10;Lcd8_Decimal3(0xc8,set_tempp);}
if(!inc){while(!inc);set_tempp++;Lcd8_Decimal3(0xc8,set_tempp);}
if(!dec){while(!dec);set_tempp--;Lcd8_Decimal3(0xc8,set_tempp);}
}Delay(20000);

Lcd8_Display(0xc0,"SET TEM:",8);

TMR1ON=1;
}
void keypad_beat()
{
TMR1ON=0;
Lcd8_Display(0x94,"hb l:",5);
while(ent)
{
if(!mov){while(!mov);beat_low+=10;Lcd8_Decimal3(0x99,beat_low);}
if(!inc){while(!inc);beat_low++;Lcd8_Decimal3(0x99,beat_low);}
if(!dec){while(!dec);beat_low--;Lcd8_Decimal3(0x99,beat_low);}
}Delay(20000);

Lcd8_Display(0x94,"HB L:",5);

Lcd8_Display(0x9d,"hb h:",5);
while(ent)
{
if(!mov){while(!mov);beat_high+=10;Lcd8_Decimal3(0xa2,beat_high);}
if(!inc){while(!inc);beat_high++;Lcd8_Decimal3(0xa2,beat_high);}
if(!dec){while(!dec);beat_high--;Lcd8_Decimal3(0xa2,beat_high);}
}Delay(20000);

Lcd8_Display(0x9d,"HB H:",5);

TMR1ON=1;
}
void forward()
{

75

r1=1;r2=0;r3=1;r4=0;
Lcd8_Display(0xD4,"

FORWARD

",16);

}
void backward()
{
r1=0;r2=1;r3=0;r4=1;
Lcd8_Display(0xD4,"

BACKWARD

",16);

}
void left()
{
r1=1;r2=0;r3=0;r4=1;
Lcd8_Display(0xD4,"

LEFT

",16);

}
void right()
{
r1=0;r2=1;r3=1;r4=0;
Lcd8_Display(0xD4,"

RIGHT

",16);

STOP

",16);

}
void stop()
{
r1=1;r2=1;r3=1;r4=1;
Lcd8_Display(0xD4,"
}
void voice(unsigned char set)
{
switch(set)
{
case 1: Lcd8_Display(0xd3,"1",1);
play=0; b2=1; b1=1; b0=0;

Delay(50000);

play=1; b2=1; b1=1; b0=1; Delay(50000);

76

break;
case 2: Lcd8_Display(0xd3,"2",1);
play=0; b2=1; b1=0; b0=1;

Delay(50000);

play=1; b2=1; b1=1; b0=1; Delay(50000);


break;
case 3: Lcd8_Display(0xd3,"3",1);
play=0; b2=0; b1=1; b0=1;

Delay(50000);

play=1; b2=1; b1=1; b0=1; Delay(50000);


break;
default: break;
}
}
13. CONCLUSION

The progress in science & technology is a non-stop process. New things and
new technology are being invented. As the technology grows day by day, we can
imagine about the future in which thing we may occupy every place.
The proposed system based on Atmel microcontroller is found to be more
compact, user friendly and less complex, which can readily be used in order to
perform. Several tedious and repetitive tasks. Though it is designed keeping in mind
about the need for industry, it can extended for other purposes such as commercial &
research applications. Due to the probability of high technology (PIC microcontroller)
used this DIGITAL AUTOMATED

HOSPITAL system is fully software

controlled with less hardware circuit. The feature makes this system is the base for
future systems.

77

78

14. REFERENCES
MILL MAN J and HAWKIES C.C. INTEGRATED
ELECTRONICS MCGRAW HILL, 1972
ROY CHOUDHURY D, SHAIL JAIN, LINEAR INTEGRATED
CIRCUIT, New Age International Publishers, New Delhi,2000
THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEM
by Mohammad Ali Mazidi.

WEBSITES:

http://www.atmel.com/
http://www.microchip.com/
www.8052.com
http://www.beyondlogic.org
http://www.ctv.es/pckits/home.html
http://www.aimglobal.org/

79

Вам также может понравиться