The MQ2 gas sensor operates by heating a SnO2 semiconductor layer. When the air is clean, electrons from the conduction band of tin dioxide are attracted to oxygen molecules, forming a potential barrier which makes the SnO2 film highly resistive. However, in the presence of reducing gasses, the surface density of adsorbed oxygen decreases, allowing electrons to be released into the tin dioxide and allowing current to freely flow through the sensor.