ESP8266 Air Quality Sensor CCS811
Posted: Wed Mar 17, 2021 8:18 am
I am doing a project where I have to connect an ESP8266 NodeMcu v1 board (attached photo) and a CCS811 air quality sensor. Attached photo of the connection. Connection
In arduino I have version 2.7.4 of esp8266 installed. I have installed the "Adafruit_CCS811.h" library and I am trying to run the example called "CCS811_test":
The problem is that when I open the Serial Monitor, I get
I think the connection is well made, so I don't know what that error might be due to.
In arduino I have version 2.7.4 of esp8266 installed. I have installed the "Adafruit_CCS811.h" library and I am trying to run the example called "CCS811_test":
Code: Select all
#include "Adafruit_CCS811.h"
Adafruit_CCS811 ccs;
void setup() {
Serial.begin(9600);
Serial.println("CCS811 test");
if(!ccs.begin()){
Serial.println("Failed to start sensor! Please check your wiring.");
while(1);
}
// Wait for the sensor to be ready
while(!ccs.available());
}
void loop() {
if(ccs.available()){
if(!ccs.readData()){
Serial.print("CO2: ");
Serial.print(ccs.geteCO2());
Serial.print("ppm, TVOC: ");
Serial.println(ccs.getTVOC());
}
else{
Serial.println("ERROR!");
while(1);
}
}
delay(500);
}
The problem is that when I open the Serial Monitor, I get
Failed to start sensor! Please check your wiring.
I think the connection is well made, so I don't know what that error might be due to.