MQ-135 Gas Sensor
The MQ-x series of smoke detectors work well with Raspberry Pi. This sensor, the MQ-135 and MQ-7, has analog and digital output. Herein, we’ll use the digital output pin labeled d0 on the sensor to output a warning if CO(i.e., smoke) is detected. Alternatively, the analog output could be used to measure the level of CO, but this will need an analog/digital converter like MCP3008.
This is the Schematics and its potential use.
This is the location of the Gas Sensor on the board.
Following python code can be used to use the gas sensor.