MAX30102: esweni izinga lentliziyo kunye nemodyuli ye-oximeter ye-Arduino

I-MAX30102

Ngalo lonke eli xesha, siye sabonisa inani elikhulu Izinto zombane iyahambelana iibhodi ezifana Arduino okanye ehambelanayo, kunye neminye imisebenzi emininzi yomenzi okanye ye-DIY. Ngoku siza kukwazisa ngemodyuli I-MAX30102, equka inzwa yokulinganisa i-pulse kunye ne-oxygen yegazi.

Ngale ndlela, unokwenza nezinto ezinxitywayo ezifana nezacholo ezenziweyo okanye ihardware ye esweni imeko yezempilo yomntu, ukubonelela ngedatha yebhayometriki okanye i-telemetry yomntu othethiweyo enkosi ekudityanisweni kwesantya sentliziyo kunye ne-oximeter kwesi sixhobo...

Yintoni umlinganiselo wentliziyo? Ingaba isebenza kanjani?

Un inzwa ye-pulse okanye i-monitor rate rate Sisixhobo sombane esisetyenziselwa ukulinganisa ukubetha kwentliziyo yomntu ngexesha lokwenyani. Isetyenziswa kakhulu kwibala lezemidlalo ukujonga ukusebenza kunye nomgudu ngexesha loqeqesho okanye imihla ngemihla. Izijongi zokubetha kwentliziyo zithandwa phakathi kweimbaleki, kodwa zikwasisixhobo esisisiseko kumaziko ezonyango ukwazi izinga lokubetha kwentliziyo, oko kukuthi, izinga lokubetha kwentliziyo okanye ukubetha ngomzuzu:

  • PR Bpm: ibonisa ukubetha kwentliziyo, oko kukuthi, ukubetha ngomzuzu.

Kuzo zonke iimeko, i Izinzwa zibamba ukwahluka kumthamo wegazi ngokubetha kwentliziyo nganye. Olu tshintsho luguqulelwe kwisignali yombane ecutshungulwa ukufumana izinga lentliziyo. Ezinye iimonitha zesantya sentliziyo zikwabandakanya ukukhulisa kunye neesekethe zokurhoxiswa kwengxolo ukuphucula ukuchaneka kokufunda.

Yintoni i-oximeter? Ingaba isebenza kanjani?

Un I-oximeter sisixhobo sonyango okanye sezemidlalo esetyenziselwa ukulinganisa ukugcwala kweoksijini egazini. Esi sixhobo sibonelela ngedatha yokugcwala kweoksijini yegazi kunye namaxabiso ukusuka kwi-0 ukuya kwi-100%. Kuqhelekile ukuba isixhobo esifanayo sibandakanye ukhetho lokubetha kwentliziyo, ebonisa lonke ulwazi lokubeka iliso okanye ukurekhoda.

Idatha leyo ilinganisa i-oximeter :

  • % SpO2: ibhekisa kwipesenti yokugcwala kweoksijini egazini.

I-oximeter ibekwe njenge-clamp ngendlela yokuba ilungelelaniswe kwi-morphology yomnwe wethu okanye inokubekwa kwezinye iindawo emzimbeni, njengoko kunjalo ne-monitor rate yentliziyo, njengesandla, njengoko inokubonwa kwizacholo ezininzi zomsebenzi. ,

