Esp32

How to Change ESP32 Bluetooth Name

ESP32 is a low-cost microcontroller board that gives us dual Bluetooth capability that is Bluetooth low energy and Bluetooth classic. Using ESP32 Bluetooth we can automate plenty of tasks such as controlling LED or a security camera system inside a specific range. Here this article highlights the steps needed to customize the ESP32 Bluetooth name.

Introduction to ESP32 Bluetooth

ESP32 is a low cost and power conserving microcontroller board that has both Bluetooth classic and Bluetooth low energy. Like Arduino in ESP32 we don’t need any external Bluetooth sensor such as HC-05.

ESP32 has a built-in Bluetooth module that can be configured in both modes (BLE and Classic).

Here is a detailed description on both these ESP32 Bluetooth modes:

Now we have some knowledge related to ESP32 Bluetooth. Let’s configure ESP32 Bluetooth and change its name later.

Configure ESP32 Bluetooth

To configure ESP32 Bluetooth we have to include the Bluetooth serial library. Using this library ESP32 Bluetooth can be turned ON.

Open Arduino IDE upload given code in ESP32 board:

This code started by including the Bluetooth serial library file. After that Bluetooth connection is established with the name of ESP32 BT.

#include "BluetoothSerial.h"

BluetoothSerial SerialBT;
 
void setup() {

  SerialBT.begin("ESP32 BT");

}
void loop() {
}

As Bluetooth connection is established now we will connect ESP32 Bluetooth with any of the devices such as PC or smartphone.

Connecting ESP32 Bluetooth with PC

As ESP32 Bluetooth is configured follow the steps to connect ESP32 Bluetooth with PC.

Step 1: Open Bluetooth and other devices settings in Windows:

Graphical user interface Description automatically generated

Step 2: Click Add a Bluetooth or other device:

Graphical user interface, text, application, email Description automatically generated

Step 3: Select Bluetooth device:

Graphical user interface, text, application Description automatically generated

Step 4: Click ESP32 BT. Here you will see any name of ESP32 which you defined inside the Arduino code.

Graphical user interface, text, application Description automatically generated

Step 5: Once the ESP32 Bluetooth is successfully connected below a message will appear:

Graphical user interface, text Description automatically generated

We have successfully connected our PC with ESP32 Bluetooth.

Changing ESP32 Bluetooth Name

Now to change ESP32 Bluetooth we will use the same code as described earlier. Now replace any other name in the SerialBT.begin() command.

Here we have changed the ESP32 name from ESP32 BT to Espressif ESP32.

Upload given code to assign a new name to ESP32 Bluetooth.

Graphical user interface, text Description automatically generated

#include "BluetoothSerial.h"

BluetoothSerial SerialBT;
 
void setup() {

  SerialBT.begin("Espressif ESP32 ");

}
void loop() {
}

Now by following the same steps mentioned earlier connect ESP32 with PC. Here we can see the updated name of ESP32 Bluetooth on the list.

Graphical user interface, text, application, email Description automatically generated

We have successfully changed the ESP32 Bluetooth name.

Conclusion

ESP32 comes with Bluetooth support and sometimes we are working with multiple ESPs Bluetooth inside a single project so different Bluetooth names must be given to each board so they can be identified easily. This article covers all steps needed to change ESP32 Bluetooth.

About the author

Kashif

I am an Electrical Engineer. I love to write about electronics. I am passionate about writing and sharing new ideas related to emerging technologies in the field of electronics.