Heart Beat Monitor
Heart Beat Monitor
5-2016
Sneha Pottian
Trinity University, [email protected]
Repository Citation
Mireles, Ivan and Pottian, Sneha, "Heart Beat Monitor" (2016). Mechatronics Final Projects. 3.
http://digitalcommons.trinity.edu/engine_mechatronics/3
This Report is brought to you for free and open access by the Engineering Science Department at Digital Commons @ Trinity. It has been accepted for
inclusion in Mechatronics Final Projects by an authorized administrator of Digital Commons @ Trinity. For more information, please contact
[email protected].
Pledged,
Project Report
Heart beat monitor
Mechatronics
ENGR 4367
Dr. Nickels
5/1/16
I. Table of Contents
2
II. Design Summary
This project is used to detect the number of heartbeats per minute from the fingertip of a
patient. It is also meant to display how a heart beats based off the signal it picks up from the pulse
through an analog counter. Once the user turns on the power button, they will be instructed to place
their finger on the sensing tip (ref. To Fig. 1).Once the user has placed their finger on the pulse
sensor, the system will require that the start button be pressed to start counting up the heart beats.
As the heart beats are sensed the counter will start moving in a circle at increments that match the
beat along with beeps from a speaker to visually display it. The sensor will take about 15s to count
the heartbeats and once it is done, the clock will stop at a number and visually display it on an
LCD screen in BPM (beats per minute). If the heart rate is too high or too low, the speaker goes
off warning the user. After a set number of seconds, the system goes back to the default setting
waiting for the next input. Figure 1 displays how each individual elements connects to the overall
system. From the diagram, one can see that the visual counter is controlled by an Arduino which
takes the input from the PIC.
3
counting the number of pulses from the input signal for 15 seconds, and multiplies the counter by
4 to convert the number to BPM. As there is a pulse, the PIC sends a digital signal to the Arduino
to turn the stepper one step determined by the program. This serves as a visual display of the pulses
the finger produces as the PIC is counting these pulses. After the counter is converted, the number
is displayed on the LCD. If the heart rate is not between the average rate of 60-100 BPM, the
buzzer will sound alerting the user that the heart rate is not within the expected range. It holds this
message for 3 seconds before returning to the default setting.
4
Table 1: The functional elements used in the design.
A Output Display -LCD
V. Special Parts
Infrared LED - produces an electromagnetic wave with wavelength between 940nm-950nm. On
Mouser Electronics, the device costs $0.70 if bought with individually.
Infrared semiconductor - serves as semiconductor collecting infrared light and increasing voltage
as amount of collected light increases. On Mouser Electronics, the device costs $0.48.
5
project. It would have been helpful to also go through the specifications of a device thoroughly
before making any assumptions and wiring it up.
VII. References
[1] Blum, Jeremy. "Arduino - Stepper unipolar circuit". Arduino.cc. N.p., 2016. Web. 2 May
2016.
VIII.Appendix
Appendix A: Figures
6
Figure 2: Functional diagram of the heartbeat system
Figure 3: The wiring diagram of the PIC16F88 to it’s input and outputs
7
Figure 4: The scope showing the first amplification stage with a gain of 100V/V with the
sensor input (yellow) and the amplified signal (green).
8
Figure 6: The flowchart diagram of the whole system.
9
Appendix B: Code
PIC Code:
'****************************************************************
'* Name : heartbeat.bas *
'* Author : Ivan Mireles, Sneha Pottian *
'* Notice : Copyright (c) 2016 *
'* : All Rights Reserved *
'* Date : 4/20/2016 *
'* Version : 1.0 *
'* Notes : Program that reads user's heartbeat from finger *
'* : tip and displays in BPM on LCD. *
'****************************************************************
ansel = 0
main:
while (1)
'initialization
low stepper
counter = 0
timer = 0
low buzzer
if (power_b == 1) then
lcdout , $FE, 1, "Place finger", $FE, $C0, "on sensor" 'Default state
if (start_b ==1) then
stepper = heartbeat 'sets stepper to be heartbeat input, controlled by
Arduino
lcdout $FE, 1,"Adjusting" 'This is to wait for the signal to settle
10
pause 3000
lcdout $FE, 1,"Checking pulse.."
'Counter variable counting pulses for 15 sec then storing the value in
BPM
COUNT heartbeat, 15000, counter
counter = counter * 4
else
lcdout $FE, 1, "Heart rate:", $FE, $C0, DEC counter, "BPM"
endif
pause 3000
endif
else
lcdout $FE, 1
endif
Wend
Arduino code:
#include <Stepper.h>
void setup() {
11
pinMode(led, OUTPUT);
void loop() {
state = digitalRead(button);
Serial.print("Button state is: ");
Serial.print(state);
Serial.print('\n');
if (state == HIGH)
{digitalWrite(led, HIGH);
myStepper.step(4);
}
else
{digitalWrite(led, LOW);
}
//writing to motor
delay(600);
12