BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Oximeter Max30100 + Blynk using cytron esp 8266(Max30100 can’t read BPM & SpO2)

• Arduino Mega 2560+ cytron esp8266 Sheild +Oximeter Max30100
• IOS
• Blynk server
• Blynk Library version v0.6.1


#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <Wire.h>
#include "MAX30100_PulseOximeter.h"
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(10, 11);
 
PulseOximeter pox;
ESP8266 wifi(&EspSerial);
BlynkTimer timer;


char auth[] = "...";
char ssid[] = "...";
char pass[] = "...";
 
void onBeatDetected()
{
    Serial.println("Beat!");
}
 
void setup()
{
    Serial.begin(115200);
    delay(1000);
    EspSerial.begin(9600);
    delay(1000);
    Blynk.begin(auth, wifi, ssid, pass);
    delay(1000);
    pinMode(9,OUTPUT);

    
    Serial.print("Initializing pulse oximeter..");
 
    if (!pox.begin()) {
        Serial.println("FAILED");
        for(;;);
    } else {
        Serial.println("SUCCESS");
    }
    pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);
    timer.setInterval(1000L, sensorDataSend);
    pox.setOnBeatDetectedCallback(onBeatDetected);
    
}
 
void loop(){
    Blynk.run();
    timer.run();  
}

void sensorDataSend(){
  pox.update(); 
  Serial.print("Heart rate:");
  Serial.print(pox.getHeartRate());
  Serial.print("bpm / SpO2:");
  Serial.print(pox.getSpO2());
  Serial.println("%");
  Blynk.virtualWrite(V7, pox.getHeartRate());
}
 

Is your device connecting to Blynk okay?
Does the Max30100 work with your hardware using a sample (non-Blynk) sketch?
How is your Max30100 wired?

Pete.

yes the connection is okey,
but when i try to put this code Blynk.virtualWrite(V7, 5);
the sensor cant read and the irredsensor got turn off

So, I asked three questions and you answered one of them.
And, you’ve then thrown in this statement…

without any explanation about where within your sketch you placed this code, what effect this had on the widget attached to V7 in the app, or whether this caused a disconnection from the Blynk server.

If you want help then you’ll need to volunteer more information, or fix the issue on your own.

Pete.

sorry for that

Does the Max30100 work with your hardware using a sample (non-Blynk) sketch?
yes.
How is your Max30100 wired?
vin-3.3volt pin
gnd - gnd
scl-scl
sda-sda