I recently bought the mq135 gas sensor and co2 detector, and I'm trying to use it with arduino uno.
The problem is that on the net I found 2 ways to get the reading of the co2 present (ppm) from it.
Simply reading with analogRead().
using the "MQ135" library and the getPPM() and getCorrectedPPM() functions with the temperature and humidity values taken from a DHT22.
The 2 (3 if we also consider the corrected) values also differ quite significantly.
Which should I consider correct?
Intuitively I would find the ones extracted using the appropriate library more reliable, but on the net I really found more examples where they simply use analogRead(), as in this case: MQ-135 Sensor (CO2, Benzyne) with Arduino | Sheekar Banerjee - Hackster.io
None. This sensor isn't able to get correct PPM values, it just gives you a clue about the air quality in a room. Of course you can do what the library tells you:
To get an accurate ppm reading it is important to calibrate the sensor.
Without doing that the getPPM() is probably the best value you can get, with calibration the getCorrectedPPM() might be even worth displaying as a PPM value.
Read the value while you have poor air quality, then read the value while you have all windows open (should give good air quality in most environments) and you have values to compare against to give a hint about the air quality.