STEP 1 / 6ESP + IOT

IoT Based Air Pollution/Quality Monitoring with ESP8266

466.IoT Based Air Pollution/Quality Monitoring with ESP8266 With the help of an ESP8266, a PM2.5 particulate matter sensor, a MQ-135 air quality sensor, and a BME280 barometric pressure s…

Circuit Atlas themed schematic for IoT Based Air Pollution/Quality Monitoring with ESP8266
PROJECT#466
TRACKIoT
PARTS12
STAGES06
STEP 1 / 6 · Overview

Know the mission before touching a wire.

Understand what you are making, prepare the right tools, and make the workbench safe.

01

Project details

IoT Based Air Pollution/Quality Monitoring with ESP8266 is a iot project. 466.IoT Based Air Pollution/Quality Monitoring with ESP8266 With the help of an ESP8266, a PM2.5 particulate matter sensor, a MQ-135 air quality sensor, and a BME280 barometric pressure s…

Source pages
1228-1235
Named parts
12
Build goal
Working, tested prototype
02

Tools you need

  • Digital multimeter
  • Wire stripper and side cutters
  • Soldering iron with a fine tip
  • Current-limited bench supply
  • Computer with a data-capable USB cable

Use eye protection, good lighting, and a clean insulated surface throughout the build.

03

Safety precautions

  • Disconnect every power source before changing a connection.
  • Check component polarity, pinout, and supply voltage twice.
  • Use a current limit for the first power-up.
  • Keep liquids, loose metal, and uninsulated wires away from the bench.
Ready to continue?
STEP 2 / 6 · Parts library

Gather, identify, and understand every part.

Use the standardized inventory, then open What's this? to learn each part's role, advantages, limitations, handling, and specifications.

NAMED PROJECT INVENTORY12 PART LINES
PARTTYPEQTYREADY
MBME280 Barometric Pressure Sensor Bosch's BME280 HumidityMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for IoT Based Air Pollution/Quality Monitoring with ESP8266MODULE LEARNING VIEW

BME280 Barometric Pressure Sensor Bosch's BME280 Humidity

A sensor converts a physical condition into an electrical signal the circuit can measure.

What it does here

It provides project input as an analogue, digital, resistive, frequency, or calibrated signal.

Buy / compare this part

Advantages

  • Adds real-world awareness
  • Can usually be tested independently
  • Often supports calibration

Limitations

  • Readings can drift
  • Placement affects results
  • Some sensors need warm-up or calibration

Handling

  • Protect the sensing surface
  • Observe supply voltage and polarity
  • Keep signal leads away from noisy power wiring

Specifications to verify

  • Use the exact model, value, package, and rating listed for BME280 Barometric Pressure Sensor Bosch's BME280 Humidity; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
Measily measured with the assistance of this BME280 Atmospheric SensorMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for IoT Based Air Pollution/Quality Monitoring with ESP8266MODULE LEARNING VIEW

easily measured with the assistance of this BME280 Atmospheric Sensor

A sensor converts a physical condition into an electrical signal the circuit can measure.

What it does here

It provides project input as an analogue, digital, resistive, frequency, or calibrated signal.

Buy / compare this part

Advantages

  • Adds real-world awareness
  • Can usually be tested independently
  • Often supports calibration

Limitations

  • Readings can drift
  • Placement affects results
  • Some sensors need warm-up or calibration

Handling

  • Protect the sensing surface
  • Observe supply voltage and polarity
  • Keep signal leads away from noisy power wiring

Specifications to verify

  • Use the exact model, value, package, and rating listed for easily measured with the assistance of this BME280 Atmospheric Sensor; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
MBosch and includes a temperature and barometric pressure sensor. ThisMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for IoT Based Air Pollution/Quality Monitoring with ESP8266MODULE LEARNING VIEW

Bosch and includes a temperature and barometric pressure sensor. This

A sensor converts a physical condition into an electrical signal the circuit can measure.

What it does here

It provides project input as an analogue, digital, resistive, frequency, or calibrated signal.

Buy / compare this part

Advantages

  • Adds real-world awareness
  • Can usually be tested independently
  • Often supports calibration

Limitations

  • Readings can drift
  • Placement affects results
  • Some sensors need warm-up or calibration

