Connect with us

Cheap AND simple respiration detector

Discussion in 'Electronic Design' started by Neon John, Jan 6, 2014.

Scroll to continue with content
  1. Neon John

    Neon John Guest

    Hey guys,

    I'm looking for some interesting ideas that are both practical AND
    cheap to monitor respiration air flow.

    I've developed a collapsed lung and my pulmonologist has put me on a
    CPAP machine to try and reinflate it. Problem is, after 6 weeks of
    trying, I can't stand the thing. I want to do some self-research and
    see what I can learn, particularly if the CPAP is having any effect.

    So I want to build a quickie anemometer. Actually, 2. One to look at
    my nose flow and another to look at my mouth flow. It's important to
    capture the flow waveform, as (at least on the spirometer) one can see
    where the bad lung quits working and the good one finishes the

    During my sleep study, they attached a rig that held a tiny tube in
    front of each nostril and one in front of my mouth. The tubes lead to
    a box containing pressure transducers, conditioners and something to
    stick the signal on an Ethernet cable. Of course I don't want to do
    something that complicated. Ideally this would be something that I
    could knock out in a day using materials on-hand.

    What I'm thinking about is Arduino-based, something that would
    digitize each waveform and spit it over the USB bus to a capture
    program. Then I can analyze the data in OO or GnuPlot or whatever.
    Very minimal software effort desired.

    First thought was a low range MEMS pressure transducer but looking on
    Digikey and Mouser, they're kinda expensive and require signal
    conditioning and amplification, at least on the ones they keep in

    Second thought is a self-heated thermistor bead. Major problem is the
    signal would have to be linearized which would take a little more
    software effort than I want to dedicate to this project.

    Third idea is a self-heated LM35. With a 50 ma load on the output an
    LM35 in the TO-92 package self-heats about 10 deg C. I can shoot the
    signal right into an Arduino's analog input with no conditioning.
    Question that remain include whether the low air flow of sleep
    breathing will cool the thing enough to matter and what its time
    constant is. Another problem is that a TO-92 package is kinda large
    to have dangling from one's nose and upper lip.

    So I thought I'd toss this problem out to you guys and see what
    innovative ideas you come up with.

    John DeArmond
    Tellico Plains, Occupied TN
    See website for email address
  2. RobertMacy

    RobertMacy Guest

    ARRRGGG!!! our radiation expert! Sorry to hear about lung.
    QUESTION: does your collapsed lung pose a pneumonia threat? With treatment
    like no drinking, antibiotics. that kind of thing?

    Anyway all ideas sound great.

    A few years ago, as part of a portable patient monitoring system; I
    designed a volumetric sensor for measuring expiration.

    The principle was based upon the variation of magnetic field strength vs
    distance. Using four coils, two transmit and two receive, with eeach coil
    transmitting its own, unique tone; it was possible to make four distance
    measurements and fairly accurately calculate lung volume. Very battery
    friendly because the 3.3 volt battery only needed to supply a total of 10
    mA for the whole sensor system. The sensors could measure anywhere from 6
    inches to over 27 inches. Accuracy? At a distance of 8 inches, I measured
    1 mil rms. Yes, that's 1/1000 of an inch of rms noise.

    The coils were constructed of 100 turns on a 6 layer 1/32 inch PCB about 1
    1/2 to 2 inch round, so the 'coils' easily fit into a wearable fabric
    'jacket' and being so flat, the patient could easily sleep on the coils
    without noticing, well not noticing too much.

    The client was ecstatic when they saw the 'clean' waveforms of breathing -
    they were used to seeing very ratty looking waveforms.

    Why the detail? if that piece of electronics you plan on using has
    something like a soundcard in it with two channels out and two channels in
    you can easily make the whole sensor system yourself.
  3. If you can break the glass without breaking the filament, a small low
    voltage lamp makes a good quick-responding anemometer. Put it in one
    limb a Wheatstone Bridge circuit which passes enough current to heat it,
    then monitor the changes in off-balance voltage as the filament is
    cooled by the air currents.

    ....on the other hand, you may not feel like stuffing a broken light bulb
    up your nose....
  4. Phil Hobbs

    Phil Hobbs Guest

    Sorry to hear about the lung. You're in my prayers.

    I second Spehro's hot-wire anemometer idea. Maybe a tungsten micro-size
    Christmas bulb? You probably have a string or two lying around. Low
    thermal mass is the key to fast response, of course, and unlike the
    thermocouple, the hot wire responds to the temperature of the sensing
    element more than that of the leads.


    Phil Hobbs

    Dr Philip C D Hobbs
    Principal Consultant
    ElectroOptical Innovations LLC
    Optics, Electro-optics, Photonics, Analog Electronics

    160 North State Road #203
    Briarcliff Manor NY 10510

    hobbs at electrooptical dot net
  5. Is there any information you can glean from the CPAP machine itself?

    They dumb down the interface and try to lock the functionality up, but
    you may be able to find software that will allow access to the data.

    For a "hot wire" anemometer you could try self-heating a smaller
    transistor than a TO-92, for example an SC-70. Not too hard attaching
    wires to something that size if you have good eyes or a microscope.
    King's law equation.. and there is some IFD stuff IIRC.

    Best regards,
  6. Yup.. I was just about to.. say that..

    Another type of bulb is those little bulbs you can find in railway
    hobby shops-- much smaller (and more expensive) than Xmas bulbs.

    I have some that are less than 0.05" diameter.. and they will work
    with maybe 5-10mA.

    Best regards,
  7. Neon John

    Neon John Guest

    Thanks everybody for your concern. Here's the rest of the story. It
    started about 25 years ago. I was picking up a small lightweight box
    (proper posture) when I felt a flick on my neck. Like an insect had
    landed. I swatted at it and gave it no further thought. That was the
    disc at C5 slipping out into my spinal canal.

    After spending an agonizing 3 day weekend at a trade show (lesson #1 -
    Hoarde opiates!), I got in to see a spinal specialist. The MRI showed
    the disc sticking out a couple of mm. He prescribed traction therapy,
    the disc slipped back in and all was well. So I thought. Turns out
    the disc didn't quite slip back in all the way.

    Fast forward 20 years. No intervening neck or back pain but I started
    to slowly lose my endurance. I owned a small chain of restaurants and
    it got so bad that I had to close them. I retired and moved here to
    the mountains of Tellico.

    Got to the point where taking a shower was fully exhausting. I
    visited my brother in his dental office one day. The walk from the
    parking lot left me dizzy and faint. He took one look at me, dragged
    me to a treatment chair and strapped on a nose mask with about 8
    liters of oxygen. In a little while I felt better than I had in a
    year or more.

    After I recovered he dragged me to the emergency room. They did all
    the acute cardiac emergency drills and found out that my ticker was
    fine. Fortunately a high school and neighborhood friend who is now a
    pulmonologist (triple board certified) was on call. He saw who it was
    and started throwing the works at me.

    He had a fluorocine "sniff test" performed. I sat in front of a
    fluoroscope with video capabilities and while bathed in radiation, did
    a great big snort. With a normal person, the diaphragm moves down
    rapidly in a quick smooth motion. Only half of mine did. The other
    half just laid there.

    A week of tests, except for an MRI, determined that my left diaphragm
    was paralyzed and that's why my lung had collapsed. After 2 months
    (!) of fighting with my insurance company for an MRI, I finally got
    one a couple of weeks ago. Here's the money shot

    The disc had hardened and the vertebrae on either side has grown bone
    to support it. My pulmonologist thinks that this abnormality has
    damaged the nerves that drive the left diaphragm that exit at C5.

    I'm to see a spinal guy in a couple of weeks. He'll probably want to
    remove that disc and the protruding bone and fuse the two vertebrae.
    That's to stop further damage.

    The nerve damage has been happening for so long that there's not much
    hope of a recovery. Best we can do is stop it where it is. Right now
    I'm strapped to an oxygen concentrator in the daytime like some old
    geezer and an oxygen enriched CPAP at night.

    I thought I could get used to the CPAP and I've really given it a good
    hard go but I'm beginning to loathe the thing. That's why I want to
    do some testing to see if it's doing anything. I want to be able to
    present hard data to the doc when I see him instead of just bitching
    about the CPAP.

    Yes they do. Thanks guys. I think Adrian's tungsten hot wire
    anemometer is going to be the way to go. I have a spool of fine
    tungsten wire that I acquired as part of my accelerator project so I
    can wind my own and not have to try to break bulbs.
    Very interesting. What did you do, look at the phase shift as
    distance varied or something like that? Have you ever published the
    design? Even though it's more than I want to do for this project, I'm
    very interested.
    As I mentioned before, I plan to use an Arduino to do the A/D
    conversion, time stamp the data and probably some smoothing and then
    squirt it to a Linux box for analysis. I don't do application
    software so I'll probably just whip together a utility that will
    condition the data so GnuPlot can display it. Maybe have a second
    display channel where the utility flags any apnea events.

    Oh, last part of your question. The lung is dry so there's not much
    chance of pneumonia or infection. There is actually a little function
    left so air moves in and out. Doc had me get the pneumonia
    vaccination series even though I'm technically too young but that's
    it. And the oxygen, of course.


    Q: Why not use a BeagleBoard?
    A: Because it's a total POS with one of the worst Linux ports I've
    ever seen. Anybody want a couple?

    Q: Why not a Raspberry Pi?
    A: Cuz I don't have one.

    Q: Why don't you do <complicated design>?
    A: Because this is something I want to knock out over a weekend using
    available materials.

    Again, thanks everybody for your good ideas. Lots of stuff to think


    John DeArmond
    Tellico Plains, Occupied TN
    See website for email address
  8. Neon John

    Neon John Guest

    No prob. I can certainly confirm that CPAP makes your chest hurt.

    I can also tell that it's expanding my lung capacity - at least
    temporarily. I can do my normal morning wake-up activities without
    the oxygen after wearing the CPAP but by the time I'm cooking
    breakfast, the feeling of suffocation is back and out comes the


    John DeArmond
    Tellico Plains, Occupied TN
    See website for email address
  9. Tom Miller

    Tom Miller Guest

    Is there anyway they could make a pacemaker like device that would stimulate
    the diaphragm?

    Are there many cases like yours that would even make this worth designing
    such a device? Or is this more like an orphan medical condition?

    Sure hope you can find some relief for it.

  10. mike

    mike Guest

    The difficulty is getting response at the junction but not conducting
    the heat down the connecting wire.
    I've used the broken bulb technique, but it's likely go get covered
    with gunk when you stuff it up your nose.

    It can't be all that hard to buy a REAL thermocouple.
    I have a commercial HVAC hot wire anemometer.
    Has two thermocouples in the head.
    The big one is about the size of a baby gnat.
    The small one is somewhat bigger than a grain of salt.

    from the op
    Second thought is a self-heated thermistor bead. Major problem is the
    signal would have to be linearized which would take a little more
    software effort than I want to dedicate to this project.

    Linearization of the data is likely the easiest part of this project.
    And how linear does it need to be if you're looking for relative

    Q: Why don't you do <complicated design>?
    A: Because this is something I want to knock out over a weekend using
    available materials.

    You have a condition that's having a MAJOR negative impact on your life
    and you can't be bothered to spend more than a weekend to address it?

    There are a lot of smart people here willing to collaborate.
    Use 'em and git-er-done.
  11. There used to be tiny glass coated thermistor probes for this sort of
    thing. STC R25 rings a bell. Very fast response, much greater
    resistance change than heated wire types, and the fact that its a bead
    means the sensor is localised to a small area.

    LTC had a neat trick for linearising. Electrically heat the bead to
    keep the temperature constant, that gets around all the thermistor
    linearity effects. Then measure the power input, which is directly
    proportional to a function ( something like the cube, I think ) of the
    airflow. Its trivial to measure the voltage and current with a couple
    of ADC channels. From that, you can compute the resistance and power
    directly. Use PWM from the micro to control the drive current.
  12. Syd Rumpo

    Syd Rumpo Guest

    Tubes connected to cheap electret microphones. Air passes over the end
    of the tube and the sound volume is related to the flow rate.

    Perhaps some filtering too? I use a headset for Skype, and breathing on
    the microphone manifests as a 'roar' in the earphones, naturally louder
    for heavier breathing. If the tubes are the same length and diameter,
    then each sensor should have similar sensitivity. Maybe a mesh on the
    tube ends would make them less directional, if that's a problem.

  13. Den tirsdag den 7. januar 2014 00.18.11 UTC+1 skrev Adrian Jansen:
    I'd think you'll also need to measure the temperature of the air

    afair the MAFs used on many cars have shielded termistor and a hot wire
    in the flow and keep a constant temperature difference

    and remember that is doesn't take direction into account and the it
    measures mass flow, not volume

  14. Glen Walpert

    Glen Walpert Guest

    You could just buy one, for example:

    There are a wide variety of breathing sensors on the market. Sleep
    studies typically measure airflow separately at nose and mouth, plus a
    chest strap "breathing effort" sensor or two.
  15. Guest

    Darn good idea, so I searched. Yes, they make "diaphragm stimulators"
    and "diaphragm pacemakers." Unfortunately I only saw units for totally
    paralyzed people that bang your whole diaphragm with an external rhythm,
    nothing that used the existing, natural impulses for timing.
    Sounds like all John really needs is a bit of golden jumper wire, either
    the jump the damage, or to tie the two sides together.

    No idea if it's that simple--he might also need a buffer amp. for the
    one side to drive the other...
    Yessir, that's for sure.

    James Arthur
  16. Robert Baer

    Robert Baer Guest

    A crude no nonsense detector can be implemented by placing a light
    cloth near the mouth and nose.
    Amount of movement indicates velocity.

    Potentially expensive expansion is to use Schlieren photography of
    moving air. See:
  17. Neon John

    Neon John Guest

    Thanks Glen, that looks very interesting. But I'm afraid that this is
    going to turn into a Project instead of something I could just sling
    together over a weekend. Still... Very appealing.
    Where would you suggest I start looking? Googling "breathing sensors"
    got me all kinds of unrelated stuff.
    As I mentioned before, I've already had two comprehensive (everything
    - EEG, EKG, breathing, effort, etc) sleep studies that had so many
    wires hanging off me I was amazed I could go to sleep at all :) Now
    I have this one specific little measurement that I want to do. If my
    debit card doesn't burn a hole in my pocket and I am forced to go your
    suggested route :) then I think the hot wire anemometer is going to
    be the solution.

    Thanks again for your suggestion.

    John DeArmond
    Tellico Plains, Occupied TN
    See website for email address
  18. Neon John

    Neon John Guest

    Don't know. Doc talked about a kind of surgery that involves slicing
    and dicing both diaphragm muscles and attaching them together in some
    manner so that they work together. We didn't go into details because
    we first need to find out if the lung can be rescued. Getting the
    muscle to work again won't be of much use of the lung has atrophied.

    One of the tests scheduled in the near future is for him to run a bore
    scope down my left bronchial tube and look around from the inside.
    That will probably be the decisive test.
    Well, it must be common enough that my dock knew immediately to do the
    sniff test in the ER but I'd never heard of it before so it's probably
    not a pressing medical issue.
    Thanks much.
    John DeArmond
    Tellico Plains, Occupied TN
    See website for email address
  19. Neon John

    Neon John Guest

    I hacked into the "clinician menus" within an hour of getting the
    thing powered up :) I found the clinician software a few hours

    The software has the ability to display breath-by-breath waveforms but
    alas, my machine only saves summary data to the SD card. The next
    model up does record that detail but I didn't know enough about them
    to ask.

    I'm embarrassed to say that I haven't taken this thing apart yet (what
    kind of hacker is that?) but that's on the agenda. Wouldn't it be
    neat if it has a processor to process the flow data and it
    communicates with the main processor over SPI or I2C?

    It has a VERY impressive blower servo control loop. It is fast enough
    to maintain the set pressure even if I snap a breath on or off. No
    overshoot that I can detect.

    Hmm, I might be able to get a useable breath waveform from the
    pressure transducer. Gotta open the thing up and look around.

    John DeArmond
    Tellico Plains, Occupied TN
    See website for email address
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day