32-bit Microcontroller with Built-in WiFi & Bluetooth
ESP32 is NOT just a microcontroller — it is a complete IoT System on Chip (SoC) with dual-core CPU, WiFi, Bluetooth, ADC/DAC, PWM, and multiple communication peripherals.
BLE (Bluetooth Low Energy) is ideal for battery-powered IoT devices. Uses significantly less power than Classic Bluetooth.
6️⃣ Power Modes (Critical for IoT)
Understanding power modes is essential for building battery-powered IoT devices.
Mode
Current Draw
Description
Active
~80–240 mA
CPU running, WiFi/BT active — full operation
Light Sleep
~1 mA
CPU paused, WiFi maintains connection
Deep Sleep
~10 µA
Only RTC memory active — ultra low power
Visual Power Comparison
Active Mode
~80–240 mA
Light Sleep
~1 mA
Deep Sleep
~10 µA
Deep Sleep Code Example
// Sleep for 10 secondsesp_deep_sleep(10 * 1000000); // value in microseconds
Deep sleep is critical for:
🔋 Battery-powered devices
💓 Medical wearables
🌱 Remote agricultural sensors
📡 Periodic data logging stations
7️⃣ Programming Workflow (Step-by-Step)
Follow these steps to get your ESP32 up and running:
Install Arduino IDE
Download from arduino.cc. Version 2.x recommended.
Install ESP32 Board Package
Go to File → Preferences → Additional Board URLs and add: https://dl.espressif.com/dl/package_esp32_index.json
Then go to Board Manager and install esp32 by Espressif Systems.
Install USB Driver
Install CP2102 or CH340 driver depending on your board's USB chip.
Select Board
Go to Tools → Board and select "ESP32 Dev Module".
Select COM Port
Go to Tools → Port and select the correct COM port where ESP32 is connected.
Upload Code
Click the Upload button (→). Hold the BOOT button on ESP32 if upload fails.
Use Serial Monitor
Open Tools → Serial Monitor. Set baud rate to 115200 to see output.
8️⃣ Real World Applications
🏥 Medical
Remote patient monitoring
Neonatal sensor systems
Temperature monitoring devices
Heart rate & SpO2 logging
🚴 Anti-Theft
GPS + WiFi tracker for vehicles
BLE tracking tags
Motion-triggered alerts
🏠 Smart Home
IoT switches & relays
Energy monitoring systems
Voice-controlled automation
Smart lighting
📡 IoT Gateway
Send data to Firebase
MQTT communication
Edge computing node
Multi-sensor data aggregation
9️⃣ Important Concepts You Must Know
🔹 Flash vs RAM
Flash → Stores your program (non-volatile, persists after power off)
RAM (SRAM) → Temporary data while running (lost on power off)
Flash = Hard Drive | RAM = Working Memory
🔹 Partition Scheme
Defines how flash memory is divided:
App partition → Your program code
OTA partition → Over-The-Air update space
SPIFFS / LittleFS → File storage
NVS → Non-volatile key-value storage
🔹 Pull-up / Pull-down Resistors
Used for stable digital input reading:
Pull-up → Default HIGH, button pulls LOW
Pull-down → Default LOW, button pulls HIGH
ESP32 has internal pull-up/pull-down — use INPUT_PULLUP
🔹 Debouncing
Important for button input:
Mechanical buttons "bounce" — give multiple signals on one press
Software debounce: add small delay (~50ms) after button read
Hardware debounce: use capacitor across button
🔟 Safe Pin Usage (Quick Reference)
✅ Safe Output Pins
These GPIO pins can be used safely for general-purpose output:
Bottom Line: ESP32 is the go-to chip for any IoT project — from simple home automation to complex medical wearables and sensor fusion systems. Master its pins, protocols, and power modes, and you can build almost anything.