T ThinkEdge Learn

ESP32 IoT Projects: From a Single Sensor to a Live Dashboard

An IoT project is a loop: sense, publish, act. Build it in that order and every project you attempt afterwards has the same shape.

esp32 iot projects esp32 projects iot projects for beginners
Maker Hardware and IoT · Every project is a stage of one loop, not a list of toys

What makes a project IoT rather than merely connected

Plenty of projects have a radio and none of them are IoT. The thing that makes a build an IoT project is that a reading leaves the device and changes something somewhere else: a chart updates, a message arrives on a phone, another machine reacts. The sensor and the radio are just the parts you can point at.

That gives you a fixed three-part shape to plan around. Sense: read a real quantity with a sensor and turn it into a number. Publish: send that number somewhere a program will receive it. Act: do something because of what came back. Get the first two right on a bench with a laptop on the same network and the third part is usually a small addition. Most beginner failures happen in the middle part, because people treat the network as if it were a wire. It is not. It drops, it delays, it delivers twice, and it disappears when the router reboots. Any project worth doing in a classroom has to survive that, which is why reconnection logic is not an optional extra here.

Choosing how the data travels

Three transports cover almost every classroom IoT project. MQTT is a publish and subscribe broker: your device publishes to a topic such as classroom/temp/node3, and anything subscribed to that topic receives the message. It handles reconnects and offline buffering, which is why it is the usual choice for sensor data. WebSockets keep a connection open and push updates, which suits a live dashboard. Plain HTTP is a request and response, and it suits a camera uploading a snapshot to a server.

Payload format matters more than people expect. A JSON message with named fields, a device identifier and a timestamp can be read by a spreadsheet, a dashboard and a Python script without anybody writing a parser three times. A bare number with no units is a number you will misread within a week. The third decision is power. A node that stays connected and sends every second will flatten a battery in days. A node that wakes, reads, publishes and sleeps can last months, because the radio only draws current during the transmit. Deep sleep is the single biggest battery win available to an ESP32, and it costs one line of code to measure the difference.

Step by step

  1. Get one node talking to a broker

    Publish a fixed value to a topic and read it back on a phone or a second laptop. Do this before adding any sensor, so a network problem never looks like a sensor problem.

  2. Replace the fixed value with a real reading

    Swap in a temperature sensor and publish the reading with a unit, a node ID and a timestamp in the payload. Compare two nodes side by side.

  3. Log a week of readings

    Store the payload stream in a file or a database and plot it. A temperature graph with a visible daily cycle is a genuinely satisfying result for very little code.

  4. Make the publishing survive a dropped link

    Turn off the access point for a minute and watch the node fail. Then add a reconnect loop with a backoff delay and watch it recover on its own.

  5. Add deep sleep between readings

    Wake on a timer, read, publish, sleep. Compare the average current draw before and after with a USB power meter or a multimeter in series.

  6. Close the loop with an action

    Let the server command a relay, a light or a fan based on a threshold, so the project becomes sense, publish, act. This is the step that turns a monitor into a system.

What you'll need

ItemQtyWhy
ESP32 DevKit board2Two nodes let you build a real path from sensor to broker to actuator instead of a loopback test.
DHT22 temperature and humidity sensor2Slow, digital and cheap. The right first sensor because the interesting part is the network, not the measurement.
Relay module, 5 V, opto-isolated1Lets the server command a real load and close the sense-publish-act loop safely.
Breadboard and jumper wires1 setTwo nodes plus a relay needs more than a single strip, and rewiring should not require a soldering iron.
5 V, 2 A USB power supply1The supply for the node that drives a relay, kept separate from the sensor node so a switching transient cannot reset it.
MicroSD card module1Local buffering so readings survive a network outage and upload later.

Practise it before you build it

Every step above has a matching circuit in the ThinkEdge Learn simulator. The simulator runs a real Arduino sketch against a modified-nodal-analysis solver, so digitalWrite actually drives the LED on screen and the readings change when you change the wiring — no hardware, no burnt components.

Common questions

Which IoT projects are easiest for beginners?

Start with temperature reporting every five minutes. It has one sensor, one output, and a graph at the end, and it can be built entirely on the breadboard in a single session. The conveyor counter is a good second build because it adds a stateful input and a count you can verify by hand.

Do I need a paid cloud service for an IoT project?

No. A broker such as Mosquitto runs on a laptop or on a Raspberry Pi and costs nothing, and it is a better teaching setup because students can see the topic traffic themselves. If you do use a hosted broker, the free tiers are enough for a class-sized number of nodes sending a reading every minute.

How long should a battery-powered IoT node last?

With deep sleep and a reading every 15 minutes, a 2000 mAh cell comfortably runs for a year, and often far longer. Continuous Wi-Fi with a reading every second drains the same cell in a day or two. The measurement worth doing in class is the current draw in each mode, because it turns the choice into arithmetic rather than opinion.

Related guides

ESP32 Microcontroller: The One With the Radio OnboardThe ESP32 is a 3.3 V microcontroller with Wi-Fi and Bluetooth built in. What it really is, how it differs from an Arduino Uno, and where it fits in IoT builds. ESP32-S3: What Changed and Why It Matters for Class BuildsThe ESP32-S3 adds a native USB port, Bluetooth 5 and vector instructions to the original ESP32. Here is what changed and what it means for class projects. LoRa and LoRaWAN: The Physics of Long Range, Low Power RadioLoRa is the radio, LoRaWAN is the network. Real link budgets, airtimes, the Indian 865 to 867 MHz band and the sensors you can send over it. Mesh Networking: How Nodes Relay Data for Each OtherA mesh network lets nodes relay data for each other. How flooding and hop limits work, what mesh costs in latency, and when a simple star is better. Home Energy MonitoringHow to monitor energy use in a home or classroom: clamp meters, energy monitoring modules, the difference between watts and watt-hours, and what the data shows.

Try the full simulator with your class

103 guided circuit projects, 21 lessons and an in-browser Arduino simulator. The first 15 projects are free, no account needed. NCERT Science mapping on 47 projects, with Arabic and English copy in the regional builds.