ESP32 Wireless

Table of Contents

  1. Lessons
    1. Lesson 1: Internet of Things
    2. Lesson 2: Bluetooth Serial
    3. Lesson 3: Bluetooth Web Serial
    4. Lesson 4: Introduction to BLE
    5. Lesson 5: Bidirectional BLE
  2. What’s next?

In this lesson series, you will explore what makes the ESP32 truly special: built-in wireless communication. You’ll connect to the cloud over WiFi, stream sensor data to your laptop wirelessly over Bluetooth Classic, build interactive p5.js visualizations using Web Serial, and learn Bluetooth Low Energy (BLE)β€”the protocol behind billions of IoT devices that works on iPhones, Android phones, and directly from Chrome via Web Bluetooth. πŸ“‘

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 the Fundamentals series first. You should be comfortable with the ESP32 board layout, 3.3V logic, the LEDC PWM API, and analogRead on the 12-bit ADC. Several lessons here also reference the Communication moduleβ€”particularly Web Serial, p5.js + Serial, and p5.js + Serial I/O.

A note on boards: Lessons 2 and 3 (Bluetooth Classic) require the original ESP32 since the ESP32-S3 lacks Bluetooth Classic hardware. All other lessons in this series work on both the original ESP32 and the ESP32-S3. If you only have an S3, you can skim or skip Lessons 2 and 3 and jump straight to Lesson 4 (BLE).

Lessons

Lesson 1: Internet of Things

Connect your ESP32 to WiFi and upload sensor data to the cloud using Adafruit IO. This is where the ESP32 truly shines! ✨

Lesson 2: Bluetooth Serial

Cut the wire! Pair your ESP32 with your Mac or Windows computer using Bluetooth Classic’s Serial Port Profile (SPP), which creates a virtual serial port that behaves exactly like a USB cable. Verify the wireless link with built-in OS tools (cat, screen, PowerShell) and Python’s pySerialβ€”the same library from the Communication module. Requires the original ESP32 (e.g., Adafruit Huzzah32, SparkFun ESP32 Thing, Espressif ESP32-DevKitC).

Lesson 3: Bluetooth Web Serial

Stream live sensor data over Bluetooth and visualize it in the browser. Build interactive p5.js sketches using Web Serial and the serial.js libraryβ€”the same tools from the Communication module, but wireless. Close the loop with bidirectional control: a browser slider that dims an LED on your breadboard wirelessly. Requires the original ESP32.

Lesson 4: Introduction to BLE

Learn Bluetooth Low Energy (BLE)β€”the protocol behind fitness trackers, smart home devices, and billions of IoT sensors. You’ll learn the peripheral/central model, the GATT data hierarchy of services and characteristics, and how to stream live sensor data to your phone and computer using notifications. Works with the ESP32-S3 and iPhones!

Lesson 5: Bidirectional BLE

Send data in both directions over BLE. Control the onboard NeoPixel by writing to a BLE characteristic from your phone, build a Web Bluetooth interface with sliders and a color picker that runs entirely in the browser, and learn the Nordic UART Service (NUS) for serial-like text communication over BLE.

What’s next?

Once you’ve completed the Wireless lessons, you’ll have a solid foundation for building WiFi-connected, Bluetooth-enabled, sensor-driven projects. Consider exploring more advanced topics like BLE HID devices (making your ESP32 act as a wireless keyboard or game controller), deep sleep for battery-powered projects, or building your own web server directly on the ESP32!


This website was developed by Professor Jon E. Froehlich and the Makeability Lab using Just the Docs. If you found the website useful or use it in your teaching, we'd love to hear from you: jonf@cs.uw.edu. This website and all code is open source (website GitHub, Arduino GitHub, p5js GitHub). You can find the MakeabilityLab_Arduino_Library here. Found an error? File a GitHub Issue.

Made with β™‘ by the The Makeability Lab logo which is a large geometric M with an embedded L