element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Summer of Sensors Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Summer of Sensors Design Challenge
  • More
  • Cancel
Summer of Sensors Design Challenge
Blog Under Pressure - BLOG# 1 - BPM Uno – INTRODUCTION
  • Blog
  • Forum
  • Documents
  • Design Challenge
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Summer of Sensors Design Challenge to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: skruglewicz
  • Date Created: 1 Oct 2022 5:03 PM Date Created
  • Views 1095 views
  • Likes 13 likes
  • Comments 5 comments
  • BLOG# 2-Research & Experimentation
  • arduino uno
  • Under Pressure
  • LSM6DSL Click MIKROE-2731
  • bpm
  • mikroelektronika
  • Summer of Sensors Design Challenge
  • mikroe
  • max30100
  • MIKROE-2000 Heart Rate Click
  • MIKROE-1581Arduino Uno Shield
  • Patient Beats Per Minute Heart Rate Monitor
  • BPM Uno
Related
Recommended

Under Pressure - BLOG# 1 - BPM Uno – INTRODUCTION

skruglewicz
skruglewicz
1 Oct 2022
Under Pressure - BLOG# 1 - BPM Uno – INTRODUCTION

imageBLOG# 1 - BPM Uno – INTRODUCTION. A Patient Beats Per Minute Heart Rate Monitor. This blog is part of a blog series for the Summer of Sensors -- Under Pressure Design Challenge. The sponsor of the challenge MikroElektronika, has supplied me with a kit  of their Sensor click boards, along with an   Arduino UNO SMD. This blog will describe the idea I have for designing and implementing a Beats Per Minute Monitor using the kit. I will describe my Idea, state my goals for the project, describe the supplied kit and list my Project Plan, by describing each Blog in this series

My idea is to use the supplied challenge kit as a Beats Per Minute Heart Sensor Unit. I will be designing this heart Sensor unit for this challenge. For my Design, I'll be attaching a Heart Rate Sensor and a OLED Display to the supplied challenge kit. I  have never worked with these particular components in this kit before. I will be experimenting with the Kit components to design, Test, and implement my idea. 

While I was waiting for my kit to arrive, I used my UNO R3 and connected a heart rate sensor and OLED display that I had from another Element14 design challenge , to prototype my idea. 

You can view my entry blog series for the " Design for a Cause 2021" at BLOG# 1 - Beats Per Minute Nano - INTRODUCTION 

