automated walker with patient monitoring mechanism

22
“Automated walker with patient monitoring mechanism” MUNOTH KAILASH KUMAR JAIN PUSHPALA MANISH KUMAR Dept. of Mechnaical Engineering Dept. of Mechnaical Engineering Padmasri Dr.b.v.raju Institue of Technology Padmasri Dr.b.v.raju Institue of Technology Medak,India. Medak,India. [email protected] [email protected] Abstract A walker device for aiding invalids and other persons having walking difficulties has an upstanding open- bottomed framework toward and within which a person can take steps while holding on and being supported by the framework. It is designed in order to make a disabled person or a paralyzed person to improve his walking ability step by step. It is provided with stepper motors in order to regulate the speed and make the person to move step by step and to move in any direction. SCOPE: Walkers are currently available for use by persons having walking difficulties devices . These devices are normally constructed as four- legged, open-bottomed, self-standing structures that a person can approach and stand within for at least partial Further, some people using conventional walkers are very weak and find it difficult to walk any distance, even with the help provided by the walker. Therefore an automated walker has been designed to overcome the drawbacks in conventional walker. A conventional walker is provided with motors to make it automated. It is provided with a joystick mechanism to move it in the desired direction, that is forward or backward without any strain/stress on the patient. We added a special feature of heart beat sensor to this automated walker. Heart beat sensor is a device which is used to monitor the heart rate of the person using the walker. This helps him to be cautious and to have a up to date analysis of his health. This would be mostly helpful for senior citizens with walking disabilities. Thus we named our project as automated walker with patient monitoring mechanism. 1.2Tools required :

Upload: kailash-jain

Post on 16-Aug-2015

23 views

Category:

Documents


3 download

TRANSCRIPT

“Automated walker with patient monitoring mechanism”

MUNOTH KAILASH KUMAR JAIN PUSHPALA MANISH KUMARDept. of Mechnaical Engineering Dept. of Mechnaical Engineering Padmasri Dr.b.v.raju Institue of Technology Padmasri Dr.b.v.raju Institue of Technology Medak,India. Medak,[email protected] [email protected]

Abstract

A walker device for aiding invalids and other persons having walking difficulties has an upstanding open-bottomed framework toward and within which a person can take steps while holding on and being supported by the framework. It is designed in order to make a disabled person or a paralyzed person to improve his walking ability step by step. It is provided with stepper motors in order to regulate the speed and make the person to move step by step and to move in any direction.

SCOPE:

Walkers are currently available for use by persons having walking difficulties devices . These devices are normally constructed as four-legged, open-bottomed, self-standing structures that a person can approach and stand within for at least partial support while holding on during the taking of walking steps. Examples of typical walker devices of this kind are shown in U.S. Pat. Nos. 2,708,473 and 3,354,893. The persons using the device picks it up, places it on the ground a distance of several steps in front of him, and then walks to it while holding on for support.While this procedure is satisfactory for some people, it requires a person to bend or lean forward to place the walker device in front of him and then to walk to the device while holding on to it in such bent position.This is very difficult or impossible for many people with walking problems and does not provide a normal walking position wherein a person strenghens the muscles necessary to walk normally without the walker . Not only that it requires a person to do some work in lifting the walker. This could be difficult for persons with limb problems. Thus, the conventional walker cannot be used by some, and, for many by whom it can be used, it is merely an aid to getting around but does not provide therapy to rehabilitate the person.

Further, some people using conventional walkers are very weak and find it difficult to walk any distance, even with the help provided by the walker.

Therefore an automated walker has been designed to overcome the drawbacks in conventional walker. A conventional walker is provided with motors to make it automated. It is provided with a joystick mechanism to move it in the desired direction, that is forward or backward without any strain/stress on the patient.

We added a special feature of heart beat sensor to this automated walker. Heart beat sensor is a device which is used to monitor the heart rate of the person using the walker. This helps him to be cautious and to have a up to date analysis of his health. This would be mostly helpful for senior citizens with walking disabilities.

Thus we named our project as automated walker with patient monitoring mechanism.

1.2Tools required: Software Tools:

Keil CompilerHardware tools:

• Micro controller.

• LED

• LCD

• Light detector

• Op-amps

• Resistors

• Power Supply 5V.

