13 / 20
Talk over Bluetooth
Pair a virtual phone and send ON or OFF to the board.
Run this experiment →Why it’s here
Pair the phone and send both commands; watch the LED and receive log.
How it works
Pair a virtual phone and send ON or OFF to the board. No. Classic Bluetooth SPP is a direct link and is supported by the original ESP32, not all newer variants. This guided model targets the original ESP32 and Arduino-ESP32 3.x; radio, acoustics, loads and mechanics are simplified.
Try it
- Open this experiment
- Pair the phone and send both commands; watch the LED and receive log.
Connections
- Bluetooth SPP — Original ESP32 + compatible phone client
- GPIO 2 — LED output
Example sketch
#include <BluetoothSerial.h>
BluetoothSerial SerialBT;
// Bluetooth Classic SPP: original ESP32, compatible client required.
void setup() {
pinMode(2, OUTPUT);
SerialBT.begin("ESP32-Learning");
}
void loop() {
if (SerialBT.available()) {
String command = SerialBT.readStringUntil('\n'); command.trim();
if (command == "ON") digitalWrite(2, HIGH);
if (command == "OFF") digitalWrite(2, LOW);
SerialBT.println(command);
}
}Check your understanding
Does Bluetooth Serial need a router?
Show the answer
No. Classic Bluetooth SPP is a direct link and is supported by the original ESP32, not all newer variants.