Sei sulla pagina 1di 16

Heart Beat Rate Sensor Cirtuit:

Monitoring the heart beat rate of the patient can be easily accomplished by analyzing the ECG pulse .
Here, the ECG pulse is amplified and the average time interval or the instantaneous time interval
between two successive R peaks is measured, from which the heart beat rate is derived. But this
method fails to indicate heart blocks immediately and so photo electric pulse transducers are used.
The pulse rate monitoring method indicates a heart block immediately by sensing the cessation of
blood circulation in the limb terminals. This technique uses photoelectric transducers which are easy
to apply then the 3 ECG electrodes. Also the output signal amplitude is large with better signal to
noise ratio.
The finger probe used for pulse pick up consists of a Ga As infrared LED and a silicon NPN
phototransistor mounted in an enclosure that fits over the tip of the patients finger. The peak spectral
emission of the LED is at 0.94 mm with a 0.707 peak bandwidth of 0.04mm. The silicon
phototransistor is sensitive to radiation between 0.4 and Due to the narrow bond of the
spectrum involved the radiation heat output is minimized. The photo transistor is used as an emitter
follower configuration. The IR signal from the LED is transmitted through the finger tip of the
patients finger and the conductivity of the phototransistor depends on the amount of radiation
reaching it with each contraction of the heart, blood is forced to the extremities and amount of blood
in finger increases. This alters the optical density and so the IR signal transmission through the finger
reduces, causing a correspondence variation in phototransistor output. The phototransistor is
connected as part of a voltage divider circuit, with 10K and 22 K carbon resistors and produces a
voltage pulse that closely follows the heart beat rate . This pulse output is given to the bit 4 of the
port D of the microcontroller for signal processing.

Measurement procedure
1. Attach the Pleth (finger/ear lobe clip) to either the fingertip or to the ear lobe.
2. Wait for a short while for the signal to stabilise. The subject should stayreasonably still muscle
movements will influence the signal. The red LEDon the Sensor housing will start to flash in time
with the heartbeat. If used onthe finger the subject may feel a throbbing sensation.
Note for EasySenseAdvanced and Logger users: if the red LED does notstart to flash, and the LCD
display on the EasySenseunit is blank, press any ofthe buttons on the top panel of the EasySenseunit
to wake it up.
3. Once a regular heart rate is detected, begin recording data.


The saline water injection plays a key role in the treatment and recovery of many a patient that
requires constant monitoring. This condition can be fulfilled by using IR sensors which can detect a
drop in the saline below the quantity. By means of annunciation systems, the hospital staff can be
informed and an action of replacing the saline can be easily accomplished before the bottle becomes
empty. Also the usage of the GSM modem facilitates sending of saline status to the doctor concerned
for any further action required.
The circuit uses an IR emitter and an IR detector which are placed in a straight line with the saline
bottle in between, at the point representing the preset saline level. The presence of saline water, in a
full bottle, refracts the emitted radiation, thus generating no output at the IR detector. When the saline
level falls below the preset value; the emitted IR radiation causes a photoelectric current from the
detector. The detector output is an analog quantity which is made to drive a switching NPN transistor
BC107 to get a binary output from the collector of the transistor. This digital output is fed to the pin
23 of the PIC micro controller, corresponding to port bit 4. The signal is processed and the saline
status is displayed on the screen. In case of the saline becoming empty the annunciation systems are
The patient calling system consists of four switches when pressed gives display on the screen and
activates an audio alert indicating that a patient is calling. These switches are placed in the vicinity of
the patient to enable medical access in an emergency.
The rate measuring circuit uses a temperature sensor for measuring the respiration rate.A thermistor
is a ceramic semiconductor which exhibits a large change in resistance with a change in its body
temperature. The thermistors have much better sensitivity than RTDs and are therefore better suited
for precision temperature measurements. The availability of high

