10 Amazing ESP32 Home Automation Projects You Can Build Today
The ESP32 is the perfect microcontroller for home automation. With built-in WiFi and Bluetooth, low cost ($5-10), and powerful processing, you can build professional-grade smart home devices for a fraction of commercial prices.
In this guide, I'll show you 10 practical ESP32 projects ranging from beginner to advanced. Each project includes the components needed, wiring diagram, code example, and difficulty level.
📑 What You'll Build
- 1. Smart WiFi Light Switch Beginner
- 2. Temperature & Humidity Monitor Beginner
- 3. Smart Garage Door Opener Intermediate
- 4. WiFi Smart Power Outlet Intermediate
- 5. Automatic Plant Watering System Intermediate
- 6. Smart Room Occupancy Sensor Intermediate
- 7. WiFi Smart Fan Controller Advanced
- 8. Water Leak Detector with Alert Beginner
- 9. Smart Curtain Opener Advanced
- 10. Complete Home Energy Monitor Advanced
1. 🔆 Smart WiFi Light Switch
What it does:
Control any light in your home from your phone, web browser, or voice assistant. Turn lights on/off remotely, set schedules, and create automation routines.
Components needed:
- ESP32 development board ($5-8)
- 1-channel relay module ($3-5)
- 5V power supply or USB cable
- Jumper wires
- Plastic enclosure box ($2)
Wiring diagram:
ESP32 Relay Module GPIO 18 → IN 3.3V → VCC GND → GND COM → Light bulb (via 120V/230V)
Code example (OceanRemote):
#include <WiFi.h>
#include <OceanRemote.h>
const char* ssid = "YOUR_WIFI";
const char* password = "YOUR_PASSWORD";
const char* token = "YOUR_DEVICE_TOKEN";
OceanRemote device(token);
const int RELAY_PIN = 18;
void setup() {
Serial.begin(115200);
pinMode(RELAY_PIN, OUTPUT);
digitalWrite(RELAY_PIN, LOW);
WiFi.begin(ssid, password);
device.begin();
}
void loop() {
device.update();
if (device.relay1()) {
digitalWrite(RELAY_PIN, HIGH); // Light ON
} else {
digitalWrite(RELAY_PIN, LOW); // Light OFF
}
}
2. 🌡️ Temperature & Humidity Monitor
What it does:
Monitor temperature and humidity in any room from anywhere. Get alerts when temperature goes above/below thresholds. Perfect for nurseries, wine cellars, or greenhouses.
Components needed:
- ESP32 development board
- DHT22 temperature/humidity sensor ($5)
- 10kΩ resistor (for DHT22)
- Breadboard and jumper wires
Wiring diagram:
DHT22 ESP32 VCC → 3.3V DATA → GPIO 4 GND → GND
Code example:
#include <DHT.h>
#include <OceanRemote.h>
#define DHTPIN 4
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
OceanRemote device(YOUR_TOKEN);
void setup() {
dht.begin();
device.begin();
}
void loop() {
float temp = dht.readTemperature();
float humidity = dht.readHumidity();
if (!isnan(temp)) {
device.setTemperature(temp);
}
if (!isnan(humidity)) {
device.setHumidity(humidity);
}
delay(10000); // Update every 10 seconds
}
3. 🚪 Smart Garage Door Opener
What it does:
Open/close your garage door from anywhere in the world. Get notifications when the door is left open. Add a magnetic sensor to know if the door is open or closed.
Components needed:
- ESP32 development board
- 1-channel relay module
- Magnetic reed switch (door sensor)
- 5V power supply
Safety First!
4. 🔌 WiFi Smart Power Outlet
What it does:
Turn any appliance on/off remotely - coffee maker, space heater, lamp, or fan. Monitor power usage and set schedules.
Components needed:
- ESP32
- 5V relay module
- Outlet box with AC socket
- Power cord with plug
- AC wire (14-16 AWG)
5. 💧 Automatic Plant Watering System
What it does:
Never forget to water your plants again! Monitors soil moisture and automatically waters when dry. Perfect for vacations or busy schedules.
Components needed:
- ESP32
- Soil moisture sensor ($5)
- 5V mini water pump ($8)
- Relay module
- Silicone tubing
- Water reservoir
6. 👤 Smart Room Occupancy Sensor
What it does:
Detect when someone enters a room. Automatically turn on lights, adjust thermostat, or trigger security alerts. Uses PIR motion sensor for reliable detection.
Components needed:
- ESP32
- HC-SR501 PIR motion sensor ($3)
- Optional: Relay for lights
7. 💨 WiFi Smart Fan Controller
What it does:
Control fan speed remotely (not just on/off). 3-speed control using PWM or relay bank. Works with ceiling fans or desk fans.
Components needed:
- ESP32
- 3 relay modules (for 3 speeds)
- AC fan (with speed wires)
- Optocoupler isolation
8. 💦 Water Leak Detector with Alert
What it does:
Place under washing machine, dishwasher, or water heater. Sends instant notification to your phone when water is detected. Prevents costly water damage.
Components needed:
- ESP32 (battery powered possible with deep sleep)
- Water leak sensor probe or DIY copper probes
- 10kΩ resistor
9. 🪟 Smart Curtain Opener
What it does:
Automatically open curtains at sunrise and close at sunset. Control via voice or schedule. Motorized system using stepper motor.
Components needed:
- ESP32
- 28BYJ-48 stepper motor + driver ($10)
- Timing belt and pulleys ($15)
- 3D printed mounts or custom brackets
- Limit switches (optional)
10. ⚡ Complete Home Energy Monitor
What it does:
Monitor real-time power usage of your entire home or individual appliances. Track costs, identify energy hogs, and save money on electricity bills.
Components needed:
- ESP32
- ZMPT101B AC voltage sensor ($8)
- SCT-013 current transformer ($10)
- Safety: Isolation transformer recommended
🚀 Getting Started with ESP32
What you'll need for all projects:
- ESP32 Development Board - $5-10 on Amazon/AliExpress
- USB Cable (data, not just charging)
- Arduino IDE (free) or PlatformIO
- Jumper wires (male-to-female, male-to-male)
- Breadboard for prototyping
- OceanRemote account (free tier available)
Setting up your ESP32:
- Install Arduino IDE from arduino.cc
- Add ESP32 board support: File → Preferences → Additional Boards Manager URLs
- Add URL:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json - Tools → Board → Boards Manager → Search "ESP32" → Install
- Select your board: Tools → Board → ESP32 Dev Module
- Select port: Tools → Port → (your COM port)
Ready to start your first project?
Create a free OceanRemote account to control all your ESP32 projects from one dashboard!
❓ Frequently Asked Questions
Which ESP32 board should I buy for beginners?
The ESP32 DevKit V1 (also called DOIT ESP32 DEVKIT V1) is the most common and well-documented. It has 30 pins, USB-C or micro-USB, and costs $5-10. Avoid ESP32-S2/S3 variants as a beginner - stick with the original ESP32.
Do I need to know programming?
Basic C++ knowledge helps, but OceanRemote generates ready-to-use code! Just copy-paste and upload. Many projects work without writing a single line of code.
Can I use ESP8266 instead of ESP32?
Yes! All these projects work with ESP8266 (NodeMCU, Wemos D1 Mini). ESP32 has more GPIO pins and Bluetooth, but ESP8266 is cheaper ($3-5) and works for most basic projects.
Is it safe to control home appliances with ESP32?
Yes, when using proper isolation! Always use relay modules (they optically isolate the high voltage side). Never connect AC directly to ESP32 pins. Consider using pre-certified smart plugs for critical appliances.
How do I control ESP32 from anywhere (not just home WiFi)?
OceanRemote handles this automatically! Your ESP32 connects to OceanRemote's cloud, and you control it from anywhere via the dashboard or API. No port forwarding or static IP needed.