Here are the components in addition to an Arduino UNO R3, that I used for prototype.. I also used: Breadboards and Jumper wires.

  • Heart Rate Sensor -- BUY on Amazon
  • SSD1306 I2C OLED Display 128x64 Yellow Blue
    • This one for $6.99 from Amazon.. BUY on Amazon.
  • Here is the circuit I used
  • image
    • Here is a video of it running
        • –
          You don't have permission to edit metadata of this video.
          Edit media
          x
          image
          Upload Preview
          image
        • Here is the firmware that Is running on the Uno. It uses the PulseSensor library with the purple wire attached to Analog 0.
        • BPM_NANO.ino
        • //	BPM_NANO.ino
          /*
          Sketch to display BPM to the OLED display from the PulseSensor.
          
          */
          
          /* OLED Section */
          // Include Wire Library for I2C
          #include <Wire.h>
          // Include Adafruit Graphics & OLED libraries
          #include <Adafruit_GFX.h>
          #include <Adafruit_SSD1306.h>
          // Reset pin not used but needed for library
          #define OLED_RESET 4
          Adafruit_SSD1306 display(OLED_RESET);  
          
          
          /* PulseSensor Section */
          #define USE_ARDUINO_INTERRUPTS false
          #include <PulseSensorPlayground.h>
          
          const int PULSE_INPUT = A0;
          const int PULSE_BLINK = 13;    // Pin 13 is the on-board LED
          const int PULSE_FADE = 5;
          const int THRESHOLD = 550;   // Adjust this number to avoid noise when idle
          
          /*
             samplesUntilReport = the number of samples remaining to read
             until we want to report a sample over the serial connection.
          */
          byte samplesUntilReport;
          const byte SAMPLES_PER_SERIAL_SAMPLE = 10;
          
          /*
             All the PulseSensor Playground functions.
          */
          PulseSensorPlayground pulseSensor;
          
          void setup() {
            
            /* OLED Section */
            // Start Wire library for I2C
            Wire.begin();   
            // initialize OLED with I2C addr 0x3C
            display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
          
            
            /* PulseSensor Section */
            /*
               Use 115200 baud because that's what the Processing Sketch expects to read,
               and because that speed provides about 11 bytes per millisecond.
            */
            Serial.begin(115200);
          
            // Configure the PulseSensor manager.
            pulseSensor.analogInput(PULSE_INPUT);
            pulseSensor.blinkOnPulse(PULSE_BLINK);
            pulseSensor.fadeOnPulse(PULSE_FADE);
          
            pulseSensor.setSerial(Serial);
            pulseSensor.setThreshold(THRESHOLD);
          
            // Skip the first SAMPLES_PER_SERIAL_SAMPLE in the loop().
            samplesUntilReport = SAMPLES_PER_SERIAL_SAMPLE;
          
            // Now that everything is ready, start reading the PulseSensor signal.
            if (!pulseSensor.begin()) {
              /*
                 PulseSensor initialization failed,
                 likely because our Arduino platform interrupts
                 aren't supported yet.
          
                 If your Sketch hangs here, try changing USE_PS_INTERRUPT to false.
              */
              for(;;) {
                // Flash the led to show things didn't work.
                digitalWrite(PULSE_BLINK, LOW);
                delay(50);
                digitalWrite(PULSE_BLINK, HIGH);
                delay(50);
              }
            }
          
          }
          
          // set up display object that will be displayed on the OLED
          void displayValues(int v){
            // Delay to allow sensor to stabalize
            delay(2000);
            // Clear the display
            display.clearDisplay();
            //Set the color - always use white despite actual display color
            display.setTextColor(WHITE);
            //Set the font size
            display.setTextSize(1);
            //Set the cursor coordinates
            display.setCursor(0,0);
            display.print("Beats Per Minute");
            display.setCursor(33,12); 
            display.setTextSize(3);
            display.print(v);
          }
          
          void loop() {
          
          /* PulseSensor Section */
            if (pulseSensor.sawNewSample()) {
              /*
                 Every so often, send the latest Sample.
                 We don't print every sample, because our baud rate
                 won't support that much I/O.
              */
              if (--samplesUntilReport == (byte) 0) {
                samplesUntilReport = SAMPLES_PER_SERIAL_SAMPLE;
          
                //pulseSensor.outputSample();
                int myBPM = pulseSensor.getBeatsPerMinute();  // Calls function on our pulseSensor object that returns BPM as an "int".
                                                         // "myBPM" hold this BPM value now. 
          
                /*
                   At about the beginning of every heartbeat,
                   report the heart rate and inter-beat-interval.
                */
                if (pulseSensor.sawStartOfBeat()) {
                  // print the values to the serial monitor
                  Serial.println("♥  A HeartBeat Happened ! "); // If test is "true", print a message "a heartbeat happened".
                  Serial.print("BPM: ");                        // Print phrase "BPM: " 
                  Serial.println(myBPM);                        // Print the value inside of myBPM. 
          
                  // Set up the display and display the BPM
                  displayValues(myBPM);
                  display.display();
                }
              }
          
              /*******
                Here is a good place to add code that could take up
                to a millisecond or so to run.
              *******/
            }
          
            /******
               Don't add code here, because it could slow the sampling
               from the PulseSensor.
            ******/
          
          }
          

 

The Challenge Kit

  • The challenge kit arrived Via UPS on October 1,2022

What's in the Box

  • Arduino Uno
    • Arduino Uno SMD
  • MIKROE-1581Arduino Uno Shield
    • This shield comes with 4 headers, used to connect the Shield to the UNO.  I was hoping the shield came with the headers already soldered on.
    • My solution is to use my Grove Base Shield and then stack this Shield onto it.
      • I tried to just put the headers on the Grove first and then mount the Shield on the headers without soldering.
      • I tested the connection and found out that the headers mounted this way DO NOT FORM A GOOD CONNECTION.
    • So, I will be Soldering the headers onto the Shield.
  • MIKROE-2000 Heart Rate Click
  • LSM6DSL Click MIKROE-2731
  • OXIMETER 5-Click

Not in the box but will be used for my idea.

  • A  SSD1306 I2C OLED Display 128x64 Yellow Blue. This one for $6.99 from Amazon.. BUY on Amazon.
  • You will need a special USB cable that does not come in the Uno package and is sold separately Arduino UNO USB Data Sync Cable
    • image
  • Also needed to use my Grove Base Shield from my Grove Starter kit.
    • I had to attach it because the Shield would not clear the USB Connector and the Power barrel on the Uno. 

Stacked and ready to start

image

