This Instructable documents how to create a simple heart rate monitor using Photoplethysmography with an IR phototransistor via transmissive absorption using the Arduino to process the pulsatile data and display live results via a TFT screen.

To use the source code and create the necessary circuitry you will need a reasonable grasp of electronics, knowledge of the Arduino, a DMM and some patience.

The design has been optimised to work with easily obtainable 'off the shelf' commercial parts and re-purposed household items and gives reasonable results.

You will need the following parts;

  1. Arduino Mega 2560 (from SainSmart)
  2. 1 off old coat hanger as depicted in the picture in Step 2 : The Sensor
  3. 1 off 1.8 SPI 128x160 TFT Module. I got mine for £2.79 from ebay. Here; http://www.ebay.co.uk/itm/1-8-Serial-SPI-TFT-LCD-Module-Display-PCB-Adapter-Power-IC-SD-Socket-128x160-/381339124956?hash=item58c99544dc:g:mqcAA0SwjvvvsM13
  4. 2 off TL072 FET OpAmps
  5. 1 off T121 NPN Darlington Transistor
  6. 3 off 1N4148 diodes
  7. 1 off BZY88C 3v3 Zener diode
  8. 1 off BPW96B Phototransistor
  9. 1 off TSAL6400 940nm IR 5mm Led
  10. 1 off Ceramic 1uF capacitor
  11. 2 off 4.7uF Electrolytic capacitors
  12. 1 off 22pF Ceramic capacitor
  13. 1 off 22nF Ceramic capacitor
  14. 1 off 10nF Ceramic capacitor
  15. 1 off 50K 10 turn potentiometer
  16. 3 off 4K7 resistors
  17. 4 off 10R resistors
  18. 2 off 7R5 resistors
  19. 1 off 1M0 resistor
  20. 1 off 3K9 resistor
  21. 2 off 10K resistors
  22. 1 off 100K resistor
  23. 5 off 1K resistors
  24. 1 off 220R resistor

Other than the Arduino Mega 2560 (Genuino), coat hanger and the TFT display, I purchased all the parts from FARNELL in the UK.


WARNING : The details contained herein are for information only and should not be relied upon for accurate heart rate monitoring in a clinical or any other environment.

Step 1: Now for the Science Part!

So what is Photoplethysmography?

Photoplethysmography (PPG) is a simple and low cost optical technique that can be used to detect blood volume changes in the microvascular bed of tissue. It is used to make non-invasive measurements at the surface of the skin.

A PPG waveform comprises two main components; 'AC' arterial pulsatile changes in blood flow synchronised to heart beat and 'DC' elements attributed to venous blood, tissue, respiration, sympathetic nervous system activity and thermoregulation. See diagram above 'Variation in light attenuation by tissue'.

It is these AC changes which are used to extract heart beat.

The interaction of light with human tissue is quite complex and involves; scattering, reflection and absorption. Research has shown that IR light around 940nm gives the deepest penetration and yields the best deep tissue blood flow measurement. See https://www.youtube.com/watch?v=2v3rae-73jc

Detection is achieved by shining a source of illumination (in this case an IR LED) at an optically sensitive receiver (photodiode/phototransistor).

Positioning of sensors is in one of two ways, reflective or transmissive. See diagram above 'Transmissive and Reflective modes'. Transmissive mode yields the best results with IR illumination, which is what this project is based around.

