The lung as a respiratory organ provides the blood with oxygen and removes at the same time the carbon dioxide resulted from cell metabolism. The gas properties of blood can therefore be used as a means of medical index to look into the patient’s health just like the oxygen uptake and the carbon dioxide output. Furthermore, the lung is closely connected to the heart since the heart activity like the cardiac output can be directly monitored by breath analysis. Although the lung is such an essential organ in human body, there are not many breath measurement tools as good as those available for the engineering systems. In this thesis, we introduce a mechanical ventilation system for respiration assistance and analyze the breath using gas sensors. The data can be used to estimate some of the patient’s medical conditions such as diffusion capability of the lung membrane, oxygen uptake and carbon dioxide output. For this purpose, we include the design of a valve consisting of a thermistor and servomotor that is synchronized with human respiration. The breath analysis system includes the circuit module for valve control, data acquisition through the $O_2$ - and $CO_2$ -sensors, and the software dedicated to respiratory gas analysis. Further we show how the breath measurement data are approximately compressed using Haar wavelet decomposition.