Post a new topicPost a reply Page 1 of 1   [ 10 posts ]
Author Message
 Post subject: We uploaded the SPO2 code but only "SPO2" is shown on TFT!
PostPosted: Fri Apr 05, 2019 6:30 pm 

Joined: Fri Apr 05, 2019 6:19 pm
Posts: 5
We recently bought MySignal HW v2.0 and we tried to make the SPO2 sensor work with Arduino UNO!

We downloaded the recent library MySignals_HW_SDK_V2.0.2 and uploaded the code example for SPO2 included in the library "sensor_SPO2_TFT" but only "SPO2" is shown on the TFT screen!

Please advise...


Top
 Profile  
 
 Post subject: Re: We uploaded the SPO2 code but only "SPO2" is shown on TF
PostPosted: Tue Apr 09, 2019 1:26 pm 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11290
Hi,

Could you please share with us some images of your devices?

Do you have BLE SPO2 sensor or wired sensor?

Regards


Top
 Profile  
 
 Post subject: Re: We uploaded the SPO2 code but only "SPO2" is shown on TF
PostPosted: Wed Apr 10, 2019 5:48 pm 

Joined: Fri Apr 05, 2019 6:19 pm
Posts: 5
Hello brother, thanks for reply!

The SPO2 sensor we have is the wired one: please have a look to the following link (photo of the system):

https://drive.google.com/file/d/12yUsCo ... p=drivesdk

Am getting only "SPO2" on the TFT screen!


Top
 Profile  
 
 Post subject: Re: We uploaded the SPO2 code but only "SPO2" is shown on TF
PostPosted: Thu Apr 11, 2019 10:35 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11290
Hi,

Are you have to see the data through the serial monitor of the IDE using the basic example code?
Code:
Code:
/*

    Copyright (C) 2016 Libelium Comunicaciones Distribuidas S.L.
   http://www.libelium.com

    By using it you accept the MySignals Terms and Conditions.
    You can find them at: http://libelium.com/legal

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Version:           0.1
    Design:            David Gascon
    Implementation:    Luis Martin / Victor Boria
*/

#include <MySignals.h>
#include "Wire.h"
#include "SPI.h"

int valuePulse;
int valueSPO2;
uint8_t pulsioximeter_state = 0;

void setup()
{

  Serial.begin(19200);
  MySignals.begin();
 
  MySignals.initSensorUART();
  MySignals.enableSensorUART(PULSIOXIMETER);
}

void loop()
{

  // First way of getting sensor data
  MySignals.enableSensorUART(PULSIOXIMETER);
  Serial.println();
  pulsioximeter_state = MySignals.getPulsioximeter();
  if (pulsioximeter_state == 1)
  {
    Serial.print(F("Pulse:"));
    Serial.print(MySignals.pulsioximeterData.BPM);
    Serial.print(F("bpm / SPO2:"));
    Serial.print(MySignals.pulsioximeterData.O2);
    Serial.println(F("%"));
  }
  else if (pulsioximeter_state == 2)
  {
    Serial.println(F("Not valid data"));
  }
  else
  {
    Serial.println(F("No available data"));
  }
  MySignals.disableSensorUART();

  delay(2000);


  // Second way of getting sensor data
  MySignals.enableSensorUART(PULSIOXIMETER);
  valuePulse = MySignals.getPulsioximeter(PULSE);
  Serial.println();
  if (valuePulse == 2)
  {
    Serial.println(F("Not valid Pulse data"));
  }
  else if (valuePulse == 0)
  {
    Serial.println(F("No available data"));
  }
  else
  {
    Serial.print(F("Pulse:"));
    Serial.print(valuePulse);
    Serial.println(F("bpm"));
  }
  MySignals.disableSensorUART();

 
  delay(2000);


  MySignals.enableSensorUART(PULSIOXIMETER);
  valueSPO2 = MySignals.getPulsioximeter(SPO2);
  if (valueSPO2 == 2)
  {
    Serial.println(F("Not valid SPO2 data"));
  }
  else if (valueSPO2 == 0)
  {
    Serial.println(F("No available data"));
  }
  else
  {
    Serial.print(F("SPO2:"));
    Serial.print(valueSPO2);
    Serial.println(F("%"));
  }
  MySignals.disableSensorUART();


  delay(2000);
 
}
      


Regards


Top
 Profile  
 
 Post subject: Re: We uploaded the SPO2 code but only "SPO2" is shown on TF
PostPosted: Thu Apr 11, 2019 4:28 pm 

Joined: Fri Apr 05, 2019 6:19 pm
Posts: 5
Hello, we want to display SPO2 readings on the Serial Monitor and on the TFT Screen!

We tried the code you sent but we got compilation error: the instruction "getPulsioximeter" is not recognized by the compiler!

Please have a look to the following link sharing a screenshot of the error:
https://drive.google.com/file/d/1OYqgtf ... sp=sharing

Please send us a working code to display SPO2 readings on the Serial Monitor and on the TFT screen as soon as possible...


Top
 Profile  
 
 Post subject: Re: We uploaded the SPO2 code but only "SPO2" is shown on TF
PostPosted: Tue Apr 16, 2019 10:00 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11290
Hi,

Sorry for the misunderstanding, the previous code is deprecated, you should use the next one, we just test it and it works properly.
Code:
/*

    Copyright (C) 2017 Libelium Comunicaciones Distribuidas S.L.
   http://www.libelium.com

    By using it you accept the MySignals Terms and Conditions.
    You can find them at: http://libelium.com/legal

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Version:           2.0
    Design:            David Gascon
    Implementation:    Luis Martin / Victor Boria
*/

