IoT for ECG signal with ESP32/Blynk

Hey , i’m doing an IoT project with the AD8232 module and ESP32 to see the ECG signal in the App. The problem appears when I mix the code to display the signal and send data to Blynk since the data is not plotted correctly.
I’m nearly sure that the problem has to be with the time of the signal but I’m relatively new in this (IoT) and I have no idea how to fix the code.

The code i have so far is :

#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

BlynkTimer timer;
char auth[] = "xxxxx";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxxxxx";
char pass[] = "xxxxx";

const int heartPin = A0;

void setup() {
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(5, sendUptime);

}

void sendUptime()
{
  
  int heartValue = analogRead(heartPin);
  Serial.println(heartValue);
  delay(1);
  Blynk.virtualWrite(V0,heartValue);

  
}

void loop() {

  Blynk.run();
  timer.run();
}

I was trying to use BlynkTimer but I couldn’t make it work propperly. The image is the output when I have the IoT communication , when I have not the output signal is correctly.I’ll appreciate any help.

@Juan_Vargas please edit your code (using the pencil icon at the bottom), and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

@PeteKnight Thanks so much for the correction. I already did it.

I’d suggest that you read this topic:

Pete.

1 Like

Hello
Can you help me?
I used the above code to send heart signals to blynk app.
But I did not receive data on my mobile phone
While the ESP 32 module connects to my mobile phone

I’d suggest that you start a new topic and explain in detail exactly what hardware you are using, how it is connected together, and exactly what code you are using and what widgets you have set-up in your app…

Pete.