{"id":253,"date":"2026-02-08T01:58:06","date_gmt":"2026-02-08T01:58:06","guid":{"rendered":"https:\/\/engineeringharmony.com\/?p=253"},"modified":"2026-02-08T12:24:10","modified_gmt":"2026-02-08T12:24:10","slug":"wearable-heartbeat-sensor","status":"publish","type":"post","link":"https:\/\/engineeringharmony.com\/?p=253","title":{"rendered":"Wearable heartbeat sensor project (version 1)"},"content":{"rendered":"\n<p>I&#8217;m working on a wearable heartbeat sensor project using the HW-502 and a Micro:bit. My initial configuration is using the Micro:bit for data collection and display, an Arduino to provide 5v power to the sensor, and the sensor is the HW-502 from the 37 sensors kit.<\/p>\n\n\n\n<p>As I was building this, I initially wanted the Micro:bit to show its heart icon when the sensor triggered, but there was a significant delay when showing the heart icon. Apparently there is an <a href=\"https:\/\/makecode.microbit.org\/reference\/basic\/show-icon\">interval parameter<\/a> that&#8217;s not shown in the block code editor &#8211; only in Javascript and Python. That should speed up the heart display.<\/p>\n\n\n\n<p>I&#8217;m planning on getting this <a href=\"https:\/\/pulsesensor.com\/\">pulse sensor<\/a>, which seems to provide much smoother data and works with the 3v power provided by the Micro:bit. In the mean time, I&#8217;m also planning on using <a href=\"https:\/\/dgallichan.github.io\/python-moving-average\/\">this moving average library<\/a> for Makecode to smooth the data on the HW-502.<\/p>\n\n\n\n<p>The next challenge is how to put it all together as a wearable device. I have a <a href=\"https:\/\/forwardedu.com\/pages\/charge-for-micro-bit\">charge for Micro:bit<\/a> to power and hold the Micro:bit, I have a <a href=\"https:\/\/www.browndoggadgets.com\/products\/wearable-circuits\">wearable circuits kit<\/a> from brown dog gadgets that I may be able to use maker tape and felt to attach it to my arm and connect the pulse sensor, and the pulse sensor comes with a velcro strap to attach it to my finger, so I think that could be a good setup.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/1000081266-1024x768.jpg\" alt=\"\" class=\"wp-image-261\" srcset=\"https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/1000081266-1024x768.jpg 1024w, https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/1000081266-300x225.jpg 300w, https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/1000081266-768x576.jpg 768w, https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/1000081266-1536x1152.jpg 1536w, https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/1000081266-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">First version of the hardware<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"624\" src=\"https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/image-1-1024x624.png\" alt=\"\" class=\"wp-image-267\" srcset=\"https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/image-1-1024x624.png 1024w, https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/image-1-300x183.png 300w, https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/image-1-768x468.png 768w, https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/image-1.png 1253w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Makecode blocks<\/figcaption><\/figure>\n\n\n\n<p>Here&#8217;s the makecode file. You can copy and paste it into the Python section of Makecode and make it your own!<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-67ba2e72-e7d4-45ea-b62c-e15d10a70067\" href=\"https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/heartbeat_project_makecode.py_.txt\">heartbeat_project_makecode.py<\/a><a href=\"https:\/\/engineeringharmony.com\/wp-content\/uploads\/2026\/02\/heartbeat_project_makecode.py_.txt\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-67ba2e72-e7d4-45ea-b62c-e15d10a70067\">Download<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m working on a wearable heartbeat sensor project using the HW-502 and a Micro:bit. My initial configuration is using the Micro:bit for data collection and display, an Arduino to provide 5v power to the sensor, and the sensor is the HW-502 from the 37 sensors kit. As I was building this, I initially wanted the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[9,11,12],"tags":[],"class_list":["post-253","post","type-post","status-publish","format-standard","hentry","category-documentation","category-projects","category-wearable-heartbeat-sensor"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/engineeringharmony.com\/index.php?rest_route=\/wp\/v2\/posts\/253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/engineeringharmony.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/engineeringharmony.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/engineeringharmony.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/engineeringharmony.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=253"}],"version-history":[{"count":9,"href":"https:\/\/engineeringharmony.com\/index.php?rest_route=\/wp\/v2\/posts\/253\/revisions"}],"predecessor-version":[{"id":270,"href":"https:\/\/engineeringharmony.com\/index.php?rest_route=\/wp\/v2\/posts\/253\/revisions\/270"}],"wp:attachment":[{"href":"https:\/\/engineeringharmony.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/engineeringharmony.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/engineeringharmony.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}