2021-06-08 08:33:51 +07:00
|
|
|
/*
|
|
|
|
This is the code for the AirGradient DIY Air Quality Sensor with an ESP8266 Microcontroller.
|
|
|
|
|
|
|
|
It is a high quality sensor showing PM2.5, CO2, Temperature and Humidity on a small display and can send data over Wifi.
|
|
|
|
|
2022-07-29 16:26:06 +02:00
|
|
|
For build instructions please visit https://www.airgradient.com/open-airgradient/instructions/
|
2021-06-08 08:33:51 +07:00
|
|
|
|
|
|
|
Compatible with the following sensors:
|
|
|
|
SenseAir S8 (CO2 Sensor)
|
|
|
|
|
|
|
|
Please install ESP8266 board manager (tested with version 3.0.0)
|
|
|
|
|
2021-12-08 09:59:32 +07:00
|
|
|
If you have any questions please visit our forum at https://forum.airgradient.com/
|
|
|
|
|
2021-06-08 08:33:51 +07:00
|
|
|
If you are a school or university contact us for a free trial on the AirGradient platform.
|
2022-07-29 16:26:06 +02:00
|
|
|
https://www.airgradient.com/
|
2021-06-08 08:33:51 +07:00
|
|
|
|
2022-07-29 16:26:06 +02:00
|
|
|
Kits with all required components are available at https://www.airgradient.com/open-airgradient/shop/
|
2021-12-08 09:59:32 +07:00
|
|
|
|
2023-03-09 07:35:49 +07:00
|
|
|
CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License
|
|
|
|
|
2021-06-08 08:33:51 +07:00
|
|
|
*/
|
|
|
|
|
2020-07-24 21:52:28 +08:00
|
|
|
#include <AirGradient.h>
|
|
|
|
AirGradient ag = AirGradient();
|
|
|
|
|
|
|
|
void setup(){
|
2022-10-29 07:39:11 +07:00
|
|
|
Serial.begin(115200);
|
2020-07-25 14:28:18 +08:00
|
|
|
ag.CO2_Init();
|
2020-07-24 21:52:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void loop(){
|
|
|
|
|
2020-07-25 14:28:18 +08:00
|
|
|
int CO2 = ag.getCO2_Raw();
|
2020-07-24 21:52:28 +08:00
|
|
|
Serial.print("C02: ");
|
2020-07-25 14:28:18 +08:00
|
|
|
Serial.println(ag.getCO2());
|
2020-07-24 21:52:28 +08:00
|
|
|
|
|
|
|
delay(5000);
|
2020-07-25 14:28:18 +08:00
|
|
|
}
|