• Servo motor

• Speed controller

2.SCHEMATIC DIAGRAM :Schematic diagram of heart beat sensor

2.1WORKING MODEL:

Prototype of our walker

3.CIRCUIT DESCRIPTION

Design: The main intention of this project is to design an

AUTOMATED WALKER WITH PATIENT MONITORING MECHANISM using motors and heart beat sensors. In order to fulfill this application, there are few steps that have been performed i.e.

• Designing the power supply for the entire circuitry.

• Selection of microcontroller that suits our application.

• Designing of heart beat sensor• Selection of motors• Selection of wheels

Complete studies of all the above points are useful to develop this project.

3.1 Power Supply Section:

In order to work with any components basic requirement is power supply. In this section there is a requirement of a 5V DC power supply.

Now the aim is to design the power supply section which converts 230V AC in to 5V DC. Since 230V AC is too high to reduce it to directly 5V DC, therefore we need a step-down transformer that reduces the line voltage to certain voltage that will help us to convert it in to a 5V DC. Considering the efficiency factor of the bridge rectifier, we came to a conclusion to choose a transformer, whose secondary voltage is 3 to 4 V higher than the required voltage i.e. 5V. For this application 0-9V transformers is used, since it is easily available in the market.

The output of the transformer is 9V AC; it feed to rectifier that converts AC to pulsating DC. As we all know that there are 3 kind of rectifiers that is

• half wave• Full wave and• Bridge rectifier

Here we short listed to use Bridge rectifier, because half wave rectifier has less efficiency. Even though the efficiency of full wave and bridge rectifier are the same, there is no requirement for any negative voltage for our application. Hence it is appropriate to choose a bridge rectifier.

Since the output voltage of the rectifier is pulsating DC, in order to convert it into pure DC we use a high value (1000UF/1500UF) of capacitor in parallel that acts as a filter. The easiest way to regulate this voltage is by using a 7805 voltage regulator, whose output voltage is constant 5V DC irrespective of any fluctuation in line voltage.

3.2 Selection of Microcontroller:

As we know, there so many types of microcontroller families are available in the market. Those are

1) 8051 Family

2) AVR microcontroller Family3) PIC microcontroller Family

4) ARM Family

Basic 8051 microcontroller is enough for our application; hence we are not concentrating on higher end controller families. In order to fulfill our application AT89S52 microcontroller is enough. There are minimum requirements for proper operation of microcontroller. Microcontroller based heartbeat monitor with lcd display ir led and ldr based heartbeat monitor with display on computer and microcontroler LCD display.The heart rate meter is used to measure the heart beats per minute from finger placing between the sensor. The sensor is made of simple photo resistor and LED. The pulses from the circuit are them amplified and converted into TTL logic pulses using comparator Operational Amplifier.

3.3 Circuit Operation:

The IR sensors placed in the transmitter unit gives data to the HT12E encoder which converts the analog data into digital form. This data is given to the RF transmitter which transmits the same. In the receiver unit, the RF signal can be detected by the RF receiver. The data is processed by the microcontroller (AT89S52) and a control signal is given to the buzzer which alerts the user immediately in case of a possible accident.

4. INTRODUCTION

Introduction to Embedded Systems

Embedded systems are electronic devices that incorporate microprocessors within their implementations. The main purpose of the microprocessors is to simplify the system design and provide flexibility. Having a microprocessor in the device helps in removing the bugs, making modifications, or adding new features and is only a matter of rewriting the software that controls the device.

perform a specific dedicated application.

The computer is hidden inside these products. Embedded systems are ubiquitous. Every week millions of tiny computer chips come pouring out of factories finding their way into our everyday products.

Embedded systems are self-contained programs that are embedded within a piece of hardware. While a regular computer has many different applications and software that can be applied to various tasks, embedded systems are usually set to a specific task that cannot be altered without physically manipulating the circuitry. Another way to think of an embedded system is a computer system that is created with optimal efficiency, thereby allowing it to complete specific functions as quickly as possible.

Embedded systems designers usually have a significant grasp of hardware technologies. They use specific programming languages and software to develop embedded systems and manipulate the equipment. When searching online, companies offer embedded systems development kits and other embedded systems tools for use by engineers and businesses.

