ESP32 - DIYables Bluetooth App Table
Overview
The Bluetooth Table example provides a structured key-value data display accessible through the DIYables Bluetooth STEM app. Designed for ESP32 boards with support for both BLE (Bluetooth Low Energy) and Classic Bluetooth connections. Define named rows and update their values in real time — perfect for dashboards, sensor status panels, system monitors, and any application requiring organized data presentation.
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
- Structured Rows: Up to 20 named attribute rows
- Real-Time Updates: Update individual row values without refreshing the entire table
- Named Attributes: Each row has a descriptive label (e.g., "Temperature", "Status")
- Dynamic Values: Send any string value for each row
- Table Structure Sync: App requests table configuration on connect
- 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
Hardware Used In This Tutorial
Or you can buy the following kits:
| 1 | × | DIYables ESP32 Starter Kit (ESP32 included) | |
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
ESP32 Code
Quick Instructions
Follow these instructions step by step:
- If this is your first time using the ESP32, refer to the tutorial on setting up the environment for ESP32 in the Arduino IDE.
- 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.

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_Table example, or copy the above code and paste it to the editor of Arduino IDE
- 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:
ESP32 BLE Code (works with app on both Android and iOS)
- On Arduino IDE, Go to File Examples DIYables Bluetooth Esp32BLE_Table example, or copy the above code and paste it to the editor of Arduino IDE
- 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:
Mobile App
- 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_Table" 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_Table"
- For BLE: tap "ESP32BLE_Table"
- Once connected, the app automatically goes back to the home screen. Select the Table app from the app menu.

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.
- The table will populate with the attribute names and their current values

Now look back at the Serial Monitor on Arduino IDE. You will see:
- Watch the table values update in real time in the app
Creative Customization - Adapt the Code to Your Project
Define Table Rows
Add attribute rows to the table (up to 20 rows max):
Update Row Values
Update individual row values by attribute name or index:
Handle Data Requests from App
When the app connects or requests a refresh:
Clear and Rebuild Table
Handle Connection Events
How to Use the Table
App Interface
The table interface in the DIYables Bluetooth App shows:
- Attribute Column: Row labels defined by addRow()
- Value Column: Current values updated by sendValueUpdate()
- Auto-Refresh: Values update in real time as they arrive
Table Limits
- Maximum 20 rows per table (MAX_TABLE_ROWS = 20)
- Attribute names should be concise but descriptive
- Values are displayed as strings
Programming Examples
Sensor Dashboard
System Status Monitor
GPIO Pin Status Table
Analog Sensor Array
Advanced Programming Techniques
Conditional Formatting with Emojis
Event-Driven Updates
Hardware Integration Ideas
BME280 Weather Station Table
Connect a BME280 sensor to display temperature, humidity, and pressure in the table.
Multi-Sensor Dashboard
Connect multiple sensors (DHT22, BMP280, LDR, MQ-135) and display all readings as rows.
Device Info Panel
Display ESP32 system information: chip model, flash size, free heap, uptime, and MAC address.
BLE vs Classic Bluetooth - Which to Choose?
| Feature | BLE (Esp32BLE_Table) | Classic Bluetooth (Esp32Bluetooth_Table) |
|---|---|---|
| iOS Support | ? Yes | ? No |
| Android Support | ? Yes | ? Yes |
| Power Consumption | Low | Higher |
| Range | ~30-100m | ~10-100m |
| Data Rate | Lower | Higher |
| Pairing Required | No (auto-connect) | Yes (manual pairing) |
| Best For | Battery-powered, cross-platform | High throughput, Android-only |
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)
2. Table shows no data
- Ensure sendTableStructure() is called in the onDataRequest callback
- Verify rows are added with addRow() before sending updates
- Check Serial Monitor for "App requested table data" message
3. Values not updating
- Verify the attribute name in sendValueUpdate() matches exactly what was added with addRow()
- Check that your update interval timer is working
- Ensure Bluetooth is still connected
4. Missing rows in the table
- Maximum 20 rows are supported
- Check getRowCount() to verify all rows were added
- Rows must be added before sending the table structure
5. Connection drops frequently
- Move closer to the ESP32 (reduce distance)
- For BLE: Check for interference from other BLE devices
- For Classic Bluetooth: Ensure stable power supply to ESP32
6. 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 Bluetooth libraries
- This setting gives ~3MB by sacrificing the OTA (over-the-air update) partition
Debug Tips
Add comprehensive debugging:
Project Ideas
Monitoring Dashboards
- Weather station display (temp, humidity, pressure, wind)
- Server/network status monitor
- Plant care dashboard (soil moisture, light, temperature)
- Aquarium monitor (temperature, pH, TDS)
System Information
- ESP32 system diagnostics table
- WiFi connection details
- Memory usage tracker
- Battery status display
Data Logging
- Sensor min/max/average tracker
- Event counter display
- Timing statistics (response time, uptime)
- I/O pin state summary
Home Automation
- Room-by-room temperature display
- Device status overview
- Energy consumption summary
- Security sensor status
Integration with Other Bluetooth Apps
Combine with Bluetooth Plotter
Display values in table and visualize trends in plotter:
Combine with Bluetooth Monitor
Use table for structured data and monitor for log messages:
Next Steps
After mastering the Bluetooth Table example, try:
- Bluetooth Monitor - For free-form text logging
- Bluetooth Plotter - For visualizing data trends
- Bluetooth Temperature - For dedicated temperature display
- Multiple Bluetooth Apps - Combining table with other displays
Support
For additional help:
- Check the API Reference documentation
- Visit DIYables tutorials
- Arduino community forums