Open zhekaus opened 5 years ago
Hey @zhekaus. I'm using this library right now and I'm getting pretty consistent values. Even using 5v with an Arduino Uno. This is the basic code I found and use, maybe it helps you.
#include "CO2Sensor.h"
CO2Sensor co2Sensor(A0, 0.99, 100);
void setup() {
Serial.begin(9600);
Serial.println("=== Initialized ===");
co2Sensor.calibrate();
}
void loop() {
int val = co2Sensor.read();
Serial.print("CO2 value: ");
Serial.println(val);
delay(1000);
}
CO2 value: 0 CO2 value: 0 CO2 value: 0 CO2 value: 0 CO2 value: 18 CO2 value: 1187 CO2 value: 120 CO2 value: 1 CO2 value: 0 CO2 value: 0 CO2 value: 0 CO2 value: 4 CO2 value: 639 CO2 value: 416 CO2 value: 3 CO2 value: 0