Embedded systems technologies are usually fairly expensive due to the necessary development time and built in efficiencies, but they are also highly valued in specific industries. Smaller businesses may wish to hire a consultant to determine what sort of embedded systems will add value to their organization.

4.1.1 Characteristics:

Two major areas of differences are cost and power consumption. Since many embedded systems are produced in tens of thousands to millions of units range, reducing cost is a major concern. Embedded systems often use a (relatively) slow processor and small memory size to minimize costs.

The slowness is not just clock speed. The whole architecture of the computer is often intentionally simplified to lower costs. For example, embedded systems often use peripherals controlled by synchronous serial interfaces, which are ten to hundred times slower than comparable peripherals used in PCs. Programs on an embedded system often run with real-time constraints with limited hardware resources: often there is no disk drive, operating system, keyboard or screen. A flash drive may replace rotating media, and a small keypad and LCD screen may be used instead of a PC's keyboard

In other words embedded computer systems are electronic systems that include a microcomputer to

Firmware is the name for software that is embedded in hardware devices, e.g. in one or more ROM/Flash memory IC chips. Embedded systems are routinely expected to maintain 100% reliability while running continuously for long periods, sometimes measured in years. Firmware is usually developed and tested to reach requirements than is general-purpose software, which can usually be easily restarted if a problem occurs.

INTRODUCTION TO MICROCONTROLLER:

Microcontrollers as the name suggests are small controllers. They resemble single chip computers that are often embedded into other systems to function as processing/controlling unit. For example the remote control you are using has microcontrollers inside it that do decoding and other controlling functions. They are also used in automobiles, washing machines, microwave ovens, toys, etc., where automation is needed.

Microcontrollers are re useful to the extent that they communicate with other devices, such as sensors, motors, switches, keypads, displays, memory and even other microcontrollers. Many interface methods have been developed over the years to solve the complex problem of balancing circuit design criteria such as features, cost, size, weight, power consumption, reliability, availability, and manufacturability. Many microcontroller designs typically mix multiple interfacing methods. In a very simplistic form, a microcontroller system can be viewed as a system that reads from (monitors) inputs, performs processing and writes to (controls) outputs.

Embedded system means the processor is embedded into the required application. An embedded product uses a microprocessor or microcontroller to do one task only. In an embedded system, there is only one application software that is typically burned into ROM. Example: printer, keyboard, video game player.Microprocessor - A single chip that contains the CPUMicrocontroller - A single chip that contains CPU, I/O ports, memory, timers, serial port, ADC, DAC etc, and is used to control other devices.

Microcontroller differs from a microprocessor in many ways. First and the most important is its functionality. In order for a microprocessor to be used, other components such as memory, or components for receiving and sending data must be added to it. In short that means that microprocessor is the very heart of the computer. On the other hand, microcontroller is designed to be all of that in one. No other external components are needed for its application because all necessary peripherals are already built into it. Thus, we save the time and space needed to construct devices.

and screen.

4.2.1 Microprocessor VS Microcontroller:

Microprocessor:

• CPU is stand-alone, RAM, ROM, I/O, timer are separate

• Designer can decide on the amount of ROM, RAM and I/O ports.

• Expensive• Versatile and general-purpose

Microcontroller:

• CPU, RAM, ROM, I/O and timer are all on a single chip

• Fixed amount of on-chip ROM, RAM, I/O ports

• For applications in which cost, power and space are critical

• Single-purpose4.3 Introduction to Kiel Software

Many companies provide the 8051 assembler; some of them provide shareware version of their product on the web of which Kiel is one. We can download them from their websites. However, the size of code for these shareware versions is limited and we have to consider which assembler is suitable for our application.

Kiel uVision 2:

This is an IDE (Integrated Development Environment) that helps you write, compile, and debug embedded programs. It encapsulates the following components:

• A project manager• A make facility• Tool configuration• Editor• A powerful debugger

Building an Application in uVision 2:

To build (compile, assemble, and link) an application in uVision2, you must:

• Select Project–Open Project(Forexample, \C166\EXAMPLES\HELLO\

HELLO.UV2)

• Select Project - Rebuild all target files or Build target. UVision2 compiles, assembles, and links the files in your project.

Creating an Application:

To create a new project in uVision2, you must:

• Select Project - New Project.• Select a directory and enter the name

of the project file.• Select Project - Select Device and

select an 8051, 251, or C16x/ST10 device from the Device• Database• Create source files to add to the

project.• Select Project - Targets, Groups, and

Files. Add/Files, select Source Group1, and add the source files to the project.• Select Project - Options and set the

tool options. Note when you select the target device from the Device Database all-special options are set automatically. You only need to configure the memory map of your target hardware. Default memory model settings are optimal for most.

Applications:

• Select Project - Rebuild all target files or Build target.

Debugging an Application in uVision 2:

To debug an application created using uVision2, you must:

• Select Debug - Start/Stop Debug Session.• Use the Step toolbar buttons to single-step

through your program. You may enter G, main in the Output Window to execute to the main C function.

• Open the Serial Window using the Serial #1 button on the toolbar.

• Debug your program using standard options like Step, Go, Break, and so on.

Limitation of Evaluation Software:

The following limitations apply to the evaluation versions of the C51, C251, or C166 tool chains. C51 Evaluation Software Limitations:

• The compiler, assembler, linker, and debugger are limited to 2 Kbytes of object code but source Code may be any size. Programs that generate more than 2 Kbytes of object code will not compile, assemble, or link the startup code

• 750/751/752.• The debugger supports files that are 2 Kbytes

and smaller.• Programs begin at offset 0x0800 and cannot be

programmed into single-chip devices.• No hardware support is available for multiple

DPTR registers.• No support is available for user libraries or

floating-point arithmetic.Evaluation Software:

• Code-Banking Linker/Locator • Library Manager.• RTX-51 Tiny Real-Time Operating System

Peripheral Simulation:

The u vision2 debugger provides complete simulation for the CPU and on chip peripherals of most embedded devices. To discover which peripherals of a device are supported, in u vision2, we can select the Simulated Peripherals item from the Help menu.

4.4Introduction of Light Emitting Diode (LED)

A light-emitting diode (LED) is a semiconductor diode that emits incoherent narrow spectrum light when electrically biased in the forward direction of the pn-junction, as in the common LED circuit. This effect is a form of electroluminescence.

While sending a message in the form of bits such as 1,the data is sent to the receiver side correspondingly the LED glows representing the data is being received simultaneously when we send 8 as a data the LED gets off .

As in the simple LED circuit, the effect is a form of electroluminescence where incoherent and narrow-spectrum light is emitted from the p-n junction

generated includes LJMP's and cannot be used in single-chip devices supporting Less than 2 Kbytes of program space like the Philips

LED’s are widely used as indicator lights on electronic devices and increasingly in higher power applications such as flashlights and area lighting. An LED is usually a small area (less than 1 mm2) light source, often with optics added to the chip to shape its radiation pattern and assist in reflection. The color of the emitted light depends on the composition and condition of the semi conducting material used, and can be infrared, visible, or ultraviolet. Besides lighting, interesting applications include using UV-LED’s for sterilization of water and disinfection of devices, and as a grow light to enhance photosynthesis in plants.

Color Coding:

COLOR POTENTIAL DIFFERENCE

Infrared 1.6V

Red 1.8V to 2.1V

Orange 2.2V

Yellow 2.4V

Green 2.6V

Blue 3.0V to 3.5V

White 3.5V

Table 4.1 Color coding

Figure 4.2 Close-up of a typical LED in its case showing the internal structure

Advantages:

• LED’s have many advantages over other technologies like lasers. As compared to laser diodes or IR sources

• LED’s are conventional incandescent lamps. For one thing, they don't have a filament that will burn out, so they last much longer. Additionally, their small plastic bulb makes them a lot more durable. They also fit more easily into modern electronic circuits.

• The main advantage is efficiency. In conventional incandescent bulbs, the light-production process involves generating a lot of heat (the filament must be warmed). Unless you're using the lamp as a heater, because a huge portion of the available electricity isn't going toward producing visible light.

• LED’s generate very little heat. A much higher percentage of the electrical power is going directly for generating light, which cuts down the electricity demands considerably.

• LED’s offer advantages such as low cost and long service life. Moreover LED’s have very low power consumption and are easy to maintain.

Disadvantages of LEDs:

