Fc-22 Gas sensor Arduino: Difference between revisions
From wikiluntti
(→Theory) |
(→Theory) |
||
Line 17: | Line 17: | ||
void loop() { | void loop() { | ||
float rzero = gasSensor.getRZero(); | float rzero = gasSensor.getRZero(); #Calibaration. Actually it takes ~24h time. | ||
float ppm = gasSensor.getPPM(); | float ppm = gasSensor.getPPM(); | ||
Serial.println(ppm); | Serial.println(ppm); |
Revision as of 18:02, 18 November 2024
Introduction
MQ-2
Theory
#include "MQ135.h"
MQ135 gasSensor = MQ135(A5);
int ppm = gasSensor.getPPM();
void setup() {
Serial.begin(9600);
}
void loop() {
float rzero = gasSensor.getRZero(); #Calibaration. Actually it takes ~24h time.
float ppm = gasSensor.getPPM();
Serial.println(ppm);
delay(1000);
}
See https://github.com/Ravenneo/CO2-sensor
Calibration https://hackaday.io/project/3475-sniffing-trinket/log/12363-mq135-arduino-library