Please Help!!!! To create respiration sensor using DS18B20 or LM35 with atmega 16/32

Go To Last Post
22 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was in search of a technique to develop a respiration sensor based on either LM35 or DS1820/DS18B20.

1) Lm 35 generates analog output with a sensitivity of 0.5 degree centigrade. 

2) DS18b20 generated digital output with the same sensitivity.

So my plan is to use an oxygen mask to protect my sensor from ambient surrounding temperature. Now with breath in cold air enters nostrils or passes through the sensor and with every breath out hot air exits from the nostrils.

so one breath cycle takes breath in and out and so there is analogous temperature change and so i want to use ADC pin of ATmega 16/32 to convert the signal variation in the form of digital signal and count the number of cycles every minute or count for 10 seconds and multiply it by 6 to generate breathing rate and finally display it on LCD.

Now thermister mostly available in the market have a thermal time constant of 5 sec or more but i need a sensitivity of atleast 1sec or less to measure high breathing rate.

Normal breathing rate lies in 12-20/min range.

so please help me out in this project and how to interface it with avr

 

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

1. I'm not sure a temperature sensor will be fast enough. 

 

2. As the person breaths, the differential temperature will change surrounding the temperature sensor as the environment within the mask warms up due to breathing.

 

A better approach might be to use a pressure sensor that is scaled in "Inches of Water Colum".  Those small scale pressure sensors are also temperature dependent so, you could also measure the temperature within the mask and compensate for the changes in temperature within the mask and correct the pressure sensor reading.

 

A couple example pressure sensors to consider:

 

http://www.digikey.com/product-search/en?pv144=762&FV=fff4001e%2Cfff800b3&k=pressure+sensor&mnonly=0&newproducts=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=25

 

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

Last Edited: Sun. Nov 23, 2014 - 04:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DS18B20.

Doesn't the data sheet say it can take up to 750 mSec for a conversion, (temperature reading), to be taken?

Way too slow for your intended application.

 

A very small thermistor, with a small thermal mass, and a fast response time would work better.

 

In this case the thermistor is just part of a resistor divider, with the center point going to the ADC input.

 

Is the person wearing a mask anyways?  If not, they will find that it significantly increases the work of breathing.

 

How many are you building?  What's your budget?

Adult, child, infant?  At rest or while exercising?

 

A thermistor and an Atmel Butterfly would be an inexpensive approach to this project.

It comes with a uC, Battery, LCD, and a thermistor, plus some other stuff.

(Perhaps the Arduino boards have replaced the Butterfly as an inexpensive test bed?)

 

There are other methods of measuring respiration, but they generally involve lots more electronics.

(Measuring the impedance across the chest, (and doing it safely!), measuring the chest excursion with ultrasound, etc.)

 

Another "low cost" sensor is a large conductive rubber band wrapped around the chest.  Its resistance changes with chest excursion.

(Much like the thermistor changes resistance when the subject breaths on it.)

 

One might consider putting a MEMS microphone over the throat, and "listen" for inhalation and exhalation.

I've not tried that, just an idea for you to consider.

It, also, would have rather simple hardware, but more involved software signal processing.

(Think of the old WWII "Throat Mics'.)

 

JC

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you for the reply!!

I want to use it on adult or old people with age above 25.

thermisters available have large thermal time constant of 5 sec or more.

A breath usually takes 3 sec.

i am uploading this file.help me with this.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

ishu121992 wrote:

 old people with age above 25.

Cheeky...

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thermisters available have large thermal time constant of 5 sec or more.

The thermistor you linked to has a thermal time constant of 20 seconds, way too long.

 

Even a 5 second time constant is much longer than desired.

 

The long time constant effectively gives you a highly LPF'd signal.

 

Go to Mouser, Digikey, etc., and select a small SMD thermistor with a much shorter thermal time constant.

 

JC 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

valusoft wrote:

 

ishu121992 wrote:

 

 old people with age above 25.

 

 

Cheeky...

 

Ya, Ross, for those of us in our 60's & 70's, how's that suppose to make us feel, eh?

 

We must be living among the relics & dinosaurs!!!

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But we are LIVING Carl... the alternative isn't worth considering...

 

Hope you are well.

 

Cheers,

 

Ross

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i said 25 for adults :)

No offence for any old person :)

Actually i am making a Stress and health monitoring system for my final semester project that has

* GSR sensor for perspiration or skin conductance

* heart rate measurement and alarm system for cardiac patients using photoplethysmography

* breathing sensor for obvious reasons

* body temp sensor

