The MQ-135 Gas sensors are used in air quality control equipments and are suitable for detecting or measuring of NH3, NOx, Alcohol, Benzene, Smoke, CO2. The MQ-135 sensor module comes with a Digital Pin which makes this sensor to operate even without a microcontroller and that comes in handy when you are only trying to detect one particular gas. If you need to measure the gases in PPM, the analog pin need to be used. The analog pin is TTL driven and works on 5V and so can be used with most common microcontrollers.
The 4 pins are GROUND, Vcc (5VDC), AO and DO. The AO pin connects to any Arduino analog input and the voltage detected is proportional to the amount of gas present. The DO (Digital Out) trigger threshold is set using the onboard potentiometer.