Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For MG-811, produces inconsistent values #2

Open
zhekaus opened this issue Jun 5, 2019 · 1 comment
Open

For MG-811, produces inconsistent values #2

zhekaus opened this issue Jun 5, 2019 · 1 comment

Comments

@zhekaus
Copy link

zhekaus commented Jun 5, 2019

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

@frankitox
Copy link

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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants