Is it just my imagination, or have they patented using pressure sensors and doing math?
I can't imagine how else one might measure the air flow through a tube. It's the most straightforward method I can think of. It's quite similar to how you measure current in an electrical circuit -- you create a small resistance somewhere and measure the voltage across it, which is always proportional to the current flowing through it. This exploits the V=IR property of electronics. The same sort of thing exists with air pressure and air flow, and so you just do the same thing -- create a small resistance and measure the pressure difference on each side of the resistance, and the result is proportional to the air flow.
Indeed, the same process is behind the respiration monitoring I've done without the CPAP machine. I leave a smallish hole in the mask (about 1 cm diameter) which is large enough to breathe easily though, but small enough to still create a measurable difference in pressure between the inside and outside of the mask. I then measure the pressure under the mask. The other side of the pressure sensor isn't connected to anything, and so the measured pressure is the difference between the pressure under the mask and the pressure outside the mask, which is the same as the air pressure anywhere else in the room, and thus, the same as the pressure at the unconnected input of the pressure sensor. It isn't like they discovered this property -- this is basic physics. I'm sure there's an equation like V=IR somewhere for it.
I guess this explains why those CPAP machines cost so much. The technology in them may be quite simple, but it's patented, and so only people allowed to build the machines are charging whatever insurance is willing to pay for them.
I hate patents. They seem immoral. Copyright is different, since, if you don't want to buy my code, you're no worse off than if I hadn't written it at all, and you're free to write your own. ...but with patents, you don't have that choice. You either buy what I've built or you do without, because you're not allowed to build your own. Doesn't matter if it's so obvious that you figured it out on your own. I figured it out first and so fuck you. Also, fuck everyone else. They can pay me whatever I demand for the "invention" rather than pay you only what it costs to manufacture.
I suppose it might not be that way if they were only granted when they should be. Like with medicine -- if you don't want to use someone's medication, you're free to discover your own, and it's apparently quite possible as there are many different medications to treat everything. ...but outside of medicine, I can't think of anything that's actually a legitimate invention. (A legitimate invention being something that wasn't obvious and required a lot of experimentation to develop.) ...and even in medicine, they frequently take the same drug and put it in a waxy pill, then patent it as the "extended release" version once the original patent runs out. No experimentation there. It's rather well-known how to turn a drug into an extended-release capsule.
I don't know that there's any way to really fix this other than for patents to disappear entirely. People just suck at judging what is and isn't an invention. Probably because it's largely a subjective decision. For example, many people might consider the television an invention. However, we already had radio, and we already had used it to transmit both sound and picture over distance. The picture tube was an invention, but the rest of the television was stuff that people were already doing. Hell, even the picture tube was stuff people were already doing. Two companies invented it near-simultaneously. Only one of those companies got the patent.
So what do we get from patents? A wide assortment of drugs for various conditions that in all honesty aren't all that effective and come with a lot of serious side effects? Because we would have had television even without patents, and we probably lose out on a lot of things that people simply can't make because there are too many patents. ...and we certainly lose out by paying too much for things.