Both mainstream and sidestream modules use infrared absorption to detect the number of CO2 molecules in exhaled gas. Specifically, a beam of infrared light with a specific wavelength is shone from one side of the gas chamber, passing through the gas chamber and radiating onto the infrared detector on the other side of the gas chamber. (The mainstream gas chamber is the adapter, the sidestream gas chamber is built-in, and the gas flowing in the gas chamber is the patient’s exhaled gas).  The CO2 in the flowing gas in the gas chamber will absorb energy at this specific wavelength, so the energy signal detected by the infrared detector on the other side of the gas chamber will change with the change in CO2 concentration. The software calculates the number of CO2 molecules in the gas chamber by the change in absorbed energy, and then calculates the CO2 concentration in the exhaled gas.