The code below demonstrate an MQ135 gas sensor detecting CO2 in the air in the unit PPM. I am trying to make these values display on my phone using cayenne while my arduino is connected serial with an usb.
int sensorValue;
float vol;
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println(“”);
sensorValue = analogRead(A0);
Serial.print(“PPM =”);
Serial.print(sensorValue);
delay(1000);
}