This project is to monitor the Air Quality especially CO2 with NodeMCU as microctroller and wifi.
By create this project now I can monitor if the air quality is good or not and it will trigger automatically if the air quality is poor.
This is very simple project created with Cayenne, no more code.
Only need MQ135 library and little modification to connect internet
What’s Connected
NodeMCU ESP-12E
MQ135 Gas Sensor
Triggers & Alerts
Triggers will send email when the Air Quality is poor
Hello , thanks for sharing this good project, i just wanted to know how can i edit this below code to be able to add my Nodemcu ESP-12E module with MQTT authentication(username, password, client_id, ssid, passwd), because we can’t add Nodemcu with token, we should use MQTT authentication instead to add nodemcu module to cayenne. can you help me?
char token = “”; // Insert your token here
char ssid = “”; // Insert your SSID here
char pwd = “”; // Insert your SSID password here
MQ135 gasSensor = MQ135(ANALOGPIN);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Cayenne.begin(token, ssid, pwd);
}
void loop() {
// put your main code here, to run repeatedly:
Cayenne.run();
// float rzero = gasSensor.getRZero(); //this to get the rzero value, uncomment this to get ppm value
// float ppm = gasSensor.getPPM(); // this to get ppm value, uncomment this to get rzero value
// Serial.println(rzero); // this to display the rzero value continuously, uncomment this to get ppm value
// Serial.println(ppm); // this to display the ppm value continuously, uncomment this to get rzero value
// Cayenne.virtualWrite(VIRTUAL_PIN,ppm); // uncomment after rzero define and get your ppm calculation
}
You can actually use a NodeMCU board with the standard Arduino library too, it’s just not officially supported. On the dashboard select Arduino Uno as the device and then upload the code above like normal. I should still have my sensor somewhere, I’ll see if I can get it working with the MQTT library.
Hi thanks for sharing the project.
Where can I have access to the code of the project please? I would like to see how you could use Cayenne with the sensor.