A Beginner’s Tutorial on ESP32 Bluetooth | Learn ESP32 Classic Bluetooth
In this tutorial, we will learn about the Bluetooth feature of ESP32. ESP32 supports both the Classic Bluetooth v4.2 as well as the Bluetooth Low Energy (BLE) standards. Let us focus on the Classic Bluetooth in this ESP32 Bluetooth Tutorial. We will learn a little bit about architecture of Bluetooth in ESP32, how to configure, setup and start Bluetooth communication and also a couple of simple projects involving data transfer between ESP32 and a smart phone over Bluetooth Communication.
A Brief Note of ESP32 Bluetooth
Bluetooth is a great wireless communication technology that has been popular for quite few years. Operating in the unlicensed 2.4 GHz ISM (Industrial, Scientific and Medical) frequency band, Bluetooth is a short-range wireless communication technology with range up to 100 m.
ESP32 SoC integrates both the Bluetooth Link Controller (or Link Manager) and the Baseband into its silicon. Physically, only an external antenna is needed for proper Bluetooth Communication.
Since both Wi-Fi and Bluetooth operate at the same 2.4 GHz ISM frequency, the Wi-Fi Radio and the Bluetooth Radio share the same antenna in ESP32. If you take a look at the pinout of ESP32 SoC, there is only one pin for connecting to antenna (LNA_IN).
ESP32 supports both the Classic Bluetooth (Classic BT) and Bluetooth Low Energy (BLE) which can be configured with BLUEDROID Bluetooth Stack. ESP32 Bluetooth supports three types of Host Controller Interface (HCI): UART, SPI and VHCI (Virtual HCI) interfaces (only one can used at a time and UART is the default).