• LED’s performance largely depends on the ambient temperature of the operating environment.

• LED’s must be supplied with the correct current.

• LED’s do not approximate a "point source" of light, so cannot be used in applications needing a highly collimated beam.

But the disadvantages are quite negligible as the negative properties of LED’s do not apply and the advantages far exceed the limitations.

5. COMPONENT DESCRIPTION:

5.1 Microcontroller 8051

Features:• 8051 have 128 bytes of RAM• 8051 have 128 user defined flags• It consist of 16 bit address bus• It also consist of 3 internal and two external

interrupts• less power usage in 8051 with respect to other

micro-controller• It consist of 16-bit program counter and data

pointer• 8051 can process 1 million one-cycle

instructions per second• It also consist of 32 general purpose registers

each of 8 bits• ROM on 8051 is 4 Kbytes in size• It also consist of Two 16 bit Timer/ Counter

Description:

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. Intel fabricated the original 8051 which is known as MCS-51. The other two members of the 8051 family are:i.     8052 – This microcontroller has 256 bytes of RAM and 3 timers. In addition to the standard features of 8051, this microcontroller has an added 128 bytes of RAM and timer. It has 8K bytes of on chip program ROM. The programs written for projects using 8051 microcontroller can be used to run on the projects using 8052 microcontroller as 8051 is a subset of 8052. 

ii.    8031 – This microcontroller has all the features of 8051 except for it to be ROM-less.  An external ROM that can be as large as 64 K bytes should be programmed and added to this chip for execution. The disadvantage of adding external ROM is that 2 ports (out of the 4 ports) are used. Hence, only 2 ports are left for I/O operations which can also be added externally if

Comparison of 8051 family members:

Features 8051 8052  8031  RAM(bytes) 128 256 128ROM 4K 8K 0KTimers 2 3 2Serial port 1 1 1I/O pins 32 32 32Interrupt sources

6 8 6

Pin dia :8051

required for execution.

Pin Description:

The 8051 microcontroller has :

• 4 Kb of ROM

• 4 Kb of ROM• 4 ports having in total of 32 input/output

lines are in most cases sufficient to make all necessary connections to peripheral environment. The whole configuration is made to satisfy the needs of most programmers working on development of automation devices. One of its advantages is that nothing is missing and nothing is too much. Another advantages are RAM organization, the operation of Central Processor Unit (CPU) and ports which completely use all recourses and enable further upgrade.

• VCC - Supply voltage.• GND - Ground.

Pins 1-8:port 1 Each of these pins can be configured as an input or an output.

Pin 9: RS A logic one on this pin disables the microcontroller and clears the contents of most registers. In other words, the positive voltage on this pin resets the microcontroller. By applying logic zero to this pin, the program starts execution from the beginning.

Pins10-17: Port 3 Similar to port 1, each of these pins can serve as general input or output. Besides, all of them have alternative functions:

Pin 10: RXD Serial asynchronous communication input or Serial synchronous communication output.

Pin 11: TXD Serial asynchronous communication output or Serial synchronous communication clock output.

Pin 12: INT0 Interrupt 0 input.

Pin 13: INT1 Interrupt 1 input.

Pin 14: T0 Counter 0 clock input.

Pin 15: T1 Counter 1 clock input.

Pin 16: WR Write to external (additional) RAM.

Pin 17: RD Read from external RAM.

Pin 18, 19: X2, X1 Internal oscillator input and output.

stability. Later versions of microcontrollers operate at a frequency of 0 Hz up to over 50 Hz.

Pin 20: GND Ground.

Pin 21-28: Port 2 If there is no intention to use external memory then these port pins are configured as general inputs/outputs. In case external memory is used, the higher address byte, i.e. addresses A8-A15 will appear on this port. Even though memory with capacity of 64Kb is not used, which means that not all eight port bits are used for its addressing, the rest of them are not available as inputs/outputs.

Pin 29: PSEN If external ROM is used for storing

A quartz crystal which specifies operating frequency is usually connected to these pins. Instead of it, miniature ceramics resonators can also be used for frequency

remains connected to the power supply voltage over a pull-up resistor of high resistance.