resistance values allows the thermistors to be used with long extension leads since the lead resistance
or contact resistance effects can be greatly diminished. The non-linearity of the thermistor resistancetemperature characteristics outs a practical limit on the temperature span over which a thermistor can
be operated in measurement or control circuit RTDs have lower sensitivity and are more linear and
can therefore be used in applications, where the temperature spans are very wide. Thermistors has
other important advantages over RTDs in that they are available in smaller sizes, with faster
response times, at lower costs and with greater resistance to shock and vibration effects.
In this circuit wehave arranged thermistor in the form of potential divider when thermistor is R1 and
a potentiator is acting as a R2 which forms potential divider network and produces an output from
potential divider network which is given to analog input channel of the micro controller.
In general to obtain clear and constant output with respect to the input change, the sensor must be
low power consumer. If we draw a lowest current sensitivity the thermistor will improve and
provides better performance. Due to the above grounds we have constructed the thermistor circuits to
produce low milli volts which can be easily digitalized by the transistor. If not the sensor will to drive
large output voltage may cause self heating of the device. Self heating means large current flows
through the thermistor create heat on it without accepting the body temperature.This voltage is given
to the transistor so that number of ones is counted in the microcontroller which is given as voltage
from the transistor.

Hardware used in the project are as follows:
1. Microcontroller-89s52
2. LCD Display
3. Photo Transistor
4. IR Emitter and Detector
5. LED
6. Switches
7. LM35D
8. Transistors
9. Resistors
10. Capacitors
11. Battery
12. Buzzer
13. Diodes


A Microcontroller is a single-chip microcomputer that contains all the componentssuch as the CPU,
RAM, some form of ROM, I/O ports, and timers.Unlike a generalpurpose computer, which also
includes all of these components, a microcontroller is designed for a very specific task to control a
particular system. Microcontrollers are sometimes calledembedded microcontrollers, which just
means that they are part of an embedded system. A microprocessor is a general-purpose digital
computer with central processing unit (CPU), which contains arithmetic and logic unit (ALU), a
program counter (PC), a stack pointer (SP), some working registers, a clock timing circuit, and
interrupts circuits. The main disadvantage of microprocessor is that it has no on-chip memory. So we
are going for micro controller since it has on-board programmable ROM and I/O that can be
programmed for various control functions

AT89S52 MICROCONTROLLER The microcontroller development effort resulted in the 8051
architecture, which was first introduced in 1980 and has gone on to be arguably the most popular
micro controller architecture available. The 8051 is a very complete micro controller with a large
amount of built in control store (ROM &EPROM) andRAM, enhanced I/O ports, and the ability to
access external memory. The maximum clock frequency with an 8051 micro controller can execute
instructions is 20MHZ. Microcontroller is a true computer on chip. The design incorporates all of the
features found in a microprocessor: CPU, ALU, PC, SP and registers. It also has the other features
needed to, make complete computer: ROM, RAM, parallel I/O, serial I/O, counters and a clock
circuit.The 89C51/89C52/89C54/89C58 contains a non-volatile FLASH program memory that is
parallel programmable. For devices that are serial programmable (In-System Programmable (ISP)
and In-Application Programmable (IAP) with a boot loader)All three families are Single-Chip 8-bit
Microcontrollers manufactured in advanced CMOS process and are Derivatives of the 80C51
microcontroller family.All the devices have the same instruction set as the 80C51.

Compatible with MCS-51 Products
8K Bytes of In-System Programmable (ISP) Flash Memory
Endurance: 10,000 Write/Erase Cycles
4.0V to 5.5V Operating Range
Fully Static Operation: 0 Hz to 33 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
Full Duplex UART Serial Channel
Low-power Idle and Power-down Modes
Interrupt Recovery from Power-down Mode
Watchdog Timer
Dual Data Pointer

Power-off Flag
Fast Programming Time
Flexible ISP Programming (Byte and Page Mode)
Green (Pb/Halide-free) Packaging Option
Description The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K
bytes of in-system programmable Flash memory. The device is manufactured using Atmels highdensity nonvolatile memory technology and is compatible with the indus-try-standard 80C51
instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed insystem or by a conventional nonvolatile memory pro-grammer. By combining a versatile 8-bit CPU
with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful
microcontroller which provides a highly-flexible and cost-effective solution to many embedded
control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256
bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a sixvector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry.
In addition, the AT89S52 is designed with static logic for operation down to zero frequency and
supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing
the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down
mode saves the RAM con-tents but freezes the oscillator, disabling all other chip functions until the
next interrupt or hardware reset.
The AT89s52 is a low power, high performance CMOS 8-bit micro computer with 8Kbytes of flash
programmable and erasable read onlymemory(PEROM).The device is manufactured using Atmels
high density nonvolatile memory technology and is compatible with the industry standard 80c51 and
80C52 instruction set and pin out. The on-chip flash allows the program memory to be
reprogrammed in- system or by a

conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with flash on a
monolithic chip, the Atmel AT89s52 Is a powerful microcomputer which provides a highly flexible
and cost effective solution to many embedded control applications. The main advantages of 89s52
over 8051 are
1. Software Compatibility
2. Program Compatibility
3. Rewritability The 89s52 microcontroller has an excellent software compatability, i.e. the software
used can be applicable to any other microcontroller. The program written on this microcontroller can
be carried to any base. Program compatibility is the major advantage in 89s52. The program can be
used in any other advanced microcontroler. The program can be reloaded and changed for nearly
1000 times.



The AT89s52 provides the following standard features: 8K bytes ofFlash,256 bytes of RAM, 32 I/O
lines, three 16-bit timer/counters, a six-vectortwo-levelinterrupt architecture, a full-duplex serial port,
on-chip oscillator, andclock circuitry.In addition, the AT89s52 is designed with static logic for
operation down to zerofrequency and supports two software selectable power saving modes. The Idle
Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to
continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator,
disabling all other chip functions until the next hardware reset.
VCC :Supply voltage.

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 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 can
also be configured to be the multiplexed lower order address/data bus during accesses to external
program and data memory. In this mode, P0 has internalpullups.Port 0 also receives the code bytes
during Flash programming and outputs the code bytes during program verification. External
pullupsare required during program verification.

Port 1
Port 1 is an 8-bit bidirectional 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 inter-nal
pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will
source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1

can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2
trigger input (P1.1/T2EX), respectively, as shown in the follow-ing table. Port 1 also receives the
low-order address bytes during Flash programming and verification.

Port 2
Port 2 is an 8-bit bidirectional 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 inter-nal
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 2 emits the high-order address byte during
fetches from external program memory and dur-ing accesses to external data memory that use 16-bit
addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when emitting
1s. During accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the
contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and
some control signals during Flash program-ming and verification.
P1.0 T2 (external count input to Timer/Counter 2), clock-out
P1.1 T2EX (Timer/Counter 2 capture/reload trigger and direction control)
P1.5 MOSI (used for In-System Programming)
P1.6 MISO (used for In-System Programming)
P1.7 SCK (used for In-System Programming)

Port 3
Port 3 is an 8-bit bidirectional 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 by the inter-nal
pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will
source current (IIL) because of the pull-ups. Port 3 receives some control signals for Flash
programming and verification. Port 3 also serves the functions of various special features of the
AT89S52, as shown in the fol-lowing table.
RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the
device. This pin drives high for 98 oscillator periods after the Watchdog times out. The DISRTO bit
in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO,
the RESET HIGH out feature is enabled.
ALE/PROG Address Latch Enable (ALE) 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 dur-ing each access to external data memory. If desired, ALE operation can be disabled by
setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC
instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the
microcontroller is in external execution mode.
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)

P3.4 T0 (timer 0 external input)

P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
PSEN Program Store Enable (PSEN) is the read strobe to external program memory. When
the AT89S52 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 exter-nal data
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. EA should be
strapped to VCC for internal program executions. This pin also receives the 12-volt programming
enable voltage (VPP) during Flash programming.
XTAL1Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2Output from the inverting oscillator amplifier.
Special Function Registers A map of the on-chip memory area called the Special Function Register
(SFR) space is shown in Table 5-1. Note that not all of the addresses are occupied, and unoccupied
addresses may not be imple-mented on the chip. Read accesses to these addresses will in general
return random data, and write accesses will have an indeterminate effect. User software should not
write 1s to these unlisted locations, since they may be used in future

products to invoke new features. In that case, the reset or inactive values of the new bits will always
be 0. Timer 2 Registers: Control and status bits are contained in registers T2CON (shown in Table 52) and T2MOD (shown in Table 10-2) for Timer 2. The register pair (RCAP2H, RCAP2L) are the
Capture/Reload registers for Timer 2 in 16-bit capture mode or 16-bit auto-reload mode. Interrupt
Registers: The individual interrupt enable bits are in the IE register. Two priorities can be set for each
of the six interrupt sources in the IP register.
T2CON Timer/Counter 2 Control Register
TF2 Timer 2 overflow flag set by a Timer 2 overflow and must be cleared by software.
TF2 will not be set when either RCLK = 1 or TCLK = 1.