ESP32 Wireless
Table of Contents
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
analogReadon 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!