How to use an Arduino along with a PPG sensor to find respiration rate

I am working on a project where I am trying to determine respiration rate through an Arduino Nano and a MikroE Heart Rate 3 Click device. I have been working on this for a few months, reading different research papers attempting to find an algorithm that would give me respiration rate values, but am having trouble finding an algorithm that both does what I need and encode it into the Arduino. Does anyone know of a code that would work? I have so far have only the basic code that reads the PPG values, but it does not provide me with the Respiration Rate values. This is the code I have so far:

/*
 * AFE4404 Basic Read library example.
 * https://github.com/rakshithbk/AFE4404-Library
 * 
 * On Arduino Uno -  | AFE4404 | Uno Pin
 *                   | I2C_Dat | A4
 *                   | I2C_Clk | A5
 * get_led_val() will return uint32_t values.
 * 
 * Advanced - you can modify the sample period and other
 * parameters in the library files (refer AFE4404 datasheet)
 */


#include <Wire.h>
#include <AFE_connect.h>

AFE A;

void setup() {
  Serial.begin(115200);
  Serial.println("AFE4404 basic readings -\n");
  A.init();
}

void loop() {
  Serial.print("LED 1 Val = ");
  Serial.print(A.get_led1_val());
  Serial.print("\t LED 2 Val = ");
  Serial.print(A.get_led2_val());
  Serial.print("\t LED 3 Val = ");
  Serial.print(A.get_led3_val());
  Serial.println();
}
1 Like

The data sheet doesn't mention respiration rate, as in number of breaths per minute.
Are you thinking of some other measurement to do with oxygen consumption?

If you want to get the breathing rate as per Photoplethysmogram - Wikipedia
then the first step is to figure out a sensible sampling rate. Currently your code looks like its going as fast as possible which might not be what you want.

Fundamentally you need a low pass filter (or filters) to remove the 50-130 bpm heart rate to leave the 16-60 breaths per minute signal. Tricky if the person has some sort of medical condition that causes the ranges to overlap.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.