IoT · Beginner

ESP32 sensor-to-MQTT starter

Read a DHT22 sensor and publish readings over MQTT — the smallest complete IoT loop, end to end. Free, no purchase required.

Project build preview
Project blueprint

What you'll build

This is the smallest complete IoT loop you can build: a sensor reads real-world values, a microcontroller formats them, and an MQTT broker distributes them to anything that subscribes. No cloud account, no dashboard service — just the loop.

It's the starter we point people to before they take on the full Edge AI Pipeline course, because it teaches the telemetry layer that every later project builds on.

Included build referenceWiring diagram — ESP32, DHT22, and power
Project overview

Understand the build here. Learn and access the assets in the LMS.

This page covers what the project does, what you need, and how the build comes together. The LMS contains the complete lessons, source code, circuit diagrams, and deployment materials.

Start Learning →
Before you start

Build requirements

01An ESP32 development board
02A DHT22 or DHT11 temperature/humidity sensor
03Jumper wires and a breadboard
04An MQTT broker (Mosquitto locally is fine)
From setup to working system

Build sequence

Follow the steps in order, verify each checkpoint, and finish with a working project you can explain and extend.

01

Wire the DHT22 to the ESP32

Connect power, ground, and the data pin to a GPIO input.

02

Flash the firmware

Install the DHT and PubSubClient libraries, then flash the read-and-publish sketch.

03

Run a local MQTT broker

Start Mosquitto on your laptop and confirm the ESP32 connects.

04

Subscribe and verify

Subscribe to the topic and watch real sensor readings arrive in real time.

Build the next checkpoint

Stop collecting tutorials. Ship a working build.

Use this project as a concrete piece of your embedded, IoT, or edge AI portfolio.

Start Building →