The ESP32 is a tiny computer chip super popular for IoT projects (like smart home gadgets). It has built-in Wi-Fi and Bluetooth, and it saves power too.
To use it well, you need to know its operating modes. These tell the ESP32 how to connect to networks and save energy.
Let's learn in easy steps! 👇
🔍 What Are Operating Modes?
Modes decide:
- How ESP32 joins Wi-Fi.
- How it talks via Bluetooth.
- How it saves battery.
ESP32 can do Wi-Fi, Bluetooth, or both at once!
⚙️ Main Modes of ESP32
There are 2 big groups:
- Wi-Fi Modes
- Bluetooth Modes
(Plus a bonus on power saving!)
🌐 1. Wi-Fi Modes (Super Easy!)
ESP32 has 3 Wi-Fi modes. Pick one or mix them.
| Mode | What It Does | Example |
|---|---|---|
| Station (STA) | Joins your home Wi-Fi (like your phone). | Send sensor data to internet. |
| Access Point (AP) | Makes its own Wi-Fi hotspot. | Phone connects directly to ESP32. |
| STA + AP | Does both at once! | Internet + local hotspot. |
🟢 Station Mode (Join Wi-Fi)
ESP32 connects to your router. Gets internet.
Simple Code:
#include "WiFi.h"
void setup() {
WiFi.begin("YourWiFi", "Password");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
Serial.println("Connected!");
}
Use: Weather sensor sending data online.
🔵 Access Point Mode (Make Hotspot)
ESP32 creates Wi-Fi. No router needed.
Simple Code:
#include "WiFi.h"
void setup() {
WiFi.softAP("MyESP32", "1234");
Serial.println("Hotspot ready!");
}
Use: Control lights with your phone (no internet).
🟣 STA + AP Mode (Both!)
Connects to internet AND makes hotspot.
Simple Code:
#include "WiFi.h"
void setup() {
WiFi.begin("HomeWiFi", "Password"); // Join router
WiFi.softAP("MyHotspot", "1234"); // Make hotspot
}
Use: Smart door that talks to cloud + your phone.
📶 2. Bluetooth Modes (Easy!)
ESP32 has 2 Bluetooth types:
🔷 Classic Bluetooth
- For fast data (like music or chat).
- ESP32 can be "Boss" (starts chat) or "Helper" (waits).
Simple Code:
#include "BluetoothSerial.h"
BluetoothSerial SerialBT;
void setup() {
SerialBT.begin("MyESP32"); // Start Bluetooth
}
Use: Wireless keyboard or speaker.
🟩 Bluetooth Low Energy (BLE)
- For tiny data (like sensor readings).
- Saves tons of battery!
- ESP32 sends data to phone app.
Use: Fitness tracker sending heart rate.
🔋 3. Power Modes (Save Battery!)
ESP32 sleeps to save power for battery projects.
| Mode | What Happens | Power Use |
|---|---|---|
| Active | Everything ON | High |
| Light Sleep | Pauses a bit | Medium |
| Deep Sleep | Almost everything OFF | Very Low |
Deep Sleep Code:
void setup() {
esp_sleep_enable_timer_wakeup(10000000); // Sleep 10 seconds
esp_deep_sleep_start(); // Go to sleep!
}
Use: Battery sensor wakes up, sends data, sleeps again.
🧭 Quick Summary Table
| Type | Mode | What For? |
|---|---|---|
| Wi-Fi | Station | Join internet |
| Wi-Fi | Hotspot | Local connect |
| Wi-Fi | Both | Internet + local |
| Bluetooth | Classic | Fast data |
| Bluetooth | BLE | Battery sensors |
| Power | Deep Sleep | Save battery |
💡 Final Tips
- Start simple: Use Station mode for internet projects.
- No internet? Use Hotspot mode.
- Battery life? Always use Deep Sleep.
- ESP32 can do anything in IoT — homes, robots, sensors!
Now you know all modes. Try one in your next project! 🚀