Ngokuphathelele ukusebenza kwazo, ii-oximeters zikhupha ngokwahlukileyo ukukhanya kwamaza ezidlula eluswini. Into esebenza koku kukhanya yihemoglobin, imolekyuli yegazi enoxanduva lokuthutha ioksijini, ifunxa izixa ezahlukeneyo zokukhanya kuxhomekeka kwinqanaba leoksijini eyihambisayo. Inkqubo eneenkcukacha imi ngolu hlobo lulandelayo:

  1. ukukhutshwa kokukhanya- I-oximeter ikhupha amaza amabini okukhanya, enye ebomvu kunye ne-infrared enye, edlula ngomnwe obekwe kwisixhobo.
  2. Ukufakwa kokukhanya: IHemoglobin, imolekyuli ekwiiseli ezibomvu zegazi ethwala ioksijini, ifunxa izixa ezahlukahlukeneyo zezi zibane. Ihemoglobin egcwele ioksijini (i-oxyhemoglobin) kunye nehemoglobin engenayo ioksijini (i-deoxyhemoglobin) zineempawu ezahlukeneyo zokufunxa ukukhanya.
  3. Ukufumanisa ukukhanya: I-detector kwelinye icala le-emitter yokukhanya iqokelela ukukhanya okudlule ngomnwe.
  4. Ukubalwa kwe-oxygen saturation- Isixhobo sibala umlinganiselo we-oxyhemoglobin ukuya kwisixa esipheleleyo se-hemoglobin ekhoyo, zombini i-oxyhemoglobin kunye ne-deoxyhemoglobin. Lo mlinganiso uboniswa njengepesenti yokugcwala kweoksijini egazini (%SpO2). Oku kwenziwa ngeprosesa ekwaziyo ukutolika le miqondiso yombane ukuze iguqulelwe kwixabiso lamanani.

Yintoni imodyuli yeMAX30102?

Inzwa MAX30102, iveliswe nguMaxim Integrated, sisixhobo esidibeneyo esidibanisa imisebenzi yezinga lentliziyo kunye ne-oximeter. Le nzwa inokusetyenziswa ngokulula kunye ne-microcontroller efana ne-Arduino. I-MAX30102 yeyoluhlu lwe-MAX3010x ye-optical sensors ezivela kule nkampani.

Ukusebenza kwayo kusekelwe kukwahluka kokufunxa ukukhanya ngegazi, kuxhomekeke kuyo inqanaba lokugcwala kweoksijini, kunye ne-pulse njengoko benditshilo kumacandelo amabini angaphambili. Le sensor ixhotyiswe ngee-LED ezimbini, enye ebomvu kunye ne-infrared enye. Ifakwa esikhumbeni, njengasemnweni okanye esihlahleni, ize ibone ukukhanya okubonakalisiweyo ukumisela iqondo lokugcwala kweoksijini.

Unxibelelwano kunye ne-MAX30102 luyenziwa ngebhasi ye-I2C, okwenza kube lula ukudibanisa kwi-microcontroller efana ne-Arduino. I-MAX30102 idinga umbane ophindwe kabini: i-1.8V yengqiqo kunye ne-3.3V yee-LEDs. Ngokuqhelekileyo ifunyenwe kwiimodyuli ze-5V esele ziquka inqanaba elifunekayo lokuhambelana.

I-MAX30102 iyinzwa esetyenziswa kwiiprojekthi zasekhaya okanye zezemidlalo, oko kukuthi, isenokungabi nokuthembeka okwaneleyo kunye novakalelo kusetyenziso lwezonyango lobuchwephesha.

La i-optical pulse oximetry Yindlela engena-invasive yokumisela ipesenti ye-oxygen saturation egazini. Njengoko benditshilo ngaphambili, isekelwe kumahluko kwi-coefficients yokufunxa ukukhanya kwe-hemoglobin (Hb) kunye ne-oxyhemoglobin (HbO2) yamaza ahlukeneyo. Igazi elityebileyo kwioksijini lifunxa ngakumbi ukukhanya kwe-infrared, ngelixa igazi elincinci kwioksijini lifunxa ngakumbi ukukhanya okubomvu. Kwiindawo zomzimba apho ulusu luncinci ngokwaneleyo kwaye kukho imithambo yegazi ngaphantsi, lo mahluko ungasetyenziselwa ukumisela iqondo lokugcwala kwe-oxygen.

Iimpawu zemodyuli ye-MAX30102 ene-pulse kunye ne-blood oxygen sensor

I-MAX30102 ibandakanya:

  • I-2x LEDs, enye ebomvu (660nm) kunye ne-infrared enye (880nm)
  • Iifotodiode ezi-2x zokulinganisa ukukhanya okubonakalisiweyo
  • I-18-bit ye-ADC converter kunye nesantya sesampuli ye-50 ukuya kwi-3200 iisampulu ngomzuzwana.
  • Ukongezelela, inee-electronics eziyimfuneko zokwandisa umqondiso kunye nokucoca, ukucinywa kokukhanya kwe-ambient, ukugatywa kwe-frequencies ye-50-60Hz (ukukhanya okwenziweyo) kunye nembuyekezo yeqondo lokushisa.