Handling

  • Protect the sensing surface
  • Observe supply voltage and polarity
  • Keep signal leads away from noisy power wiring

Specifications to verify

  • Use the exact model, value, package, and rating listed for Bosch and includes a temperature and barometric pressure sensor. This; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
Msensor is an upgrade to the widely used BMP085/BMP180/BMP183 SensorMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for IoT Based Air Pollution/Quality Monitoring with ESP8266MODULE LEARNING VIEW

sensor is an upgrade to the widely used BMP085/BMP180/BMP183 Sensor

A sensor converts a physical condition into an electrical signal the circuit can measure.

What it does here

It provides project input as an analogue, digital, resistive, frequency, or calibrated signal.

Buy / compare this part

Advantages

  • Adds real-world awareness
  • Can usually be tested independently
  • Often supports calibration

Limitations

  • Readings can drift
  • Placement affects results
  • Some sensors need warm-up or calibration

Handling

  • Protect the sensing surface
  • Observe supply voltage and polarity
  • Keep signal leads away from noisy power wiring

Specifications to verify

  • Use the exact model, value, package, and rating listed for sensor is an upgrade to the widely used BMP085/BMP180/BMP183 Sensor; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
Pprecise sensing, and it measures barometric pressure with an absolutePART1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for IoT Based Air Pollution/Quality Monitoring with ESP8266PART LEARNING VIEW

precise sensing, and it measures barometric pressure with an absolute

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It performs a documented electrical, control, interface, or construction function in this project.

Buy / compare this part

Advantages

  • Selected for this project
  • Can be checked independently
  • Supports modular troubleshooting

Limitations

  • Substitutes may differ
  • Generic names can hide variants
  • Pinouts and ratings vary

Handling

  • Compare the received part with the source
  • Keep it labelled
  • Do not force connectors or adjusters

Specifications to verify

  • Use the exact model, value, package, and rating listed for precise sensing, and it measures barometric pressure with an absolute; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
MNodeMCU - ESP8266MODULE1
What's this?Image, role, pros, cons, handling & specifications
NodeMCU ESP8266 development boardMODULE LEARNING VIEW

NodeMCU - ESP8266

A programmable controller that reads inputs, makes decisions, and drives the project's outputs.

What it does here

It is the control centre and must use the documented board, pin map, supply, and logic level.

Buy / compare this part

Advantages

  • Reprogrammable and reusable
  • Large learning ecosystem
  • Complex behaviour remains changeable

Limitations

  • GPIO voltage and current are limited
  • Some pins affect boot or communication
  • Loads normally need a driver

Handling

  • Disconnect power before rewiring
  • Avoid static discharge
  • Never power motors, relays, or pumps directly from GPIO

Specifications to verify

  • Use the exact model, value, package, and rating listed for NodeMCU - ESP8266; similar-looking parts are not always interchangeable.
  • Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
MPM2.5/PM10 Sensor - PMS5003MODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for IoT Based Air Pollution/Quality Monitoring with ESP8266MODULE LEARNING VIEW

PM2.5/PM10 Sensor - PMS5003

A sensor converts a physical condition into an electrical signal the circuit can measure.

What it does here

It provides project input as an analogue, digital, resistive, frequency, or calibrated signal.

Buy / compare this part

Advantages

  • Adds real-world awareness
  • Can usually be tested independently
  • Often supports calibration

Limitations

  • Readings can drift
  • Placement affects results
  • Some sensors need warm-up or calibration

Handling

  • Protect the sensing surface
  • Observe supply voltage and polarity
  • Keep signal leads away from noisy power wiring

Specifications to verify

  • Use the exact model, value, package, and rating listed for PM2.5/PM10 Sensor - PMS5003; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
MAir Quality Sensor - MQ-135MODULE1
What's this?Image, role, pros, cons, handling & specifications
MQ-135 air-quality moduleMODULE LEARNING VIEW

Air Quality Sensor - MQ-135

A sensor converts a physical condition into an electrical signal the circuit can measure.

What it does here

It provides project input as an analogue, digital, resistive, frequency, or calibrated signal.

Buy / compare this part

Advantages

  • Adds real-world awareness
  • Can usually be tested independently
  • Often supports calibration

