A device for measuring the composition of medical air, comprising: • an inlet branch that can be connected to a duct through which the medical air circulates; • a sensor body in fluid communication with the inlet branch, for receiving a fraction (fA) of the medical air that circulates through the duct and which has measuring modules, each module comprising a sensor for measuring the concentration of an element of the composition of the fraction (fA) of the medical air; • an outlet branch in fluid communication with the sensor body, for carrying the fraction (fA) of the medical air to the outside of the device; and • a control unit configured to receive the measurements and information of the sensors of the measuring modules, wherein the inlet branch has a pressure regulator to adjust the pressure of the fraction (fA) of the medical air, and a flow regulator to maintain a constant flow of the fraction (fA) of the medical air characterized in that: the inlet branch has a humidifier system (9,H) to supply the fraction (fA) of the medical air to the sensor body in a dry or moist condition, the humidifier system (9,H) comprising a humidifier container and two solenoid valves that are configured to switch between a first state in which they allow the fraction (fA) of the medical air to pass through the humidifier container to supply the fraction (fA) of the medical air in a moist condition to the sensor body, and a second state in which they allow for the fraction (fA) of the medical air to directly pass to the sensor body in a dry condition, wherein the two solenoid valves are controlled by the control unit;; each measuring module has an internal memory with the information on the installation data, calibration data and lifespan of the sensor of the measuring module; each measuring module has power supply means for continuously supplying electrical energy to the sensor of the measuring module; and the measuring modules are independent units that have quick coupling means to connect to and disconnect from the sensor body. • an inlet branch that can be connected to a duct through which the medical air circulates; • a sensor body in fluid communication with the inlet branch, for receiving a fraction (fA) of the medical air that circulates through the duct and which has measuring modules, each module comprising a sensor for measuring the concentration of an element of the composition of the fraction (fA) of the medical air; • an outlet branch in fluid communication with the sensor body, for carrying the fraction (fA) of the medical air to the outside of the device; and • a control unit configured to receive the measurements and information of the sensors of the measuring modules, wherein the inlet branch has a pressure regulator to adjust the pressure of the fraction (fA) of the medical air, and a flow regulator to maintain a constant flow of the fraction (fA) of the medical air characterized in that: the inlet branch has a humidifier system (9,H) to supply the fraction (fA) of the medical air to the sensor body in a dry or moist condition, the humidifier system (9,H) comprising a humidifier container and two solenoid valves that are configured to switch between a first state in which they allow the fraction (fA) of the medical air to pass through the humidifier container to supply the fraction (fA) of the medical air in a moist condition to the sensor body, and a second state in which they allow for the fraction (fA) of the medical air to directly pass to the sensor body in a dry condition, wherein the two solenoid valves are controlled by the control unit;; each measuring module has an internal memory with the information on the installation data, calibration data and lifespan of the sensor of the measuring module; each measuring module has power supply means for continuously supplying electrical energy to the sensor of the measuring module; and the measuring modules are independent units that have quick coupling means to connect to and disconnect from the sensor body. the inlet branch has a humidifier system (9,H) to supply the fraction (fA) of the medical air to the sensor body in a dry or moist condition, the humidifier system (9,H) comprising a humidifier container and two solenoid valves that are configured to switch between a first state in which they allow the fraction (fA) of the medical air to pass through the humidifier container to supply the fraction (fA) of the medical air in a moist condition to the sensor body, and a second state in which they allow for the fraction (fA) of the medical air to directly pass to the sensor body in a dry condition, wherein the two solenoid valves are controlled by the control unit;; each measuring module has an internal memory with the information on the installation data, calibration data and lifespan of the sensor of the measuring module; each measuring module has power supply means for continuously supplying electrical energy to the sensor of the measuring module; and the measuring modules are independent units that have quick coupling means to connect to and disconnect from the sensor body.