The mass airflow sensor is placed in the stream of intake air. It measures the intake flow rate by measuring a part of the entire intake flow. It consists of a hot wire that is supplied with electric current from the ECM. The temperature of the hot wire is controlled by the ECM a certain amount. The heat generated by the hot wire is reduced as the intake air flows around it. The more air, the greater the heat loss. Therefore, the ECM must supply more electric current to maintain the temperature of the hot wire as airflow increases. The ECM detects the airflow by means of this current change.
The Mass Air Flow sensor is a very delicate sensor.
Between very fine dirt and the trend towards oiled filters it's very important to keep the MAF clean. MAF sensors also can get contaminated from a variety of sources: dirt, oil, silicon, spider webs, potting compound from the sensor itself, etc. When a MAF sensor gets contaminated, it skews the transfer function such that the sensor over-estimates air flow at idle (causes the fuel system to go rich) and under-estimates air flow at high air flows (causes fuel system to go lean). This means Long Term Fuel Trims will learn lean (negative) corrections at idle and learn rich (positive) corrections at higher airflows.
In the past there really was not any safe way of cleaning them without risk of damaging them. Today CRC Mass Air Flow Sensor Cleaner is the safe and an effective alternative to using aggressive chemicals like brake parts cleaners or carburetor cleaners.