#include <Adafruit_GFX_AS.h>
#include <Adafruit_ILI9341_AS.h>
#include <MySignals.h>



Adafruit_ILI9341_AS tft = Adafruit_ILI9341_AS(TFT_CS, TFT_DC);


int valuePulse;
int valueSPO2;
uint8_t pulsioximeter_state = 0;

void setup()
{

  Serial.begin(19200);
  MySignals.begin();
 
  MySignals.initSensorUART();
  MySignals.enableSensorUART(PULSIOXIMETER);
 
  tft.init();   
  tft.setRotation(2);
  tft.fillScreen(ILI9341_BLACK);
  tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
 
  tft.drawString("SPO2:", 0, 0, 2);
}

void loop()
{
/*
  pulsioximeter_state = MySignals.getPulsioximeter();
  if (pulsioximeter_state == 1)
  {
    tft.drawNumber(MySignals.pulsioximeterData.BPM, 0, 30, 2);
    tft.drawNumber(MySignals.pulsioximeterData.O2, 0, 45, 2);
  }

  delay(1000);
*/

    if (MySignals.spo2_micro_detected == 0 && MySignals.spo2_mini_detected == 0)
  {
    uint8_t statusPulsioximeter = MySignals.getStatusPulsioximeterGeneral();

    if (statusPulsioximeter == 1)
    {
      MySignals.spo2_mini_detected = 0;
      MySignals.spo2_micro_detected = 1;
     
      tft.drawString("Micro detected", 0, 100, 2);
    }
    else if (statusPulsioximeter == 2)
    {
      MySignals.spo2_mini_detected = 1;
      MySignals.spo2_micro_detected = 0;

      tft.drawString("Mini detected", 0, 100, 2);
    }
    else
    {
      MySignals.spo2_micro_detected = 0;
      MySignals.spo2_mini_detected = 0;
    }
  }


  if (MySignals.spo2_micro_detected == 1)
  {
    MySignals.enableSensorUART(PULSIOXIMETER_MICRO);
    delay(10);
    uint8_t getPulsioximeterMicro_state = MySignals.getPulsioximeterMicro();

    if (getPulsioximeterMicro_state == 1)
    {
      tft.drawNumber(MySignals.pulsioximeterData.BPM, 0, 30, 2);
      tft.drawNumber(MySignals.pulsioximeterData.O2, 0, 45, 2);
     
    }
    else if (getPulsioximeterMicro_state == 2)
    {
      //Serial.println(F("Finger out or calculating"));
    }
    else
    {
      MySignals.spo2_micro_detected = 0;
      //Serial.println(F("SPO2 Micro lost connection"));
    }
  }


  if (MySignals.spo2_mini_detected == 1)
  {
    MySignals.enableSensorUART(PULSIOXIMETER);

    uint8_t getPulsioximeterMini_state = MySignals.getPulsioximeterMini();

    if (getPulsioximeterMini_state == 1)
    {
      tft.drawNumber(MySignals.pulsioximeterData.BPM, 0, 30, 2);
      tft.drawNumber(MySignals.pulsioximeterData.O2, 0, 45, 2);
    }
    else if (getPulsioximeterMini_state == 2)
    {
      //Serial.println(F("Finger out or calculating"));
    }
    else if (getPulsioximeterMini_state == 0)
    {
      MySignals.spo2_mini_detected = 0;
      //Serial.println(F("SPO2 Mini lost connection"));
    }
  }

  delay(1000);
}







Hope it works now.

Regards.


Top
 Profile  
 
 Post subject: Re: We uploaded the SPO2 code but only "SPO2" is shown on TF
PostPosted: Tue Apr 16, 2019 4:22 pm 

Joined: Fri Apr 05, 2019 6:19 pm
Posts: 5
Hi brother, unfortunately we tried but it didn't work!

It displayed only "SPO2:" on the TFT screen although on the sensor's screen display is correct!
Even on the Serial monitor it displayed strange characters "?A" at 19200 baud rate!

Please send as working codes for both displays: on the TFT screen and the Serial Monitor...
I hope we'll end-up this issue, struggling since two weeks!

Regards.


Top
 Profile  
 
 Post subject: Re: We uploaded the SPO2 code but only "SPO2" is shown on TF
PostPosted: Wed Apr 24, 2019 1:54 pm 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11290
Hi,

Could you try to replace the battery of the sensor? Sometimes we have found that the sensor shows data but it doesn't send the data through the serial interface when the battery is low.

Could you please send us some images of the connection between the sensor and the MySignal board? Please make sure that the sensor is connected properly.

Regards


Top
 Profile  
 
 Post subject: Re: We uploaded the SPO2 code but only "SPO2" is shown on TF
PostPosted: Thu Apr 25, 2019 3:15 pm 

Joined: Fri Apr 05, 2019 6:19 pm
Posts: 5
Hello brother, I don't think it's battery issue because I measured the voltage: 1.5 Volt per battery!

I uploaded again the code you sent and unfortunately I got same display "SPO2:" on the TFT screen!
Here is a photo of the whole system:
https://drive.google.com/file/d/1uVyODo ... sp=sharing

I think it's sensor issue: no data sent through the serial port! Even more, I tried to display data on the Oscilloscope but it was no data frame coming!

Please send us another sensor and I'll ship back the one I have: we need to solve this issue soon...

Thanks for assistance.


Top
 Profile  
 
 Post subject: Re: We uploaded the SPO2 code but only "SPO2" is shown on TF
PostPosted: Mon Apr 29, 2019 9:20 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11290
Hi,

Please fill the RMA and our tech support team will contact you to solve the issue.
http://www.libelium.com/contact/#RMA

Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 10 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use.