BLOG# 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
-
- Here is a video of it running
-
- –
-
- 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. ******/ }
-
- Here is a video of it running
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
- 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
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)
- Wiring Diagram
- Software Design
- UML Sequence Diagram
- Show the Logic of the flow of the Software
- Libraries
- List all the libraries that I plan to use.
- UML Sequence Diagram
- Functional Specification
-
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.
Top Comments