RobotForge
Lesson 1: Meet the ESP32
tutorial·18 min read

Lesson 1: Meet the ESP32

A beginner-friendly walkthrough of the ESP32 microcontroller — what it is, why it's the best chip for your first robot, how to install the toolchain, and how to blink your first LED. Part of our 'Build Your First Robot' course.

Course · Lesson 1 of 8
Build Your First Robot
Free sample. Full course launching soon — join the waitlist for 40% off.
Join the waitlist →

Welcome to the first lesson of Build Your First Robot. Before we solder anything, before we spin a single motor, we need to understand the little chip that's going to be the brain of your robot: the ESP32. By the end of this lesson you'll have your development environment set up, your ESP32 plugged in, and a tiny blue LED blinking to confirm everything works.

If you've done Arduino before, this will feel familiar. If you haven't, you're in the right place — I'll explain everything as we go.

What you'll learn in this lesson

  • What the ESP32 is and why it's the best chip for hobby robotics in 2026
  • What to buy (with real links, not vague advice)
  • How to install USB drivers on macOS, Windows, and Linux
  • How to install the Arduino IDE and add ESP32 board support
  • How to upload your first program (blink an LED)
  • The 4 GPIO pin categories — which pins are safe and which will brick your boot
  • The #1 mistake beginners make when connecting servos, and how to avoid a brownout

What the ESP32 actually is

An ESP32 is a dual-core microcontroller made by Espressif Systems. In plain English: it's a tiny computer on a chip that can run your code, read sensors, control motors, and talk to Wi-Fi and Bluetooth — all for about $5. It replaced the older Arduino Uno and ESP8266 as the default hobby microcontroller around 2018, and in 2026 it's still the chip most tutorials, kits, and courses assume you have.

It runs at 240 MHz (most beginners never max it out), has 520 KB of RAM, 4 MB of flash on most dev boards, and 36 GPIO pins — though we'll see in a minute that only about half of them are truly usable for general-purpose I/O.

Why ESP32 for your first robot

  • Cheap. A "DevKit V1" board — the one we're using — costs $3–10 depending on where you buy. Order three and plan to fry one. You will.
  • Built-in Wi-Fi + Bluetooth. No extra shields. When we get to telling your robot what to do from a phone, it's already wired up.
  • Huge community. Every problem you'll have has been asked and answered on the Arduino Forum, Reddit, Random Nerd Tutorials, or Hackaday. You are never alone.
  • Arduino-compatible. You can use the Arduino IDE you already might know, with the same setup() and loop(). If you'd rather use Python, MicroPython runs on it. If you want production-grade FreeRTOS, ESP-IDF is there too.
  • 16 PWM channels. Enough to drive 6 servos directly, or 16 with a PCA9685 add-on. We'll cover this in Lesson 2.

The short version: if you asked three experienced roboticists what chip a beginner should start with in 2026, you'd get "ESP32" from all three.

What to buy

