Thunkable Docs
Build an AppDrag and Drop DocsSnap to Place DocsAcademy
Drag and Drop
Drag and Drop
  • What is Thunkable?
  • 🗺️Getting Started
    • Gen AI
    • Getting Started Guide
    • Keyboard Shortcuts
    • Undo Redo
    • Thunkable Account
      • Account Management
    • Preview and Test your App
    • Versioning
    • Data Sources
      • Google Sheets Data Source
      • Airtable Data Source
      • Webflow Data Source
      • Local Table Data Source
    • Project Collaboration
      • Organizations
    • 🎓Sample Apps & Tutorials
      • Thunkable Community Forums
      • Sample Apps
      • Video Tutorials
        • Thunkable Live App
          • How to Test and Troubleshoot with Thunkable Live App
        • Data Source Tutorials
          • Connecting to Data Sources
            • Google Sheets
            • Local Table
          • Create Data in a Thunkable Data Source
          • Read Data in a Thunkable Data Source
          • Update Data in a Thunkable Data Source
          • Delete Data in a Thunkable Data Source
        • User Auth & Management
          • Firebase
            • User Sign-Up, Sign-In, and Auth
            • User Sign Out and Password Reset
          • Google
            • User Sign-Up, Sign-In, Sign-Out, and Auth
          • Apple
            • User Sign-Up, Sign-In, Sign-Out, and Auth
        • Projects
          • How to Save Versions of Your Thunkable Project
          • How to Copy and Customize Public or Sample Thunkable Projects
        • User Interface & Design
          • Screens
            • Save and Reuse Thunkable Screens
            • Change Thunkable Screens with a Button Click
            • Create Scrollable Screens in Your Thunkable App
          • Navigators
            • How to Use the Thunkable Stack Navigator
            • How to Use Thunkable Top and Bottom Tab Navigators
            • How to Use the Thunkable Drawer Navigator
            • Combine Figma Frames with Thunkable Navigators
          • Components
            • How to Use the Visibility Property to Create Modals in Thunkable
          • Data Visualization
            • Customize a Data Viewer
          • Text
            • Implement Text Input Validation
        • Alerts & Notifications
          • Display Alert Messages in Your Thunkable App
          • How to Create Three-Button Alert Messages
        • Files
          • Cloudinary
            • Store and Access Cloudinary Files in Your Thunkable App
        • Camera
          • How to Use the Device’s Camera
          • How to Use the Device’s Video Camera
          • Use the Device’s Camera as a QR or Barcode Scanner
        • Realtime Databases
          • Firebase
            • How to Read Data in a Firebase Realtime Database
            • How to Update Data in a Firebase Realtime Database
        • Advanced Blocks
          • Connect Your Thunkable App to a Web API
        • Thunkable Academy
          • Building Your First Thunkable App
            • Getting Started with Thunkable
            • How to Design a Thunkable App
            • How to Connect a Thunkable App to a Data Source
            • How to Make A Thunkable App Interactive with Blocks
          • Thunkable No Code App Creation Basics
            • Thunkable UI Components and App Features
            • Understanding Thunkable's Drag and Drop Block Builder
            • Design, Develop, Debug, and Deploy Your App
        • Hour of Code
          • 2021 - Build an Informational App
          • 2022 - Build a Scavenger Hunt App
          • 2023 - Build a Translator and Text-to-Speech App
        • App Building
          • How to Build a Translation App in Thunkable
          • How to Create an Image Recognition App with Thunkable
          • How to Create a Text-to-Speech App in Thunkable
  • 🎨App Design
    • User Interface (UI) Components
      • Basic Components
        • Button Component
        • Label Component
        • Rich Text Component
        • Image Component
        • Text Input Component
        • Layout Component
        • Group Component
      • Data Components
        • Simple List Component
        • Data Viewer Components
          • Data Viewer List Component
          • Data Viewer Grid Component
          • Custom Data Viewer
      • Input Components
        • Switch Component
        • Slider Component
        • Checkbox Component
        • Date Input Component
        • Time Input Component
      • Media Components
        • Animation Component
        • Video Component
        • Loading Icon Component
      • Embed Components
        • Web Viewer Component
        • Map Component
        • Canvas Component
        • PDF Reader Component
        • Rating Component
      • Modules
        • Introduction
        • User Guide
      • Generative AI
    • Screens
      • Save and Reuse Screens
      • Improve Thunkable Load Time
    • Navigators
      • Top Tab Navigator
      • Bottom Tab Navigator
      • Drawer Navigator
      • Stack Navigator
    • Figma Integration
  • 🛠️Blocks
    • Thunkable Blocks Overview
    • Core Blocks
      • Control Blocks
      • Logic Blocks
      • Math Blocks
      • Text Blocks
      • Lists Blocks
      • Color Blocks
      • Device Blocks
      • Objects Blocks
      • Variables Overview
        • Connect a Firebase Realtime Database
        • Variables Blocks
      • Functions Blocks
    • App Features Blocks
      • Speech Blocks
      • Sound Blocks
      • Share Blocks
      • Camera Blocks
      • Files Blocks
      • Sign In Blocks
        • User Sign Up, Sign In, and Authentication with Firebase
        • User Sign Up, Sign In, and Authentication with Google
        • User Sign Up, Sign In, and Authentication with Apple
      • Location Blocks
      • Push Notification Blocks
      • In-App Purchase Blocks (with RevenueCat)
      • Data Sources Blocks
      • Alerts Blocks
      • Timer Blocks
      • Sensors Blocks
        • Gyroscope
        • Magnetometer
        • Accelerometer
        • Location Sensor
      • Ads by AdMob
    • Advanced Blocks
      • Web APIs Blocks
        • CORS Policy
        • 🆓No Auth APIs
          • Update Data in a Data Source
          • CRUD Operations
          • Setting Headers
        • 📊Charting APIs
          • Create a chart template
          • Charting in Thunkable
      • Bluetooth Low Energy Blocks
      • OpenAI Services ChatGPT Integration Blocks
      • "Any Component" Blocks
      • JavaScript Web Bridge
  • ⚙️Settings
    • App Settings
      • Tablet View
    • Assets
    • Cloud Variable Viewer
    • Manage your Projects
      • My Projects Page
      • Thunkable Projects
      • Duplicate Project
      • Share Your App
      • Download Your App
        • Download Your App on iOS
        • Download Your App on Android
      • Add to Home Screen
      • Managing Project Storage
      • App Data Privacy
      • Delete Project
  • 📱Publishing
    • Overview
    • Publish to the Apple App Store
      • User Guide
      • Troubleshooting
      • Review Process
      • Tracking Usage Description
    • Publish to Google Play Store
      • User Guide
      • Troubleshooting
      • Review Process
    • Publish as a Web App
      • User Guide
      • Custom Domains
      • Troubleshooting
    • Testing
      • Testing on iOS via TestFlight
      • Testing on Android
    • Troubleshooting
      • Publishing Checklist
      • Generate Screenshots
  • 🎮Gaming
    • Gaming Overview
      • Canvas Label
      • Sprites
      • Sprite Gallery
    • Gaming Blocks
      • Events
      • Motion
      • Looks
      • Direction
      • Sensing
      • Add & Remove
      • Stage
  • 🗃️Additional Resources
    • Release Notes
      • Release Notes 2025
      • Release Notes 2024
      • Release Notes 2023
    • Troubleshooting
      • Can't Sign in to Thunkable?
      • FAQs
    • Minimum Requirements
    • Bugs and Product Feedback
    • App Services and Emulators
