So just a short update on what I've been up to.
I've received a 0.96" oled(for software testing, will be using something smaller for the final design), my first bread board(and some other stuff), the 1A charger module I'll be using and finally the new heart rate monitor.
I've wired some of it together so I can start testing code and must admit its going pretty well. The only issue I've got is with the heart rate sensor since it gives allot of noise(I've had to set the threshold into the decimals to get consistent results). I've contacted the people who make the official sensor and it seems I've been sold a counterfeit, so Ill be playing around with this till payday and then order an official one.
Following is the code I'm working on right now::
#include <Adafruit_SSD1306.h>
#define USE_ARDUINO_INTERRUPTS true
#include <PulseSensorPlayground.h>
const int PulseWire = 0;
const int LED13 = 13;
float Threshold = 534.445;
PulseSensorPlayground pulseSensor;
Adafruit_SSD1306 display(4);
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.display();
pulseSensor.analogInput(PulseWire);
pulseSensor.blinkOnPulse(LED13);
pulseSensor.setThreshold(Threshold);
pulseSensor.begin();
}
void loop() {
display.setTextColor(WHITE);
display.clearDisplay();
display.setCursor(0,0);
display.println("Pulse:");
display.display();
int myBPM = pulseSensor.getBeatsPerMinute();
if (pulseSensor.sawStartOfBeat()) {
display.setCursor(50,0);
display.println(myBPM);
display.display();
}
else
{
display.setCursor(50,0);
display.println("---");
display.display();
}
delay(1);
}
Following are some pics of the setup
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.