STEP 1 / 6ESP + IOT

ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE)

424.ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) Learn how to use the ESP8266 NodeMCU and MQTT to send temperature,…

ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) - source illustration from page 1015
PROJECT#424
TRACKIoT
PARTS08
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

ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) is a iot project. 424.ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) Learn how to use the ESP8266 NodeMCU and MQTT to send temperature,…

Source pages
1015-1018
Named parts
8
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 INVENTORY8 PART LINES
PARTTYPEQTYREADY
Pdevelopment boards)PART1
What's this?Image, role, pros, cons, handling & specifications
ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) - source illustration from page 1015PART LEARNING VIEW

development boards)

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 development boards); similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
MRaspberry Pi board equipped with BME680 and ESP8266 GuideMODULE1
What's this?Image, role, pros, cons, handling & specifications
ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) - source illustration from page 1015MODULE LEARNING VIEW

Raspberry Pi board equipped with BME680 and ESP8266 Guide

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 Raspberry Pi board equipped with BME680 and ESP8266 Guide; similar-looking parts are not always interchangeable.
  • Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
M(read Best Raspberry Pi Starter Kits)MODULE1
What's this?Image, role, pros, cons, handling & specifications
ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) - source illustration from page 1015MODULE LEARNING VIEW

(read Best Raspberry Pi Starter Kits)

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 (read Best Raspberry Pi Starter Kits); similar-looking parts are not always interchangeable.
  • Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
PClass 10 MicroSD Card with 16 GB of StoragePART1
What's this?Image, role, pros, cons, handling & specifications
ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) - source illustration from page 1015PART LEARNING VIEW

Class 10 MicroSD Card with 16 GB of Storage

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 Class 10 MicroSD Card with 16 GB of Storage; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
MSupply of Electricity for the Raspberry Pi (5V 2.5A)MODULE1
What's this?Image, role, pros, cons, handling & specifications
ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) - source illustration from page 1015MODULE LEARNING VIEW

Supply of Electricity for the Raspberry Pi (5V 2.5A)

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 Supply of Electricity for the Raspberry Pi (5V 2.5A); similar-looking parts are not always interchangeable.
  • Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
BA set of jumper wiresBUILD1
What's this?Image, role, pros, cons, handling & specifications
ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) - source illustration from page 1015BUILD LEARNING VIEW

A set of jumper wires

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 A set of jumper wires; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
MBMP180 - barometric sensorMODULE1
What's this?Image, role, pros, cons, handling & specifications
ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) - source illustration from page 1015MODULE LEARNING VIEW

BMP180 - barometric 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 BMP180 - barometric sensor; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
MBMP280 - barometric sensorMODULE1
What's this?Image, role, pros, cons, handling & specifications
ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) - source illustration from page 1015MODULE LEARNING VIEW

BMP280 - barometric 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 BMP280 - barometric sensor; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
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

424.ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE) Learn how to use the ESP8266 NodeMCU and MQTT to send temperature, humidity, pressure, and gas air quality readings from a BME680 sensor to any platform that supports MQTT or any MQTT client. As an illustration, we will send the readings from the sensors to the Node-RED Dashboard MQTT is gaining popularity as an Industrial IoT (Internet of Things) data protocol. It is a lightweight method that is both efficient and secure, and it was developed for the purpose of connecting remote devices to a central server. On the other hand, IoT installations are becoming larger and more complicated, and there is a rising demand for OT/IT connectivity. The MQTT protocol is therefore good for the environment and simple to implement for a large number of devices. Keeping devices connected despite having unreliable networks: Even when connections between devices are

unstable, MQTT in the Internet of Things is able to leverage QoS levels to assure that messages will be delivered to their intended recipients.

02

Components Required

Project build note

The ESP8266 is a required component (read Best ESP8266 development boards) Raspberry Pi board equipped with BME680 and ESP8266 Guide (read Best Raspberry Pi Starter Kits) Class 10 MicroSD Card with 16 GB of Storage Supply of Electricity for the Raspberry Pi (5V 2.5A) A set of jumper wires Breadboard

03

Project Overview

Project build note

A high-level overview of the project that we are going to construct can be seen in the accompanying diagram. Readings from the sensor are requested by the ESP8266, which is connected to the BME680. Node-RED is subscribed to those topics; Node-RED receives the sensor readings and then displays them on gauges and text fields;

The temperature readings are published in the esp/bme680/temperature topic; the humidity readings are published in the esp/bme680/humidity topic; the pressure readings are published in the esp/bme680/pressure topic; and the gas readings are published in the esp/bme680/gas topic. You have the ability to receive the readings in any other platform that supports MQTT, and you may treat the readings in any manner that you see fit. BME680 Integrated Environmental Sensor The BME680 is a digital sensor that measures gas, humidity, pressure, and temperature all in one package, and it does so use sensing methods that have been tried and tested. The BMP180, BMP280, and BME280 are all predecessors to the BME680, which is an updated and superior version of those models. The BME680 has a gas sensor that can detect a wide variety

of volatile organic chemicals, which allows it to monitor the quality of the air within. High linearity and accuracy are both characteristics of the sensor. The BME680 was designed specifically for mobile applications and wearables, two categories of electronics in which the criteria for size and power consumption are particularly stringent. The gas sensor contained within the BME680 is capable of detecting a wide variety of gases, including volatile organic compounds, in order to carry out air quality measurements (VOC).

04

Schematic Diagram

Project build note

Connect the BME680 to the ESP8266 in the manner depicted in the accompanying block diagram of the schematic. The SDA pin should be connected to GPIO 4, and the SCL pin should be linked to GPIO 5.

Ready to continue?
PROJECT ACHIEVED

You built ESP8266 NodeMCU MQTT - Publish Temperature, Humidity, Pressure, and Gas Readings from a BME680 Sensor (Arduino IDE).

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

Web Server for ESP32/ESP8266 Relay Modules Built with the Arduino IDE (1, 2, 4, 8, 16 Channels) project thumbnail featuring ESP8266, ESP32, NodeMCU
NEXT IOT ADVENTURE

Web Server for ESP32/ESP8266 Relay Modules Built with the Arduino IDE (1, 2, 4, 8, 16 Channels)

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

Start this project
Browse all 500 projects