Using these sensors cardiac patients (aimed for old people living alone at home ) can monitor their health in an economical manner. i will use avr to predict cases of heart attack, sleep apnea or stress( common in adults and a major cause of suicide). and with a gsm module transmit the warnings to a local doctor/( 911) and closed ones.

Now you may laugh that no one is going to wear it while watching tv or sleeping but if this project succeeds it can be built in a much better smarter way and that is the coolest thing about electronics.

Its growing and growing !!!!

 

Even though i am a novice but my aim is to help. for sure you all are experienced and pro in this field so i am seeking your help!! That's how the world has evolved :)

pardon for any offence :)

Thank you

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ishu121992 wrote:
my final semester project ...  i am a novice

If you're still a novice by your final semester, something is very wrong!

 

The purpose of a final semester project is to demonstrate what you have learned - including the ability to design a solution & select components.

 

You should really discuss this with your tutors to make sure that it is appropriate to your course!

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

* GSR sensor for perspiration or skin conductance

Gun Shot Residue ?

 

Oh -- Galvanic Skin Response Sensor (GSR - Sweating)

 

 

Using these sensors cardiac patients (aimed for old people living alone at home ) can monitor their health in an economical manner.

Sounds more like a lie detector to me.

 

Seven years ago: http://legacy.avrfreaks.net/inde...

... and a mention of temperature http://legacy.avrfreaks.net/inde...

"transthorasic impedance" http://legacy.avrfreaks.net/inde...

 

...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch,

this does show that all great ideas come from india... again and again and again and......

I wonder if they had the same lecturer and that they could choose from a short list of projects to do......

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

novice carried  a relative meaning

its not the case with my education till now but it was used relative with the experienced and pro people in this forum :)

i try to read new stuff everyday and all the different types of circuits. i have many project ideas too and i have done enough part in this project.i just needed help in breathing sensors.

@theusch yes it is also used to detect lie but with few calibrations and wireless alarm system it can be used to detect cases of heart attack.

just for example :) check the file attached

 

http://phys.org/news/2014-11-scientists-thousands-student-diy-microscope.html

@theusch @DocJC @microcarl thank you for the help :)

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

* GSR sensor for perspiration or skin conductance

* heart rate measurement and alarm system for cardiac patients using photoplethysmography

* breathing sensor for obvious reasons

* body temp sensor

 

 

Interesting project.  Select an AVR with lots of memory.  You don't want to get part way through your project and run out of memory.

 

Are you working by yourself, (alone), or with a team?

 

I would split the project up into the hardware side, (temperature measurements, Photodiode measurements, and GSR measurements), and the software side to process the data.

 

How much experience do you have so far with microcontrollers?  You need to start simple:  Flash an LED on and off at a known rate.  Then work on adding an LCD to display your data.  Then work on reading an ADC input, (for the thermistors, and for the photodiode).  (Start with reading a 10K pot, then switch to the other signals.)

 

Measuring GSR is actually rather challenging.  The concept is easy, actually do it is not.  Unlike simply measuring a thermistor, the electrodes you place on the skin will each have 1/2 cell potentials to deal with.  Additionally, the slightest of motion will change the impedance of the electrode - skin interface, and that signal is much larger than the desired GSR signal.  (Hence with lie detectors the individual is always sitting still, and the electrode straps have been carefully applied to the forearms / fingers / etc., and the subject is instructed to not move their hands and arms, (i.e. "don't figit")), (which is what a lot of people undergoing a polygraph do anyways!).

 

The additional challenge, circuit wise, is that the thermistors and photodiode are (or at least can be) electrically isolated from the individual being monitored.  The GSR, by definition, requires that electrodes be attached to the patient.  Like an EKG, you will have to be very careful with your GSR input circuitry to insure the safety of your patient.  Hopefully you have studied in your class the fundamentals of electrical isolation.   Just hooking up an O'scope to your circuit while designing and debugging it can be a "problem".

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yes you are right.we are a team but i am handling the designs as my other mates are lazy.

i have designed the ppg sensor for heart rate calculation and from your views i am thinking of dropping the gsr sensor.i don't want to disappint my guide and incharge.i will build respiration sensor and gsr and interface them with lcd.

i have built and run small programs on lcd like adc with lm35, timer(hr:mn:sec), simple moving data display,etc.

i have knowledge of atmega 16/32, have designed my own programming board for atmega 16/32, have knowledge of pcb designing on express pcb/eagle cad(not complete)

i have one doubt:

if i have connected my lcd and i am measuring my heartbeat say for 10 sec using ppg sensor what can i do to make the lcd show heartbeat after 10 sec.

