My sensor didn't send data to blynk

I already run the coding but it just display on serial monitor. when I check on blynk the data from hardware didn’t receive to blynk

Posting your whole sketch might help.

[Screenshot of code removed by moderator]

[Screenshot of code removed by moderator]

@ismi please do not post screenshots of your code. Instead you should copy the entire code text from your IDE and post it with triple backticks at the beginning and end of the code.

Triple backticks look like this:
```

Pete.

#define BLYNK_TEMPLATE_ID "TMPLb9tVjL-2"

#define BLYNK_DEVICE_NAME "smartoxymeter"

#define BLYNK_AUTH_TOKEN "RzXX1Yzz2GMwP5q5gcq-Nsi_FFo0YtiE"

#include <ESP8266WiFi.h>

#include <Blynk.h>

#define BLYNK_PRINT Serial

#include <BlynkSimpleEsp8266.h>

#include <WiFiClientSecure.h>

#include <UniversalTelegramBot.h>

#include <Adafruit_GFX.h>      

#include <Adafruit_SSD1306.h>

#include <Wire.h>

#include "MAX30100_PulseOximeter.h"

#include "MAX30100.h"

#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

BlynkTimer timer;

char auth[] = BLYNK_AUTH_TOKEN;

const char* ssid = "Cemi"; //wifi name

const char* password = "iszah1997";//wifi password

#define BOTtoken "5840782505:AAGS_yxbT5fO9vNyiR3oom1QSKJ7ZfHxmxo "// bot token dari telegram

#define CHAT_ID "617709603" // chat id telegram

X509List cert(TELEGRAM_CERTIFICATE_ROOT);

WiFiClientSecure client;

UniversalTelegramBot bot(BOTtoken, client);

#define REPORTING_PERIOD_MS     1000

#define SAMPLING_RATE                       MAX30100_SAMPRATE_100HZ

#define IR_LED_CURRENT                      MAX30100_LED_CURR_50MA

#define RED_LED_CURRENT                     MAX30100_LED_CURR_7_6MA

#define PULSE_WIDTH                         MAX30100_SPC_PW_1600US_16BITS

#define HIGHRES_MODE                        true

#define BLYNK_PRINT Serial

MAX30100 sensor;

PulseOximeter pox;

uint32_t tsLastReport = 0;

#define SCREEN_WIDTH 128 // OLED display width, in pixels

#define SCREEN_HEIGHT 32 // OLED display height, in pixels

#define OLED_RESET    -1 // Reset pin # (or -1 if sharing Arduino reset pin)

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); //Declaring the display name (display)

static const unsigned char PROGMEM logo2_bmp[] =

{ 0x03, 0xC0, 0xF0, 0x06, 0x71, 0x8C, 0x0C, 0x1B, 0x06, 0x18, 0x0E, 0x02, 0x10, 0x0C, 0x03, 0x10,              //Logo2 and Logo3 are two bmp pictures that display on the OLED if called

0x04, 0x01, 0x10, 0x04, 0x01, 0x10, 0x40, 0x01, 0x10, 0x40, 0x01, 0x10, 0xC0, 0x03, 0x08, 0x88,

0x02, 0x08, 0xB8, 0x04, 0xFF, 0x37, 0x08, 0x01, 0x30, 0x18, 0x01, 0x90, 0x30, 0x00, 0xC0, 0x60,

0x00, 0x60, 0xC0, 0x00, 0x31, 0x80, 0x00, 0x1B, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x04, 0x00,  };

static const unsigned char PROGMEM logo3_bmp[] =

{ 0x01, 0xF0, 0x0F, 0x80, 0x06, 0x1C, 0x38, 0x60, 0x18, 0x06, 0x60, 0x18, 0x10, 0x01, 0x80, 0x08,

0x20, 0x01, 0x80, 0x04, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0xC0, 0x00, 0x08, 0x03,

0x80, 0x00, 0x08, 0x01, 0x80, 0x00, 0x18, 0x01, 0x80, 0x00, 0x1C, 0x01, 0x80, 0x00, 0x14, 0x00,

0x80, 0x00, 0x14, 0x00, 0x80, 0x00, 0x14, 0x00, 0x40, 0x10, 0x12, 0x00, 0x40, 0x10, 0x12, 0x00,

0x7E, 0x1F, 0x23, 0xFE, 0x03, 0x31, 0xA0, 0x04, 0x01, 0xA0, 0xA0, 0x0C, 0x00, 0xA0, 0xA0, 0x08,

0x00, 0x60, 0xE0, 0x10, 0x00, 0x20, 0x60, 0x20, 0x06, 0x00, 0x40, 0x60, 0x03, 0x00, 0x40, 0xC0,

0x01, 0x80, 0x01, 0x80, 0x00, 0xC0, 0x03, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x30, 0x0C, 0x00,

0x00, 0x08, 0x10, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x01, 0x80, 0x00  };

void onBeatDetected()

{

        display.clearDisplay();                                

        display.drawBitmap(0, 0, logo3_bmp, 32, 32, WHITE);    

        display.setTextSize(1);                                

        display.setTextColor(WHITE);            

        display.setCursor(50,0);                

        display.println("BPM");            

        display.setCursor(80,0);                

        display.println(pox.getHeartRate());

        display.setCursor(50,18);

        display.println("SpO2");

        display.setCursor(80,18);

        display.println(pox.getSpO2());

        display.setCursor(95,18);

        display.println("%");

        display.display();

}

void setup()

{

 

    Serial.begin(115200);

    Wire.begin(D2, D1);//sda,scl

    configTime(0, 0, "pool.ntp.org");      

    client.setTrustAnchors(&cert);

    display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

    display.display();

    delay(5000);

    //pinMode(10, INPUT); //for L0+

   // pinMode(11, INPUT); //for L0-

    sensor.begin(); //Get raw values

    sensor.setMode(MAX30100_MODE_SPO2_HR);

    sensor.setLedsCurrent(IR_LED_CURRENT, RED_LED_CURRENT);

    sensor.setLedsPulseWidth(PULSE_WIDTH);

    sensor.setSamplingRate(SAMPLING_RATE);

    sensor.setHighresModeEnabled(HIGHRES_MODE);

    pox.begin();

    Serial.println("Adafruit MLX90614 test");  

    mlx.begin();

 // pox.setIRLedCurrent(MAX30100_LED_CURR_50MA);

  WiFi.mode(WIFI_STA);

  WiFi.begin(ssid, password);

  int a = 0;

    while (WiFi.status() != WL_CONNECTED) {

    Serial.print(".");

    display.setCursor(a, 0);

    display.print(".");

    delay(500);

    a++;

   

}

 Serial.println("");

  display.clearDisplay();

  display.setTextSize(1);                    

  display.setTextColor(WHITE);

  display.setCursor(0, 0);

  display.print("WiFi connected");

  Serial.println("WiFi connected");

  Serial.print("IP address: ");

  display.setCursor(0, 1);

  display.print(WiFi.localIP());

  Serial.println(WiFi.localIP());

  delay(500);

  bot.sendMessage(CHAT_ID, "System started", "");

  display.clearDisplay();

  display.setCursor(0, 0);

  display.print("System started");

  delay(3000);

  display.clearDisplay();

 //Blynk.begin();

 //WiFi.begin(ssid, pass);

 //timer.setInterval(2000L, checkBlynkStatus);

 Blynk.begin(auth, ssid, password);  

 delay(1000);

}

void loop()

{

  Blynk.run();

  float Hr = pox.getHeartRate();

  float SpO2 = pox.getSpO2();

  float temp = mlx.readObjectTempC();

  Serial.print("*C\tObject = ");

  Serial.print(temp);

  Serial.println("*C");

  display.clearDisplay();

  display.setTextSize(2);                                

  display.setTextColor(WHITE);            

  display.setCursor(50,0);

  display.print(temp);

  Blynk.virtualWrite(V2,SpO2);

  display.setCursor(110,0);

  display.println("*C");

  delay(1000);

  if(temp >= 37.5){

  bot.sendMessage(CHAT_ID, "Heart Rate Abnormal Alert!!", "");

  }

 

  Serial.println(analogRead(A0));

  uint16_t irValue, red;

    sensor.update();

    pox.update();

   

    sensor.getRawValues(&irValue, &red);

    if (irValue < 7000){       //If no finger is detected it inform the user and put the average BPM to 0 or it will be stored for the next measure

     display.clearDisplay();

     display.setTextSize(1);                    

     display.setTextColor(WHITE);            

     display.setCursor(30,5);                

     display.println("Please Place ");

     display.setCursor(30,15);

     display.println("your finger ");  

     display.display();

    }

       

    if (millis() - tsLastReport > REPORTING_PERIOD_MS) {

        if(irValue > 7000){                                          

        display.clearDisplay();                                  

        display.drawBitmap(5, 5, logo2_bmp, 24, 21, WHITE);      

        display.setTextSize(1);                                

        display.setTextColor(WHITE);            

        display.setCursor(50,0);                

        display.println("BPM");            

        display.setCursor(80,0);                

        display.println(Hr);

        Blynk.virtualWrite(V0, Hr);

        if(Hr <= 50 ){

        bot.sendMessage(CHAT_ID, "Low Heart Rate Alert!!", "");

        }

        if(Hr >= 150){

         bot.sendMessage(CHAT_ID, "High Heart Raate Alert!!", "");  

        }

        display.setCursor(50,18);

        display.println("SpO2");

        display.setCursor(80,18);

        display.println(SpO2);

        Blynk.virtualWrite(V1,SpO2);

        if(SpO2 <=93){

         bot.sendMessage(CHAT_ID, "SpO2 Abnormal Alert!!", "");

        }

        display.setCursor(95,18);

        display.println("%");

        display.display();

       

        pox.setOnBeatDetectedCallback(onBeatDetected);                        

         

        Serial.print("\t Heart rate:");

        Serial.print(Hr);

        Serial.print("bpm / SpO2:");

        Serial.print(SpO2);

        Serial.println("%");

        tsLastReport = millis();

      }

  }

} 

You should probably remove your Telegram token, and it’s not a good idea to share your Template ID or Auth token on a public forum. Always best to replace the values with “REDACTED”.

Your void loop is a mess. A correctly structured Blynk void loop should normally only contain the following…

void loop
{
  Blynk.run();
  timer.run();
}

and thee should be no delay() commands in your code, except maybe in your void setup.

You should read this…

https://docs.blynk.io/en/legacy-platform/legacy-articles/keep-your-void-loop-clean

Pete.

Thank you pete. but may I ask why my esp8266 just detect and display reading only one sensor. another sensor didn’t display anything.it is because the coding ? or the problem of hardware. sometimes its detect both sensor but won’t display any reading.

I have no idea. With your sketch breaking so many Blynk rules it’s difficult to know exactly where the issue is. Maybe you should use a simplified sketch with no Blynk code to test your hardware.

Pete.

thank you pete