ESP32 Course

Learn GPIO, WiFi, Bluetooth, sensors, web dashboards, and ESP32-CAM basics.

Lesson 1: Why ESP32?

ESP32 is more powerful than ESP8266. It has WiFi, Bluetooth, many GPIO pins, ADC inputs, PWM, touch pins, and camera support on ESP32-CAM boards.

Most ESP32 pins are 3.3V logic. Do not feed 5V signal into GPIO pins.

Lesson 2: GPIO Output

const int ledPin = 2;

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

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

Lesson 3: PWM LED Dimming

const int ledPin = 2;

void setup() {
 ledcAttach(ledPin, 5000, 8);
}

void loop() {
 for (int value = 0; value <= 255; value++) {
  ledcWrite(ledPin, value);
  delay(10);
 }
}

If your ESP32 core is older, use ledcSetup and ledcAttachPin instead.

Lesson 4: WiFi Connection

#include <WiFi.h>

const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";

void setup() {
 Serial.begin(115200);
 WiFi.begin(ssid, password);
 while (WiFi.status() != WL_CONNECTED) {
  delay(500);
  Serial.print(".");
 }
 Serial.println(WiFi.localIP());
}

void loop() {
}

Lesson 5: Bluetooth Serial

#include "BluetoothSerial.h"

BluetoothSerial SerialBT;

void setup() {
 Serial.begin(115200);
 SerialBT.begin("OpenRoboHub-ESP32");
}

void loop() {
 if (SerialBT.available()) {
  char command = SerialBT.read();
  Serial.println(command);
 }
}

Lesson 6: ESP32-CAM Basics

Final Project: Smart Sensor Dashboard

Build an ESP32 dashboard that reads a sensor, hosts a web page, and displays live status.