one way i think is to initialize the already powered lcd after 15 second and doing this by sending a high pulse to interrupt pin and calling a subroutine to initialize the lcd.

**don't mind if am writing crap.its just an idea. 

delays in avr programming are in ms or microsec.

the slow 1-2 Hz digital output from ppg sensor will be given to port pin and i want to say for 10 seconds use count=0 and increase count by 1 whenever i encounter a positive edge of pulse.

suppose the count is 14 in 10 seconds so i'll multiply it by 6 ,i.e, 88bpm.

i want to store that output and display it on lcd

research has shown that for a normal natural breathing rate, breathing rate is nearly 1/4 times the heart rate but i don't want to cheat.i will build somehow the sensor.

 

HEY CAN I BUILD BLOOD PRESSURE SENSOR INSTEAD OF GSR :)

PLEASE CHECK THE PDF BELOW :)

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 breathing rate is nearly 1/4 times the heart rate

 

No, not over any range of possible states, rest, walking, running, exercising, swimming, etc.

The above is a pretty meaningless statement.

 

 

Pulse Transit Time can best be used to track a change in blood pressure over time.

One would still have to calibrate the PTT signal to the baseline blood pressure.

Using PTT to "measure blood pressure" is also a very challenging task, at least of one wants it to be reliable.

 

Measuring PTT is "easy".  Converting that signal into a meaningful, (i.e. accurate), blood pressure reading is not easy.

 

Personally, I think measuring GSR is much easier than "measuring BP" via the PTT methodology.

 

Note that it is relatively easy to measure blood pressure with a blood pressure cuff, and either a mems microphone (rather simple system), or a pressure transducer on the BP cuff's inflator hose, (much better). 

 

Whether you use a uC to run a pump and valve to inflate and deflate the BP cuff, or do this manually, (by human), is up to you.

 

JC

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ishu,

If you are smart you take only little steps at a time.

At start that seems to be the slower way, but in the end it will save you a lot of time in getting the different block together.

start with blinking a LEd or if you already have that knowledge(you should btw if you are a final year...) start with getting the LCD up and running.

perhaps also get a uart going to have a more extended debug interface later on in the project

did that... great then you have two good simple debug interfaces(I assume a student does not have a full blown ICE to its posesion).

 

Then you add one sensor at a time. If you have 5 sensors on the same bus, still add them one by one and make sure they function and keep on functioning as expected when adding more sensors.

Or you could get each sensor up and running individually and then at a final stage combine. Negative side of that is when your processor is not fast enough you will only find out when in the end you combine it all.

If you add one by one there might be a point during development were it becomes clear that you have lack of processing power and then you still have time to change processor.... as most of the times in the final stage it costs a lot more time to change platform.

 

to bad the co workers are lazy,make sure you keep record of what you do.

I my long past school days we had a 'team' of 3 and one did nothing to help. In the end we did a 3 man job with 2. During final presentation the 3rd guy was telling the teacher what he had done. he initially tolled that he had been doing a lot of things that he did not.

We kept a simple log on what we did when and when we came together we wrote down who was going to do what and how we would do things. When we did things differently we wrote that down also. As the teacher has seen me and my co worker talk a lot about the project and asking him questions (just us 2)  he wanted to also see our other documentation. That is were it became very clear that the 3rd person had done almost nothing to the project..... we got a 9 (scale 1 to 10 with 10 being best)  and the 3rd member got a 2 as he had done 1 small thing.

 

so if you are supposed to be judged as a team make sure you keep track of what you do and what others do, specially if they do almost nothing and you do all the work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you @DocJC and @meslomp for helping me out in this project :)

I think i can step further in the project.

@DocJC yes you were right.its not right.it was misrepresented on a site.later i found that they have a very irregular relationship even with body temperature as a variable.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did the sensor work as you want , how it is work ?

because I have a project and I want to take some idea from you please .

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The original poster has not been back here for 6 years... and is highly unlikely to read your post. You are out of luck.

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sloiiix wrote:

Did the sensor work as you want , how it is work ?

because I have a project and I want to take some idea from you please .

Welcome to AVRFreaks!

 

From the posting dates, you are asking for info from 6 years ago and the OP has not been heard from since, your chance of getting a usable reply is near nil!

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@ Sloiiix : As Ross says, unlikely to get a reply from the OP.

 

So probably best to start your own thread, stating your own specific requirements and goals.

 

In that thread, tell us what research you've done so far, what you've found, and what it is that you need further help with.

 

You could always give a link to this thread, and summarise what you have learned from the posts here ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Sep 15, 2020 - 04:05 PM