You have two paths: individual parts (cheaper, you know exactly what you're getting) or an all-in-one kit (pricier, everything tested together, better docs).

Path A: Individual parts (~$25–$40)

Item Recommended source Price
ESP32 DevKit V1 (30-pin, USB-C or Micro-B) Amazon (DIYmall, 2-pack) · Adafruit (official) · AliExpress (cheap) $3 – $15
USB Micro-B cable, data-capable (not power-only!) Amazon (StarTech 2m) — any phone charging cable works if it has data lines. $5
Solderless breadboard (830-point) Amazon (ELEGOO, 4-pack) $10
Jumper wires (M-M, M-F, F-F; 120-pc pack) Amazon (HiLetgo 200pc) $7
LEDs + 220 Ω resistors Amazon (Gikfun kit) — or any mixed resistor pack. $5

Links are Amazon US / Adafruit / AliExpress direct product URLs. Not affiliate yet — we may add affiliate tags in Phase 2; right now they're plain links because we'd rather you get the best price than we get $0.20.

Path B: All-in-one starter kit (~$60–$80)

If you hate shopping, buy a kit. You'll pay a premium of $20–30 over individual parts, but everything's pre-tested together and you get a printed tutorial.

I'll reference the DIYmall 2-pack ESP32 + the Gikfun LEDs for the rest of this course. If you have a kit, just use its equivalents.

Step 1 — Plug it in (and install drivers if needed)

Out of the box, the ESP32 DevKit V1 has a USB-to-serial chip (usually a CH340 from WCH, sometimes a CP2102 from Silicon Labs) that lets your computer talk to the microcontroller over USB. Most laptops don't have the driver preinstalled.

🎥
Video walkthrough: installing the CH340 driver on macOS
Coming soon — I'm recording this lesson myself as I follow it.

macOS

  1. Download the CH340 macOS driver from WCH (chip manufacturer's official site).
  2. Unzip, open the .pkg, follow the installer.
  3. Go to System Settings → Privacy & Security. If it says "System software from developer 'WCH.CN' was blocked," click Allow.
  4. Reboot. Yes, actually reboot.

Windows

  1. Download the CH340 Windows driver.
  2. Run the installer. Click "Install." Wait for the green check.
  3. If Windows 10/11 auto-installs a generic USB driver that doesn't work, use Device Manager to uninstall it and reinstall from the CH340 installer.

Linux

Works out of the box on kernel ≥ 3.4 (so, since 2012). Just plug it in. You may need to add yourself to the dialout group:

sudo usermod -a -G dialout $USER
# then log out and back in

To check it worked: plug in the ESP32 with your USB cable. On macOS, open Terminal and run ls /dev/tty.* — you should see something like /dev/tty.usbserial-0001 or /dev/tty.wchusbserial1410. On Windows, check Device Manager for a new "USB-SERIAL CH340" entry. On Linux, ls /dev/ttyUSB*.

Step 2 — Install the Arduino IDE

You have three options for writing code for the ESP32. For Lesson 1, use Arduino IDE. It's the simplest and matches 90% of the tutorials online.

  • Arduino IDE — easiest, single-file sketches, huge example library. Use this.
  • PlatformIO (VS Code extension) — better for multi-file projects. Migrate to this around Lesson 4.
  • ESP-IDF — Espressif's professional framework. Overkill for now; we don't use it in this course.

Install

  1. Download Arduino IDE 2.x (the newer one with a built-in library manager and decent autocomplete).
  2. Install and open it.
  3. Go to Arduino IDE → Settings (Preferences on Windows/Linux).
  4. In the "Additional Boards Manager URLs" field, paste:
    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  5. Click OK.
  6. Go to Tools → Board → Boards Manager. Search "esp32". Install "esp32 by Espressif Systems" (the first result). Wait 2–5 minutes — it's downloading ~300 MB of toolchain.
  7. Go to Tools → Board → esp32. Select "ESP32 Dev Module."
  8. Go to Tools → Port. Pick the port you found in Step 1.
🎥
Video walkthrough: Arduino IDE + ESP32 board support install
Recording in progress.

Step 3 — Your first program: blink an LED

The Blink sketch is the "Hello World" of hardware. Every microcontroller tutorial in the world starts here, and for good reason: it tests your compiler, your USB connection, and your understanding of GPIO in one 15-line program.

Your ESP32 DevKit has a tiny blue LED built into the board, wired to GPIO 2. We'll blink that first — no external wiring needed.

In Arduino IDE, open File → New Sketch and paste this:

#define LED 2

void setup() {
  pinMode(LED, OUTPUT);
}

void loop() {
  digitalWrite(LED, HIGH);
  delay(500);
  digitalWrite(LED, LOW);
  delay(500);
}

Hit the Upload button (the right-arrow icon in the top-left). You should see compile output at the bottom, then:

Connecting........_____........
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core...
Writing at 0x00000000... (100%)
Hash of data verified.
Leaving...
Hard resetting via RTS pin...

The blue LED on the board should now blink every half-second.

If you get stuck on "Connecting.....____......" and it times out: hold down the BOOT button on the ESP32 while you click Upload, and release it once you see "Writing at 0x..." in the console. Some boards need this; newer ones auto-reset.

🎥
Video: Upload + blink demo (with the BOOT button trick)
Recording soon.

If the LED is blinking — congratulations, you're a robotics programmer. That's not hyperbole. From here, everything we add is just "connect more things and write more logic." The core skill is what you just did.

Step 4 — Understanding ESP32 pins (the part that trips everyone up)

The ESP32 has 36 labeled GPIO pins, but — and this is where people get frustrated — only about 18 of them are truly usable for general purpose I/O. Let's break them into four categories.

✅ Safe to use (your go-to pins)

GPIO 4, 5, 13, 14, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33. These are regular bidirectional digital I/O. Use these for your servos, LEDs, buttons, sensors — everything. Start from this list when designing any circuit.

⚠️ Input-only (can read but not write)

GPIO 34, 35, 36, 39. These pins can't output and have no internal pull-up/pull-down. They're great for things like reading an analog sensor, but useless for driving an LED or sending a PWM signal to a motor.

🚫 Don't touch — connected to internal flash

GPIO 6, 7, 8, 9, 10, 11. These are wired to the ESP32's SPI flash memory. Using them for anything else will, at best, cause garbled behavior, and at worst, brick your chip's ability to boot. Never use these.

🟡 Strapping pins — work, but be careful at boot

GPIO 0, 2, 5, 12, 15. These control boot behavior. The ESP32 samples them when powered on to decide "normal boot vs flash mode" and "log level." If you have external circuitry pulling them in an unexpected direction at boot, the chip won't start.

Rule of thumb: avoid strapping pins for anything connected to external hardware that's powered before the ESP32. If you have to use them, add the external device after the ESP32 has booted (via a MOSFET or relay), or accept that you'll need to unplug things to reflash.

I'll put a printable cheat sheet of this in Lesson 2. For now, keep this tab open.

Essential reference: Random Nerd Tutorials' ESP32 Pinout Reference — bookmark this. It's the single most-linked ESP32 page on the internet for a reason.

Step 5 — The brownout that ends 50% of first robot builds

This is the mistake you're most likely to make when we get to Lesson 2 (motors). Flagging it now so it doesn't catch you later.

When you plug a hobby servo (like the SG90 we'll use in Lesson 2) into your ESP32's 5V or VIN pin, it looks like it works for a second. The servo twitches. You write the code. It runs. And then — the moment the servo tries to actually move against any load — your ESP32 suddenly resets. It prints some gibberish to the serial monitor like:

Brownout detector was triggered
ets Jun  8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

That's a brownout. The servo under load pulls 250–500 mA. The onboard USB voltage regulator on your dev board can only supply about 500 mA total — and it needs most of that for the ESP32 itself. The voltage dips below the ESP32's minimum, the chip resets, and your robot stops.

The fix: never power servos, motors, or LED strips from the ESP32's USB rail. Give them their own 5V supply (USB power bank, phone charger, or a 4× AA battery pack with a boost converter) and just share ground with the ESP32.

We'll wire this up properly in Lesson 2. For now, just know it's coming.

🎥
Bonus video: I'll demo what a brownout looks like on camera
So you recognize it when it happens to you.

Troubleshooting cheat sheet

Symptom Most likely cause Fix
No port shows up in Arduino IDE Driver not installed, or cable is power-only Reinstall CH340 driver; try a different USB cable
Connecting......_____...... timeout Auto-reset circuit didn't trigger Hold BOOT button during upload
Upload fails with "Permission denied" (Linux) User not in dialout group sudo usermod -a -G dialout $USER then reboot
LED doesn't blink, but upload succeeded Your dev board's built-in LED might be on GPIO 5 or 22 instead of 2 Change #define LED 2 to 5, re-upload. Still nothing? Wire an external LED to GPIO 4 with a 220 Ω resistor to GND.
Chip keeps resetting; gibberish on serial Brownout (peripheral drawing too much current) Remove everything connected. Does it stop resetting? Add peripherals back one at a time; the one that triggers the reset needs its own supply.
Flash failed; chip won't re-enter bootloader Strapping pin (GPIO 0, 2, 12, 15) held to a wrong level by external circuit Unplug everything from those pins, then flash

Where to go from here

If you want to go deeper than this lesson covers before Lesson 2 ships, here's where I'd send you:

  • Random Nerd Tutorials — Getting Started with ESP32: A more detailed walkthrough of the same material, with screenshots of every step.
  • Espressif's Official Blink Tutorial: Has a live in-browser simulator (Wokwi) so you can practice uploading code even if your hardware isn't here yet.
  • arduino-esp32 on GitHub (16.6k stars): The official Arduino core. The libraries/ folder has example sketches for every peripheral on the chip. This is the "source of truth" for any library questions.
  • SparkFun ESP32 Tutorials: Excellent hookup guides for interfacing sensors.
  • MicroPython (21.6k stars): If you'd rather write Python than C, MicroPython runs on the ESP32. We're using Arduino C for this course because it's what 90% of robotics libraries target, but MicroPython is a perfectly valid alternative for hobby work.

What's next

In Lesson 2 (Motors, drivers, and PWM), we'll connect our first servo, wire up a proper external power supply (so we don't trigger that brownout we just discussed), and write code that sweeps a servo back and forth. That's the last lesson before we start actually building the robot chassis in Lesson 3.

Lesson 2 launches when the course launches
Get notified at launch — and save 40%

Waitlist members get early access, 40% off launch pricing, and the complete "Build Your First Robot" course when it drops. One email at launch. Zero spam.

Join the waitlist →

Hey — I'm writing and recording this course as I learn it myself. If you hit something in this lesson that breaks, or a link that's dead, email hi@robotforge.org — I'll fix it the same day.

Liked this?

Get a new one in your inbox. No spam. Unsubscribe in one click.