ESP32 Tutorial: A Comprehensive Guide to ESP32 Boards, Features, and Getting Started

ESP32 Tutorial: A Comprehensive Guide to ESP32 Boards, Features, and Getting Started

Sep 8th,2025

Illustration of an ESP32 development board with USB port and Wi-Fi antenna, used for ESP32 tutorial

What is ESP32?

In this ESP32 tutorial, imagine controlling your home lights with a smartphone, checking live weather conditions from your garden, or receiving an alert when a machine in your factory overheats.These are all examples of everyday IoT applications powered by affordable and energy-efficient microcontrollers.To program the ESP32 microcontroller, we need to install the ESP32 board package in the Arduino IDE—check SunFounder’s blog article on [Raspberry Pi Ubuntu Setup] for insight into cross-platform installation challenges.

Wiring diagram showing ESP32 development board connected to a 2-channel relay module controlling two light bulbs

ESP32 boards are at the heart of many IoT systems, offering versatile development options designed by Espressif.Whether you’re building a simple weather station, a smart lighting system, or an industrial monitoring solution, the ESP32 provides the wireless connectivity, processing power, and flexibility to bring your ideas to life.

Why ESP32 became popular in IoT & embedded

All-in-one radio + MCU: Among the most practical ESP32 features is the all-in-one design: no separate Wi-Fi/BLE module or coprocessor required.
Strong toolchain & docs: Official ESP-IDF, Arduino core, PlatformIO, abundant examples.
Right-sized performance: Enough RAM/flash for secure stacks (MQTT/TLS), web UIs, and ML-lite at the edge.
Huge ecosystem: Boards, sensors, libraries, and community support across use cases.
Cost & availability: Competitive pricing with many pin-compatible modules.

ESP32 Features & Specifications (high level)

CPU: Dual-core Xtensa @ up to 240 MHz (ESP32, S3) or single-core Xtensa (S2) / single-core RISC-V (C3, C6)—see the official [ESP32 Technical Reference Manual] for more details
Connectivity: 2.4 GHz Wi-Fi (802.11 b/g/n); BLE 4.2/5.x on many variants; BT Classic on the original ESP32; 802.15.4 on C6/H2.
Memory: Internal SRAM (hundreds of KB, model-dependent); external PSRAM available on WROVER/S3 boards (typically 4–16 MB).
Flash: 4–16 MB common on dev kits; more on some modules.
I/O: Rich GPIO, ADC/DAC (DAC not on all families), SPI/I²C/UART, PWM, RMT, I²S, SD/MMC, and native USB on S2/S3.
Security: AES/SHA, secure boot, flash encryption, hardware RNG, TLS acceleration (varies by family).
Low power: Deep sleep in microamps at the SoC; board-level quiescent current depends on regulators/LEDs.

Guide ESP32 Development Boards

Official Espressif

ESP32-DevKitC (WROOM/WROVER): One of the most common ESP32 development board options is the ESP32-DevKitC (WROOM/WROVER), a classic dual-core with Wi-Fi + BLE + (BT Classic on WROOM).
ESP32-S2-DevKit: Wi-Fi only, native USB OTG, good for HID/USB-device projects.
ESP32-S3-DevKitC-1: Dual-core with BLE 5, Wi-Fi, vector instructions, native USB; common with 8 MB PSRAM.
ESP32-C3-DevKitM/MINI: RISC-V, Wi-Fi + BLE 5, very low power, small footprint.
ESP32-C6-DevKitC: RISC-V with Wi-Fi 6 (2.4 GHz) + BLE 5 + 802.15.4 (Thread/Zigbee) for modern Matter stacks.

Front view of ESP32-S3-WROOM-1 development board showing chip, pins, and USB connectors
Front view of ESP32-S3-WROOM-1 development board with dual USB-C connectors and pin layout
Front view of ESP32-S3-WROOM-1-N8R2 development board with micro-USB port and reset button
Front view of ESP32-WROOM-32 development board with micro-USB port, reset button, and pin headers

Popular Third-Party Boards

NodeMCU-32S / DOIT clones: Budget ESP32-WROOM dev boards, breadboard-friendly.
LOLIN/WEMOS D32 / D32 Pro: Quality USB-C options; some with microSD/IMU.