Port 0:The P0 port is characterized by two functions. If external memory is used then the lower address byte (addresses A0-A7) is applied on it. Otherwise, all bits of this port are configured as inputs/outputs. The other function is expressed when it is configured as an output. Unlike other ports consisting of pins with built-in pull-up resistor connected by its end to 5 V power supply, pins of this port have this resistor left out. This apparently small difference has its consequences: If any pin of this port is configured as an input then it acts as if it “floats”. Such an input has unlimited input resistance and indetermined potential. When the pin is configured as an output, it acts as an “open drain”. By applying logic 0 to a port bit, the appropriate pin will be connected to ground (0V). By applying logic 1, the external output will keep on “floating”. In order to apply logic 1 (5V) on this output pin, it is necessary to built in an external pull-up resistor.

Port 1:Port1 is a true I/O port, because it doesn't have any alternative functions as is the case with P0, but can be cofigured as general I/O only. It has a pull-up resistor built-in and is completely compatible with TTL circuits.

Port 2

P2 acts similarly to P0 when external memory is used. Pins of this port occupy addresses intended for external memory chip. This time it is about the higher address byte with addresses A8-A15. When no memory is added, this port can be used as a general input/output port showing features similar to P1.

Port 3

All port pins can be used as general I/O, but they also have an alternative function. In order to use these alternative functions, a logic one (1) must be applied to appropriate bit of the P3 register. In tems of hardware, this port is similar to P0, with the difference that its pins have a pull-up resistor built-in .

Pin's Current limitations

When configured as outputs (logic zero (0)), single port pins can receive a current of 10mA. If all 8 bits of a port are active, a total current must be limited to 15mA (port

program then a logic zero (0) appears on it every time the microcontroller reads a byte from memory.

Pin 30: ALE Prior to reading from external memory, the microcontroller puts the lower address byte (A0-A7) on P0 and activates the ALE output. After receiving signal from the ALE pin, the external register (usually 74HCT373 or 74HCT375 add-on chip) memorizes the state of P0 and uses it as a memory chip address. Immediately after that, the ALU pin is returned its previous logic state and P0 is now used as a Data Bus. As seen, port data multiplexing is performed by means of only one additional (and cheap) integrated circuit. In other words, this port is used for both data and address transmission.

Pin 31: EA By applying logic zero to this pin, P2 and P3 are used for data and address transmission with no regard to whether there is internal memory or not. It means that even there is a program written to the microcontroller, it will not be executed. Instead, the program written to external ROM will be executed. By applying logic one to the EA pin, the microcontroller will use both memories, first internal then external (if exists).

Pin 32-39: Port 0 Similar to P2, if external memory is not used, these pins can be used as general inputs/outputs. Otherwise, P0 is configured as address output (A0-A7) when the ALE pin is driven high (1) or as data output (Data Bus) when the ALE pin is driven low (0).

Pin 40: VCC +5V power supply

Input/Output (I/O) pin :

It refers to all the pins except those of the P0 port which do not have pull-up resistors built-in.

Output pin :A logic zero (0) is applied to a bit of the P register. The output FE transistor is turned on, thus connecting the appropriate pin to ground.

Input pin :A logic one (1) is applied to a bit of the P register. The output FE transistor is turned off and the appropriate pin

When these pins are configured as inputs (logic 1), built-in pull-up resistors provide very weak current, but strong enough to activate up to 4 TTL inputs of LS series

RST:Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.

P0: 26mA). If all ports (32 bits) are active, total maximum current must be limited to 71mA.

Block Diagram of 8051:

Figure 5.2 block diagram of 8051 microcontrollerOscillator Characteristics:

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier, which can be configured for use as an on-chip oscillator. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low times specifications must be observed.Idle Mode:

In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain active. The mode is invoked by software. The content of the on-chip RAM and all the special function registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a

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. However, that one ALE pulse is skipped during 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.

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 pro-gram memory locations starting at 0000H up to FFFFH. However, 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 12V programming enable voltage (VPP) during Flash programming when 12V programming is selected.

XTAL1: Input to the inverting oscillator

amplifier and input to the internal clock operating circuit.XTAL2:

It is an output from the inverting oscillator amplifier.

It should be noted that when idle is terminated by a hardware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory.

hardware reset.

5.2 Servomotors

