Breath-by-breath measurement of carbon dioxide using a plastic film optical sensor