In this project “DIY Air Quality Tester” we use Node MCU microcontroller and air quality sensors to measure various gases concentration levels, providing valuable insights into the air’s purity.

Full Project Link:



An air quality tester using NodeMCU is a project that utilizes the NodeMCU board and an air quality sensor, such as the MQ series, to monitor the concentration of gases in the air. The NodeMCU reads analog data from the sensor, converts it to a gas concentration value, and sends this information to a cloud service or displays it locally. This compact device can provide real-time air quality insights, making it a valuable tool for environmental monitoring and ensuring healthier living spaces. The project involves hardware connections and all the hardware design and manufacturing files.

Bill of materials


1Node MCUD1 Mini Pro V3.01https://amzn.to/3MGTsVn
2Connecting wiresjumper wiresomehttps://amzn.to/3fMoSw7
4Carbon Dioxide SensorSCD301https://amzn.to/3swJDCo
5Temperature and humiditySHT401https://amzn.to/3QVhqhZ
6Dust SensorSPS301SPS30 Sensor
7Carbon Oxygen Alcohol VOC GasMiCS55241https://amzn.to/40ChdU5
8Barometric Pressure SensorBME2801https://amzn.to/40CvFvb
9Ambient Light Sensor ModuleVEML77001https://amzn.to/3QCKHg1

Working Principle

The Air Quality Tester project using NodeMCU with multiple sensors involves monitoring various environmental parameters to assess the air quality. Here’s a brief overview of the working principles of each sensor:

Individual Working of Sensor

  1. Carbon Dioxide (CO2) Sensor:
    • Measures the concentration of carbon dioxide in the air.
    • Utilizes a non-dispersive infrared (NDIR) sensor technology.
    • NDIR sensors measure the amount of infrared light absorbed by CO2 molecules, providing an indication of CO2 levels.
  2. Temperature and Humidity Sensor :
    • Measures both temperature and humidity in the air.
    • Utilizes a capacitive humidity sensor and a thermistor for temperature measurement.
    • Changes in capacitance and resistance are converted into temperature and humidity values.
  3. Dust Sensor :
    • Measures the concentration of particulate matter (PM) in the air.
    • Utilizes an infrared LED and a photodetector to detect the light scattered by particles.
    • The amount of scattered light correlates with the concentration of dust particles.
  4. Carbon Oxygen Alcohol VOC Gas Sensor :
    • Measures the concentration of various gases such as carbon monoxide, methane, alcohol, and volatile organic compounds (VOCs).
    • Utilizes a metal oxide semiconductor to detect changes in electrical conductivity when exposed to target gases.
  5. Barometric Pressure Sensor :
    • Measures atmospheric pressure, which can be used to estimate altitude.
    • Utilizes a piezoelectric sensor that changes resistance with variations in air pressure.
    • The resistance change is converted into pressure readings.
  6. Ambient Light Sensor Module :
    • Measures the intensity of ambient light.
    • Utilizes a photodiode to convert incident light into an electrical current.
    • The current is then converted into a digital value, representing the light intensity.

Overall working

  1. Initialization:
    • The NodeMCU initializes the sensors and communication interfaces during setup.
  2. Continuous Reading:
    • In the loop function, the NodeMCU continuously reads data from each sensor.
    • Analog or digital signals from sensors are converted into meaningful readings.
  3. Data Processing:
    • The collected sensor data is processed as needed. For example, converting raw sensor values into physical units (e.g., ppm for gas concentrations).
  4. Display or Transmission:
    • The processed data can be displayed locally on the NodeMCU’s serial monitor for debugging purposes.
    • Optionally, the NodeMCU can transmit the data to a cloud platform or a local server for remote monitoring.
  5. Monitoring and Analysis:
    • Users can monitor the air quality parameters in real-time, track historical trends,...
Read more »