Limitations

  • Readings can drift
  • Placement affects results
  • Some sensors need warm-up or calibration

Handling

  • Protect the sensing surface
  • Observe supply voltage and polarity
  • Keep signal leads away from noisy power wiring

Specifications to verify

  • Use the exact model, value, package, and rating listed for Air Quality Sensor - MQ-135; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
MBarometric Pressure Sensor - BME280 Temperature, HumidityMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for IoT Based Air Pollution/Quality Monitoring with ESP8266MODULE LEARNING VIEW

Barometric Pressure Sensor - BME280 Temperature, Humidity

A sensor converts a physical condition into an electrical signal the circuit can measure.

What it does here

It provides project input as an analogue, digital, resistive, frequency, or calibrated signal.

Buy / compare this part

Advantages

  • Adds real-world awareness
  • Can usually be tested independently
  • Often supports calibration

Limitations

  • Readings can drift
  • Placement affects results
  • Some sensors need warm-up or calibration

Handling

  • Protect the sensing surface
  • Observe supply voltage and polarity
  • Keep signal leads away from noisy power wiring

Specifications to verify

  • Use the exact model, value, package, and rating listed for Barometric Pressure Sensor - BME280 Temperature, Humidity; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
MPressure SensorMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for IoT Based Air Pollution/Quality Monitoring with ESP8266MODULE LEARNING VIEW

Pressure Sensor

A sensor converts a physical condition into an electrical signal the circuit can measure.

What it does here

It provides project input as an analogue, digital, resistive, frequency, or calibrated signal.

Buy / compare this part

Advantages

  • Adds real-world awareness
  • Can usually be tested independently
  • Often supports calibration

Limitations

  • Readings can drift
  • Placement affects results
  • Some sensors need warm-up or calibration

Handling

  • Protect the sensing surface
  • Observe supply voltage and polarity
  • Keep signal leads away from noisy power wiring

Specifications to verify

  • Use the exact model, value, package, and rating listed for Pressure Sensor; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
MESP8266MODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for IoT Based Air Pollution/Quality Monitoring with ESP8266MODULE LEARNING VIEW

ESP8266

A programmable controller that reads inputs, makes decisions, and drives the project's outputs.

What it does here

It is the control centre and must use the documented board, pin map, supply, and logic level.

Buy / compare this part

Advantages

  • Reprogrammable and reusable
  • Large learning ecosystem
  • Complex behaviour remains changeable

Limitations

  • GPIO voltage and current are limited
  • Some pins affect boot or communication
  • Loads normally need a driver

Handling

  • Disconnect power before rewiring
  • Avoid static discharge
  • Never power motors, relays, or pumps directly from GPIO

Specifications to verify

  • Use the exact model, value, package, and rating listed for ESP8266; similar-looking parts are not always interchangeable.
  • Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
MESP8266-12E - controller board / ICMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for IoT Based Air Pollution/Quality Monitoring with ESP8266MODULE LEARNING VIEW

ESP8266-12E - controller board / IC

A programmable controller that reads inputs, makes decisions, and drives the project's outputs.

What it does here

It is the control centre and must use the documented board, pin map, supply, and logic level.

Buy / compare this part

Advantages

  • Reprogrammable and reusable
  • Large learning ecosystem
  • Complex behaviour remains changeable

Limitations

  • GPIO voltage and current are limited
  • Some pins affect boot or communication
  • Loads normally need a driver

Handling

  • Disconnect power before rewiring
  • Avoid static discharge
  • Never power motors, relays, or pumps directly from GPIO

Specifications to verify

  • Use the exact model, value, package, and rating listed for ESP8266-12E - controller board / IC; similar-looking parts are not always interchangeable.
  • Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
Ready to continue?
STEP 4 / 6 · Source code

Confirm the hardware-only control path.

This project does not include firmware in the source. The circuit itself provides the required behaviour.

01

How to connect

  1. Match every controller label to the circuit view and source pin map.
  2. Join grounds before signal wires when separate low-voltage supplies are used.
  3. Keep motors, relays, pumps, and other loads on a suitable driver and external supply.

Common mistakes

Reversed VCC/GND, board-label versus GPIO-number confusion, missing common ground, and charge-only USB cables.

Troubleshoot

Disconnect loads, continuity-test one path at a time, then test with a current limit.

