Getting Started with ESP32: A Beginner's Guide
The ESP32 is one of the most versatile microcontrollers available today. With built-in WiFi and Bluetooth, it's the perfect starting point for IoT projects.
What You'll Need
- ESP32 DevKit v1 (available at Proto.supply)
- USB-C cable
- Arduino IDE 2.x
- A computer running Windows, macOS, or Linux
Step 1: Install Arduino IDE
Download the latest Arduino IDE from the official website. Version 2.x includes a modern editor with autocomplete, which makes working with ESP32 libraries much easier.
Step 2: Add ESP32 Board Support
Open File → Preferences and add this URL to the "Additional Board Manager URLs" field:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.jsonThen go to Tools → Board → Board Manager, search for "esp32", and install the package by Espressif Systems.
Step 3: Your First Sketch
Let's start with the classic blink sketch, but we'll add a WiFi scan to prove the wireless hardware works:
#include <WiFi.h>
void setup() {
Serial.begin(115200);
pinMode(2, OUTPUT); // Built-in LED on most ESP32 boards
// Scan for WiFi networks
Serial.println("Scanning for WiFi networks...");
int n = WiFi.scanNetworks();
Serial.printf("Found %d networks\n", n);
for (int i = 0; i < n; i++) {
Serial.printf(" %s (%d dBm)\n", WiFi.SSID(i).c_str(), WiFi.RSSI(i));
}
}
void loop() {
digitalWrite(2, HIGH);
delay(500);
digitalWrite(2, LOW);
delay(500);
}What's Next?
Once you've confirmed the basics work, try connecting to your home WiFi and serving a simple web page. The ESP32's dual-core processor can handle a lightweight HTTP server while still reading sensors — making it ideal for home automation dashboards.