The ESP32 is the Swiss Army knife of IoT microcontrollers — and the best way to learn it is by building real ESP32 projects. Whether you are a college student, a hobbyist, or someone looking to automate your home in India, these 10 projects cover everything from a simple WiFi weather station to an Alexa-compatible smart switch. Each project is hands-on, genuinely useful, and buildable with parts available in India.
Table of Contents
1. WiFi Weather Station
Difficulty: Beginner | Time: 1–2 hours
Build a compact weather station that reads temperature, humidity, and optionally pressure, then serves the data as a live web page hosted directly on the ESP32. You can view it from any phone or laptop on your home WiFi network.
Parts Needed
- ESP32 development board (any DevKit)
- DHT11 or DHT22 temperature and humidity sensor
- BMP180 or BMP280 for barometric pressure (optional)
- Breadboard and jumper wires
- USB cable and 5V adapter
How It Works
The ESP32 reads the DHT sensor every 30 seconds and stores the values in memory. It runs an HTTP web server using the built-in WebServer library. When you open the ESP32’s IP address in a browser, it serves a simple HTML page showing current readings with a timestamp. Add a simple JavaScript auto-refresh to make it update every 30 seconds automatically.
#include <WiFi.h>
#include <WebServer.h>
#include <DHTesp.h>
const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASSWORD";
const int dhtPin = 4;
DHTesp dht;
WebServer server(80);
void handleRoot() {
TempAndHumidity data = dht.getTempAndHumidity();
String html = "<h1>Weather Station</h1>";
html += "<p>Temperature: " + String(data.temperature, 1) + " C</p>";
html += "<p>Humidity: " + String(data.humidity, 1) + " %</p>";
server.send(200, "text/html", html);
}
void setup() {
dht.setup(dhtPin, DHTesp::DHT11);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) delay(500);
Serial.println(WiFi.localIP());
server.on("/", handleRoot);
server.begin();
}
void loop() {
server.handleClient();
}
2. Smart Relay Controller
Difficulty: Beginner–Intermediate | Time: 2–3 hours
Control mains appliances (lights, fans, pumps) remotely over WiFi using an ESP32 and a relay module. This is the foundation of any home automation system and works without any cloud service — everything runs on your local network.
Parts Needed
- ESP32 development board
- 1-channel, 2-channel, or 4-channel 5V relay module
- Breadboard and wires
- Optional: Enclosure box, terminal blocks for mains wiring
How It Works
The ESP32 hosts a simple web page with ON/OFF buttons for each relay. When you click a button, a POST request is sent to the ESP32, which toggles the relay. You can also add a timer function to auto-turn-off after a set period. For safety, the relay module uses optocoupler isolation between the ESP32’s 3.3V circuit and the mains-voltage switching side.
3. Bluetooth LED Controller
Difficulty: Beginner | Time: 1 hour
Use the ESP32’s Bluetooth LE (BLE) to control an RGB LED strip from your phone using a free BLE terminal app (LightBlue or nRF Connect). No WiFi router needed — great for portable applications.
Parts Needed
- ESP32 development board
- RGB LED or WS2812B LED strip (1–5 LEDs for testing)
- 3x 220Ω resistors (for common-cathode RGB LED)
- Phone with LightBlue or nRF Connect app (free on Play Store)
How It Works
The ESP32 creates a BLE GATT server with a custom characteristic for colour data. Your phone connects, writes a hex colour code (e.g., FF0000 for red) to the characteristic, and the ESP32 decodes it and sets the RGB PWM outputs accordingly. The BLE library in the Arduino ESP32 package makes this straightforward with about 80 lines of code.
4. Web Server Dashboard
Difficulty: Beginner–Intermediate | Time: 2–4 hours
Build a responsive web dashboard hosted on the ESP32 itself — showing sensor readings, system status, and control buttons — all served as a single-page application with real-time updates via Server-Sent Events (SSE).
Key Libraries
- ESPAsyncWebServer (fastest async web server for ESP32)
- ArduinoJson (for JSON API responses)
- SPIFFS or LittleFS (to store HTML/CSS/JS files in flash)
Using SPIFFS to store your HTML files means you can edit the dashboard UI independently from the firmware. Upload files via Arduino IDE’s LittleFS uploader plugin. This pattern scales from simple sensor displays to full-featured control panels.
5. MQTT Sensor Node
Difficulty: Intermediate | Time: 2–3 hours
Publish sensor data to an MQTT broker (Mosquitto on a Raspberry Pi or a cloud broker like HiveMQ) and integrate it with Home Assistant or Node-RED for dashboards, automations, and alerts.
Parts Needed
- ESP32 development board
- DHT11/DHT22 or any I2C sensor
- MQTT broker (Mosquitto on Pi, or HiveMQ free cloud account)
- PubSubClient library (install via Arduino Library Manager)
#include <WiFi.h>
#include <PubSubClient.h>
#include <DHTesp.h>
WiFiClient wifiClient;
PubSubClient mqtt(wifiClient);
DHTesp dht;
void publishSensorData() {
TempAndHumidity d = dht.getTempAndHumidity();
mqtt.publish("home/bedroom/temperature",
String(d.temperature, 1).c_str());
mqtt.publish("home/bedroom/humidity",
String(d.humidity, 1).c_str());
}
void loop() {
if (!mqtt.connected()) mqtt.connect("esp32-sensor");
mqtt.loop();
static unsigned long lastSend = 0;
if (millis() - lastSend > 30000) {
publishSensorData();
lastSend = millis();
}
}
Once your sensor data is on MQTT, Home Assistant auto-discovers it, Node-RED can process it, and Grafana can graph it over time — making this one of the most powerful building blocks for a smart home.
6. ESP32-CAM Doorbell with Telegram Notification
Difficulty: Intermediate | Time: 3–5 hours
The ESP32-CAM module combines an OV2640 2MP camera with an ESP32 and microSD card slot. Use it to build a doorbell that captures a photo when a button is pressed and sends it directly to your WhatsApp or Telegram — no subscription, no cloud service required.
Parts Needed
- ESP32-CAM module (AI Thinker version)
- FTDI programmer or CP2102 USB-to-TTL adapter (for initial programming)
- Momentary push button
- 5V 2A power supply (the camera is power-hungry)
- Telegram account and BotFather bot token
How It Works
When the doorbell button is pressed, the ESP32-CAM captures a JPEG image and sends an HTTP POST request to the Telegram Bot API with the image as a multipart upload. The message arrives on your phone within 1–2 seconds. You can also add face detection using the built-in TensorFlow Lite inference capabilities of the ESP32-S3 variant.
7. Smart Plant Watering System
Difficulty: Intermediate | Time: 3–4 hours
Automate your plant watering based on real soil moisture readings. The ESP32 reads a capacitive soil moisture sensor and triggers a small water pump via a relay when the soil gets too dry. Schedule overrides and soil readings are available on a web dashboard.
Parts Needed
- ESP32 development board
- Capacitive soil moisture sensor v1.2 (better than resistive — does not corrode)
- 5V submersible mini pump
- 1-channel relay module
- Silicone tube (5 mm ID)
- 5V power supply (2A for pump)
Key Code Logic
Read ADC on GPIO 34 every 60 seconds. Map the raw ADC value to a percentage (0% = completely dry, 100% = saturated). If below threshold (e.g. 30%), activate relay for 5 seconds to run the pump. Log all readings to SPIFFS for a graph on the dashboard. Add a deep sleep mode between readings to save power for solar-powered outdoor versions.
8. WiFi Garage Door Opener
Difficulty: Intermediate | Time: 2–3 hours
Replace your manual garage door remote with a WiFi-controlled opener. The ESP32 mimics a momentary button press on the relay to trigger the garage door motor’s existing controller — working with virtually any existing garage door.
Parts Needed
- ESP32 development board
- 1-channel relay module (dry-contact relay)
- Reed switch or magnetic sensor for door position feedback (open/closed detection)
- 12V to 5V step-down module if powering from garage door motor supply
Security Considerations
For a garage door opener, basic HTTP is not secure enough. Use WPA2-secured WiFi, add authentication (HTTP Digest Auth or a simple token), and only make the ESP32 accessible on your local network. Consider using Home Assistant integration with SSL rather than exposing the device to the internet directly.
9. Temperature Logger to Google Sheets
Difficulty: Intermediate | Time: 2–3 hours
Log temperature and humidity data from a DHT sensor directly to a Google Spreadsheet using Google Apps Script as an endpoint. No external MQTT broker or server needed — the ESP32 makes an HTTPS GET request to a Google Apps Script Web App URL every 5 minutes.
How It Works
- Create a Google Apps Script that appends a row to a spreadsheet when called with query parameters
- Deploy it as a Web App (Anyone can access)
- Copy the Web App URL
- On the ESP32, use
WiFiClientSecureto make HTTPS GET requests:https://script.google.com/macros/s/SCRIPT_ID/exec?temp=25.3&hum=65 - View live graphs in Google Sheets using chart tools
This creates a free, permanent cloud temperature log with zero infrastructure. The data is in your Google account, and you can add conditional formatting alerts for out-of-range temperatures.
10. Alexa-Compatible Smart Switch (Fauxmo)
Difficulty: Intermediate | Time: 2–3 hours
Make your ESP32-controlled relay respond to Alexa voice commands — completely locally, without any Amazon cloud account or subscription. The ESP32 emulates a Philips Hue bridge using the fauxmoESP library, which Amazon Echo devices on the same network discover automatically.
Parts Needed
- ESP32 development board
- Relay module
- Amazon Echo Dot or any Alexa device on the same WiFi network
- fauxmoESP library (install from Arduino Library Manager)
#include <WiFi.h>
#include <fauxmoESP.h>
fauxmoESP fauxmo;
const int RELAY_PIN = 26;
void setup() {
pinMode(RELAY_PIN, OUTPUT);
WiFi.begin("YOUR_SSID", "YOUR_PASSWORD");
while (WiFi.status() != WL_CONNECTED) delay(100);
fauxmo.createServer(true);
fauxmo.setPort(80);
fauxmo.enable(true);
fauxmo.addDevice("bedroom light"); // Name Alexa will respond to
fauxmo.onSetState([](unsigned char deviceId,
const char* deviceName, bool state, unsigned char value) {
digitalWrite(RELAY_PIN, state ? HIGH : LOW);
});
}
void loop() {
fauxmo.handle();
}
After uploading, open the Alexa app, go to Discover Devices, and the switch will appear as a smart light. Say “Alexa, turn on bedroom light” and the relay will click. Works with Google Home too using a similar library.
Frequently Asked Questions
Q: Which ESP32 board should I buy for these projects?
For most of the projects in this list, any ESP32 DevKit (38-pin or 30-pin) will work. The DOIT DevKit V1 or a compatible board from Zbotic.in is a great starting point. For camera projects, you need the ESP32-CAM specifically. For projects that require Matter/Thread smart home protocols, choose an ESP32-C6 or ESP32-H2.
Q: Can I power the ESP32 from a mobile power bank?
Yes — a USB power bank works well for portable projects. However, some power banks auto-shut off when current draw drops too low (which happens when the ESP32 enters light sleep). For battery-powered sensors, use a proper 18650 Li-ion cell with a TP4056 module instead.
Q: Do these projects work on local network only, or can I access them remotely?
By default, the ESP32’s web server is accessible only on your local WiFi network. For remote access, options include: port forwarding on your router (not recommended for security), a free Cloudflare Tunnel, or integrating with Home Assistant which has a free Nabu Casa cloud relay. The MQTT approach with HiveMQ cloud gives the cleanest remote access without exposing your ESP32 directly.
Q: How many relays can I control with one ESP32?
The ESP32 has enough GPIO pins to control 8 or more relay channels. For 4-channel relay modules, connect each relay’s IN pin to a dedicated GPIO. For 8+ channels, use a PCF8574 I2C expander to control relays via just two pins (SDA/SCL).
Q: Which project is best for a college engineering project in India?
The MQTT sensor node (Project 5) is excellent — it demonstrates IoT protocols, cloud connectivity, and real-time data visualisation. The smart plant watering system (Project 7) has strong visual impact for demonstrations and solves a real problem. Both are well-documented, have clear working demonstrations, and can be expanded with additional sensors.
Get Your ESP32 Project Started
Find ESP32 boards, sensors, relay modules, and all the components you need at Zbotic.in. Same-day dispatch on most items, fast delivery across India.
Add comment