Powered by GitBook
On this page
  • Add a Bluetooth component to Thunkable
  • Deleting your Bluetooth Component
  • Functions
  • Scan
  • Connect to Device Id
  • Connect to Device Name
  • Subscribe To Characteristics
  • Characteristics Change
  • Disconnect
  • Receive String
  • Receive Byte Array
  • Listen for Disconnection
  • Transmit String
  • Transmit Byte Array
  • Transmit Hexadecimal
  • Transmit Base64

Was this helpful?

Export as PDF
  1. Blocks
  2. Advanced Blocks

Bluetooth Low Energy Blocks

PreviousCharting in ThunkableNextOpenAI Services ChatGPT Integration Blocks

Last updated 3 months ago

Was this helpful?

Description

Bluetooth Low Energy, or BLE, is used to wirelessly connect two devices to one another. The BLE component allows you to find and connect to BLE devices and to communicate directly with them.

BLE functionality can't be tested with the app on iOS. To test the BLE functionality in your app on iOS, please your app.

Add a Bluetooth component to Thunkable

To add a Bluetooth component to your app:

  • Go to your Blocks tab

  • Find the Advanced drawer of blocks. Click the drop-down menu icon to show the Advanced invisible components

  • Click the ⊕ icon next to the Bluetooth drawer

