Skip to content

πŸ“šπŸŒ€ Arduino library for the MQ135 air quality sensor. Allows for temperature and humidity corrected readings.

License

Notifications You must be signed in to change notification settings

Keiran90/MQ135

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

41 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MQ135 GAS SENSOR

arduino-library-badge latest version issues open pr

Updated and improved Arduino library for the MQ135 gas/air quality sensor.

This library is also available in the Arduino IDE, see Arduino Library List.

Datasheet

Can be found here.

Application

This type of sensor is used in air quality control equipments for buildings/offices and is suitable for detecting of NH3, NOx, alcohol, Benzene, smoke, CO2, etc.

Features

This library has:

  • Corrections for temperature and humidity
  • Measurements:
    • getResistance
    • getCorrectedResistance
    • getPPM
    • getCorrectedPPM
    • getRZero
    • getCorrectedRZero

Calibration

To get an accurate ppm reading it is important to calibrate the sensor.

To do so put your sensor outside where there is enough fresh air (ideally at 20Β°C & 33% humidity according to the datasheet) and leave it powered on for 12-24 hours to burn it in and stabilize.

Then you can read out the calibrated resistance value RZERO like this (needs to be done when still outside!):

float rzero = gasSensor.getRZero();

The best way to do this is to average multiple readings to fight ADC noise. To finish the calibration process you now only need to pass your RZERO value to the constructor like this:

MQ135 gasSensor(PIN_MQ135, RZERO);

More Info

https://hackaday.io/project/3475-sniffing-trinket/log/12363-mq135-arduino-library

About

πŸ“šπŸŒ€ Arduino library for the MQ135 air quality sensor. Allows for temperature and humidity corrected readings.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%