I will need to solder the headers onto the MikroE shield. I was unable to get a good connection to the Shield. I found that the click boards were not connected properly to get a consistent connection.

The Project Plan Blogs   

  • BLOG# 2 - BPM Uno –Research & Experimentation

    • Since I have not used most of the components in the kit before I will need to research and experiment with the following:
    • Using the MIKROE-1581  Arduino Uno Shield and MIKROE-2000  Heart Rate Click
      • Experiment with Heart Rate Values to calculate BPM’s 
      • Researching available libraries available for the MIKROE-2000 Heart Rate Click.
      • Experiment with using libraries found.
  • BLOG# 3 - BPM Uno - System Design

    • Functional Specification
      • Describe the functionality of prototype
    • Block diagram
      • Wiring Diagram
        • Show the components (Uno, Uno Shield, Heart Rate Click & OLED)
    • Software Design
      • UML Sequence Diagram
        • Show the Logic of the flow of the Software
      • Libraries
        • List all the libraries that I plan to use.
  • BLOG# 4 - BPM Uno – System Unit Testing

  • In this blog I will:
    • Unit testing on individual components of the kit by running a series of test.
    • Evaluate the results of the test and determine if all the components will operate together to implement my ides.
    • If they do not, introduce a redesign using the component that will work to implement my design. 
  • BLOG# 5 - BPM Uno – Redesign and Implementation

  • In this blog I will describe my Redesign and implementation of my Design. I found that my planned component, SSD1306 did not work along with the MikroE Heart Sensor. I decided to abandon the use of it and came up with another solution to display the BPM monitor information. This blog, will describe my redesign of my solution, using the Grove-LCD Display and some other Grove modules from my Grove Starter kit.  This blog contains the following sections
    • Functional specification 
    • Block Diagram
    • Electrical build
    • Implemented Application
    • Conclusions
    • Future Enchantments
    • Summary and conclusions
  • BLOG# 6 - BPM Uno - Experimenting with the LSM6DSL CLICK

  • My initial plan for this blog was, to add a new feature to my Arduino prototype sensor stack that I designed and implemented in this blog series.
  • I was only able to get the LSM6DSL Click to operate using the SPI interface, since that is what the click comes configured with.
  • I2C is supported, but you will need to solder some jumpers on the click, to use this interface. 

  • Sign in to reply

Top Comments

  • skruglewicz
    skruglewicz over 2 years ago in reply to osjef +2
    Thanks so much for the comment. The video should be available soon. In my hast to get this blog posted, I forgot to insert my image of my BPM prototype. This is an experiment that I tried before getting…
  • skruglewicz
    skruglewicz over 2 years ago +2
    Hello fellow Under Pressure Challengers taifur fragmentparadox milosrasic98 Cristi I just received my Kit today via UPS.... Hooray.. The Arduino Uno Shield is not connecting properly to the Uno.…
  • osjef
    osjef over 2 years ago +1
    Great intro, looks like you've made some good progress already! Looking forward to seeing it evolving. P.S. I can't see the video
Parents
  • osjef
    osjef over 2 years ago

    Great intro, looks like you've made some good progress already! Looking forward to seeing it evolving.

    P.S. I can't see the video

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • skruglewicz
    skruglewicz over 2 years ago in reply to osjef

    Thanks so much for the comment. The video should be available soon. In my hast to get this blog posted, I forgot to insert my image of my BPM prototype. 

    This is an experiment that I tried before getting the Kit for the challenge. I used a heart rate sensor from another project with a Arduino Uno I had. I've used this Heart Rate Sensor before and It is very easy to use with the Arduino. The library is well written and includes a Beats Per Minute example.   Hopefully the MkroE click will work just as easy. Now that I have the kit I'll be experimenting with the Heart Rate monitor click and the other 2 click boards in the Under Pressure Challenge Kit.

    Cheers

    Steve K

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • skruglewicz
    skruglewicz over 2 years ago in reply to osjef

    Thanks so much for the comment. The video should be available soon. In my hast to get this blog posted, I forgot to insert my image of my BPM prototype. 

    This is an experiment that I tried before getting the Kit for the challenge. I used a heart rate sensor from another project with a Arduino Uno I had. I've used this Heart Rate Sensor before and It is very easy to use with the Arduino. The library is well written and includes a Beats Per Minute example.   Hopefully the MkroE click will work just as easy. Now that I have the kit I'll be experimenting with the Heart Rate monitor click and the other 2 click boards in the Under Pressure Challenge Kit.

    Cheers

    Steve K

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube