How can i convert this code into an widget for cayenne


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()

void loop()
sensorValue = analogRead(A0);

Serial.print(“PPM =”);



have a look at this

but it is bit difficult to use serial usb connection, so i would suggest getting a ethernet or wifi shield and then connect to cayenne.