Angled view of ESP32-WROOM-32 development board with micro-USB port and Wi-Fi module
Front view of ESP32-S2 Mini development board with purple PCB and USB-C port
Front view of ESP32-S2 development board with purple PCB, USB-C port, and expansion connectors

Specialized Modules

WROVER series (ESP32 / S3): On-module PSRAM for camera/UI/ML-lite.
ESP32-H2 modules: 802.15.4 + BLE (no Wi-Fi) geared to Thread/Zigbee/Matter sleepy nodes.
Pico-form-factor and stamp modules: Ultra-compact for wearables and space-constrained designs.

ESP32 Board Comparison

This ESP32 comparison highlights typical configurations, though exact numbers vary by vendor and SKU—see this [ESP32 vs ESP8266 comparison] for detailed differences.

SCR-20250907-lwhc.png__PID:88797024-62fa-4c6f-970e-10c213be63f5

This ESP32 comparison highlights typical configurations, though exact numbers vary by vendor and SKU—see this [ESP32 vs ESP8266 comparison] for detailed differences.

Power consumption differences (rule of thumb)

Deep sleep (chip): One of the most notable ESP32 low power modes is deep sleep, where the chip can reach single-digit µA, though board consumption depends on regulators and LEDs (often 50–200 µA unless optimized).
Modem-sleep / light-sleep: tens of mA during bursts; design for duty-cycled radio use.
Active RX/TX: hundreds of mA peaks on Wi-Fi; size your regulator and bulk caps accordingly.

Price vs. performance

C3 generally leads for cost-sensitive BLE+Wi-Fi nodes.
S3/WROVER carry a small premium but unlock PSRAM-heavy scenarios (UI, camera, buffering).
C6/H2 add modern protocols (Thread/Zigbee/Matter); they are often considered among the best ESP32 boards when your roadmap requires advanced connectivity.

Best ESP 32 boards

Rapid prototyping: ESP32-DevKitC (WROOM), ESP32-S3-DevKitC-1, M5Stack/M5Stamp for fast enclosure/UI.
Battery IoT nodes: ESP32-C3 (optimize board quiescent current) or ESP32-H2 for 802.15.4/BLE sleepy roles.
Edge gateways & vision: ESP32-S3 with PSRAM (camera, small CNNs, USB gadgets)—check SunFounder’s [ESP32 Camera Extension] for practical projects.
Production: Pick the module you can purchase in volume (e.g., WROOM, WROVER, C3-MINI, S3-WROOM). Validate RF, certify, and lock the BOM early.

Development Environments

Arduino IDE (fast iteration)

ESP32 Arduino IDE is one of the most popular environments for beginners, known for fast iteration.

When to use: Quick proofs, hobby projects, simple products with known libraries.
Pros: Minimal setup, huge library pool, serial monitor is enough for many tasks.
Considerations: Less control over partitions, OTA, and power tuning; CI/CD is basic unless scripted.
https://www.arduino.cc/en/software/

ESP-IDF (Espressif IoT Development Framework)

ESP32 ESP-IDF (Espressif IoT Development Framework) is the production-grade environment for advanced firmware.

When to use: Production-grade firmware with FreeRTOS, dual-core scheduling, secure boot/flash encryption, tuned power states.
Pros: First-party drivers, CMake build, Component Manager, full toolchain control, robust logging/monitoring.
Considerations: Steeper learning curve; more boilerplate. Rewards you with stability and features.
https://www.espressif.com/en/products/sdks/esp-idf

PlatformIO (multi-ecosystem workflow)

ESP32 PlatformIO is a flexible option for teams working across multiple ecosystems and frameworks.

When to use: Teams, multiple boards, or mixed frameworks (Arduino core and ESP-IDF) in one workspace.
Pros: Per-env configs, library/version pinning, unit testing, debug integration
Considerations: Adds a layer over native toolchains—know how to drop to raw IDF/Arduino for edge cases.
https://platformio.org/

ESP32 Getting Started

1. Hardware & Software Requirements
ESP32 getting started begins with basic hardware and software requirements.
• An ESP32 development board (e.g., ESP32-DevKitC).
• USB cable (data-capable, not just charging).
• Computer with Arduino IDE, ESP-IDF, or PlatformIO installed.

