Arduino Nano ESP32 - DIYables Bluetooth App Table

Overview

This example implements structured data display on the Arduino Nano ESP32 using BLE (Bluetooth Low Energy) via the DIYables Bluetooth STEM app. Display sensor readings, system status, and any data in a clean table format on a smartphone, with named rows and real-time value updates. Suitable for dashboards, system monitoring, and multi-sensor displays.

Note: The Arduino Nano ESP32 supports BLE only — Classic Bluetooth is not supported. The DIYables Bluetooth App works on both Android and iOS with BLE.

Arduino Nano ESP32 Bluetooth Table Example - Structured Data Display via BLE Tutorial

Features

  • Named Rows: Define rows with labels (e.g., "Temperature", "Humidity")
  • Real-Time Updates: Push individual value updates efficiently
  • Structure Sync: Auto-send table structure on connection
  • Flexible Data: Display any string or numeric data
  • Up to 20 Rows: Support for multiple data fields
  • Android & iOS Support: BLE is compatible with both platforms
  • No Pairing Required: BLE connects without manual pairing

Hardware Preparation

1×Arduino Nano ESP32
1×USB Cable Type-A to Type-C (for USB-A PC)
1×USB Cable Type-C to Type-C (for USB-C PC)
1×Recommended: Screw Terminal Expansion Board for Arduino Nano
1×Recommended: Breakout Expansion Board for Arduino Nano
1×Recommended: Power Splitter for Arduino Nano ESP32

Or you can buy the following kits:

1×DIYables Sensor Kit (30 sensors/displays)
1×DIYables Sensor Kit (18 sensors/displays)
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you.
Additionally, some of these links are for products from our own brand, DIYables .

Arduino Nano ESP32 Code

Detailed Instructions

  • New to the Arduino Nano ESP32? Start with the Arduino Nano ESP32 getting started guide.
  • Connect the Arduino Nano ESP32 to your computer via USB.
  • Open Arduino IDE.
  • Select the Arduino Nano ESP32 board and the correct COM port.
  • Click the Libraries icon in the left sidebar.
  • Search for "DIYables Bluetooth" and select the DIYables Bluetooth library by DIYables.
  • Click Install.
Arduino Nano ESP32 DIYables Bluetooth library
  • When prompted to install dependencies, click Install All.
Arduino Nano ESP32 DIYables Bluetooth dependency

BLE Code

  • In Arduino IDE, open File Examples DIYables Bluetooth ArduinoBLE_Table, or paste the code into the editor.