02

Software preparation

No IDE, board package, library, or firmware upload is required for this project.

If you add a programmable controller as an extension, document its pin map separately.

03

How to upload code

The original design is implemented entirely in hardware, so proceed after verifying the circuit and supply.

Ready to continue?
STEP 5 / 6 · Build

Assemble, deploy, test, and troubleshoot.

Use the complete source notes in build order, then pass the final checks before calling the project finished.

ASSEMBLY

Build in functional stages

  • Power and regulation
  • Controller or processing stage
  • Inputs and sensors
  • Outputs and loads
  • Enclosure and strain relief
TEST

Power up safely

  • Inspect unpowered continuity first
  • Apply the lowest safe current limit
  • Measure supply rails before signals
  • Add one load at a time
  • Record expected and actual results
TROUBLESHOOT

Work from simple to complex

  • Confirm power, ground, polarity, and orientation
  • Compare each pin with the source
  • Test inputs separately from outputs
  • Replace only one variable at a time
  • Power off before every correction
PROJECT-SPECIFIC BUILD NOTES

Follow the documented instructions.

These notes come from this project's source and remain in their original order.

01

Project overview

Project build note

466.IoT Based Air Pollution/Quality Monitoring with ESP8266 With the help of an ESP8266, a PM2.5 particulate matter sensor, a MQ-135 air quality sensor, and a BME280 barometric pressure sensor, we are going to create an Internet of Things–based air pollution and quality monitoring system. Through the use of the internet, we will keep an eye on the Air Quality on the Thinspeak Server. This is a basic prototype for an Internet of Things (IoT) Environmental Air Pollution/Quality Monitoring System that will monitor the concentrations of the most significant air pollutants. The PMS5003 PM2.5 Particulate Matter Sensor, the MQ-135 Air Quality Sensor, and the BME280 Barometric Pressure Sensor are the three sensors that are utilized by the system. Through this Internet of Things project, you will be able to monitor the level of pollution using your computer or mobile device from any location.

Plantpower's PMS5003 PM2.5 Particulate Matter Sensor is capable of determining the concentration of particles in PM1.0, PM2.5, and PM10. This MQ-135 Sensor for Air Quality measures the concentrations of gases such as CO, CO2, SO2, and NO2 and provides the results in parts per million (PPM) (Part per Million). In a similar vein, the BME280 can measure the Temperature, Pressure, and Humidity of its surroundings. The environmental sensors will collect data on a variety of environmental parameters and then transmit that data to the Thingspeak server, which will then display the data online at regular intervals of 15 seconds. We are able to install this system anywhere, and it has the capability to activate certain devices, such as an exhaust fan, if the level of pollution in the air reaches a certain threshold. A low-cost laser particle counter, the Plantower PMS5003 is one of a range of sensors made by Plantower that also includes the PMS1003, PMS3003, and PMS7003. PMS5003 is a type of digital and universal particle concentration sensor that can be used to obtain the number of particles that are suspended in the air, also known as the concentration of particles, and output them in the form of a digital interface. This can be accomplished by using the sensor to determine the number of particles that are suspended in the air. This sensor can be installed into variable instruments that measure the concentration of suspended particles in the air or other types of environmental improvement equipment in order to provide accurate data on the concentration of the substance in question at a given point in time. MQ-135 Air Quality Sensor The MQ-135 gas sensor is capable of detecting a wide variety of gases, including ammonia, nitrogen, oxygen, alcohols, aromatic compounds, and sulphide, as well as smoke. The MQ-3 gas sensor has a lower conductivity

than other gas sensing materials, which allows it to clean the air. Pollutant gases can be found in the atmosphere; however, the conductivity of the gas sensor will increase as the concentration of the pollutant gas rises. The MQ- 135 gas sensor is an option for use in applications that require the detection of smoke, benzene, steam, and other potentially hazardous gases. It has the capability of identifying a variety of hazardous gases. It has a low price point and is especially well-suited for applications involving the monitoring of air quality. The MQ135 sensor functions as an instruction for a signal output indicator. The analog output and the TTL output are both available from this device. TTL stands for transistor-transistor logic, and its output is a low-level signal that can be read through the IO ports of the microcontroller. The analog output is a concentration, and increasing voltage is directly proportional to increasing concentration. This means that the concentration can be determined by the analog output. This sensor has a long life and is stable and reliable throughout its operation.