2. Installing USB Drivers
Depending on your board’s USB chip:
CP210x → Silicon Labs driver https://www.silabs.com/software-and-tools/usb-to-uart-bridge-vcp-drivers
CH34x → WCH driver https://ftdichip.com/drivers/vcp-drivers/
FTDI → FTDI VCP driver https://ftdichip.com/drivers/vcp-drivers/
After installation, the board should appear as a COM port (Windows) or /dev/ttyUSB* / /dev/ttyACM* (Linux/macOS).
IMPORTANT ARDUINO IDE: Add Espressif’s ESP32 URL to Boards Manager

1. Go to File → Preferences (Arduino IDE 1.8.x) or Arduino IDE → Settings (2.x).

Screenshot of Arduino IDE Preferences window showing Additional Board Manager URLs field with ESP32 package link

2. In the field “Additional Board Manager URLs”, paste:
https://espressif.github.io/arduino-esp32/package_esp32_index.json
3. If there are other URLs already, click the icon at the right (📋) and add it on a new line.
4. Go to Tools → Board → Board Manager, as explained in SunFounder’s [ESP32 Starter Kit documentation]
5. Search for: esp32 and Select “esp32 by Espressif Systems”. Click Install (latest stable release is recommended).

3. Uploading Your First Program (Blink)
The Blink sketch is the “Hello World” of microcontrollers:
// Blink Example for ESP32
int ledPin = 2; // Most boards have the onboard LED on GPIO2
void setup() {
  pinMode(ledPin, OUTPUT); // set GPIO2 as output
}
void loop() {
  digitalWrite(ledPin, HIGH); // turn LED on
  delay(1000); // wait 1 second
  digitalWrite(ledPin, LOW); // turn LED off
  delay(1000); // wait 1 second
}

1. Open Arduino IDE → Tools > Board > ESP32 Dev Module
2. Select the correct COM port.

Screenshot of Arduino IDE showing Blink Example code for ESP32 Dev Module with LED control

3. Upload the sketch → you should see the onboard LED blink every second.

ESP32 development board powered via micro-USB with red LED indicator lit

ESP32 Tutorial: Simple Sensor Monitoring

A fundamental way to begin working with the ESP32 is through a sensor monitoring project. In this scenario, the ESP32 is connected to a basic environmental sensor—such as a temperature, humidity, or light sensor—and programmed to collect measurements at regular intervals.
The board then transmits the data via Wi-Fi or Bluetooth Low Energy (BLE) to a local dashboard, a mobile application, or even a cloud platform. By doing so, developers gain hands-on experience with data acquisition, wireless communication, and visualization.

This type of project is particularly valuable because it reflects many real-world IoT deployments, making it an excellent foundation for ESP32 IoT projects.
Home automation: Monitoring room conditions to optimize heating or lighting.
Industrial settings: Tracking machine temperature to prevent overheating.
Agriculture: Measuring soil moisture to trigger smart irrigation.

1) Hardware

• ESP32 dev board (DevKitC / S3 DevKit or similar)
• DS18B20 waterproof temperature probe (3-wire) + 4.7 kΩ resistor (pull-up)
• Micro-USB cable
• Jumper wires, breadboard

2) Wiring (DS18B20 → ESP32)

Wiring diagram of ESP32-WROOM-32 development board connected to DS18B20 temperature sensor with 4.7K pull-up resistor

3) Arduino IDE: setup & libraries

Install libraries (Library Manager):
√PubSubClient (MQTT)  
√OneWire
√DallasTemperature

Screenshot of Arduino IDE showing ESP32 code for DS18B20 temperature sensor with DallasTemperature and MQTT libraries installed

4) ESP32 Sketch (MQTT + DS18B20)

Paste, then fill in your Wi-Fi and broker IP. This publishes every 10 seconds and sets a Last-Will message.

#include <WiFi.h>#include <PubSubClient.h>
#include <OneWire.h>
#include <DallasTemperature.h>
// --------- USER SETTINGS ----------
const char* WIFI_SSID = "YOUR_WIFI";
const char* WIFI_PASSWORD = "YOUR_PASS";
const char* MQTT_HOST = "192.168.1.50"; // Raspberry Pi IPconst uint16_t MQTT_PORT = 1883;
const char* MQTT_CLIENT_ID = "esp32-temp-01";
const char* MQTT_TOPIC = "lab/esp32/temperature";
// ----------------------------------
#define ONE_WIRE_BUS 4 // DS18B20 data on GPIO4
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
WiFiClient wifiClient;

