miguel5612 / MQSensorsLib

We present a unified library for MQ sensors, this library allows to read MQ signals easily from Arduino, Genuino, ESP8266, ESP-32 boards whose references are MQ2, MQ3, MQ4, MQ5, MQ6, MQ7, MQ8, MQ9, MQ131, MQ135, MQ136, MQ303A, MQ309A.
MIT License
169 stars 64 forks source link

info mq135 #15

Closed lizzus closed 5 years ago

lizzus commented 5 years ago

Hi, i have an mq135 sensor. I would to konw the right R0 value default for a right calibration. I also have an RL value. Can i use an r0 for all gases controlled? thank y

miguel5612 commented 5 years ago

Good night. You are right, the value of R0 is a unique value for all types of gases and this is because R0 represents the initial condition of the sensor. In your case, which is an MQ135, R0 expresses the value of the resistance of the sensor when it is immersed in amosphere that contains 100ppm of NH3 in the clean air. The RL that you found in the sensor you must add it as much in the calibration program as in the program that you will use to take your measurements after calibration, for it in the function setup you will have to invoke the following method MQ135.setRL(Value of Rl in Kilo Ohms) and with it the library will proceed to use the value that you have sent to make your calculations). Therefore, if you want to obtain this value you must guarantee that the sensor is immersed in a totally clean atmosphere, containing approximately 100ppm of NH3 and that the sensor is preheated for 48 hours. At this point the value you get from the resistance of the sensor is R0, which with our library is obtained with the method MQ135.calibrate() is the value of R0, which you must use in your arduino program, configuring it in the setup with the following method MQ135.setR0(Here goes the value of R0 you found). If at any point in the execution of the program you have concerns and want to know what your arduino is doing to depart from the voltage measured at the analog input deduce the PPM you can debug the library through the monitor series, adding a second parameter as shown below: MQ131.readSensor("", True); Remember that this will only work if in the setup you have already done the initialization of the serial port at the speed that is your serial monitor, for example: Serial.begin(9600); If you have more doubts, I remain attentive to your comments. Att: Miguel Califa