{"id":8183,"date":"2014-01-08T22:58:41","date_gmt":"2014-01-09T03:58:41","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=8183"},"modified":"2023-04-05T23:18:21","modified_gmt":"2023-04-06T03:18:21","slug":"chipkit-project-3-easy-pulse-meter","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/chipkit-project-3-easy-pulse-meter\/","title":{"rendered":"chipKIT Project 3: Easy Pulse Meter"},"content":{"rendered":"<p>This is a third project in our <a href=\"http:\/\/embedded-lab.com\/blog\/?page_id=4705\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>chipKIT tutorial series<\/strong><\/a> and today we are going to construct a simple pulse rate meter using\u00a0our <a href=\"http:\/\/embedded-lab.com\/blog\/?p=7336\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Easy Pulse sensor<\/strong><\/a>\u00a0with Digilent&#8217;s\u00a0<a href=\"http:\/\/embedded-lab.com\/blog\/?p=4444\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>chipKIT Uno32<\/strong><\/a> board. Digilent&#8217;s <a href=\"https:\/\/digilentinc.com\/Products\/Detail.cfm?NavPath=2,892,936&amp;Prod=CHIPKIT-BASIC-IO-SHIELD\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>chipKIT Basic I\/O shield<\/strong><\/a> is also used in this project for displaying the pulse waveform and the pulse rate.<\/p>\n<div id=\"attachment_8184\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Title.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8184\" class=\"size-full wp-image-8184\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Title.jpg\" alt=\"Pulse rate meter using chipKIT Uno32 and Easy Pulse\" width=\"580\" height=\"432\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Title.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Title-550x409.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-8184\" class=\"wp-caption-text\">Pulse rate meter using chipKIT Uno32 and Easy Pulse<\/p><\/div>\n<p><!--more--><\/p>\n<p><strong>What do we need?<\/strong><\/p>\n<p>In order to build this project, we will need following things.<\/p>\n<ul>\n<li>1 <a href=\"http:\/\/embedded-lab.com\/blog\/?p=7336\" target=\"_blank\" rel=\"noopener noreferrer\">Easy Pulse sensor<\/a><\/li>\n<li>1 <a href=\"http:\/\/embedded-lab.com\/blog\/?p=4444\" target=\"_blank\" rel=\"noopener noreferrer\">chipKIT Uno32 board<\/a><\/li>\n<li>1 <a href=\"https:\/\/digilentinc.com\/Products\/Detail.cfm?NavPath=2,892,936&amp;Prod=CHIPKIT-BASIC-IO-SHIELD\" target=\"_blank\" rel=\"noopener noreferrer\">chipKIT Basic I\/O Shield<\/a><\/li>\n<li>3 male\/female jumper wires (20 cm long)<\/li>\n<li>Power supply source (9V DC wall adapter or battery with a clip)<\/li>\n<\/ul>\n<div id=\"attachment_8187\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_ThingsRequired2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8187\" class=\"size-full wp-image-8187\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_ThingsRequired2.jpg\" alt=\"Things required to build this pulse meter\" width=\"580\" height=\"423\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_ThingsRequired2.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_ThingsRequired2-550x401.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-8187\" class=\"wp-caption-text\">Things required to build this pulse meter<\/p><\/div>\n<p>Besides, a USB cable (not shown in the picture above) is also required to upload the firmware from PC to the Uno32 board.<\/p>\n<p><strong>Where to Buy Easy Pulse Sensor?<\/strong><\/p>\n<p><strong><a href=\"https:\/\/www.tindie.com\/products\/rajbex\/easy-pulse-a-diy-pulse-sensor-based-on-photoplethysmography\/\" target=\"_blank\" rel=\"noopener noreferrer\">US customers buy here<\/a><\/strong><\/p>\n<p><a href=\"https:\/\/www.elecrow.com\/ep3350cde.html\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>International customers buy here<\/strong><\/a><\/p>\n<p><strong>Wire Connections and Setup<\/strong><\/p>\n<p>The OLED display on the Basic I\/O Shield is driven through SPI interface. This requires the JP4 jumper on chipKIT Uno32 board be placed on the RG9 position so that the SPI SS function is available on Pin 10. Read our tutorial <a href=\"http:\/\/embedded-lab.com\/blog\/?p=4444\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Exploring the chipKIT Uno32<\/strong><\/a> for more details on jumper functions and settings on the Uno32 board. The following picture shows the required jumper settings on Uno32 board for this project.<\/p>\n<div id=\"attachment_8191\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_JumperSettings.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8191\" class=\"size-full wp-image-8191\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_JumperSettings.jpg\" alt=\"Jumper settings on Uno32 board\" width=\"580\" height=\"436\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_JumperSettings.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_JumperSettings-550x413.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-8191\" class=\"wp-caption-text\">Jumper settings on Uno32 board<\/p><\/div>\n<p>Now plugin the Basic I\/O shield on top of the Uno32 board and connect the Easy Pulse sensor power supply and the analog PPG output pins to the I\/O shield as shown in the following figure.<\/p>\n<div id=\"attachment_8192\" style=\"width: 539px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/CircuitSetup.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8192\" class=\"size-full wp-image-8192\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/CircuitSetup.jpg\" alt=\"Pin connections between Easy Pulse and I\/O shield\" width=\"529\" height=\"525\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/CircuitSetup.jpg 529w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/CircuitSetup-150x150.jpg 150w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/CircuitSetup-90x90.jpg 90w\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" \/><\/a><p id=\"caption-attachment-8192\" class=\"wp-caption-text\">Pin connections between Easy Pulse and I\/O shield<\/p><\/div>\n<p>The Easy Pulse board is powered with 3.3V power supply from the I\/O board header pins. The analog pulse output from Easy Pulse is connected to analog pin A1 of Uno32 through headers available on the I\/O shield. The analog pin A0 of Uno32 may not be used for feeding Easy Pulse output because it is already hard-wired to the potentiometer output on the I\/O shield. The following picture shows the complete setup of this project.<\/p>\n<div id=\"attachment_8196\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Setup.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8196\" class=\"size-full wp-image-8196\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Setup.jpg\" alt=\"Complete project setup\" width=\"580\" height=\"446\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Setup.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Setup-550x422.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-8196\" class=\"wp-caption-text\">Complete project setup<\/p><\/div>\n<p><strong>Project sketch<\/strong><\/p>\n<p>The firmware of this project is based on the same algorithm as used in out previous project\u00a0<a href=\"http:\/\/embedded-lab.com\/blog\/?p=7485\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>PC-based heart rate monitor<\/strong><\/a>. The algorithm used by the PC application before is now implemented in the firmware of Uno32. The following flowchart shows the algorithm used to compute the pulse rate. For more detail on this algorithm, visit the\u00a0<a href=\"http:\/\/embedded-lab.com\/blog\/?p=7485\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>PC-based heart rate monitor<\/strong><\/a>\u00a0project.<\/p>\n<div id=\"attachment_10347\" style=\"width: 594px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/embedded-lab.com\/blog\/chipkit-project-3-easy-pulse-meter\/algorithm\/\" rel=\"attachment wp-att-10347\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-10347\" class=\"size-full wp-image-10347\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/algorithm.jpg\" alt=\"Al\" width=\"584\" height=\"625\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/algorithm.jpg 584w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/algorithm-550x588.jpg 550w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><p id=\"caption-attachment-10347\" class=\"wp-caption-text\">Algorithm flowchart for computing heart rate<\/p><\/div>\n<p>The PPG waveform and the pulse rate (in beats per minute, BPM) are both displayed on the OLED screen of the I\/O shield. The Uno32 sketch uses the <a href=\"https:\/\/digilentinc.com\/Data\/Products\/CHIPKIT-BASIC-IO-SHIELD\/chipKIT%20IOShield%20Library.zip\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>chipKIT I\/O Shield library<\/strong><\/a> to display data on the OLED. The complete sketch along with the required library routines is available for download through the following link.<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/uploads\/chipKIT\/P3_Uno32_PulseMeter.zip\"><strong>Download complete sketch<\/strong><\/a><\/p>\n<p>Unzip the downloaded sketch folder and upload the sketch named <em><strong>P3_Uno32_PulseMeter.pde<\/strong><\/em>\u00a0to the Uno32 board.<\/p>\n<p><strong>Demonstration<\/strong><\/p>\n<p>After the sketch is uploaded, power the Uno32 board through a DC wall adapter or any other external power supply that could be used to power the Uno32 board. Using USB power source is not recommended as some USB ports do not supply enough current for Easy Pulse sensor, in which case the performance of the sensor would be poor. When the sensor is unplugged, the range of ADC would not exceed 50 counts (described in the algorithm) and the pulse meter displays &#8220;No Pulse Signal&#8221; message on the OLED screen as shown below.<\/p>\n<div id=\"attachment_8199\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Display2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8199\" class=\"size-full wp-image-8199\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Display2.jpg\" alt=\"Sensor unplugged\" width=\"580\" height=\"430\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Display2.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Display2-550x407.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-8199\" class=\"wp-caption-text\">Sensor unplugged<\/p><\/div>\n<p>Now wear the Easy Pulse sensor on a finger tip and adjust the P1 potentiometer on the Easy Pulse to 1\/4th position from left. The PPG waveform and the pulse rate should now display on the screen. The screen is refreshed in every 3 seconds. If the PPG signal appears clipped at the peak values, consider decreasing the gain of the filter circuit on the Easy Pulse board. This can be done by rotating the P1 potentiometer counterclockwise. Similarly, if you see the &#8220;No Pulse Signal&#8221; message even after wearing the sensor, you should consider increasing the gain by slightly turning the potentiometer clockwise. Read the <a href=\"http:\/\/embedded-lab.com\/blog\/?p=7336\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Easy Pulse document<\/strong><\/a> for more details on the function of P1 and P2 potentiometers of Easy Pulse.<\/p>\n<div id=\"attachment_8200\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Display1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8200\" class=\"size-full wp-image-8200\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Display1.jpg\" alt=\"PPG waveform and Pulse Rate\" width=\"580\" height=\"399\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Display1.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/01\/P3_Display1-550x378.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-8200\" class=\"wp-caption-text\">PPG waveform and Pulse Rate displayed on the OLED screen<\/p><\/div>\n<p>Here is a demo video that shows the Easy Pulse Meter in action.<\/p>\n<p><iframe loading=\"lazy\" src=\"\/\/www.youtube.com\/embed\/R4j4xUp_ylw\" width=\"480\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a third project in our chipKIT tutorial series and today we are going to construct a simple pulse rate meter using\u00a0our Easy Pulse sensor\u00a0with Digilent&#8217;s\u00a0chipKIT Uno32 board. Digilent&#8217;s chipKIT Basic I\/O shield is also used in this project for displaying the pulse waveform and the pulse rate.<\/p>\n","protected":false},"author":1,"featured_media":8184,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[150,401],"tags":[1314,711,486,177],"class_list":["post-8183","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino-2","category-chipkit","tag-chipkit","tag-chipkit-pulse-meter","tag-easy-pulse","tag-pulse-meter"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/8183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/comments?post=8183"}],"version-history":[{"count":19,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/8183\/revisions"}],"predecessor-version":[{"id":15126,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/8183\/revisions\/15126"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/8184"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=8183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=8183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=8183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}