/* * DIYables Bluetooth Library - ESP32 BLE Table Example * Works with DIYables Bluetooth STEM app on Android and iOS * * This example demonstrates the Bluetooth Table feature: * - Display structured data in a two-column table * - Real-time value updates for each row * - Perfect for sensor dashboards and status displays * * Tutorial: https://diyables.io/bluetooth-app * Author: DIYables */ #include <DIYables_BluetoothServer.h> #include <DIYables_BluetoothTable.h> #include <platforms/DIYables_Esp32BLE.h> // BLE Configuration const char* DEVICE_NAME = "ESP32BLE_Table"; const char* SERVICE_UUID = "19B10000-E8F2-537E-4F6C-D104768A1214"; const char* TX_UUID = "19B10001-E8F2-537E-4F6C-D104768A1214"; const char* RX_UUID = "19B10002-E8F2-537E-4F6C-D104768A1214"; // Create Bluetooth instances DIYables_Esp32BLE bluetooth(DEVICE_NAME, SERVICE_UUID, TX_UUID, RX_UUID); DIYables_BluetoothServer bluetoothServer(bluetooth); // Create Table app instance DIYables_BluetoothTable bluetoothTable; // Variables for demo data unsigned long lastUpdate = 0; const unsigned long UPDATE_INTERVAL = 1000; int counter = 0; void setup() { Serial.begin(115200); delay(1000); Serial.println("DIYables Bluetooth - ESP32 BLE Table Example"); // Initialize Bluetooth server with platform-specific implementation bluetoothServer.begin(); // Add table app to server bluetoothServer.addApp(&bluetoothTable); // Define table structure bluetoothTable.addRow("Temperature"); bluetoothTable.addRow("Humidity"); bluetoothTable.addRow("Pressure"); bluetoothTable.addRow("Counter"); bluetoothTable.addRow("Uptime"); bluetoothTable.addRow("Free Heap"); bluetoothTable.addRow("Status"); Serial.print("Table rows defined: "); Serial.println(bluetoothTable.getRowCount()); // Set up connection event callbacks bluetoothServer.setOnConnected([]() { Serial.println("Bluetooth connected!"); bluetoothTable.sendTableStructure(); updateTableValues(); }); bluetoothServer.setOnDisconnected([]() { Serial.println("Bluetooth disconnected!"); }); bluetoothTable.onDataRequest([]() { Serial.println("App requested table data"); bluetoothTable.sendTableStructure(); updateTableValues(); }); Serial.println("Waiting for Bluetooth connection..."); } void updateTableValues() { float temperature = 20.0 + random(0, 100) / 10.0; bluetoothTable.sendValueUpdate("Temperature", String(temperature, 1) + " °C"); int humidity = 40 + random(0, 21); bluetoothTable.sendValueUpdate("Humidity", String(humidity) + " %"); int pressure = 1000 + random(0, 21); bluetoothTable.sendValueUpdate("Pressure", String(pressure) + " hPa"); bluetoothTable.sendValueUpdate("Counter", String(counter)); counter++; unsigned long uptime = millis() / 1000; String uptimeStr = String(uptime / 3600) + "h " + String((uptime % 3600) / 60) + "m " + String(uptime % 60) + "s"; bluetoothTable.sendValueUpdate("Uptime", uptimeStr); bluetoothTable.sendValueUpdate("Free Heap", String(ESP.getFreeHeap()) + " bytes"); bluetoothTable.sendValueUpdate("Status", counter % 2 == 0 ? "Running" : "Active"); Serial.println("Table values updated"); } void loop() { bluetoothServer.loop(); if (bluetooth.isConnected() && millis() - lastUpdate >= UPDATE_INTERVAL) { lastUpdate = millis(); updateTableValues(); } delay(10); }
  • Click Upload to flash the sketch to the board.
  • Open the Serial Monitor.
  • The Serial Monitor output should look like:
COM6
Send
DIYables Bluetooth - Table Example Waiting for Bluetooth connection...
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

Mobile App

  • Install the DIYables Bluetooth App on your smartphone: Android | iOS

Note: The DIYables Bluetooth App works on both Android and iOS with BLE. No manual pairing is required.

  • Launch the DIYables Bluetooth App.
  • On first launch, grant the following permissions:
    • Nearby Devices (Android 12+) / Bluetooth (iOS) — required to scan and connect to Bluetooth devices
    • Location (Android 11 and below only) — required by older Android versions to scan for BLE
  • Ensure Bluetooth is enabled on your device.
  • Tap Connect on the home screen. The app will scan for BLE devices.
DIYables Bluetooth App - Home Screen with Scan Button
  • Tap "Arduino_Table" in the scan results.
  • After connecting, return to the home screen and open the Table app.
DIYables Bluetooth App - Home Screen with Table App

Tap the settings icon on the home screen to show or hide apps. See the DIYables Bluetooth App User Manual for details.

  • A table displays Temperature, Humidity, Pressure, Counter, Uptime, Free Memory, and Status rows — all updating in real time.
DIYables Bluetooth App - Table Screen

Now look at the Serial Monitor. The output will show:

COM6
Send
Bluetooth connected! Sending table updates... Temperature: 25.30 °C Humidity: 55.70 %
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

Creative Customization - Adapt the Code to Your Project

Define Table Structure