You will see a dialog to create your Bluetooth component. Click Submit to create the component, or Delete to dismiss the dialog without creating the component.

Deleting your Bluetooth Component

Once you have added at least one Bluetooth component to your app, you will be able to view all of your Bluetooth components under the Bluetooth drawer in the Advanced section of the Blocks tab.

To delete a Bluetooth component, click on the ⚙ icon next to the component's name to bring up the properties dialog and click Delete.

Functions

Version 1 of the BLE component in Thunkable ✕ contains 5 functions, each of which are documented in greater detail below.

Scan

This function is used to scan for nearby BLE or Bluetooth enabled devices. Scanning happens for 10 seconds. Once scanning has successfully completed then a list of the available device ids and a list of available names will be returned. If the scanning function can not be completed then an error will be returned.

Outputs

Output Name
Data Type
Description

Device Ids

List

Returns a list of the IDs of the available devices

Device Names

List

Returns a list of the names of the available devices

Device RSSIs

List

Returns a list of the signal strengths (in dBm) for the available devices, measured relative to 1 milliwatt

error

Text

Returns an error message from the function

Example

The Location Sensor returns a list of names of the available BLE devices which can be connected to a Simple List,

Connect to Device Id

The Connect to Device Id function allows your app to connect to a BLE enabled device based in the Id of that device.

Inputs

Input Name
Data Type
Description

Device Id

Text

Expects a text string with the device id you want to connect to

Outputs

Output Name
Data Type
Description

Device Name

Text

Returns the name of the device you have just connected to

error

Text

If an error message is returned, returns the error. Else returns null

Connect to Device Name

When you know the name of the BLE device that you want to connect to you can use the Connect to Device Name block to connect directly to it. Please note that device names are not unique and it is relatively easy to change the name of a BLE device.

Inputs

Input Name
Data Type
Description

Device Name

Text

Expects a text block with the name of the device to connect to

Outputs

Output Name
Data Type
Description

Device Id

Text

Returns the ID of the device that you have just connected to

error

Text

If an error message is returned, returns the error. Else returns null

Example

Present the list of names of the available BLE devices in a simple list allowing users to connect on the device they click using the Connect to Device Name block and connect it to the item block.

It is not possible to connect to a BLE device using the device name without using the Scan block.

Subscribe To Characteristics

To receive data from a BLE device, capable of sending data to another device as notifications, you need to use the Subscribe To Characteristics function in your app. This function allows you to listen to updates from the peripheral device by subscribing to its characteristics and receiving data through the "notify" method.

To use this functionality, ensure your app is already connected to the desired Bluetooth device.

Inputs

Input Name
Data Type
Description

characteristic UUID

Text

Expects a text block with a 32-bit UUID for the BLE type, service or profile required

Outputs

Output Name
Type
Description

error

Text

If an error message is returned, returns the error. Else returns null

Characteristics Change

If you are connected to a BLE device that is capable of sending data to another device using the "notify" method and you have already subscribed to a characteristic then you need to use the Characteristic Change function in your app. This block alerts you whenever the characteristic value changes on the peripheral (server) device. Data from the BLE device may be received in either String or Byte format.

Ensure that you have subscribed to the characteristic to use this block.

Set something to happen when the Characteristics Change.

Outputs

Output Name
Type
Description

data (string)

Text

Returns a string containing the information received from the BLE device