A servomotor is a motor which forms part of a servomechanism. The servomotor is paired with some type of encoder to provide position/speed feedback. This feedback loop is used to provide precise control of the mechanical degree of freedom driven by the motor. A servomechanism may or may not use a servomotor. For example, a household furnace controlled by a thermostat is a servomechanism, because of the feedback and resulting error signal, yet there is no motor being controlled directly by the servomechanism.

5.3 Light detectorThis circuit detects light falling on the Photo-cell (Light Dependent Resistor) to turn on the 555 and create a tone that is delivered to the speaker. Pin 4 must be held below 0.7v to turn the 555 off. Any voltage above 0.7v will activate the circuit. The adjustable sensitivity control is needed to set the level at which the circuit is activated.  When the sensitivity pot is turned so that it has the lowest resistance (as shown in red), a large amount of light must be detected by the LDR for its resistance to be low. This produces a voltage-divider made up of the LDR and 4k7 resistor. As the resistance of the LDR decreases, the voltage across the 4k7 increases and the circuit is activated. When the sensitivity control is taken to the 0v rail, its resistance increases and this effectively adds resistance to the 4k7. The lower-part of the voltage-divider now has a larger resistance and this is in series with the LDR. Less light is needed on the LDR for it to raise the voltage on pin 4 to turn the 555 on.

Oscillator Connections:

Note: C1, C2 = 30 pF ± 10 pF for Crystals= 40 pF ± 10 pF for Ceramic Resonators

Figure 5.4 Oscillator connections

The power supply pins (VS+ and VS−) can be labeled in different ways . Despite different labeling, the function remains the same – to provide additional power for amplification of the signal. Often these pins are left out of the diagram for clarity, and the power configuration is described or assumed from the circuit.

Battery

An electrical battery is one or more electrochemical cells that convert stored chemical energy into electrical energy.Since the invention of the first battery (or "voltaic pile") in 1800 by Alessandro Volta and especially since the technically improved Daniell cell in 1836, batteries have become a common power source for many household and industrial applications. According to a 2005 estimate, the worldwide battery industry generates US$48 billion in sales each year, with 6% annual growth.

There are two types of batteries: primary batteries (disposable batteries), which are designed to be used once and discarded, and secondary batteries (rechargeable batteries), which are designed to be recharged and used multiple times. Batteries come in many sizes, from miniature cells used to power hearing aids and wristwatches to battery banks the size of rooms that provide standby power fortelephone exchanges and computer data centers.

Here we make use of a 6v battery.

Op amp:

 Operational amplifier ("op-amp") is a DC-coupled high-gain electronic voltage amplifier with a differential input and, usually, a single-ended output. An op-amp produces an output voltage that is typically hundreds of thousands times larger than the voltage difference between its input terminals.

Operational amplifiers had their origins in analog computers where they were used in many linear, non-linear and frequency-dependent circuits. Characteristics of a circuit using an op-amp are set by external components with little dependence on temperature changes or manufacturing variations in the op-amp itself, which makes op-amps popular building blocks for circuit design.

Op-amps are among the most widely used electronic devices today, being used in a vast array of consumer, industrial, and scientific devices. Many standard IC op-amps cost only a few cents in moderate production volume; however some integrated or hybrid operational amplifiers with special performance specifications may cost over $100 US in small quantities.Op-amps may be packaged as components, or used as elements of more complex integrated circuits.

The op-amp is one type of differential amplifier. Other types of differential amplifier include the fully differential amplifier (similar to the op-amp, but with two outputs), the instrumentation amplifier (usually built from three op-amps), the isolation amplifier (similar to the instrumentation amplifier, but with tolerance to common-mode voltages that would destroy an ordinary op-amp), and negative feedback amplifier (usually built from one or more op-amps and a resistive feedback network).

