Like pulse oximetry, capnography typically works by detecting infrared energy absorption at a specific wavelength compared to a reference energy source. One difficulty with the idea of making a cheap device that one might, for example, plug into a smart phone, is that unlike a pulse oximeter, you don't simply slip the energy source/detector over someone's fingertip - the capnographic sensor is usually adapted or otherwise attached to the endotracheal tube with which the person in extremis is intubated.
Who is going to use this? If they drive a Big White Truck, an ordinary capnograph won't make it any bigger. Otherwise, they're not even trained to check for a pulse, because history shows they'll stuff it up in real life. (Real life refers to the first aider - it's most likely real death for the patient, no matter who treats them.)
Ideally, a portable/cheap capnograph would be one part of a 21st century first-aid scenario, while the other parts might include automatic defibrillators and freezing blankets.