ESP32 UNO - DIYables Bluetooth App Monitor
Overview
Cut the USB cable and still read your log: an ESP32 Uno Bluetooth monitor sends every status line to the DIYables Bluetooth App on your phone. The ESP32 Uno form board has a BLE radio and a Classic Bluetooth radio, so this wireless serial monitor runs on iPhone and Android alike. You type short command words in the app, and the board answers right in the same scrolling list.
By the end, you can:
- Add the DIYables Bluetooth library and flash a monitor sketch
- Choose BLE or Classic Bluetooth to match your phone
- Watch heartbeat, uptime and free memory lines arrive every 3 seconds
- Switch an LED with the LED_ON and LED_OFF commands from the phone
- Stream sensor values and button events for remote debugging

Pick your radio
| Sketch | Radio | Phones | Pairing |
|---|---|---|---|
| Esp32BLE_Monitor | BLE (Bluetooth Low Energy) | Android and iOS | None, scan inside the app |
| Esp32Bluetooth_Monitor | Classic Bluetooth | Android only | One time, in the phone settings |
Good to know: iPhones do not list Classic Bluetooth hobby boards at all. If one of your users has iOS, use the BLE sketch.
Features
Here is what the monitor sketches already do before you edit them.
| Feature | What You Get |
|---|---|
| Live log on the phone | Text lines show up in the app as soon as the board sends them |
| Command input | Words you type in the app reach a handler in your sketch |
| Board facts | Uptime, free heap, CPU speed and chip model on request |
| LED test | LED_ON and LED_OFF give a fast "is it alive" check |
| Timed lines | A heartbeat, uptime or heap line every 3 s while a phone is linked |
| Two radio modes | BLE for iOS and low power, Classic Bluetooth for Android-only builds |
Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Buy Note: Use the LED Module for easier wiring. It includes an integrated resistor.
The log itself needs only the board and the cable. The LED and resistor let the LED_ON and LED_OFF commands show a visible result.
ESP32 Uno Pinout
The Bluetooth radio sits inside the chip, so the log uses no header pin. The LED and the sensor examples do, and this diagram turns each Uno label into the GPIO number you write in code.

How to Connect the Test LED
By the end of this part, the LED for the command test is on the board.
The Uno headers of this board have no built-in LED, so the sketches drive an external LED on D13 (GPIO18).
| LED Pin | ESP32 Uno Pin |
|---|---|
| Anode (long leg) through a 220 ohm resistor | D13 (GPIO18) |
| Cathode (short leg) | GND |
Good to know: ESP32 Uno pins give 3.3V, so a 220 ohm resistor keeps the LED current low and safe.
ESP32 Uno Code
By the end of this part, the library is in Arduino IDE and one monitor sketch runs on the board.
Upload and Test
- First time with this board? Set it up with ESP32 Uno - Getting Started before you continue.
- Build the circuit by following the LED table above.
- Plug in the USB Type-C cable between the ESP32 Uno and your computer.
- Select the board in Arduino IDE: pick ESP32 Dev Module and the COM port of the board (CH340).
- Open the Library Manager from the Libraries icon in the left bar.
- Search for "DIYables Bluetooth" and find the entry made by DIYables.
- Press Install.
- Search for DIYables Bluetooth created by DIYables and click the Install button.
- Take the helpers too. A popup lists other libraries it depends on. Press Install All.
- Give the code more flash. Set Tools > Partition Scheme to Huge APP (3MB No OTA/1MB SPIFFS). A Bluetooth sketch does not fit the default space.
Choose one radio below and upload only that sketch.
Classic Bluetooth Monitor (Android phones only)
WARNING
iPhones cannot reach a Classic Bluetooth board. For iOS, go to the BLE sketch.
On the phone, this sketch appears as ESP32_Monitor. It knows HELP, LED_ON, LED_OFF, STATUS, HEAP and CLEAR, and sends a timed line every 3 s.
- Get the code from File Examples DIYables Bluetooth Esp32Bluetooth_Monitor, or paste the code below into a new sketch. The library example uses pin 2 for the LED; change it to 18 (D13).
- Press Upload and wait for "Done uploading".
- Open the Serial Monitor at 115200 baud.
- Read the start lines:
BLE Monitor (Android and iOS)
Over BLE, the board shows up as ESP32BLE_Monitor. It has the same log and commands, minus CLEAR, and uses less power.
- Get the code from File Examples DIYables Bluetooth Esp32BLE_Monitor, or paste the code below. Again, move the LED pin from 2 to 18 if you start from the library example.
- Press Upload and let it finish.
- Open the Serial Monitor at 115200 baud.
- Read the start lines:
- Pro tip: give the board a name of your own, such as GardenLog, by changing DEVICE_NAME (BLE) or the text in DIYables_Esp32Bluetooth bluetooth("...") (Classic). With several boards in one room, you then tap the right one at once.
Mobile App
By the end of this part, your phone is linked and the Monitor screen shows the live log.
Step 1 — Install the app
Get the DIYables Bluetooth App: Android | iOS
Step 2 — Pair (Classic Bluetooth only)
With the BLE sketch, skip this step. With the Classic sketch, pair the board on your Android phone first:
- Open Settings > Bluetooth and switch Bluetooth on.
- Wait for the device list, then choose "ESP32_Monitor".
- Accept the request. There is no PIN.
- Check that the name now says "Paired".
Step 3 — Allow permissions
Start the app. The first time, it asks for:
- Nearby Devices (Android 12 and newer) or Bluetooth (iOS), to scan and connect
- Location (Android 11 and older only), because those versions need it for BLE scans
Step 4 — Connect
Switch on Bluetooth on the phone, then press Connect. A single scan finds BLE and Classic boards.