02

Figure: PMS5003 PM2.5 Particulate Matter Sensor

Project build note

BME280 Barometric Pressure Sensor Bosch's BME280 Humidity, Temperature, and Pressure Sensor is an integrated environmental sensor that has a very small size and uses very little power. It also measures pressure.

The readings of barometric pressure, humidity, and temperature can be easily measured with the assistance of this BME280 Atmospheric Sensor Breakout, which does not occupy an excessive amount of space. You can learn pretty much everything you need to know about the conditions in the atmosphere by looking at this one little breakout here. This module makes use of an environmental sensor that was produced by Bosch and includes a temperature and barometric pressure sensor. This sensor is an upgrade to the widely used BMP085/BMP180/BMP183 Sensor and belongs to the next generation. This sensor is fantastic for a wide variety of weather sensing applications and can even be used in I2C as well as SPI! This precision sensor from Bosch is the best low-cost solution for precise sensing, and it measures barometric pressure with an absolute accuracy of 1 hPa, and it measures temperature with an accuracy of 1.0 degrees Celsius. You can also use it as an altimeter with an accuracy of within one meter thanks to the fact that pressure varies with altitude and the fact that the pressure measurements are so accurate.

03

Component Required

Project build note

NodeMCU - ESP8266 PM2.5/PM10 Sensor - PMS5003 Air Quality Sensor - MQ-135 Barometric Pressure Sensor - BME280 Temperature, Humidity, Pressure Sensor Connecting Wires Breadboard Circuit Diagram: IoT Based Air Pollution/Quality Monitoring with ESP8266

The connection diagram or circuit diagram for the IoT-based air quality and pollution monitoring system can be found below. There is a total of three sensors, each of which is linked to the wifi chip NodeMCU ESP8266 12E. The PMS5003 Sensor uses UART Communication to function. There are 8 pins in total, and the counting starts from the right. Connect the VCC pin of Pin1 to the Vin pin of NodeMCU, and connect the GND pin of Pin2 to GND. The receiving (Rx) pin is the fourth one, and it is connected to the transmitting (Tx) pin on NodeMCU. In a similar manner, the fifth pin is known as the Tx pin, and it is connected to the NodeMCU Rx pin. MQ-135 is an analog sensor. Therefore, connect its A0 pin to the corresponding A0 pin on the NodeMCU. Join the VCC pin to the Vin 5V pin, and the GND pin to the GND pin. The BME280 Sensor is also included, and it operates using the I2C Communication protocol. Therefore, connect the SCL and SDA pins of it to the I2C pins of NodeMCU, which are D1 and D2.

04

Setting up Thingspeak

Project build note

In order to monitor the data from the Nodemcu ESP8266-12E online, we need to set up an account with Thingspeak. Go to https://thingspeak.com/ to set up your Thingspeak account. You will need to register for an account before continuing. When you have finished creating the account, you will need to make a new channel by providing the information requested in the image that follows.

Now copy the write API key, and make the necessary changes to the Arduino by substituting the API key that you copied. Online Monitoring of Air Pollution You will be able to see the following results by clicking on the serial monitor after the code has been successfully uploaded to NodeMCU. In a similar vein, you can go to Thingspeak and check out the private view to see the graph that is presented further down.

There is a more advanced version of the BME280 Sensor available called the BME680 Sensor. This sensor can measure Index of Air Quality (IAQ) in addition to Air Quality, and it can also be used to measure Air Quality. Therefore, the single sensor is sufficient to replace both the BME280 and the MQ-135.

Ready to continue?
PROJECT ACHIEVED

You built IoT Based Air Pollution/Quality Monitoring with ESP8266.

You followed the full workflow from understanding the mission to testing the finished project. That is a real engineering achievement - well done.

IoT Biometric Fingerprint Attendance System using NodeMCU project thumbnail featuring NodeMCU - ESP8266, Fingerprint Sensor - R305/R307 Module, OLED Display
NEXT IOT ADVENTURE

IoT Biometric Fingerprint Attendance System using NodeMCU

Ready to reuse what you learned in another project from the same track?

Start this project
Browse all 500 projects