I'd like to use a SCD30 sensor connected to ESP8266. I know it's possible to use for example Adafruit library to connect SCD's to Arduino:
// Basic demo for readings from Adafruit SCD30
#include <Adafruit_SCD30.h>
Adafruit_SCD30 scd30;
void setup(void) {
Serial.begin(115200);
while (!Serial) delay(10); // will pause Zero, Leonardo, etc until serial console opens
Serial.println("Adafruit SCD30 test!");
// Try to initialize!
if (!scd30.begin()) {
Serial.println("Failed to find SCD30 chip");
while (1) { delay(10); }
}
Serial.println("SCD30 Found!");
// if (!scd30.setMeasurementInterval(10)){
// Serial.println("Failed to set measurement interval");
// while(1){ delay(10);}
// }
Serial.print("Measurement Interval: ");
Serial.print(scd30.getMeasurementInterval());
Serial.println(" seconds");
}
void loop() {
if (scd30.dataReady()){
Serial.println("Data available!");
if (!scd30.read()){ Serial.println("Error reading sensor data"); return; }
Serial.print("Temperature: ");
Serial.print(scd30.temperature);
Serial.println(" degrees C");
Serial.print("Relative Humidity: ");
Serial.print(scd30.relative_humidity);
Serial.println(" %");
Serial.print("CO2: ");
Serial.print(scd30.CO2, 3);
Serial.println(" ppm");
Serial.println("");
} else {
//Serial.println("No data");
}
delay(100);
}
But it requires SDL and SDA pins, which my ESP doesn't have. And this code at least doesn't allow changing the connection pins. I know that connecting SCD30 and ESP8266 is at the very least possible using YAML format, then you can use regular digital pins. But I'd like to know if it's possible to do it with Arduino code as well.
If SCD30 isn't possible to use this way then how about other air sensors, would the CSS811 work?