I bought an FC-22 (MQ135) gas sensor module which I plugged into my Arduino Uno. I connected it to the A0 analog port. Then created a code that reads the raw data from A0 (code below).
When I run the code on my Arduino Uno in my house I get values of about 30. If I blow over the sensor I get values until about 160. My question is now how I have to read / interpret these values.
According to the MQ135 specifications the sensor has a sesitivity for air quality, measuring benzene, alcohol and smoke.
How can I interpret the values I get? What is a good value and what isn't? Do I have to calculate something out of these values?
My code looks like this:
void setup() {
Serial.begin(9600);
pinMode(13, OUTPUT);
}
void loop() {
int sensorValue = analogRead(0);
Serial.print(sensorValue, DEC);
delay(100);
if (sensorValue > 50) {
digitalWrite(13, HIGH);
}
else {
digitalWrite(13, LOW);
}
}
-
any reference for co2 calibration?manish– manish2017年11月17日 06:43:36 +00:00Commented Nov 17, 2017 at 6:43
-
@manish As for now the only info I have is from the answer below in the datasheet of the MQ135.Socrates– Socrates2017年11月17日 23:35:35 +00:00Commented Nov 17, 2017 at 23:35
1 Answer 1
According to the datasheet you have to calibrate it.
-
Thanks for the link to the datasheet. Yep, at the end of the document indeed it says to calibrate the sensor to either 100ppm NH3 or 50ppm Alcohol. Unfortunately, I haven't got the tools to create an atmosphere with these contents. Furthermore, I'd be more interested in CO2 values, even if I didn't state that in the initial question.Socrates– Socrates2017年11月17日 23:34:35 +00:00Commented Nov 17, 2017 at 23:34
-
@Socrates Any update on CO2? I'm struggling with it. Could you please help me out?Aditya Ponkshe– Aditya Ponkshe2018年07月24日 06:12:03 +00:00Commented Jul 24, 2018 at 6:12
-
@AdityaPonkshe I haven't got any update on this yes, sorry. Please post it here, if you get it running.Socrates– Socrates2018年07月24日 09:07:31 +00:00Commented Jul 24, 2018 at 9:07