I had a project miniaturizing nasa tech for detecting hypoxia with o2 and CO2 sensors. It used a phosphorescent dye that changed a delay flash (ie you blinked a light, the dye would absorbed and blink back after a delay) based on temp and o2.
CO2 was measured with infrared but water also absorbed it, so you need to heat things up enough to not have water. It can be small, but not watch small.
All and all interesting stuff!