Bluetooth BLE (UART Service)

Bluetooth Low Energy (BLE) is the same short-range wireless technology used by wireless earbuds and fitness trackers — it's built to sip very little power.

Connectivity8 blocksMicroPythonC++

Bluetooth Low Energy (BLE) is the same short-range wireless technology used by wireless earbuds and fitness trackers — it's built to sip very little power. The Nordic UART Service (NUS) mode covered here turns that connection into something that feels just like a serial cable (the same kind you'd use to print text to your computer), except wireless: your board can send and receive plain text to a nearby phone, tablet, or computer using low power consumption.


1. Real-World Uses

BLE UART is the easiest way to get short-range, low-power wireless text/number exchange between your board and a phone:

  • A wireless "serial monitor" — read your project's sensor values from your phone, standing across the room, without a USB cable.
  • Simple remote control apps — pair a generic BLE terminal app (or a custom-built one) with your robot/project to send commands like "forward" or "stop" from a phone screen.
  • Telemetry without any Wi-Fi network — great for demos in places with no Wi-Fi (a classroom, a science fair booth), since BLE just needs the two devices near each other, no router or password.
  • Battery-friendly wearables and remotes — BLE uses far less power than Wi-Fi (Section 7.1), making it a better fit for small battery-powered gadgets that need to last for days, not hours.

2. Specifications & Service UUIDs

  • Compatible Boards: ESP32, Raspberry Pi Pico W, Pico 2 W.

[!IMPORTANT] Real BLE functionality is ESP32-only in C++. Every block below cleanly no-ops on a Pico board compiled to C++ (an empty statement, or a hardcoded false for the "Is Connected?" check) — Pico W/2W only get real BLE behavior in MicroPython mode.

  • Conflicts with: BLE HID and ESP-NOW (Sections 7.4/7.2) — you can't use this extension's blocks alongside either of those in the same project.
  • UUIDs (Nordic UART Service Standard):
    • Service UUID: 6E400001-B5A3-F393-E0A9-E50E24DCCA9E
    • TX Characteristic: 6E400003-B5A3-F393-E0A9-E50E24DCCA9E — Notify (MicroPython also allows Read on this one; the C++ side only ever declares Notify)
    • RX Characteristic: 6E400002-B5A3-F393-E0A9-E50E24DCCA9E — Write

3. How it Works (Auto-Detecting Message Dispatch)

Unlike ESP-NOW's explicit S:/N:/V: tag prefixes (Section 7.2), BLE UART auto-detects what kind of message just arrived, and can fire more than one receive-event block for the same incoming message:

  • The String Received handler always fires for anything received.
  • If the text also parses cleanly as a number, the Number Received handler also fires with that value.
  • Otherwise, if the text contains a : (and isn't a valid number), the Key-Value Received handler fires instead, splitting on the first :.

So sending "25.5" fires both String and Number Received; sending "Temp:25.5" fires String and Key-Value Received; sending "hello" fires only String Received.


4. Supported Blockly Blocks (9 Blocks)

Drawing the blocks…

5. Simulator Behavior

[!IMPORTANT] BLE runs without crashing in the browser-based Circuit Simulator now, but is completely inert — same category of gap as Wi-Fi (Section 7.1) and ESP-NOW (Section 7.2). The bluetooth module is now a stub that starts up without error, but no real central device (phone/PC) is ever simulated connecting:

  • Start BLE UART succeeds silently — it registers the service and "advertises," but nothing is actually broadcasting over the air.
  • Is Bluetooth Connected? always returns false — no central ever connects, so the connection list stays empty forever.
  • Send BLE Text / Send BLE Number / Send Key-Value Telemetry are all guarded by "is connected," so they never actually attempt to transmit anything.
  • On String/Number/Key-Value Received blocks never fire — nothing is ever received, because no phone or PC ever connects to write to the RX characteristic. As with Wi-Fi and ESP-NOW, this can only be meaningfully tested on real, uploaded ESP32 hardware — Pico boards can't test it for real either way, since their C++ path is a no-op (see the board-support note above).
Bluetooth BLE (UART Service) — OMS Parts