Arduino sending data from sensor ( MAX30100 ) to Android app via Bluetooth

This might be a very basic question but i'll still ask cause i'm a noob.

Explaining the complete project here is irrelevant so i'll just talk about what i want to achieve.

I want the Arduino ( NANO) to send some data from MAX30100 ( Pulse and Oximeter sensor ) to android bluetooth terminal app . I've done all i could but i dont know why the app is not receiving is not displaying what i want it show.

I'm not sure where i'm mistaken.

To keep it simple ill just add the relevant part of the code:

The piece of code you supplied does not send any BT data. There are no BTSerial.print() commands.

What happens if you replicate the Serial.print() commands in this section with BTSerial.print()

void MAX30100() {

  // Make sure to call update as fast as possible
  pox.update();

  // Asynchronously dump heart rate and oxidation levels to the serial
  // For both, a value of 0 means "invalid"

  if (millis() - tsLastReport > REPORTING_PERIOD_MS ) {
    Serial.println("Heart rate:");
    Serial.println(pox.getHeartRate());
    Serial.print("bpm / SpO2:");
    Serial.println(pox.getSpO2());
    tsLastReport = millis();
  }

I tryed change that earlier but it didn't help :

BTserial.listen();
  delay(500);

Why are you using .listen()? It is for multiple software serial instances and you only have one. I would remove the .listen() and the delay.

What BT module are you using? What terminal app on the phone?

What data are you expecting receive from the phone such that you have all the BTSerial.read() commands?

Have you run a simple BT sketch with the phone and can verify communication? Have you connected the software serial RX to the module TX and the module RX to the software serial TX?

Does the code work properly with Serial output? BlueTooth is simply serial without wires, so you can upload the code which works properly with serial, and then connect the BT module to the Serial output pins 0/1. Remember to cross the RX/TX connections.

bardamxi: Maybe that part of code is wrong : void loop() BTserial.listen();

You are absolutely right, it couldn't be more wrong. As Cattledog points out, if you can send the data to the serial monitor, have have all the code you need. You might find the following background notes useful.

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

(includes some useful, pictures)