Hello, i am trying to calculate the respiration rate with a temperature sensor for Arduino UNO. Can someone recommend me a sensor or give a tip for the code?
It has to be something like, when the temperature increases you are exhaling and when decreases inspiring.
But idk how to set the times.
The actual temperature doesn't matter so you don't need accuracy. If you have any sort of temperature sensor you can probably use that.
Keep a moving average of sensor values. When the sensor vale crosses from below the average to above the average, that would count as a breath. Note the time (millis()) each time that happens. Average the last few intervals and divide that into 60000 milliseconds to get breaths per minute.