{"id":8863,"date":"2015-08-04T09:48:47","date_gmt":"2015-08-04T16:48:47","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=8863"},"modified":"2021-06-16T16:10:32","modified_gmt":"2021-06-16T23:10:32","slug":"heart-rate-monitor-using-a-myrio","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/heart-rate-monitor-using-a-myrio\/","title":{"rendered":"Heart Rate Monitor Using a myRIO"},"content":{"rendered":"<p>For NI week, we wanted to include a demo that used <a href=\"http:\/\/www.ni.com\/labview\/\" target=\"_blank\" rel=\"noopener\">LabVIEW<\/a>, the <a href=\"http:\/\/www.ni.com\/myrio\/\" target=\"_blank\" rel=\"noopener\">NI myRIO<\/a>, the <a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,842,845&amp;Prod=APK\" target=\"_blank\" rel=\"noopener\">Analog Parts Kit<\/a>, the <a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?Prod=MYPROTO\" target=\"_blank\" rel=\"noopener\">myProto board<\/a>, the <a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?Prod=PMOD-CLS\" target=\"_blank\" rel=\"noopener\">PmodCLS LCD display<\/a>, and the Pmod Adapter for the myRIO. \u00a0The idea I came up with was to use a photoresistor to measure your heart rate from your finger. \u00a0As your heart pumps, the blood volume in your finger changes depending on the stage of the heartbeat and thus the amount of light absorbed by your finger changes as well. \u00a0These different light values can then be used to see how many heart beats have occurred in a period of time. \u00a0Check out my Instructable for this project <a href=\"http:\/\/www.instructables.com\/id\/Heart-Rate-Monitor-Using-a-Photoresistor\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/booga.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-8886 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/booga-600x445.png\" alt=\"booga\" width=\"600\" height=\"445\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/booga-600x445.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/booga-1024x760.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/booga-225x167.png 225w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/booga-800x594.png 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/booga.png 2000w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><strong>Circuit Design<\/strong>:<\/p>\n<p>First, a <a href=\"https:\/\/learn.blog.digilentinc.com\/Documents\/251\" target=\"_blank\" rel=\"noopener\">voltage divider<\/a> is created using 5V supply from the myRIO, a 14.7k resistor, and the photoresistor. \u00a0The voltage across the photoresistor is then fed to a <a href=\"http:\/\/www.facstaff.bucknell.edu\/mastascu\/elessonshtml\/OpAmps\/OpAmp3Note1Buffer.html\" target=\"_blank\" rel=\"noopener\">buffer op-amp<\/a> to protect the voltage reading across the photoresistor from the load of the rest of the circuit. \u00a0The resulting voltage is then sent to a <a href=\"http:\/\/www.electronics-tutorials.ws\/filter\/filter_4.html\" target=\"_blank\" rel=\"noopener\">passive bandpass filter<\/a> with both the low and high frequency cutoffs set to 2Hz using resistors and capacitors. \u00a0The filtered voltage is then amplified 101 times by using a <a href=\"http:\/\/www.electronics-tutorials.ws\/opamp\/opamp_3.html\" target=\"_blank\" rel=\"noopener\">non-inverting amplifier<\/a> with a 1M resistor and a 10k resistor. \u00a0Finally, the amplified voltage is sent to the analog input on the myRIO. \u00a0The Op-Amp I used (<a href=\"http:\/\/www.analog.com\/en\/products\/amplifiers\/operational-amplifiers\/jfet-input-amplifiers\/adtl082.html\" target=\"_blank\" rel=\"noopener\">ADTL084<\/a>) acts like\u00a0two Op-Amps packaged together.<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,842,845&amp;Prod=APK\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8865 size-medium\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/prettycircuit-600x197.png\" alt=\"prettycircuit\" width=\"600\" height=\"197\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/prettycircuit-600x197.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/prettycircuit-1024x336.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/prettycircuit-225x74.png 225w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/prettycircuit.png 1486w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/Products\/Detail.cfm?NavPath=2,842,845&amp;Prod=APK\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8866 size-medium\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/fritzingpic-600x286.png\" alt=\"fritzingpic\" width=\"600\" height=\"286\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/fritzingpic-600x286.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/fritzingpic-1024x489.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/fritzingpic-225x107.png 225w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/fritzingpic.png 1052w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>When Button0 is pushed on the bottom of the myRIO, the LED1 on the myRIO turns on and the voltage is monitored for 10 seconds. The number of heart beats sensed during that time period is multiplied by 6 to give you a beats per minute reading\u00a0which\u00a0is then sent to the PmodCLS via <a href=\"https:\/\/learn.blog.digilentinc.com\/Documents\/403\" target=\"_blank\" rel=\"noopener\">SPI<\/a>. \u00a0When the myRIO is idling, LED0 is on.<\/p>\n<p>&nbsp;<\/p>\n<p>Feel free to try and recreate this project. \u00a0For low-light conditions, try using\u00a0another non-inverting amplifier to further increase the voltage reading.<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-8863 jlk' data-task='like' data-post_id='8863' data-nonce='2183b1f519' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-8863 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-8863 jlk' data-task='unlike' data-post_id='8863' data-nonce='2183b1f519' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-8863 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-8863 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Heart racing in excitement for NI Week? Well now you can measure exactly how fast it is going, with a photoresistor heart rate sensor.<\/p>\n","protected":false},"author":33,"featured_media":8886,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,4327],"tags":[],"ppma_author":[4481],"class_list":["post-8863","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-expansion-modules","category-projects"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/07\/booga.png","authors":[{"term_id":4481,"user_id":33,"is_guest":0,"slug":"sudharsan-sukumar","display_name":"Sudharsan Sukumar","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/ade8dccd0e229a47c849e77c724cb3a6?s=96&d=mm&r=g","author_category":"","user_url":"","last_name":"Sukumar","last_name_2":"","first_name":"Sudharsan","first_name_2":"","job_title":"","description":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/8863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=8863"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/8863\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/8886"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=8863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=8863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=8863"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=8863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}