Ukusetyenziswa kwemodyuli inokufikelela kwi-50mA ngexesha lomlinganiselo, nangona ubunzulu bunokulungelelaniswa ngokwenkqubo, ngemowudi yamandla aphantsi we-0.7µA ngexesha lemilinganiselo.

Ixabiso kunye nendawo yokuthenga

Iinzwa ze-MAX30102 zokulinganisa i-pulse kunye ne-oxygen yegazi zitshiphu kakhulu. Ezi modyuli zinokuba zezakho ngee-euro nje ezimbalwa kwiindawo ezifana ne-eBay, i-Aliexpress okanye i-Amazon. Uya kubona ukuba kukho iintlobo ezininzi, kwaye sincoma oku kulandelayo:

Uqhagamshelwano kunye nomzekelo kunye neArduino

Arduino IDE, iintlobo zedatha, inkqubo

Ukuvavanya i-MAX30102 nge-Arduino, into yokuqala kukudibanisa le modyuli kwibhodi ye-Arduino. Oku unxibelelwano lulula kakhulu, kufuneka udibanise oku kulandelayo:

  1. I-Vcc yemodyuli kufuneka idibaniswe ne-5V yemveliso yebhodi ye-Arduino.
  2. I-GND yemodyuli kufuneka iqhagamshelwe kwi-socket ye-GND yebhodi ye-Arduino.
  3. I-SCL yemodyuli kufuneka iqhagamshelwe kwelinye lamagalelo e-analog yebhodi ye-Arduino, njenge-A5.
  4. I-SDA yemodyuli kufuneka idityaniswe kwelinye lamagalelo e-analog yebhodi ye-Arduino, njenge-A4.

Emva kokuba uxhulumaniso olufanelekileyo lusekiwe phakathi kwebhodi ye-MAX30102 kunye nebhodi ye-Arduino, into elandelayo iya kuba ukubhala ikhowudi yomthombo okanye umzobo ukuze usebenze kwaye uqale ukufumana idatha ye-biometric kumntu ochaphazelekayo. Oku kulula njengokubhala le khowudi ilandelayo kuyo I-Arduino IDE kwaye inkqubo yebhodi:

Kufuneka kwakhona ufake ithala leencwadi kwi-Arduino IDE ukuze uyisebenzise. Ithala leencwadi lenziwe ngabakwaSparkFun, kwaye liyafumaneka kwa https://github.com/sparkfun/SparkFun_MAX3010x_Sensor_Library.
#include <Wire.h>
#include "MAX30105.h"
#include "spo2_algorithm.h"

MAX30102 pulsioximetro;


#define MAX_BRIGHTNESS 255


#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
//Arduino Uno no tiene suficiente SRAM para almacenar 100 muestreos, por lo que hay que truncar las muestras en 16-bit MSB.
uint16_t pulsoBuffer[100]; //infrared LED sensor data
uint16_t oxiBuffer[100];  //red LED sensor data

#else
uint32_t pulsoBuffer[100]; //Sensores
uint32_t oxiBuffer[100];  

#endif

int32_t BufferLongitud; //Longitud de datos
int32_t spo2; //Valor de SPO2
int8_t SPO2valido; //Indicador de validez del valor SPO2
int32_t rangopulsacion; //PR BPM o pulsaciones
int8_t validrangopulsacion; //Indicador de validez del valor PR BPM

byte pulsoLED = 11; //Pin PWM
byte lecturaLED = 13; //Titila con cada lectura

