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, 2019 in IoT (Internet of Things) by Upasana
• 8,620 points
2,098 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, 2019 by Shubham
• 13,490 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,130 points
930 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,240 points
746 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,240 points
2,579 views
0 votes
1 answer
+1 vote
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,240 points
718 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,490 points
6,544 views
0 votes
1 answer

KAA server : Is it possible to develop an application to communicate with routers using PHP

It's actually not possible to develop a ...READ MORE

answered Jan 10, 2019 in IoT (Internet of Things) by Shubham
• 13,490 points
744 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP