The response of a metal oxide gas sensor to a target gas can be drifted by the variation of ambient humidity and temperature as well as the memory and hysteresis effects of the sensor. Therefore, drift compensation is essential when accurate qualitative and quantitative analysis is sought. In this project memory and hysteresis effects have been investigated separately at different conditions of ambient humidity, ambient temperature and target gas concentration. Also, many experiments were carried out to investigate the combinatorial effect of these parameters on the sensor response to a target gas. Results showed that the effect of memory and hysteresis is considerable. Modelling of the sensor dynamics was selected as the main approach for compensating the effect of these affecting parameters. Experimental data were used to extract a nonlinear dynamic model for estimating the concentration of ethanol at varying environmental conditions. Inputs of this system were sensor response, ambient humidity and ambient temperature. This nonlinear model could successfully estimate the target gas concentration in all of the experiments. Also, the performance of the dynamic model was compared with a static model and an uncompensated model. Results showed that compensation of drift that caused by memory effect and hysteresis effect can lead to significant reduction of error in gas concenteration estimation. The results of this project can be used for building a sensor module resistant to environmental changes. Keywords: quantitative gas analysis, metal oxide gas sensor, drift, temperature effet, humidity effect, memory effect, hysteresis effect