A detector device configured to measure composition of a flow of breathable gas received from a respiratory circuit the detector device comprising: a housing; a removable flow path element forming an enclosed flow path for flow of breathable gas, the flow path element comprising an inlet, a sampling chamber, a pump section, and an outlet, the pump section including a membrane and an actuator interface; a flow path element dock formed by the housing, the flow path element dock being configured to removably engage the flow path element; a radiation source housed within the housing configured to emit electromagnetic radiation into the sampling chamber of the flow path element while the flow path element is docked in the flow path element dock; a sensor assembly housed within the housing configured such that, while the flow path element is docked in the flow path element dock and the radiation source emits electromagnetic radiation into the sampling chamber of the flow path element, the sensor assembly receives electromagnetic radiation that has been emitted by the radiation source and has passed through the flow path formed in the flow path element, the sensor assembly being further configured to generate an output signal conveying information related to one or more parameters of the received electromagnetic radiation for determining composition of the breathable gas in the enclosed flow path; a pump actuator carried by the housing and driven by a pump, the pump actuator being configured to actuate the membrane in the pump section of the flow path element via the actuator interface to draw flow of breathable gas through the enclosed flow path; and a controller housed within the housing configured to control the pump actuator to maintain the flow rate of the flow of breathable gas through the enclosed flow path. a housing; a removable flow path element forming an enclosed flow path for flow of breathable gas, the flow path element comprising an inlet, a sampling chamber, a pump section, and an outlet, the pump section including a membrane and an actuator interface; a flow path element dock formed by the housing, the flow path element dock being configured to removably engage the flow path element; a radiation source housed within the housing configured to emit electromagnetic radiation into the sampling chamber of the flow path element while the flow path element is docked in the flow path element dock; a sensor assembly housed within the housing configured such that, while the flow path element is docked in the flow path element dock and the radiation source emits electromagnetic radiation into the sampling chamber of the flow path element, the sensor assembly receives electromagnetic radiation that has been emitted by the radiation source and has passed through the flow path formed in the flow path element, the sensor assembly being further configured to generate an output signal conveying information related to one or more parameters of the received electromagnetic radiation for determining composition of the breathable gas in the enclosed flow path; a pump actuator carried by the housing and driven by a pump, the pump actuator being configured to actuate the membrane in the pump section of the flow path element via the actuator interface to draw flow of breathable gas through the enclosed flow path; and a controller housed within the housing configured to control the pump actuator to maintain the flow rate of the flow of breathable gas through the enclosed flow path.