The Multiple Bluetooth Apps example demonstrates how to combine multiple Bluetooth app interfaces into a single ESP32 project. Run Monitor, Chat, Slider, Joystick, Temperature, Plotter, Table, Analog Gauge, and Rotator all at once — accessible through the DIYables Bluetooth STEM app. Designed for ESP32 boards with support for both BLE (Bluetooth Low Energy) and Classic Bluetooth connections. This is ideal for complex projects that need multiple control and display interfaces simultaneously.
This example supports two Bluetooth modes:
ESP32 BLE (Bluetooth Low Energy): Works on both Android and iOS
ESP32 Classic Bluetooth: Works on Android only. iOS does not support Classic Bluetooth. Use BLE if you need iOS support.
Features
9 Apps in One: Monitor, Chat, Slider, Joystick, Temperature, Plotter, Table, Analog Gauge, and Rotator running simultaneously
Independent Callbacks: Each app has its own event handlers
Independent Timing: Different update intervals for each app
App Switching: Switch between apps freely in the mobile app
BLE & Classic Bluetooth: Choose the Bluetooth mode that suits your project
Cross-Platform: BLE mode works on both Android and iOS; Classic Bluetooth works on Android
Low Power Option: BLE mode consumes less power than Classic Bluetooth
Disclosure: Some of the links in this section are Amazon affiliate links, meaning we may earn a commission at no additional cost to you if you make a purchase through them. Additionally, some links direct you to products from our own brand, DIYables .
Connect the ESP32 board to your computer using a USB cable.
Launch the Arduino IDE on your computer.
Select the appropriate ESP32 board and COM port.
Navigate to the Libraries icon on the left bar of the Arduino IDE.
Search "DIYables Bluetooth", then find the DIYables Bluetooth library by DIYables
Click Install button to install the library.
You will be asked for installing some other library dependencies
Click Install All button to install all library dependencies.
> Important: Since this example includes many Bluetooth app libraries, the compiled sketch is larger than usual. You must select the correct partition scheme (see below).
Choose one of the two Bluetooth modes below depending on your needs:
ESP32 Classic Bluetooth Code (works with app on Android only)
Note: Classic Bluetooth is NOT supported on iOS. If you need iOS support, use the BLE code below.
On Arduino IDE, Go to File Examples DIYables Bluetooth Esp32Bluetooth_MultipleApps example, or copy the above code and paste it to the editor of Arduino IDE
Important: Go to Tools > Partition Scheme and select "Huge APP (3MB No OTA/1MB SPIFFS)". This is required because the multiple apps example uses significantly more flash space.
Click Upload button on Arduino IDE to upload code to ESP32
Open the Serial Monitor
Check out the result on Serial Monitor. It looks like the below:
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32 Dev Module
Newbiely.ino
···
8Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32 Dev Module' on 'COM15')
New Line
9600 baud
DIYables Bluetooth - ESP32 Multiple Apps Example
Waiting for Bluetooth connection...
Ln 11, Col 1
ESP32 Dev Module on COM15
2
ESP32 BLE Code (works with app on both Android and iOS)
On Arduino IDE, Go to File Examples DIYables Bluetooth Esp32BLE_MultipleApps example, or copy the above code and paste it to the editor of Arduino IDE
Important: Go to Tools > Partition Scheme and select "Huge APP (3MB No OTA/1MB SPIFFS)". This is required because the multiple apps example uses significantly more flash space.
Click Upload button on Arduino IDE to upload code to ESP32
Open the Serial Monitor
Check out the result on Serial Monitor. It looks like the below:
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32 Dev Module
Newbiely.ino
···
8Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32 Dev Module' on 'COM15')
New Line
9600 baud
DIYables Bluetooth - ESP32 BLE Multiple Apps Example
Waiting for Bluetooth connection...
Ln 11, Col 1
ESP32 Dev Module on COM15
2
Mobile App
Install the DIYables Bluetooth App on your smartphone: Android | iOS
If you are using the ESP32 Classic Bluetooth code, you need to pair the ESP32 with your Android phone before opening the app:
Go to your phone's Settings > Bluetooth
Make sure Bluetooth is turned on
Your phone will scan for available devices
Find and tap "ESP32 Multi-App" in the list of available devices
Confirm the pairing request (no PIN required)
Wait until it shows "Paired" under the device name
If you are using the ESP32 BLE code, no pairing is needed. Just proceed to the next step.
Open the DIYables Bluetooth App
When opening the app for the first time, it will ask for permissions. Please grant the following:
Nearby Devices permission (Android 12+) / Bluetooth permission (iOS) - required to scan and connect to Bluetooth devices
Location permission (Android 11 and below only) - required by older Android versions to scan for BLE devices
Make sure Bluetooth is turned on on your phone
On the home screen, tap the Connect button. The app will scan for both BLE and Classic Bluetooth devices.
Find and tap your device in the scan results to connect:
For Classic Bluetooth: tap "ESP32 Multi-App"
For BLE: tap "ESP32BLE Multi-App"
Once connected, the app automatically goes back to the home screen. The home screen shows all available apps. The 9 apps initialized in the Arduino code will respond and work — other apps on the home screen will appear but will not function with this sketch.
Note: You can tap the settings icon on the home screen to hide/show apps on the home screen. For more details, see the DIYables Bluetooth App User Manual.
Tap some of the following apps to open and interact with the ESP32: Monitor, Chat, Slider, Joystick, Temperature, Plotter, Table, Analog Gauge, Rotator
Switch between apps freely — they all share the same Bluetooth connection
Now look back at the Serial Monitor on Arduino IDE. You will see:
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32 Dev Module
Newbiely.ino
···
8Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32 Dev Module' on 'COM15')
Creative Customization - Adapt the Code to Your Project
How Multiple Apps Work
Each app is created as a separate object and registered with the same Bluetooth server. They share the single Bluetooth connection but operate independently:
// Include all app headers#include <DIYables_BluetoothMonitor.h>#include <DIYables_BluetoothChat.h>#include <DIYables_BluetoothSlider.h>#include <DIYables_BluetoothJoystick.h>#include <DIYables_BluetoothTemperature.h>#include <DIYables_BluetoothPlotter.h>#include <DIYables_BluetoothTable.h>#include <DIYables_BluetoothAnalogGauge.h>#include <DIYables_BluetoothRotator.h>// Create app instancesDIYables_BluetoothMonitor bluetoothMonitor;DIYables_BluetoothChat bluetoothChat;DIYables_BluetoothSlider bluetoothSlider(0, 100, 1);DIYables_BluetoothJoystick bluetoothJoystick;DIYables_BluetoothTemperature bluetoothTemperature(-10.0, 50.0, "°C");DIYables_BluetoothPlotter bluetoothPlotter;DIYables_BluetoothTable bluetoothTable;DIYables_BluetoothAnalogGauge bluetoothGauge(0.0, 100.0, "km/h");DIYables_BluetoothRotator bluetoothRotator(ROTATOR_MODE_LIMITED, 0, 180);// Register all apps with the Bluetooth serverbluetoothServer.addApp(bluetoothMonitor);bluetoothServer.addApp(bluetoothChat);bluetoothServer.addApp(bluetoothSlider);bluetoothServer.addApp(bluetoothJoystick);bluetoothServer.addApp(bluetoothTemperature);bluetoothServer.addApp(bluetoothPlotter);bluetoothServer.addApp(bluetoothTable);bluetoothServer.addApp(bluetoothGauge);bluetoothServer.addApp(bluetoothRotator);
You don't have to include all 9 apps. Choose only the ones you need:
// Example: Only Monitor + Slider + Temperature#include <DIYables_BluetoothMonitor.h>#include <DIYables_BluetoothSlider.h>#include <DIYables_BluetoothTemperature.h>DIYables_BluetoothMonitor bluetoothMonitor;DIYables_BluetoothSlider bluetoothSlider(0, 100, 1);DIYables_BluetoothTemperature bluetoothTemperature(-10.0, 50.0, "°C");voidsetup() {// ... Bluetooth server setup ... bluetoothServer.addApp(bluetoothMonitor); bluetoothServer.addApp(bluetoothSlider); bluetoothServer.addApp(bluetoothTemperature);// Only these 3 apps will appear in the mobile app}
Handle Connection Events
bluetoothServer.setOnConnected([]() {Serial.println("Bluetooth connected!");// Send initial values for all apps bluetoothTemperature.send(currentTemperature); bluetoothGauge.send(currentGaugeValue); bluetoothRotator.send(currentAngle);});bluetoothServer.setOnDisconnected([]() {Serial.println("Bluetooth disconnected!");});
How to Use Multiple Apps
App Switching
In the DIYables Bluetooth App:
The home screen shows all registered apps as buttons
Tap any app to open it
Use the back button or home button to return and switch to another app
All apps continue running on the ESP32 regardless of which app is shown
Data Flow
Input Apps (Slider, Joystick, Rotator, Chat): Send data from phone to ESP32
Output Apps (Monitor, Temperature, Plotter, Table, Gauge): Send data from ESP32 to phone
Bidirectional Apps (Chat, Monitor): Can send and receive data
> Note for Multiple Apps: Since multiple apps send data simultaneously, Classic Bluetooth's higher data rate can be beneficial if you have many fast-updating apps (e.g., plotter at 100ms). For battery-powered projects, BLE is still recommended.
Troubleshooting
Common Issues
1. Cannot find the device in the app
Make sure the ESP32 is powered on and the sketch is uploaded
For BLE: Ensure your phone's Bluetooth and Location are enabled
For Classic Bluetooth: Pair the device first in phone's Bluetooth settings
Check that the correct partition scheme is selected (Huge APP) — this is critical for multi-app examples
2. Sketch too large / not enough space
In Arduino IDE, go to Tools > Partition Scheme and select "Huge APP (3MB No OTA/1MB SPIFFS)" or "No OTA (Large APP)"
The default partition scheme only provides ~1.2MB for app code, which is not enough for the multi-app example
This setting gives ~3MB by sacrificing the OTA (over-the-air update) partition
If still too large, remove apps you don't need
3. Some apps not appearing in the mobile app
Ensure each app is registered with bluetoothServer.addApp()
Check that the include headers match the app objects created
Verify all apps are registered before bluetoothServer.begin()
4. Data updates are slow or delayed
Reduce the number of apps sending data simultaneously
Increase update intervals for less critical apps
BLE has limited bandwidth — stagger updates across time
5. ESP32 crashes or resets
Check available heap memory with ESP.getFreeHeap()
Reduce the number of table rows or plotter samples
Ensure power supply is adequate (USB 3.0 or external supply)
6. Connection drops frequently
Move closer to the ESP32 (reduce distance)
Reduce the total amount of data being sent
Stagger update intervals so apps don't all send at the same time
Energy monitor (Gauge + Plotter + Table + Monitor)
Next Steps
Now that you've mastered combining multiple Bluetooth apps, you have all the tools to build complex ESP32 projects with rich mobile interfaces. Explore each individual app tutorial for deeper API knowledge:
Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!