STEP 1 / 6ESP + IOT

Gas Level Monitoring Using ESP8266 & Gas Sensor Over the Internet

Internet In this project, we'll learn how to monitor gas levels over the Internet using ESP8266 and the MQ135 gas sensor module. The amount of gas will be measured in percentages and sent…

Circuit Atlas themed schematic for Gas Level Monitoring Using ESP8266 & Gas Sensor Over the Internet
PROJECT#471
TRACKIoT
PARTS05
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

Gas Level Monitoring Using ESP8266 & Gas Sensor Over the Internet is a iot project. Internet In this project, we'll learn how to monitor gas levels over the Internet using ESP8266 and the MQ135 gas sensor module. The amount of gas will be measured in percentages and sent…

Source pages
1258-1264
Named parts
5
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 INVENTORY5 PART LINES
PARTTYPEQTYREADY
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.
MAir Quality Sensor - MQ135 Air Quality SensorMODULE1
What's this?Image, role, pros, cons, handling & specifications
MQ-135 air-quality moduleMODULE LEARNING VIEW

Air Quality Sensor - MQ135 Air Quality 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 Air Quality Sensor - MQ135 Air Quality Sensor; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
MMQ135 Gas/Smoke SensorMODULE1
What's this?Image, role, pros, cons, handling & specifications
MQ-135 air-quality moduleMODULE LEARNING VIEW

MQ135 Gas/Smoke 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 MQ135 Gas/Smoke Sensor; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
Palcohols, aromatic compounds, sulfide, and smoke. As a gas sensingPART1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Gas Level Monitoring Using ESP8266 & Gas Sensor Over the InternetPART LEARNING VIEW

alcohols, aromatic compounds, sulfide, and smoke. As a gas sensing

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 alcohols, aromatic compounds, sulfide, and smoke. As a gas sensing; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
MESP8266-12E - controller board / ICMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Gas Level Monitoring Using ESP8266 & Gas Sensor Over the InternetMODULE 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

Internet

In this project, we'll learn how to monitor gas levels over the Internet using ESP8266 and the MQ135 gas sensor module. The amount of gas will be measured in percentages and sent over the internet using the thingspeak server. With this system, you can keep an eye on the data from anywhere in the world. We just need a gas/smoke/LPG sensor like MQ2/MQ3/MQ5/MQ7/MQ135 that is directly connected to Nodemcu ESP8266-12E Module. ThingSpeak is an open-source application and application programming interface (API) for the Internet of Things (IoT). It can store and retrieve data from things using the HTTP protocol over the Internet or a Local Area Network.

02

Component Required

Project build note

NodeMCU - ESP8266 Air Quality Sensor - MQ135 Air Quality Sensor Connecting Wires

Breadboard MQ135 Gas/Smoke Sensor The MQ-135 gas sensor can detect gases like ammonia, nitrogen, oxygen, alcohols, aromatic compounds, sulfide, and smoke. As a gas sensing material, the MQ-3 gas sensor has a lower conductivity to clean the air. There are polluting gases in the air, but the conductivity of the gas sensor goes up as the amount of polluting gas goes up. With the MQ-135 gas sensor, you can find smoke, benzene, steam, and other dangerous gases. It might be able to find different dangerous gases. It doesn't cost much and works well for applications that monitor air quality. The MQ135 sensor is an instruction for sending a signal. It has two outputs: one is analog and the other is TTL. The Microcontroller's IO ports can be used to access the TTL output, which is a low signal light. The analog output is a concentration, which means that as the voltage goes up, so does the concentration. This sensor lasts for a long time and stays stable.

03

Features

Project build note

High Sensitivity High sensitivity to Ammonia, Sulfide, and Benze Stable and Long Life Detection Range: 10 – 300 ppm NH3, 10 – 1000 ppm Benzene, 10 – 300 Alcohol Heater Voltage: 5.0V Dimensions: 18mm Diameter, 17mm High excluding pins, Pins – 6mm High Long life and low cost Circuit Diagram & Connections

Connect the parts as shown in the diagram below. Connect the VCC pin of the MQ135 to the Vin pin of the NodeMCU and the GND pin to the GND pin of the NodeMCU. Connect the MQ135's analog pin A0 to the NodeMCU's analog pin A0.

04

Setting Thingspeak & Getting API Key

Project build note

Go to https://thingspeak.com/ if you don't already have an account. Sign in to your account. By clicking on the button, you can make a new channel. Type in the basics about the channel. Then Save the channel by scrolling down. You can use the video below as a guide. Then, go to API keys and copy and paste this key into a separate notepad file. You'll need it when you're programming later.

The code should be uploaded after the circuit is put together on a breadboard.

05

Figure: Prototype of Gas Level Monitor on Internet Using ESP8266 & Gas Sensor

Project build note

Once the code is uploaded, open the serial monitor to check if the Wi-Fi is connected. Be sure that the baud rate is 115200. If Wi-Fi is connected, the gas level will be shown as a percentage, and information will be sent to thingspeak.

Now, you can add gas, smoke, or perfume to the MQ135 and watch the changes as the percentage value of gas level goes up.

Open the thingspeak channel and choose public/private view. Here, you can see the data that was uploaded after a 15-second break.

Ready to continue?
PROJECT ACHIEVED

You built Gas Level Monitoring Using ESP8266 & Gas Sensor Over the Internet.

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

IoT Live Weather Station Monitoring Using NodeMCU ESP8266 project thumbnail featuring NodeMCU- ESP8266, BMP180 Sensor- BMP180 Barometric Pressure Sensor from Bosch, DHT11 Sensor- DHT11 Humidity Temperature Sensor
NEXT IOT ADVENTURE

IoT Live Weather Station Monitoring Using NodeMCU ESP8266

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

Start this project
Browse all 500 projects