You are on page 1of 14

Daniel Ofori-Darko

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

compromises were made, rough idea of project


build plan

Complete

June
19th

Order

Complete

June 20th
June 21st

Report
Wiring

Incomplete
Incomplete

June
22nd

Wiring and
Report

Incomplete and
Complete

Realized that the pic used in project is a different


model compared to the assumed one, PIC16F684.
This caused hesitation in ordering of the parts and
extended into research into other projects to fit a
complete-able project in the time allotted.
Ordered parts for a new project, but was told that
I should continue with the previous project, parts
may not come in time but set up will be
completed in case the parts arrive.
Working on the report
Went in-depth with wiring and connected most of
components, however ran into several wiring
issues and assumptions/estimations were made
based on PIC outputs even with datasheets.
Parts arrived at 11:45am for the thermoresistor
project, however the 3 digit seven segment
display could be used for the heart rate monitor.
Spent a majority of my time wiring and even
applied power to the board, however connections
were misplaced and the board got shorted, felt
abnormal amount of heat from both regulator and
OpAmp. Code was edited however it was not yet
added, only a short test of current was done.

Project Diagrams

Figure 1a PIC16F628A

Figure 2a PIC16F684

Figure 3 simplified diagram

Figure 4 IR sensors and signal conditioning circuit schematic

Figure 5 Microcontroller and Display Circuit Schematic

Figure 6 Sensor unit finger placement

Figure 7 Assembly

Figure 8 Final product photo

Figure 9 Personal alpha product

Figure 10 Pseudo Code

Bill of Materials

3 digit seven segment display


PIC16F628A
OpAmps (2x)
BC557 Transistor (x3)
BC547 Transistor
IR diode
Photo diode
5V supply (x4)
IC MCP602 (2x)
LED
Switch (3x) 1microF
1k resistor (4x)
330 ohm resistor (x2)
470 ohm resistor
10k resistor (x2)
680K resistor (x2)
6.8k Resistor (x2)
68k resistor (x2)
150 ohm resistor
1 microferret Capacitor (x2)
100 nanoferret Capacitor (x2)
0.1microferret Capacitor
22 pF Capacitor (x3)
4.0M
Switch (Start and Clear)

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.

5. References Page (APA style)


Works Cited

(n.d.). Retrieved June 21, 2015, from


http://ww1.microchip.com/downloads/en/DeviceDoc/41202F-print.pdf
Circuit Lake. (n.d.). Retrieved June 21, 2015, from http://www.circuitlake.com/pic-digitalthermometer.html
Heart rate measurement from fingertip - Embedded Lab. (2011, February 5). Retrieved June 21,
2015, from http://embedded-lab.com/blog/?p=1671
Kumar, P., & Das, S. (n.d.). The Development of a Microcontroller Based Low- Cost Heart Rate
Counter for Health Care Systems. Retrieved June 21, 2015, from
http://www.academia.edu/7719833/The_Development_of_a_Microcontroller_Based_Low_Cost_Heart_Rate_Counter_for_Health_Care_Systems
YourITronics. (n.d.). Retrieved June 21, 2015, from http://www.youritronics.com/pic16f684based-digital-thermometer/

6. Attach a self-assessment using the rubric below

Assessment
Category Expectations:

Levels: 0 = inc 1= ltd 2=some 3= most 4= thorough


0

Project technology details clearly explained in the report

Project details are clearly explained in oral presentation/demo

Research shows current and future trends, variety of sources

Detailed project plans, testing section, and insightful conclusions

Report is complete, neat, organized, and clearly written

One page product poster summarizes key aspects in text & images

Oral presentation and discussion is clear and engaging (5 minutes)

The system functions accurately and efficiently.

Hardware interfaces are well constructed, wiring is neat

Efficiently uses programming structures

Project complexity is significant ( h/w, s/w, scale, fabrication process)

Knowledge & Understanding

Category weight:

/ 20 %

Thinking & Inquiry

Category weight:

/ 20 %

Communication

Category weight:

/ 20 %

Application

Category subtotal:

40%

You might also like