Submit

13 / 20

Talk over Bluetooth

Pair a virtual phone and send ON or OFF to the board.

Run this experiment →
ESP32 teaching illustration with module, GPIO headers and lesson components

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

  1. Open this experiment
  2. 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.

Sources

Arduino-ESP32 ↗ · GPIO reference ↗

MAKE A THOUGHTFUL CHOICE

Your shortlist, side by side.

Pricing models are indicative. Check each official website for current plans and limits.