**Hi friends, i have an IoT device that using a MQ135 Gas sensor measures the air quality and i'm using cayenne platform for showing the results and i'm using it's analog pin and it gives me one output that is in ppm unit. But i can't uderstand this value is for which gas while MQ135 can sense various gases such as NH3, Alcohol, Benzene, Smoke and so on. How can i distinguish between this gases and show value of each one in outut? is it possible? ** 
My code is this:
#include "MQ135.h"
#include <CayenneMQTTESP8266.h>
#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#define VIRTUAL_PIN 5
#define ANALOGPIN A0
char ssid[] = "xxxxx";
char wifiPassword[] = "xxxxxxxx";
char username[] = "0628b770-693e-11e7-ac32-c53314110d38";
char password[] = "8bcd57937e106797d740610dc18ee23f54846a8e";
char clientID[] = "7e9ccf60-75f6-11e7-8230-efa4c0c056b2";
MQ135 gasSensor = MQ135(ANALOGPIN);
void setup() {
Serial.begin(115200);
Cayenne.begin(username, password, clientID, ssid, wifiPassword);
}
void loop() {
Cayenne.loop();
float ppm = gasSensor.getPPM();
Serial.println(ppm);
Cayenne.virtualWrite(VIRTUAL_PIN,ppm);
}
CAYENNE_IN_DEFAULT()
{
CAYENNE_LOG("CAYENNE_IN_DEFAULT(%u) - %s, %s", request.channel, getValue.getId(), getValue.asString());
}
yo code gives and error like this
"exit status 1"
"error compling for board arduino/genuino Mega or Mega 2560"
could u expalin this reasoning
If several gases like CO, CO2 or NH3 can be present, there is no way to know which one the MQ135 is sensing, without using some other technique. At best, by comparing before and after measurements, the sensor can tell you that something in the air mixture has changed.
If you use several different types of MQ sensors at the same time, then it is possible to do so.
This great article describes how to do that, and how to make an "electronic nose" using MQ sensors.
jremington:
If several gases like CO, CO2 or NH3 can be present,
You're answering a question of almost a year ago.
INFAMOUSPEPSI:
yo code gives and error like this
"exit status 1"
"error compling for board arduino/genuino Mega or Mega 2560"
You failed to post the complete error message which tells you what's actually wrong, so nothing sensible to be said about that, but most likely:
- OP didn't post complete code, or
- you didn't copy/paste properly, or
- OP used another Arduino board than you.
The latter is definitely the case, and you can tell by just looking at the code and the description of OP. An Arduino Mega doesn't have an ESP8266.
You're answering a question of almost a year ago.
I'm certain that the OP was still hoping for an answer.