Go Down

Topic: Interface Blynk with Arduino UNO, Bluetooth HC-05, AD8232 Heart Monitor Sensor (Read 65 times) previous topic - next topic

Capstone18

Hey Guys!

I'm working on a project that allows early Heart Attack Detection and Heart Rate Monitor. I opt-ed to use Blynk as the IoT platform for the mobile app development.

However, I started to have problems displaying the heart rate data in the mobile app via Blynk connecting using Bluetooth, but I could display it perfectly well on Arduino platform.

Hope you guys could help to solve the Blynk interface part.
Thank you!



Below is the code:

#define BLYNK_PRINT Serial


#include <SoftwareSerial.h>
SoftwareSerial SwSerial(0, 1); // RX, TX
   
#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "9dd15340ef6749e890405775c********";

SoftwareSerial SerialBLE(0, 1); // RX, TX

BlynkTimer timer;
int sensorData;
// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  sensorData = analogRead(A0);
  Blynk.virtualWrite(V5, sensorData);
}

void setup()
{
  // Debug console
  Serial.begin(9600);

  SerialBLE.begin(9600);
  Blynk.begin(SerialBLE, auth);

  Serial.println("Waiting for connections...");

  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);
}

void loop()
{
  Blynk.run();
  timer.run(); // Initiates BlynkTimer
}

Go Up