void setup()
{
  Serial.begin(115200); // Inicia la comunicación con el microcontrolador a 115200 bits/segundo

  pinMode(pulsoLED, OUTPUT);
  pinMode(lecturaLED, OUTPUT);

  // Inicializar sensores
  if (!pulsioximetro.begin(Wire, I2C_SPEED_FAST)) //Usar el bus I2C a 400kHz 
  {
    Serial.println(F("MAX30102 no encontrado. Por favor, comprueba la conexión y alimentación del módulo."));
    while (1);
  }

  Serial.println(F("Pon el sensor en contacto con tu dedo y presiona cualquier tecla para iniciar la conversión."));
  while (Serial.available() == 0) ; //Esperar hasta que se pulsa una tecla
  Serial.read();

  byte brilloLED = 60; //Opciones: 0=Apagado hasta 255=50mA
  byte mediaMuestreo = 4; //Opciones: 1, 2, 4, 8, 16, 32
  byte ModoLED = 2; //Opciones: 1 = Rojo solo, 2 = Rojo + IR, 3 = Rojo + IR + Verde
  byte rangoMuestreo = 100; //Opciones: 50, 100, 200, 400, 800, 1000, 1600, 3200
  int anchoPulso = 411; //Opciones: 69, 118, 215, 411
  int rangoADC = 4096; //Opciones: 2048, 4096, 8192, 16384

  pulsioximetro.setup(brilloLED, mediaMuestreo, ModoLED, rangoMuestreo, anchoPulso, rangoADC); //Configuración del módulo
}

void loop()
{
  BufferLongitud = 100; //10 almacenamientos en el buffer con 4 segundos corriendo a 25sps

  //Leer las primeras 100 muestras
  for (byte i = 0 ; i < BufferLongitud ; i++)
  {
    while (pulsioximetro.available() == false) //Comprobar nuevos datos
      pulsioximetro.check(); 
    oxiBuffer[i] = pulsioximetro.getRed();
    pulsoBuffer[i] = pulsioximetro.getIR();
    pulsioximetro.siguienteMuestreo(); //Muestreo terminado, ir al siguiente muestreo

    Serial.print(F("red="));
    Serial.print(oxiBuffer[i], DEC);
    Serial.print(F(", ir="));
    Serial.println(pulsoBuffer[i], DEC);
  }

  //Calcular el valor del pulso PM y SpO2 tras los primeros 100 samples
  maxim_heart_rate_and_oxygen_saturation(pulsoBuffer, BufferLongitud, oxiBuffer, &spo2, &SPO2valido, &rangopulsacion, &validrangopulsacion);

  //Calcular muestreos continuos
  while (1)
  {
    //Volcar los 25 primeros valores en memoria y desplazar los últimos 75 arriba
    for (byte i = 25; i < 100; i++)
    {
      oxiBuffer[i - 25] = oxiBuffer[i];
      pulsoBuffer[i - 25] = pulsoBuffer[i];
    }

    for (byte i = 75; i < 100; i++)
    {
      while (pulsioximetro.available() == false) //Comprobar si existen nuevos datos
        pulsioximetro.check(); 

      digitalWrite(lecturaLED, !digitalRead(lecturaLED)); //Parpadea el LED on-board con cada dato

      oxiBuffer[i] = pulsioximetro.getRed();
      pulsoBuffer[i] = pulsioximetro.getIR();
      pulsioximetro.siguienteMuestreo(); //Al finalizar, moverse al siguiente muestreo

      Serial.print(F("Oxígeno="));
      Serial.print(oxiBuffer[i], DEC);
      Serial.print(F(", Pulso="));
      Serial.print(pulsoBuffer[i], DEC);

      Serial.print(F(", HR="));
      Serial.print(rangopulsacion, DEC);

      Serial.print(F(", HRvalid="));
      Serial.print(validrangopulsacion, DEC);

      Serial.print(F(", SPO2="));
      Serial.print(spo2, DEC);

      Serial.print(F(", SPO2 válido="));
      Serial.println(SPO2valido, DEC);
    }

    //Recalcular tras los primeros muestreos
    maxim_heart_rate_and_oxygen_saturation(pulsoBuffer, BufferLongitud, oxiBuffer, &spo2, &SPO2valido, &rangopulsacion, &validrangopulsacion);
  }
}

Ewe kunjalo, ungayiguqula ikhowudi ngokweemfuno zakho, lo ngumzekelo nje...


Yiba ngowokuqala ukuphawula

Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa. ezidingekayo ziphawulwe *

*

*

  1. Uxanduva lwedatha: UMiguel Ángel Gatón
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.