ESP32 Fundamentals
Table of Contents
In this lesson series, you will learn the foundations of programming the ESP32: how it differs from the Arduino Uno and Leonardo you’ve used before, how to set up your development environment, and how to use the ESP32’s hardware features—from GPIO and PWM to its 12-bit ADC and built-in capacitive touch sensing. By the end of this series, you’ll be comfortable enough with the board to dive into the Wireless series, where the ESP32 really shines.
The lessons are interactive and designed to be completed in order. All ESP32 code is open source and in this GitHub repository.
Before starting, we recommend completing both Intro to Electronics and Intro to Arduino. We build on concepts from those modules—like voltage dividers,
digitalWrite,analogWrite, and PWM—without re-explaining them in detail here.
Lessons
Lesson 1: Introduction to the ESP32
Learn about the ESP32 platform, how it compares to the Arduino Uno and Leonardo, and how to set up your development environment. You’ll get familiar with the pin diagram and important hardware differences like the 3.3V operating voltage.
Lesson 2: Blinking an LED
Write your first ESP32 program! The code is the same as the Arduino Blink lesson—the challenge here is getting comfortable with the new board and its pin layout.
Lesson 3: Fading an LED with PWM
Learn how to use PWM output on the ESP32 to fade an LED. This is where things start to diverge from Arduino: instead of analogWrite, the ESP32 uses the LEDC (LED Control) library, which gives you more control over PWM channels, frequencies, and resolutions.
Lesson 4: Analog Input
Use the ESP32’s 12-bit ADC to read a potentiometer and control an LED’s brightness—combining analog input with PWM output.
Lesson 5: Playing Tones
Learn how to play tones and melodies on the ESP32 using the tone() function (now supported in ESP32 Arduino core v3.x!) and the LEDC PWM library.
Lesson 6: Capacitive Touch Sensing
The ESP32 has built-in capacitive touch sensing hardware—no external components needed! In this lesson, you’ll use a bare wire (or aluminum foil) as a touch sensor to control an LED.
What’s next?
Once you’ve completed the Fundamentals lessons, move on to Wireless to learn about WiFi, Bluetooth Classic, and Bluetooth Low Energy (BLE)—the features that make the ESP32 truly powerful for IoT and physical computing projects!