void main() {P0=0xff;P1=0xff;P2=0xff;P3=0xff;rw=0;EA = 1; TMOD = 0x21; IT0 = 1; EX0 = 1; ET0 = 1; TR0 = 1;

msdelay(1000); lcdinit(); msdelay(1000); send_string("Heart beat ");msdelay(1500);

msdelay(500);

//delay(15000); bpm=0;bt=0;

while(1) {

if(sec >=1) {sec=0; /* The sampling time is fixed 1 sec.A variable "tick" is incremented with one tick per 100mSc in the

timer 0 interrupt routine. Each on occurring of external interrupt the value in the "tick" is

picked up and it is set to zero for recounting.The process continues till next external interrupt.Formula for calculating beats per minutes (microcontroller based

heartbeat monitor ) isas tick is the time period in Sec/100. so extract the frequency of

pulses at external interruptFrequency = (1/tick)* 100 i.e pulses /secThen bpm = frequency * 60 for one minutes i.e pulses per minutein short we can do it asbpm = 6000/ bt*/lcdcmd(0x02);

6.CODING

The code is written in keil C51 compiler .The C code listing for heartbeat monitor system is:

#include<at89x52.h> // plz ad the reg51 . h file#include<string.h> // plz ad the string . h file//heart beat monitor 8051 based#define lcdport P2 // chnage it for ur hardwaresbit rw = P3^7; // LCD connection may be differentsbit rs=P3^6; // LCD interface with microcontroller sbit en=P3^5; // Enable pin of LCD unsigned char sec,sec100;unsigned int bt,tick,r,bpm; void lcdinit(); void lcdcmd(unsigned char);void lcddata(unsigned char);void send_string(unsigned char *s);void msdelay(unsigned int);void extrint (void) interrupt 0 // external Interrupt to detect the

heart pulse{ bt=tick; // number of ticks are picked tick=0; // reset for next counting} void timer0 (void) interrupt 1 using 1 // Timer 0 for one second

time{ TH0 = 0xdc; //The value is taken for Ssc/100 at crystal

11.0592MHzsec100++; // It is incremented every Ssc/100 at crystal

11.0592MHztick++; // This variable counts the time period of incoming pulse

in Sec/100if(tick>=3500){tick=0;} // tick are limited to less trhan 255 for

valid calculationif(sec100 >=100) // 1 sec = sec100 * 100{ sec++; sec100=0; }

if(bt >=7){bpm = 6000/bt; // for valid output bt is limited so that it should be

greater than 6msdelay(500); send_string("Pulse. ");while(i --);}void send_string(unsigned char *s){unsigned char l,i;l = strlen(s); // get the length of stringfor(i=1;i <=l;i++){lcddata(*s); // write every char one by ones++; }}

6.CONCLUSION:It has been successfully proved that a

simple IR sensor in conjunction with an encoder-decoder arrangement and a microcontroller can be effectively used to alert the user of any potential accident with very low cost. The low cost of this design makes it attractive to use on a daily basis. The potentiometer at the transmitter side is used to change the sensitivity of the module. Various sensitivities have been tested successfully.

7.BIBLIOGRAPHY

Text Books Referred:

1. “The 8051 Microcontroller and Embedded Systems” by Muhammad Ali Mazidi and Janice Gillispie Mazidi, Pearson Education.

2. 8051 Microcontroller Architecture, programming and application by KENNETH JAYALA

3. ATMEL 89s52 Data sheets

4. Hand book for Digital IC’s from Analogic Devices

Websites Viewed:

• www.atmel.com

• www.beyondlogic.org

• www.dallassemiconductors.com

} lcddata((bpm/100)+0x30); r=bpm%100; lcddata((r/10)+0x30); lcddata((r%10)+0x30); send_string(" bpm ");} else {send_string("out of range");} // otherwise bpm will be shown

zero, if limit does not fit for your project you can change it.} } }void lcdinit(){msdelay(100); lcdcmd(0x01);msdelay(500); lcdcmd(0x38);msdelay(500);lcdcmd(0x38);msdelay(500);lcdcmd(0x38);msdelay(500);lcdcmd(0x06);msdelay(500);lcdcmd(0x0c);msdelay(500);lcdcmd(0x03);msdelay(500);msdelay(500);}void lcdcmd(unsigned char value){rs=0;lcdport=value;msdelay(100);en=1;msdelay(100);en=0;msdelay(100);rs=1; }void lcddata(unsigned char value)//heart beat monitoring system using microcontroller {rs=1;lcdport=value;msdelay(10);en=1;msdelay(100);en=0;rs=0;} void msdelay(unsigned int i){

• www.maxim-ic.com

• www.alldatasheets.com

• www.howstuffworks.com

//unsigned int i;