data (byte array)

Returns a byte array containing the information received from the BLE device

error

Text

If an error message is returned, returns the error. Else returns null

Example

Connect to a specific device using Device ID. Subscribe to a characteristic using characteristic UUID and set the new data to labels when the characteristics change.

Disconnect

If connected to another Bluetooth device, this block will disconnect your app from the device.

Receive String

If you have a BLE device that is capable of sending data to another device then you will need to use the Receive String function in your app in order to listen to, or receive, data coming from the BLE device in String format.

You need to be connected to another Bluetooth device in order to use this block.

Inputs

Input Name
Data Type
Description

characteristic UUID

Text

Expects a text block with a 32-bit UUID for the BLE type, service or profile required

Outputs

Output Name
Type
Description

data (string)

Text

Returns a string containing the information received from the BLE device

error

Text

If an error message is returned, returns the error. Else returns null

Receive Byte Array

If you have a BLE device that is capable of sending data to another device then you will need to use the Receive Byte Array function in your app in order to listen to, or receive, data coming from the BLE device in Byte Array format.

You need to be connected to another Bluetooth device in order to use this block.

Inputs

Input Name
Data Type
Description

characteristic UUID

Text

Expects a text block with a 32-bit UUID for the BLE type, service or profile required

Outputs

Output Name
Data Type
Description

data (byte array)

Returns a byte array containing the information received from the BLE device

error

Text

If an error message is returned, returns the error. Else returns null

Listen for Disconnection

This asynchronous function listens for when your device disconnects from a named Bluetooth device.

You can program some events to happen when your device disconnects from the named device in the then do section of this block.

Inputs

Input Name
Data Type
Description

Device Id

Text

Unique ID of the bluetooth device to listen for disconnection with

Outputs

Output Name
Data Type
Description

error

Text

If an error message is returned, returns the error. Else returns null

Transmit String

Use this block to send data as a string of text to a BLE device.

You need to be connected to another Bluetooth device in order to use this block.

Inputs

Input Name
Data Type
Description

characteristic UUID

Text

Expects a text block with a 32-bit UUID for the BLE type, service or profile required

data

Text

Expects a text block with the message that you want to send to your BLE device

Outputs

Output Name
Data Type
Description

error

Text

If an error message is returned, returns the error. Else returns null

Transmit Byte Array

You need to be connected to another Bluetooth device in order to use this block.

Inputs

Input Name
Data Type
Description

characteristic UUID

Text

Expects a text block with a 32-bit UUID for the BLE type, service or profile required

data

Expects a text block with the message that you want to send to your BLE device

Outputs

Output Name
Data Type
Description

error

Text

If an error message is returned, returns the error. Else returns null

Transmit Hexadecimal

You need to be connected to another Bluetooth device in order to use this block.

Inputs

Input Name
Data Type
Description

characteristic UUID

Text

Expects a text block with a 32-bit UUID for the BLE type, service or profile required

data (hexadecimal)

Expects a text block with the message that you want to send to your BLE device

Outputs

Output Name
Data Type
Description

error

Text

If an error message is returned, returns the error. Else returns null

Transmit Base64

You need to be connected to another Bluetooth device in order to use this block.

Inputs

Input Name
Data Type
Description

characteristic UUID

Text

Expects a text block with a 32-bit UUID for the BLE type, service or profile required

data

Expects a text block with the message that you want to send to your BLE device

Outputs

Output Name
Data Type
Description

error

Text

If an error message is returned, returns the error. Else returns null

All values (string, HEX, Byte array, Base64) are being converted to a byte array before sending.

array () of bytes

array () of bytes

Use this block to send data as an array () of bytes to a BLE device.

array () of bytes

Use this block to send data in format to a BLE device.

data in format

Use this block to send data in format to a BLE device.

data in format

🛠️
Transmit Hexadecimal
list
hexadecimal
base64
Scan
Connect to Device Id
Connect to Device Name
Disconnect
Receive String
Receive Byte Array
Listen for Disconnection
Transmit String
Transmit Byte Array
list
list
list
hexadecimal
base64
Thunkable Live
download