This document describes a heart rate measurement circuit that uses an optical sensor to detect changes in blood volume in a finger artery with each heartbeat. The sensor detects the infrared light reflected off blood cells. The signal is too small for a microcontroller so it is amplified and filtered. The amplified signal is counted by a microcontroller and displayed on a 7-segment display. The microcontroller counts the pulses to determine the heart rate in beats per minute.
This document describes a heart rate measurement circuit that uses an optical sensor to detect changes in blood volume in a finger artery with each heartbeat. The sensor detects the infrared light reflected off blood cells. The signal is too small for a microcontroller so it is amplified and filtered. The amplified signal is counted by a microcontroller and displayed on a 7-segment display. The microcontroller counts the pulses to determine the heart rate in beats per minute.
This document describes a heart rate measurement circuit that uses an optical sensor to detect changes in blood volume in a finger artery with each heartbeat. The sensor detects the infrared light reflected off blood cells. The signal is too small for a microcontroller so it is amplified and filtered. The amplified signal is counted by a microcontroller and displayed on a 7-segment display. The microcontroller counts the pulses to determine the heart rate in beats per minute.
Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 1
CHAPTER 1 INTRODUCTION
A heart rate monitor is a simple device that makes a sample of the heartbeat signal and computes the bpm so that the information can easily be used to track heart conditions. Heart rate measurement indicates the soundness of the human cardiovascular system. This project demonstrates a technique to measure the heart rate by sensing the change in blood volume in a finger artery while the heart is pumping the blood. It consists of an infrared LED that transmits an IR signal through the finer tip of the subject, a part of which is reflected by the blood cells. The reflected signal is detected by a photo transistor. The changing blood volume with heartbeat results in a train of pulses at the output of the photo transistor, the magnitude of which is too small to be detected directly by a microcontroller. Therefore, a two stage high gain, active low pass filter is designed using two operational amplifiers to filter and amplify the signal to appropriate voltage level so that the pulses can be counted by a microcontroller.
Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 2
CHAPTER 2 BLOCK DIAGRAM AND EXPLANATION 2.1 BLOCK DIAGRAM
Fig: 2.1 Block Diagram of Heart Rate Measurement Circuit 2.2 MATERIALIZATION OF BLOCK DIAGRAM 2.2.1 SENSING UNIT An optical sensor is a device that converts light rays into electronic signals. Similar to a photo resistor, it measures the physical quantity of light and translates it into a form read by the instrument. Usually, the optical sensor is part of a larger system integrating a measuring device, a source of light and the sensor itself. This is generally connected to an electrical trigger, which reacts to a change in the signal within the light sensor. One of the features of an optical sensor is its ability to measure the changes from one or more light beams. This change is most often based around alterations to the intensity of the light. SENSING UNIT AMPLIFIER AND FILTER MICRO CONTROLLER DISPLAY Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 3
When a phase change occurs, the light sensor acts as a photoelectric trigger, either increasing or decreasing the electrical output, depending on the type of sensor. The CNY70 is a reflective sensor used in this project that includes an infrared emitter and phototransistor in a leaded package which blocks visible light.
Fig: 2.2 Optical Reflective Sensor CNY 70
Fig: 2.3 Internal Diagram of CNY70 The CNY70 has a compact construction where the emitting light source and the detector are arranged in the same direction to sense the presence of an object by using the reflective IR beam from the object. The IR LED transmits an infrared light into the fingertip, a part of which is reflected back from the blood inside the finger arteries. The photo diode senses the portion of the light that is reflected back. The intensity of reflected light depends upon the blood volume inside Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 4
the fingertip. So, every time the heart beats the amount of reflected infrared light changes, which can be detected by the photo transistor. 2.2.2 MICROCONTROLLER The Atmel AT89 series is an Intel 8051-compatible family of 8 bit microcontrollers (Cs) manufactured by the Atmel Corporation. Based on the Intel 8051 core, the AT89 series remains very popular as general purpose microcontrollers, due to their industry standard instruction set, and low unit cost. This allows a great amount of legacy code to be reused without modification in new applications. While considerably less powerful than the newer AT90 series of AVR RISC microcontrollers, new product development has continued with the AT89 series for the aforementioned advantages. All four ports in the AT89C51 and AT89C52 are bidirectional. Each consists of a latch (Special Function Registers P0 through P3), an output driver, and an input buffer. The output drivers of Ports 0 and 2, and the input buffers of Port 0, are used in access to external memory. In this application, Port 0 outputs the low byte of the external memory address, time-multiplexed with the byte being written or read. Port 2 outputs the high byte of the external memory address when the address is 16 bits wide. Otherwise the Port 2 pins continue to emit the P2 SFR content. All the Port 3 pins, and two Port 1 pins (in the AT89C52) are multifunctional. The alternate functions can only be activated if the corresponding bit latch in the port SFR contains a 1. Otherwise the port pin is stuck at 0. It has less complex feature than other microprocessor. In this project, it is used to count the pulses reached at its input port. The output of the sensing unit which consists of the sensor, amplifier, filter and comparator is given to the input of the microcontroller. A seven segment display is connected at its port 2 in which the final output count of the pulses are shown. 2.2.3 SEVEN SEGMENT DISPLAY The seven elements of the display can be lit in different combinations to represent the Arabic numerals. Often the seven segments are arranged in an oblique (slanted) arrangement, which aids Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 5
readability. The numerals 6, 7 and 9 may be represented by two or more different glyphs on seven-segment displays, with or without a 'tail'. The seven segments are arranged as a rectangle of two vertical segments on each side with one horizontal segment on the top, middle, and bottom. Additionally, the seventh segment bisects the rectangle horizontally. There are also fourteen-segment displays and sixteen-segment displays (for full alphanumeric); however, these have mostly been replaced by dot matrix displays. The segments of a 7-segment display are referred to by the letters A to G, where the optional DP decimal point (an "eighth segment") is used for the display of non-integer numbers. Seven-segment displays may use a liquid crystal display (LCD), a light-emitting diode (LED) for each segment, or other light-generating or controlling techniques such as cold cathode gas discharge, vacuum fluorescent, incandescent filaments, and others. For gasoline price totems and other large signs, vane displays made up of electromagnetically flipped light-reflecting segments (or "vanes") are still commonly used. In a simple LED package, typically all of the cathodes (negative terminals) or all of the anodes (positive terminals) of the segment LEDs are connected and brought out to a common pin; this is referred to as a "common cathode" or "common anode" device. Hence a 7 segment plus decimal point package will only require nine pins (though commercial products typically contain more pins, and/or spaces where pins would go) in order to match standard IC sockets. Integrated displays also exist, with single or multiple digits. Some of these integrated displays incorporate their own internal decoder, though most do not: each individual LED is brought out to a connecting pin as described.
Fig:2.4 Individual Segment of a Seven Segment Display Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 6
All the anodes of the A segments of each digit position would be connected together and to a driver circuit pin, while the cathodes of all segments for each digit would be connected. To operate any particular segment of any digit, the controlling integrated circuit would turn on the cathode driver for the selected digit, and the anode drivers for the desired segments; then after a short blanking interval the next digit would be selected and new segments lit, in a sequential fashion. In this manner an eight digit display with seven segments and a decimal point would require only 8 cathode drivers and 8 anode drivers, instead of sixty-four drivers and IC pins. A single byte can encode the full state of a 7-segment-display. The most popular bit encodings are GFEDCBA and ABCDEFG, where each letter represents a particular segment in the display. In the GFEDCBA representation, a byte value of 0x06 would (in a common-anode circuit) turn on segments 'C' and 'B', which would display a '1'.
Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 7
CHAPTER 3 CIRCUITRY
3.1 CIRCUIT DIAGRAM 1: SENSING UNIT
Fig:3.1 Sensing Unit
Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 8
3.2 CIRCUIT DIAGRAM 2: COUNTING UNIT
Fig:3.2 Counting Unit
Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 9
Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 11
CHAPTER 4 PIN DIAGRAMS 4.1 AT89C51
Fig: 4.1 Pin Diagram of AT89C51 DESCRIPTION AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C51 has 4KB of Flash programmable and erasable read only memory (PEROM) and 128 bytes of RAM. It can be erased and program to a maximum of 1000 times. In 40 pin AT89C51, there are four ports designated as P1, P2, P3 and P0. All these ports are 8-bit bi-directional ports, i.e., they can be used as both input and output ports. Except P0 which needs external pull-ups, rest of the ports have internal pull-ups. When 1s are written to these port pins, they are pulled high by the internal Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 12
pull-ups and can be used as inputs. These ports are also bit addressable and so their bits can also be accessed individually. Port P0 and P2 are also used to provide low byte and high byte addresses, respectively, when connected to an external memory. Port 3 has multiplexed pins for special functions like serial communication, hardware interrupts, timer inputs and read/write operation from external memory. AT89C51 has an inbuilt UART for serial communication. It can be programmed to operate at different baud rates. Including two timers & hardware interrupts, it has a total of six interrupts. VCC: Positive (+ve) DC Supply voltage. Which is normally between 3V to 5V DC. GND: 0V Ground. This pin is connected to negative (-ve) DC supply voltage. PORTS: Ports are generally used by computers to communicate to the outside world. Microcontrollers use port to read input from another device or to send output to another device. AT89C51 has four ports for communication. PORT 0, PORT 1, PORT 2, PORT 3: These ports are 8-bit bi-directional I/O ports. They can be used for both input and output ports. As an output port, each pin can sink eight TTL inputs. Port can be used as an input when they are made to read data from another device (which can be a component or a sensor), or as an output when they are used to send a signal to another device. They basically understand two logic states that is 1s and 0s. RST: Reset input. This pin is used to reset the microcontroller. If a high remains on this pin for two machine cycles while the oscillator is running, the microcontroller is reset. ALE/PROG: Address Latch Enable output pulse for latching the low byte of the address during access to external memory. This pin is also the program pulse input (PROG) during Flash programming. This pin used to program the microcontroller. 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 AT89C51 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. Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 13
EA/VPP: External Access Enable. A 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 12V programming enable voltage (VPP) during Flash programming, for parts that require 12V VPP. XTAL1: Input to the inverting oscillator amplifier and input to the internal clock operating circuit. This pin is connected to the external crystal oscillator together with XTAL2. XTAL2: Output from the inverting oscillator amplifier.
Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 14
ARCHITECTURE OF AT89C51
Fig: 4.2 Architecture of AT89C51
Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 15
4.2 LM358
Fig: 4.3 Pin Diagram of LM358
LM358 is a dual operational amplifiers feature low power drain, a common mode input voltage range extending to ground/VEE, and single supply or split supply operation. The LM358 series is equivalent to one-half of an LM324. These amplifiers have several distinct advantages over standard operational amplifier types in single supply applications. They can operate at supply voltages as low as 3.0 V or as high as 32 V, with quiescent currents about onefifth of those associated with the MC1741 (on a per amplifier basis). The common mode input range includes the negative supply, thereby eliminating the necessity for external biasing components in many applications. The output voltage range also includes the negative power supply voltage.
Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 16
4.3 CNY70
Fig: 4.4 Optical Sensor CNY70
The CNY70 is a reflective sensor that includes an infrared emitter and phototransistor in a leaded package which blocks visible light. Its dimension is described as L7 mmW7 mmH6 mm and its peak operating distance is less than 0.5mm. Also its emitter wavelength is about 950nm. The CNY70 has a compact construction where the emitting light source and the detector are arranged in the same direction to sense the presence of an object by using the reflective IR beam from the object.
Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 17
CHAPTER 5 ADVANTAGES AND DISADVANTAGES 5.1 ADVANTAGES Ergonomic. Cost Effective. Durable. Portable. Simple. Can be used in clinical & non-clinical environments. 5.2 DISADVANTAGES
Noise may produce disturbance. Resting heart rate is subject to high variability thus causing error. Continuous monitoring is not possible.
5.3 PROBLEMS FACED
The major problem faced during the development of our project was the difficulty in making up a pulse sensing circuit. The IR diode was sensing the object movement but not the variation of blood flow. By adding a comparator unit and by proper designing of the whole circuit leads us to overcome the same. The interference of the visible light and surrounded noise makes the development of the sensing unit to be the greatest challenge.
Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 18
CHAPTER 6 CONCLUSION In this project, the design and development of a Heart Rate Measuring device is presented. It measures the heart rate efficiently in a short time and with less expense without using time consuming and expensive clinical pulse detection systems. Analog signal processing techniques are used to keep the device simple and to efficiently suppress the disturbance in signals. Experimental results showed that the heart rate can be filtered and digitized so that it can be counted to calculate an accurate pulse rate. The device is able to detect, filter, digitize, and display the heartbeat of a user ergonomically. The device could be further developed into a continuously monitoring device that could be used to detect the heart rate anomalies associated with certain heart conditions. The maximum and minimum heart rates over a period of time and thus any abnormalities in the pulse rate can also be detected.
Amal Jyothi College of Engineering Heart Rate Measurement
Department of Electronics and Communication Page 19
REFERENCES
BOOKS
J.B. Gupta: Electronic circuits and devices. Ramakanth A. Gayakward: Op-amps and linear integrated circuits. K.R. Botkar: Integrated circuits. Muhammad Ali Mazidi, Janice Gillispie Mazidi and Rolin D Mckinlay: The 8051 Microcontroller and Embedded Systems, Pearson Prentice Hall Publication. Udayashankara: 8051 Microcontroller; Hardware, Software & Applications.