Code and Wiring Diagram: https://benocampos.blogspot.com/2017/...
Reading Analog data from an MQ135 Air Quality Sensor with a Raspberry Pi Model B+ using MCP3008 analog-to-digital converter.
I used almost the same wiring diagram as in here: https://learn.adafruit.com/downloads/... the only difference is that I used the 5V pin instead of 3.3V (it doesn't affect the MCP3008) and oviously I used a sensor instead of the potentiometer that appears in the PDF.