// Add rows during setup bluetoothTable.addRow("Temperature", "-- °C"); bluetoothTable.addRow("Humidity", "-- %"); bluetoothTable.addRow("Pressure", "-- hPa"); bluetoothTable.addRow("Status", "Initializing...");

Update Values

// Update by row name bluetoothTable.sendValueUpdate("Temperature", "25.5 °C"); bluetoothTable.sendValueUpdate("Status", "Running"); // Update by row index (0-based) bluetoothTable.sendValueUpdate(0, "25.5 °C"); bluetoothTable.sendValueUpdate(3, "Running");

Send Table Structure

// Re-send the full table structure to the app bluetoothTable.sendTableStructure(); // Handle data request from app bluetoothTable.onDataRequest([]() { bluetoothTable.sendTableStructure(); });

Programming Examples

Weather Station Dashboard

DIYables_BluetoothTable bluetoothTable(bluetoothServer); void setup() { bluetoothTable.addRow("Temperature", "-- °C"); bluetoothTable.addRow("Humidity", "-- %"); bluetoothTable.addRow("Pressure", "-- hPa"); bluetoothTable.addRow("Wind Speed", "-- m/s"); bluetoothTable.addRow("Rain", "None"); bluetoothTable.onDataRequest([]() { bluetoothTable.sendTableStructure(); }); } void loop() { bluetoothServer.loop(); static unsigned long lastTime = 0; if (millis() - lastTime >= 2000) { lastTime = millis(); bluetoothTable.sendValueUpdate("Temperature", String(readTemp(), 1) + " °C"); bluetoothTable.sendValueUpdate("Humidity", String(readHumidity(), 1) + " %"); bluetoothTable.sendValueUpdate("Pressure", String(readPressure(), 0) + " hPa"); } }

System Status Monitor

void setup() { bluetoothTable.addRow("Uptime", "0s"); bluetoothTable.addRow("Free RAM", "-- bytes"); bluetoothTable.addRow("WiFi RSSI", "-- dBm"); bluetoothTable.addRow("IP Address", "N/A"); bluetoothTable.addRow("Status", "Starting..."); } void loop() { bluetoothServer.loop(); static unsigned long lastTime = 0; if (millis() - lastTime >= 1000) { lastTime = millis(); unsigned long uptime = millis() / 1000; String uptimeStr = String(uptime / 3600) + "h " + String((uptime % 3600) / 60) + "m " + String(uptime % 60) + "s"; bluetoothTable.sendValueUpdate("Uptime", uptimeStr); bluetoothTable.sendValueUpdate("Status", "Running"); } }

Troubleshooting

Common Issues

1. Device not visible in the app

  • Confirm the board is powered on and the sketch is uploaded
  • Verify Bluetooth is enabled on your phone
  • On Android 11 and below, enable Location services as well

2. Table is empty or rows not showing

  • Ensure addRow() is called in setup() before connecting
  • Implement the onDataRequest callback to re-send structure
  • Verify sendTableStructure() is called

3. Values not updating

  • Check that sendValueUpdate() is being called in the loop
  • Verify the row name matches exactly (case-sensitive)
  • Ensure bluetoothServer.loop() is called in every loop iteration

4. Row names don't match

  • Row names are case-sensitive — "Temperature" ≠ "temperature"
  • Use row index (0-based) as an alternative to row names

5. Upload fails or board not recognized

  • Install the latest Arduino Nano ESP32 board package via Board Manager
  • Try a different USB cable or port

Project Ideas

  • Weather station dashboard
  • System resource monitor
  • Multi-sensor data display
  • Device configuration panel
  • IoT device status board

Next Steps

After completing the Bluetooth Table example, explore:

  1. Bluetooth Plotter — Graphical data visualisation
  2. Bluetooth Monitor — Text-based interaction
  3. Bluetooth Temperature — Gauge-style display
  4. Multiple Bluetooth Apps — Combine table with other app widgets

Support

For additional help:

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • 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!