PubSubClient mqtt(wifiClient);
  unsigned long lastPublish = 0;
const unsigned long PUBLISH_INTERVAL_MS = 10000;

 void connectWiFi() {
   WiFi.mode(WIFI_STA);
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  Serial.print("Connecting WiFi");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.print("\nWiFi OK, IP: ");
  Serial.println(WiFi.localIP());
}

void ensureMqtt() {
  while (!mqtt.connected()) {
     Serial.print("Connecting MQTT...");
     // LWT to indicate offline status
     mqtt.setWill("lab/esp32/status", "offline", true, 1);
    if (mqtt.connect(MQTT_CLIENT_ID, "lab/esp32/status", 1, true, "online")) {
       Serial.println("connected");
      // Announce online mqtt.publish("lab/esp32/status", "online", true); } else {
       Serial.print("failed, rc="); Serial.print(mqtt.state()); S
erial.println(" retry in 3s");
      delay(3000);
    }
  }
}

void setup() {
  Serial.begin(9600);
  delay(50);
  connectWiFi();
   mqtt.setServer(MQTT_HOST, MQTT_PORT);
  sensors.begin();
}

void loop()
{ if (WiFi.status() != WL_CONNECTED) {
     connectWiFi();
  }
  if (!mqtt.connected()) {
    ensureMqtt();
  }
  mqtt.loop();

unsigned long now = millis(); i
f (now - lastPublish >= PUBLISH_INTERVAL_MS) { l
astPublish = now;

sensors.requestTemperatures();
    float tC = sensors.getTempCByIndex(0);

// Build compact JSON: {"temp_c":24.62,"rssi":-55}
    char payload[100];
    snprintf(payload, sizeof(payload), "
{\"temp_c\":%.2f,\"rssi\":%d}", tC, WiFi.RSSI());

Serial.print("Publish: ");
     Serial.println(payload);
    mqtt.publish(MQTT_TOPIC, payload, true); // retained
  }
}

1. Tools → Board: your ESP32 model
2. Tools → Port: the COM/tty of your board
3. Click Upload. Open Serial Monitor at 115200 to watch logs.

Screenshot of Arduino IDE Serial Monitor displaying ESP32 DS18B20 temperature readings in Celsius and Fahrenheit

Example Projects & Use Cases

Wi-Fi Web Server

• ESP32 hosts a simple webpage showing sensor values—see the [Get Started with ESP32 guide] from SunFounder.
• Users can toggle LEDs or relays via browser.
• Demonstrates HTTP server and GPIO control.

MQTT Publish/Subscribe

• ESP32 publishes sensor data to an MQTT broker (e.g., Mosquitto, HiveMQ).
• Another ESP32 or client subscribes and reacts (e.g., turns on a fan if temperature > 30 °C).
• Introduces cloud integration and scalable IoT.

Bluetooth Communication (BLE)

• ESP32 acts as a BLE peripheral (e.g., temperature beacon).
• Mobile app scans & reads values in real time.
• Shows how to build low-energy, app-connected devices.

Learning Path / Next Steps

A roadmap to help readers progress:
Wi-Fi Networking: Run a web server, connect to router.
MQTT Integration: Exchange messages with a broker, connect multiple devices.
Cloud Platforms: Send IoT data to AWS, Azure, or ThingsBoard dashboards.
Low-Power Optimization: Apply deep sleep for battery-driven nodes. AIoT with ESP32-S3: Run TensorFlow Lite Micro models for vision/voice at the edge

Conclusion

The ESP32 stands out as one of the most versatile and affordable microcontrollers for IoT and embedded systems. With its powerful wireless capabilities, flexible development environments, and wide range of board options, it enables both beginners and experienced developers to bring their ideas to life. From a simple Blink sketch to advanced projects involving web servers, MQTT, and cloud integration, the ESP32 provides a solid foundation for learning, prototyping, and production. Whether you are building smart home devices, industrial monitors, or edge AI applications, this ESP32 guide provides the knowledge and direction to begin your journey with confidence.

How to Install and Run UniFi Controller on a Raspberry Pi: Complete Guide Back to News Raspberry Pi Portainer: Complete Setup and Management Guide