LM35 temperature sensor as respiratory sensor

Hello fellas, i face a problem with my analog sensor LM35. I want to count the breaths/minute with the specific sensor but i'm kinda newbie on computer programming, so i don't know how exactly can i do this.I've written a code in Arduino IDE but it doesn't work..Does anyone know any code for converting temperature values from LM35 to respiratory rate? Here is the code i've done so far. I would appreciate any help. Thanks in advance :slight_smile:

LM35_test.ino (657 Bytes)

Hi,
The LM35 has quite a bit of thermal mass; may not see breathing differences.

A very small thermistor in self-heat mode as a "gas flow speed" sensor might work..

How is the breather's air routed??

Hello, thank you for your response. So, you're telling me to use a thermistor as a respiratory sensor. I've used 2 male to female cables in each pin for reaching the LM35 in my nose to test the temperatures of exhales every time. I thought to calculate an average temperature so i can compare any temperature after that and , simultaneously, will begin a counter if the temperature of my exhale breath from my nose is bigger than that.. Sorry for my bad English. :slight_smile:

Just what data are you hoping to get??

How many breaths taken? Rate? What??

Do you want to measure temperature or flow or both?

For temperature this is the sort of low-thermal-mass device that may give meaningful results:
http://www.murata.com/en-us/about/newsroom/news/product/thermistor/2014/1022

Because the sensor that you are using is encapsulated in a plastic package, there will be a significant delay between the external temperature changing, and that change being detected by the internal circuitry.

This delay can be expressed as a time constant,, but because the period of the normal breathing rate is far less than that time, then the sensor will only be able to detect the average temperature.

My apologies that i didn't give you all the information. My main purpose is to count the breaths,and everytime when you finish a breath cycle(inhale and exhale),a counter has to register that breath.My problem is, i don't know how exactly i can do this in programming.

JohnLincoln:
Because the sensor that you are using is encapsulated in a plastic package, there will be a significant delay between the external temperature changing, and that change being detected by the internal circuitry.

This delay can be expressed as a time constant,, but because the period of the normal breathing rate is far less than that time, then the sensor will only be able to detect the average temperature.

I understood. Could you,please, suggest me any temperature sensor for being able about that project? And, do you have any idea how can i count the breaths from an temperature sensor because i'm a newbie in computer programming?

This package. http://www.thinking.com.tw/documents/en-TTF.pdf
I have used it to record temp when falling from 1000m @ 8m/sec. In combination with a comparator (opamp) it can easily be used to generate an interrupt for each breath.

Time constant is 5 sec in still air.=> fast enough

knut_ny:
This package. http://www.thinking.com.tw/documents/en-TTF.pdf
I have used it to record temp when falling from 1000m @ 8m/sec. In combination with a comparator (opamp) it can easily be used to generate an interrupt for each breath.

Time constant is 5 sec in still air.=> fast enough

Thank you very much guys for your help :slight_smile: Does anybody have any idea about the code that i have to write? What should i take into account to complete that task?

I you use a 10k NTC (eg TTF3A103) :
@ 30degC it is approx 8k (see the datasheet)

If you connect this in series with a 8k2 resistor, make a voltage divider, you will (analog) read close to 500 at this temp.
(connect 5V to NTC -> resistor -> GND. Connect midpoint to analog in)

Then do the test: Use arduino IDEs Serial plotter to observe the analog-value. This will tell you the range of the analog values.
..lets say u get range 450..550 (500 +/- n)

Your code reads the analog (repeatedly) and notes the time, millis(), when the value turns greater than 510
Then wait until its value drops below 490... and repeat above

The time difference ...


This can also be done interruptdriven: U'll need a comparator and a couple of resistors
..possibly a few more components to obtain a little hysteresis

Thank you soooo much knut_ny, i really appreciate your help!!!