0

ESP8266 Air Quality Sensor CCS811
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ESP8266 Air Quality Sensor CCS811

by Osfuco on Wed Mar 17, 2021 8:59 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.https://i.stack.imgur.com/tmkzh.jpg

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 | TOGGLE FULL SIZE
#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.

Osfuco
 
Posts: 3
Joined: Wed Mar 17, 2021 8:57 am

Re: ESP8266 Air Quality Sensor CCS811

by adafruit_support_bill on Wed Mar 17, 2021 9:24 am

Please do not double post: viewtopic.php?f=25&t=176899#p861581

adafruit_support_bill
 
Posts: 81286
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.


cron