Professional Documents
Culture Documents
Mr. Younan
TEJ4M0 - A
Tuesday June 23rd 2015
Final Report
Project Summary
A heart rate monitor is a tool used to measure heart rate and essentially the well-being of the
cardiovascular system. This device will sense the change in blood volume from an artery in the
finger, using infrared LEDs, IR signals, photodiode sensors, microcontrollers, OpAmps,
PIC16F628A and a 3-digit seven segment display.
Theory: The project uses a microcontroller based heart rate measurement system that uses optical
sensors to measure blood volume alterations from a fingertip based on each heartbeat. The sensor
unit consists of infrared light-emitting-diode (IR LED) and a photodiode. IR diode >>>
(infrared)>>> Fingertip (on sensor unit) >>> photodiode (senses portion of light that is reflected
back). The intensity of light received depends on the blood volume in the fingertip at the time
captured, thus a heartbeat can alter the amount of reflected infrared light that will be detected.
The pulses are normally too small to be detected however an OpAmp is used as an active low
pass filter to amplify the voltage so that it may be detected. Then, by signal conditioning, the
change in amplitude of the reflected light is translated as a pulse signal, then they are simply
recorded by the microcontroller and displayed as a number.
Research Background
The heart rate monitor is low cost, portable, and can be self-managed rather than going to a
center or the doctor, which helps with management and medical fees. The data used is essentially
to determine physiological state, biological workload, stress, concentration, drowsiness and the
state of the nervous system. This build is cheap and will have errors, however it is semi-reliable
and functions the same as hospital-grade or independent company heart rate monitors,
additionally this project could be edited and manufactured for timers, better technology, capacity,
compatibility, and design (such as becoming as portable as a watch).
Project Plan
DATE
TASK
June 5th8th
June 8th-
Pre-build
Work
Gathering
COMPLETIO
N
Complete
Complete
NOTES
Needs further research to better understand use
and materials
Parts were gathered for the majority, some
18th
June
18th
parts,
preparing
for
purchase,
planning
build and
simulation
Reconfigure
project,
dilemma
Complete
June
19th
Order
Complete
June 20th
June 21st
Report
Wiring
Incomplete
Incomplete
June
22nd
Wiring and
Report
Incomplete and
Complete
Project Diagrams
Figure 1a PIC16F628A
Figure 2a PIC16F684
Figure 7 Assembly
Bill of Materials
Other sections:
1. Theory of Operation (system explained in detail and parts described referencing datasheets)
(Fix and organize)
The sensor unit consists of infrared light-emitting-diode and a photodiode pair covered and
bound together with Styrofoam to block out external signals. The IR diode sends a signal to
the finger as it is placed on the diodes sensor unit, this signal is reflected in the blood cells of
the individual and is received by the photodiode.
The intensity of light received depends on the blood volume in the fingertip at the time
captured, thus a heartbeat can alter the amount of reflected infrared light that will be
detected. The pulses are normally too small to be detected, so the OpAmp is used as an active
low pass filter to amplify the voltage so that small signatures are can be detected. Then, by
signal conditioning, the change in amplitude of the reflected light is translated as a pulse
signal, then they are simply recorded by the microcontroller (PIC16F684) and displayed as a
number on the 3 digit seven segment display as BPM.
2. Software Code
/*
Project: Measuring heart rate through fingertip
Daniel Ofori-Darko
June 22, 2015
PIC16F684 8MHz internal to 125 KHz
*/
sbit IR_Tx at RA3_bit;
sbit DD0_Set at RA2_bit;
sbit DD1_Set at RA1_bit;
sbit DD2_Set at RA0_bit;
sbit start at RB7_bit;
unsigned short j, DD0, DD1, DD2, DD3;
unsigned short pulserate, pulsecount;
unsigned int i;
//-- ------------ Function to Return mask for common anode 7-seg. display
unsigned short mask(unsigned short num) {
case 0 : return 0xC0;
case 1 : return 0xF9;
case 2 : return 0xA4;
case 3 : return 0xB0;
case 4 : return 0x99;
case 5 : return 0x92;
case 6 : return 0x82;
case 7 : return 0xF8;
case 8 : return 0x80;
case 9 : return 0x90;
} //case end
}
void delay_debounce(){
Delay_ms(300);
}
void delay_refresh(){
Delay_ms(5);
}
void countpulse(){
IR_Tx = 1;
delay_debounce();
delay_debounce();
TMR0=0;
Delay_ms(15000); // Delay 1 Sec
IR_Tx = 0;
pulsecount = TMR0;
pulserate = pulsecount*4;
}
void display(){
DD0 = pulserate%10;
DD0 = mask(DD0);
DD1 = (pulserate/10)%10;
DD1 = mask(DD1);
DD2 = pulserate/100;
DD2 = mask(DD2);
for (i = 0; i<=180*j; i++) {
DD0_Set = 0;
DD1_Set = 1;
DD2_Set = 1;
PORTB = DD0;
delay_refresh();
DD0_Set = 1;
DD1_Set = 0;
DD2_Set = 1;
PORTB = DD1;
delay_refresh();
DD0_Set = 1;
DD1_Set = 1;
DD2_Set = 0;
PORTB = DD2;
delay_refresh();
}
DD2_Set = 1;
}
void main() {
CMCON = 0x07; // Disable Comparators
TRISA = 0b00110000; // RA4/T0CKI input, RA5 is I/P only
TRISB = 0b10000000; // RB7 input, rest output
OPTION_REG = 0b00101000; // Prescaler (1:1), TOCS =1 for counter mode
pulserate = 0;
j = 1;
display();
do {
if(!start){
delay_debounce();
countpulse();
j= 3;
display();
}
} while(1); // Infinite loop
}
3. Test Procedures, Test Results and Modifications Completed and Recommendations
4. Conclusions (learnings, issues, future possibilities)
In conclusion I was not able to get my product to work, the Pulse at Ease (easy to measure
pulse, and can measure pulse when heart rate is at ease). This is due to a combination of
procrastination, improvisation, and lack of information. There were communication issues in
the design of the product as I was not directly following a guide, I had to construct the guide
based on the information I was given and then I had to construct the device itself based on
my guide, as such there are various sources of error that stem from the project structure. Such
include using a substitute microcontroller, substitute resistors, transistors, OpAmps, and
capacitors to an extent. Virtually no variables were defined and model numbers were only
given for specific items, as such I was forced to make several assumptions in design, pin lay
out, pin use, and connection.
Despite the failure I am rather intrigued and excited at the experience, I believe that with
enough time and research I could adjust parts, layout and pin design and actually get the
product working, additionally I had fun learning about the product and learning about each
chip and minor device as I constructed it. Although I plan to go into a completely different
field, I can now view engineered products in a specific light and I could potentially
manufacture or suggest certain products based on the information that I learned and that I
would be able to apply.
This products highlight is its mobility and ease of access. For such a low production cost
product the possibilities are high and can expand into several fields excluding the medical.
Simple heart rate monitors can be kept in workplaces so to measure the working conditions
and physiological states of the workers or even guests. Heart rate values will be more
common and understood, creating precautionary measures for sudden implications as
individuals may notice when their heart rates are marginally different than they would be
usually. Additionally, the ease of access isnt limited to watches but can even be programmed
in phones using correct sensors and controllers. Another industry huge on sensors other than
the medical is that of the gaming industry. As we push towards virtual reality gaming that
capture facial expressions, and words, they can be taken a step further by monitoring the
physiological state of the individual. Such as the heart rate when playing a virtual reality
horror game, or simply measuring how awestruck players are in an adventure game, such
data could be used to make better games.
Assessment
Category Expectations:
One page product poster summarizes key aspects in text & images
Category weight:
/ 20 %
Category weight:
/ 20 %
Communication
Category weight:
/ 20 %
Application
Category subtotal:
40%