Air Quality Sensor
-
So what is the conditioning period for testing in it??? It is two days.. What does it mean??
@bhavika said:
So what is the conditioning period for testing in it??? It is two days.. What does it mean??
on this kind maybe to have it powered for a full two days to burn out the production "dusts" that may remain in.
those sensors are not good science, see the correlation of gases they are reported for in the datasheet
-
Hello,
a very sensitive HCHO module you can see a demo here: http://www.seeedstudio.com/recipe/379-a-handheld-hcho-detector.html?utm_source=EDM&utm_medium=EDM&utm_campaign=EDM20150930
https://github.com/empierre/arduino/blob/master/AirQuality-HCHO.ino
-
Looks strange, could you supply your code?
Btw the sensor draws a lot of current, the power supply should be able to deliver 1A. Did you burn in the sensor for 12-24 hours? -
I have used the code from epiere. Baking I have not done. I use different power supplies (USB, Samsung and a large controllable power supply). I sometimes feel that contacts do not function properly. But the sensor draws but only about 100 mA = 0.1 A? Then it seems to be on branding. I have three new sensors. Mostly we read that it is only an attempt here is to measure the CO2 content. When I check the values with a measuring instrument with which agree the details here https://olimex.wordpress.com/2015/05/26/experimenting-with-gas-sensors-and-arduino/ Branding should work outdoors? Can you show me a chart or values?
-
I used this library:
https://github.com/GeorgK/MQ135Together with this description:
https://hackaday.io/project/3475-sniffing-trinket/log/12363-mq135-arduino-librarySimple to use and very good explanations.
-
Hi @paqor,
I wrote a little sketch which you could use as a start, it uses the MQ135 library.
I also used a timer library, but this could be replaced by a simple sleep, too.RZERO should be changed when calibrating the sensor, this can be done at compile-time or during runtime by sending the value to the sensor via the gateway.
Unfortunately I could not test the sketch yet, but it should help you getting started.
If you have a second sensor which provides humidity and temperature then you can also get the corrected ppm from the library,...good luck!
/* MQ135 MySensor A0 white D0 black GND brown 5V red */ #include <SPI.h> #include <MySensor.h> #include <MQ135.h> #include "Timer.h" Timer timer; // 30 seconds #define TEMP_UPDATE_INTERVAL 30000 // MQ135 #define CHILD_ID_CO2 0 #define CHILD_ID_R0 1 #define CO2_SENSOR_ANALOG_PIN 0 /// Calibration resistance at atmospheric CO2 level #define RZERO 300.0 #define EEPROM_R0 0 MQ135 gasSensor = MQ135(CO2_SENSOR_ANALOG_PIN, RZERO); int lastC02; float lastR0; //----------------------------------------------------------------------------- // MySensor MySensor gw; MyMessage msgCO2(CHILD_ID_CO2, V_VAR1); MyMessage msgR0(CHILD_ID_R0, V_VAR1); //----------------------------------------------------------------------------- void setup() { gw.begin(incomingMessage, AUTO, true); gw.sendSketchInfo("MQ135 Sensor", "1.0"); gw.present(CHILD_ID_CO2, S_AIR_QUALITY); gw.present(CHILD_ID_R0, S_CUSTOM); uint8_t R02 = gw.loadState(EEPROM_R0); // get R0 from EEPROM float R0 = R02 * 2; // do a plausibility check if (R0 > 1.0 && R0 < 400.0) { Serial.print(F("Setting R0 from EEPROM: ")); } else { Serial.print(F("Setting default R0: ")); R0 = RZERO; } Serial.print(R0); Serial.println(F("")); gasSensor.setR0(R0); timer.every(TEMP_UPDATE_INTERVAL, timerHandler); } bool MQ135Changed() { bool changed = false; lastR0 = gasSensor.getRZero(); Serial.print(F("R0: ")); Serial.println(lastR0); { float ppm = gasSensor.getPPM(); Serial.print(F("CO2 ppm: ")); Serial.print(ppm); int roundedPpm = (int)ppm; Serial.print(F(" --> ")); Serial.println(roundedPpm); if (roundedPpm != lastC02) { lastC02 = roundedPpm; changed = true; } } return changed; } void timerHandler() { bool airQualityChanged = MQ135Changed(); if (airQualityChanged) { gw.send(msgCO2.set(lastC02)); gw.send(msgR0.set(lastR0, 2)); } } void loop() { gw.process(); timer.update(); } // Gets the R0 value from the gw passes ot to the lib and stores it into the EEPROM. void incomingMessage(const MyMessage& message) { Serial.println(F("Incoming Message:")); if (message.isAck()) { Serial.println(F("This is an ack from gateway")); } uint8_t sensor = message.sensor; if (sensor == CHILD_ID_R0) { float R0 = message.getFloat(); Serial.print(F("Incoming R0: ")); Serial.print(R0); Serial.println(F("")); gw.saveState(EEPROM_R0, (uint8_t)(R0/2)); gasSensor.setR0(R0); gw.send(msgR0.set(R0, 2)); } } -
I have compiled from various sources themselves something. The result is https://gleisnetze.de/2015/12/25/das-erste-kleine-programm/ described herein. The most plausible values I received with the MQ135.h library. For that I have then added the transfer after MySensors / FHEM.

-
Hello
In MiCS 2614 or in any gas sensor. what should be the value of R0... Because in datasheet they mentioned that value is measured in ambient condition. Any default value for that??
@bhavika said:
Hello
In MiCS 2614 or in any gas sensor. what should be the value of R0... Because in datasheet they mentioned that value is measured in ambient condition. Any default value for that??
The datasheed propose the "clean air calibration": "Sensing resistance in air R0 is measured under controlled ambient conditions, i.e. synthetic air at 23 ±5°C and 50 ± 10% RH. Sampling test."
so you should go outside and mesure the defautl R0 value in your environment. -
MQ-135 with 10k results in a R0 of around 360 in my environment. So you could start experimenting with values around 300-500. I had to use a voltage regulator to get reliable values from the sensor.
-
a little update on the MICS-6814:
NO2: sensible
CO: flat
NH3 flat

For the HCHO:

sorry for the flat part, some arduino issues at this time
-
I have had some questions about converting from mg/m3 to ppm gases, here are the weight values and a proposed method:
NH3 17.03 g/mol
CO2 44.01
CO 28.01
H2S 34.08
NO2 46.01
NO 30.01
O3 48.00
C6H6 78.11
C7H8 92.14you have:
NO2 50 μg/m3 gives 26,5868821 ppm
O3 27 μg/m3 = 0.027 mg/m3 -> (8,31441298,15)/(48101,325)*27=13,7617025 ppmcorrect me if I'm wrong
-
2016 is where IoT for gas sensors are moving to more maturity, Cooking Hacks / Libellium proposed so far Fibaro sensors, but are now proposing more pricey one that are calibrated.
-
CO2 with MH-Z14

NO2 MICS-6814

HCHO sensor