<p>Hi man, nice work. But I'm wondering why didn't you use AnalogWrite() and a low-pass filter to obtain 2.5V for the fake ground. Any explanations?</p>
<p>Hi <a href="https://www.instructables.com/member/MatejJ7" rel="nofollow">MatejJ7</a>,</p><p>&pound;4&pound; a 3v3 zener has a good band gap reference (exhibits good temp stability), is cheap, and the inclusion of IC1A as a buffer amp gives a good low impedance output meaning in combination will provision a cheap and stable(ish) 0v. </p><p>Let me know how you get on with a microprocessor driven PWM and a single pole filter. I suspect the S/N will be high.</p><p>Good luck with the Uni project.</p><p>Regards</p><p>SteveQuinn</p>
<p>Is it possible to use a pre-made sensor (like Adafruit's Pulse Sensor Amped) and incorporate the display code with it?</p>
Hi marcpr,<br><br>The sensor output is conditioned and fed into the Arduino via analogue pin 0, so long as the output from this sensor is an analogue of the heart rate (ie. the signal is continuous in time) and you ensure the signal swing is within the dynamic range of the Arduino it should be ok. You can then do away with the electronics in the 'front end'. Though it kind of dumbs down the challenge of making the device outlined in the instructable. <br>You will most probably need to tweak the code in the routine named 'void handleCalibration(void)'<br><br>Regards<br><br>SteveQuinn
<p>I dont know whether you are still answering questions OP. but I have one, why did you use that array of parallel series parallel resistors for the current supply? thanks.</p>
<p>Hi <a href="https://www.instructables.com/member/jtome" style="">jtome</a>,</p><p>If you mean R5, R6, R18...21 I describe this in the text of the Instructable. Step 3 Signal Conditioning : Description of circuit. Does this help?</p><p>Regards</p><p>SteveQuinn</p>
Nice project
<p>This is a great project! I've been wanting to try something like this, so many thanks for the 'ible!</p><p>Can I ask: Is it necessary to use the Arduino Mega, or would a normal Uno with a ATMega 328 be sufficient? I haven't had a chance to look at the sketch but conceptually, there doesn't seem to be too much analysis involved - read the ADC, write to the screen and compare with threshold values.</p><p>Either way, a superb project!</p><p>Ugi</p>
<p>Hi Ugifer, I've taken a quick look at the data sheets for the ATMega2560 and ATMega328, it looks like the ADC block is the same (approx. 13 clock cycles to convert, less S&amp;H etc.). The schematics for the Uno and 2560 look like they use a 16MHz clock. So, tentatively that would be a yes. </p><p>In this project there is nothing really time critical but you may have to tweak some of the counters to get the best output. Though the most important bit is the front end. Try to get the best signal off the sensor that you can.</p><p>Best of luck.</p>
<blockquote>Can you give a nice view of circuit diagram without arduino and tft screen?<br>If I can run it by using function generator(oscilloscope) and 5v power supply?<br>I wanted to have good look at the clip sensor that how you connected the diodes.<br>Hope you will help.<br>If you can then mail me at rahman.naeem.1994@gmail.com<br>Thank you...</blockquote>
<p>Hi Naeem, You're better off constructing your own circuit from the full and comprehensive details I gave in step 3. My 'lashed up' protoboard example also contains a second constant current source which is not required for this project. Besides I've got wires dangling all over the place no doubt coupling to the mains. To answer your question can it be run by an oscilloscope (I'm guessing FnGen is a typo), yes would be the answer, but this was developed as a portable Arduino project. Hence the Arduino and TFT display. Interestingly though, I initially wrote the s/w using a RIGOL DZ1032 Arbitrary Waveform Generator which has a built in heart beat waveform and allowed me to deterministically reproduce a beat signature without having to keep my finger in the sensor. This allowed me to get a good feel for the s/w trigger levels (90%/70%).</p><p>If you choose to use a scope as an output device then you can do away with IC2 and couple direct to the o/p of the LPF (R10, C6). Your probe will need to be HiZ at least &gt;= 1MOhm. You can suitably scale the i/p signal by choosing whatever Y-axis amplification works best with your facsimile of the circuit. Though you will need to make your own pulse rate measurements/calculations which will be tricky as the pulse can vary substantially between beats and auto trigger won't work. That's why the rolling average is useful.</p><p>The circuit was developed for single rail +5V so it will work fine, however as I say, use a linear supply or better still a battery. If you use switched mode, especially one of the poor quality derivative Chinese brands there will invariably be a lot of noise on the +ve rail which will couple to the sensor supply and degrade the quality of your signal.</p><p>As for the sensor clip. This is just trail and error around 0.1&quot; pitches. You can see from the pictures in Step 2 how the device is assembled. The Led and Phototransistor are just soldered directly into the veroboard (paper/phenolic - not the best material, FR4 would be better) and pressed through the plastic clip. I did make sure I removed any residual flux between tracks after soldering. As described in 'Practical' note #2.</p><p>Hope the final year project works out. ;-)</p>
<p>Many many thanks for information brother... :)</p>
<p>Great smooth signal, but couldn't fine the circuit diagram.</p>
<p>Try clicking on 'Show All Items' in step 3.</p>
<p>If you don't see a signal, you know you are dead xD</p><p>Great i'ible!</p>
<p>Correct, or indeed 'walking dead'. Though I suspect you would need to add a temp sensor to be sure. ;-)</p>
Very cool project !
<p>Thanks for the nod.</p><p>Like the cool apiarist related projects.</p>

About This Instructable




More by SteveQuinn:WiFi IoT Temperature and Humidity Sensor. Part : 8 IoT, Home Automation Using ESP8266 SPIFFS Expand your Arduino's I/O with an I2C Slave device 
Add instructable to: