Finding Oxygen and CO2 levels using Arduino

0 votes
int sensorValue;
int pin8 = 8;
void setup()
{
  Serial.begin(9600);      // sets the serial port to 9600
  pinMode(pin8, OUTPUT);
}

void loop()
{
  sensorValue = analogRead(0);       // read analog input pin 0
  Serial.print(sensorValue, DEC);  // prints the value read
  Serial.println("ppm");
  if (sensorValue > 500) {
    // Activate digital output pin 8 - the LED will light up
    digitalWrite(pin8, HIGH);
  }
  else {
    // Deactivate digital output pin 8 - the LED will not light up
    digitalWrite(pin8, LOW);
  }

  delay(5000);           


How can I determine Co2 and O2 level  using MQ135 with Arduino?

Mar 29 in IoT (Internet of Things) by Upasana
• 8,530 points
47 views

1 answer to this question.

0 votes

If you're using the sensor for the first time, it's a good practice to leave it powered on for about 24 hours before getting a good read.

just calibrate it to get about 100-150 from analogRead in a good air condition.

normal air returns ~100-150
alcohol returns ~700
lighter gas returns ~750+

you can find the code here.

answered Mar 29 by Shubham
• 13,300 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer

Finding the Unicast, DNS and Gateway Address in UWP

Try the PInvoke api methods from Iphlpapi.dll. ...READ MORE

answered Aug 20, 2018 in IoT (Internet of Things) by nirvana
• 3,060 points
57 views
0 votes
1 answer

Using Post and Get for Embedded System Communication

Twitter would be a great place to ...READ MORE

answered Sep 4, 2018 in IoT (Internet of Things) by anonymous2
• 4,260 points
53 views
0 votes
1 answer

Using Google Maps to track GPS enabled Arduino Board

What is the GPS Module which you ...READ MORE

answered Sep 6, 2018 in IoT (Internet of Things) by anonymous2
• 4,260 points
688 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Suggest Implementation method for Smart Parking Points

They are different things. Raspberry PI is ...READ MORE

answered Aug 24, 2018 in IoT (Internet of Things) by anonymous2
• 4,260 points
31 views
0 votes
1 answer

PWA : Using Bluetooth in my phone in Progressive Web Apps

Yes, you can access in Geo Location(for ...READ MORE

answered Dec 20, 2018 in IoT (Internet of Things) by Shubham
• 13,300 points
857 views
0 votes
1 answer