Tap the name that fits your sketch:
| Sketch | Name in the Scan List |
|---|---|
| Classic Bluetooth | ESP32_Monitor |
| BLE | ESP32BLE_Monitor |
Step 5 — Open Monitor
Once linked, the app returns to its home screen. Tap the Monitor tile.

※ NOTE THAT:
The settings icon on the home screen hides or shows tiles. The DIYables Bluetooth App User Manual covers every screen.
Step 6 — Send a command
Log lines start to scroll. Type LED_ON in the input box and tap Send. The LED on D13 lights, and a confirmation line appears.

Back in Arduino IDE, the Serial Monitor shows a short session like this:
Now try the rest: HELP, STATUS, LED_OFF and HEAP. STATUS answers with the LED state, uptime such as Uptime: 0h 2m 41s, free heap and the number of timed lines sent.
Video Tutorial
See the ESP32 Uno build in action in the video below.
The demo uses the Classic Bluetooth sketch with the LED on D13 (GPIO18).
Shape the Monitor Code for Your Build
By the end of this part, you know the three building blocks behind every monitor project.
| Code Part | What It Does |
|---|---|
| bluetoothMonitor.send() | Adds one text line to the phone log |
| bluetoothMonitor.onMonitorMessage() | Runs your handler for each word typed in the app |
| setOnConnected() / setOnDisconnected() | Runs your code when the phone links or leaves |
| bluetooth.isConnected() check in loop() | Sends timed lines only while someone is listening |
Send Log Lines
Call send() from any place in the sketch. Tags such as [INFO] or [WARN] make the log easy to scan.
Answer Commands from the App
The handler gets the typed word as a String. Compare it and act. The LED is the one on D13 (GPIO18).
Each new word is one more else if. For example, PUMP_ON / PUMP_OFF can drive a relay, and READ can reply with a fresh sensor value.
React to Link Events
A welcome block tells the user which words work. Put it in the connect callback.
The result: with these parts you get a two-way debug channel, and the rest of the sketch stays free for your own job.
ESP32 Uno vs UNO R4 for This Project
Moving this monitor from the UNO R4 WiFi to the ESP32 Uno changes the platform file, the LED and the serial speed.
| Item | Arduino UNO R4 WiFi | ESP32 Uno |
|---|---|---|
| Logic voltage | 5V | 3.3V |
| Bluetooth types | BLE only | BLE and Classic Bluetooth |
| Example sketch | ArduinoBLE_Monitor | Esp32BLE_Monitor or Esp32Bluetooth_Monitor |
| Platform header | DIYables_ArduinoBLE.h | DIYables_Esp32BLE.h or DIYables_Esp32Bluetooth.h |
| Test LED | LED_BUILTIN | External LED on D13 (GPIO18) |
| Serial baud rate | 9600 | 115200 |
| Arduino IDE board | Arduino UNO R4 WiFi | ESP32 Dev Module plus Huge APP partition |
Your send() lines and command handler copy over as they are. Only the include, the class name and the pin numbers change. The ESP32 Uno also adds the HEAP command, because its core can report free memory with ESP.getFreeHeap().
Using the Monitor Screen
This part maps the screen and the command words of the example.
App Interface Controls
| Screen Part | Job |
|---|---|
| Log list | Shows every line from the board and scrolls down by itself |
| Input box | Holds the command you type, at the bottom |
| Send button | Ships the command to the board |
Built-in Commands
| Command | Answer from the Board |
|---|---|
| HELP | The list of known words |
| LED_ON | Lights the LED on D13 |
| LED_OFF | Switches the D13 LED dark again |
| STATUS | LED state, uptime, free heap and lines sent (Classic adds CPU speed and chip model) |
| HEAP | Free memory (Classic adds the minimum free heap and total heap size) |
| CLEAR | Sends an empty line (Classic sketch only) |
Programming Examples
Each block drops into a monitor sketch. Keep the Bluetooth setup from the full code. The Uno label sits in the comment, and the GPIO number goes in the code.
Rotating Status Lines
One line every 3 s that cycles through heartbeat, free heap and uptime.
Analog Sensor Log
A light sensor sits on A0 (GPIO2) and a voltage source on A1 (GPIO4). Both values go to the phone every 3 s. Readings run from 0 to 4095 on this 12-bit ADC, so the voltage formula divides by 4095 and scales to 3.3V.
Good to know: analogSetAttenuation(ADC_11db) opens the ESP32 Uno analog input to the full 0V to about 3.3V span. With a narrow range, readings reach 4095 too early and the sensor numbers look wrong. A typical log line reads [SENSOR] Light: 38% and [SENSOR] Voltage: 1.27V.
WARNING
A0 (GPIO2) is a boot strapping pin. If the sensor pulls it HIGH during an upload, the upload can fail. Unplug the sensor while you upload, or move it to A2 or A3 (GPIO35 or GPIO34) and change the pin in code. Keep every analog input at 3.3V or less.
Button Event Log
Instead of a timer, send a line only when something happens. Here a push button wired to D7 (GPIO14) logs every press and every release.
DHT22 Data Logger
A DHT22 data line on D2 (GPIO26) is read every 5 s. Type READ to get a value right away.
Good to know: power the DHT22 from the 3V3 pin, so its data line never goes above 3.3V.
Dashboard Block
This function prints a framed block of values. The light value comes from A3 (GPIO34), an input-only ADC1 pin. So setup() needs the analogSetAttenuation(ADC_11db) line too. The temperature, humidity and battery helpers are your own functions.
Header Pin Watcher
Six Uno pins are watched: D2, D3, D4, D5, D6 and D7. Each change is logged, and PINS lists all states. These pins avoid the boot strapping and input-only pins of the board.
Advanced Techniques
Two patterns for bigger sketches: tagged log levels and settings you change from the phone.
Log Levels
A helper puts a level tag in front of each line, so errors stand out.
Settings over Bluetooth
Change the interval or a verbose flag from the phone, with no new upload. For example, SET INTERVAL 7 sets 7 s.
Slow Loop Watchdog
This timer measures each pass of loop() and warns on the phone when one takes more than 100 ms.
BLE or Classic Bluetooth on the ESP32 Uno
Both sketches give the same log. Pick by phone type and power budget.
| Point | BLE (Esp32BLE_Monitor) | Classic (Esp32Bluetooth_Monitor) |
|---|---|---|
| iPhone | Works | Does not work |
| Android | Works | Works |
| Power draw | Lower | Higher |
| Pairing | None, connect in the app | Once, in phone settings |
| Speed | Enough for text lines | Higher throughput |
| Good choice for | Battery builds and mixed phones | Android-only builds with lots of data |
Mix the Monitor with Other Apps
One Bluetooth server can host several app screens. Here the Monitor works next to another one.
With Bluetooth Chat
The Monitor streams values by itself, and Chat answers questions.
With Bluetooth Slider
Log each slider move and the matching PWM value, so you can check your math.
Build Ideas
| Area | Ideas |
|---|---|
| Debugging | Cable-free log for a robot, live variable check, loop timing |
| Monitoring | Greenhouse readings, door and window states, battery level |
| Logging | Event list with uptime stamps, error alerts, sensor history |
| Learning | How BLE and Classic Bluetooth differ, command parsers, your own debug tool |
Try These Next
- ESP32 Uno - Bluetooth Chat for question and answer messages
- ESP32 Uno - Bluetooth Table for values in fixed rows
- ESP32 Uno - Bluetooth Plotter for live graphs
- ESP32 Uno - Multiple Bluetooth Apps to join the Monitor with other screens
- ESP32 Uno - Web Monitor for the same log in a browser over WiFi
More help: the API Reference of the DIYables Bluetooth library, the DIYables Bluetooth App page, and the Arduino community forums.
Debug Tips
Print the link state to the USB Serial Monitor. Then you see at once if the fault is on the board side or the phone side.
Troubleshooting
| Problem | Possible Cause | Solution |
|---|---|---|
| No COM port shows up in Arduino IDE | CH340 driver missing or a charge-only USB cable | Install the CH340 driver and use a USB cable that carries data |
| Upload stops at Failed to connect or Waiting for download | The chip did not enter upload mode | Hold the BOOT button while the upload starts, then let go |
| Error says the sketch is too big | The default partition is too small for Bluetooth | Set Tools > Partition Scheme to Huge APP (3MB No OTA/1MB SPIFFS) |
| The phone scan never lists the board | Sketch not running, phone Bluetooth off, or permissions denied | Check that the Serial Monitor shows Waiting for Bluetooth connection, switch Bluetooth on, allow Nearby Devices (Location on Android 11 and older) |
| ESP32_Monitor missing on an iPhone | Classic Bluetooth does not work with iOS | Upload the Esp32BLE_Monitor sketch instead |
| Classic sketch connects but drops at once | The board was never paired | Pair ESP32_Monitor in Android Bluetooth settings first |
| The log stays empty | Monitor tile not open, or bluetoothServer.loop() missing | Open the Monitor tile and keep bluetoothServer.loop() at the top of loop() |
| LED_ON gets a reply but the LED stays dark | LED on the wrong pin, LED turned around, or code still uses pin 2 | Wire the long leg through the resistor to D13 (GPIO18) and use pin 18 in code |
| Upload fails with the A0 light sensor connected | GPIO2 is a boot strapping pin pulled the wrong way | Unplug the sensor while uploading, or use A2 or A3 instead |
| Lines come late or cut off | Too many long lines for the link | Keep each line under 200 characters and send less often |
| Odd symbols in the Serial Monitor | Baud rate does not match | Set the Serial Monitor to 115200 baud |
FAQ
Is the Bluetooth monitor a full replacement for the USB Serial Monitor?
For reading your own log lines and sending short commands, yes. It shows only what you pass to bluetoothMonitor.send(), not Serial.print() output. Many makers send the same line to both, so the log works with or without the cable.
Should I pick BLE or Classic Bluetooth on the ESP32 Uno?
Pick BLE if any user has an iPhone, or if the board runs on a battery. Pick Classic Bluetooth only for Android-only builds that push a lot of text. The command handler is the same in both sketches.
Do I need extra parts to run the monitor?
No. The radio is inside the chip, so the board and a USB cable are enough. The LED on D13 with a 220 ohm resistor is only there to see the LED_ON and LED_OFF commands work.
Why is the LED on D13 and not on a built-in LED?
The Uno headers of the ESP32 Uno have no LED that the code can switch, and the library example uses GPIO2 (A0), which is a boot strapping pin. D13 (GPIO18) is a plain I/O pin, so the code writes 18.
How long can one log line be?
Keep each line under about 200 characters. Long lines or many lines in a short time can arrive late or cut off, mostly over BLE. Split a big report into several short lines.
Can several phones read the same log at once?
No, one phone links to the board at a time. When it disconnects, another phone can connect. For many viewers, use the WiFi Web Monitor page, which works in any browser on the network.
Why does my sketch need the Huge APP partition?
The Bluetooth stack takes a lot of flash. The default scheme leaves about 1.2MB for code, and the build fails. Huge APP (3MB No OTA/1MB SPIFFS) gives about 3MB, but you lose over-the-air updates.
Why does the code call analogSetAttenuation(ADC_11db)?
The sensor log reads A0 and A1 with analogRead(). With it, the ESP32 Uno ADC accepts about 0 to 3.3V, and that whole span turns into readings from 0 to 4095. Leave it out and the reading tops out at 4095 long before the signal reaches 3.3V. The UNO R4 does not need this line; only the ESP32 Uno does. Never feed the analog pin more than 3.3V.
Can I read A0 and A1 while Bluetooth is running?
Yes. A0 (GPIO2) and A1 (GPIO4) are ADC2 pins, and ADC2 only stops working while WiFi is on. Bluetooth alone does not block it. If you later add WiFi to the same sketch, move the sensors to A2 to A5 (GPIO35, 34, 36, 39) or GPIO32/33.
Can my sketch from the UNO R4 WiFi run as it is?
Not quite. Change the include to DIYables_Esp32BLE.h and the class to DIYables_Esp32BLE, set the baud rate to 115200, replace LED_BUILTIN with 18, and pick ESP32 Dev Module with the Huge APP partition. Your send() lines and command logic stay the same.
What if my project needs more pins than the Uno headers give?
The ESP32 Uno has a few extra holes near the power header: GPIO32 and GPIO33 (I/O, PWM, analog on ADC1, so they also work while WiFi is on) and GPIO15 (I/O, PWM, analog on ADC2). Add a strip of pin headers with solder, then put the plain GPIO number in your sketch. For an extra analog sensor in your log, GPIO32 or GPIO33 is the best pick. Two warnings: GPIO15 and GPIO0 (the IO0 pin at the unused Uno NC position) are boot strapping pins, and a wrong connection can stop the board from booting or uploading code, so use GPIO32/33 first. Never use the six holes under the digital header (SD0 to SD3, CMD, CLK = GPIO6 to GPIO11), because they are wired to the flash chip and using them crashes the board.