# Bluetooth Low Energy (BLE)

> Discover how Bluetooth Low Energy (BLE) enables communication between devices for low-energy data transfers, specifically in IoT applications, using PandaSuite's BLE integration.

https://docs.pandasuite.com/essentials/components/bluetooth-low-energy/

**Communicate between multiple devices using Bluetooth Low Energy (BLE). In practice, this connection is established through the transmission and reception of characteristics.**

Bluetooth Low Energy (BLE) is a wireless communication technology designed for low-energy data transfers over short distances. It is primarily used with connected devices (IoT) for home automation. BLE is an evolution of classic Bluetooth, offering more efficient and energy-saving communication.

> **Warning**
>
> **Compatibility**: this component is only compatible with native iOS & Android
> apps, and not with the web.

Here is an example of our animated 2018 greeting card which triggered the lighting of a connected bulb (see video at 0:16).

[Video: PandaSuite's animated 2018 greeting card, which turns on a connected bulb over BLE](https://www.youtube.com/embed/l5yL3MW2slQ?&hl=fr&cc_lang_pref=fr&cc_load_policy=1)

## BLE use cases

The BLE component allows you to create innovative interactive experiences:

- **Home automation**: control connected objects (bulbs, sensors, smart locks)
- **Multi-screen experiences**: synchronize tablets/smartphones with physical display screens or interactive installations
- **Hardware prototyping**: quickly test interactions with Arduino, Raspberry Pi, or other microcontrollers

## Which solution to choose for connecting multiple objects/devices?

- **Use BLE** to communicate with physical connected devices (bulbs, sensors, locks) in close proximity (< 10m) via Bluetooth.

- **Use [App-to-App](https://docs.pandasuite.com/essentials/components/app-to-app/)** to synchronize multiple PandaSuite applications with each other, with better range, offline availability, web compatibility, and richer data sharing.

- **Use automation platforms** like [IFTTT](https://ifttt.com/) or [Zapier](https://zapier.com/) to create complex scenarios between different services and devices, via the [HTTP component](https://docs.pandasuite.com/essentials/components/http/).

## How BLE works in PandaSuite

PandaSuite integrates BLE via the [Bluetooth GATT](https://www.novelbits.io/bluetooth-gatt-services-characteristics/) (Generic Attribute Profile) standard, which defines the interaction between a central application (like a smartphone) and a peripheral device (like a connected bulb or another smartphone).

### Characteristics concept

BLE communication is done via **characteristics**:

- Each BLE characteristic has a unique identifier (UUID).
- A characteristic corresponds to a specific communication action.
- For two devices to communicate, they must share the same characteristic identifiers.
- These characteristics can be reused across multiple PandaSuite projects.

## BLE component configuration

### Adding a BLE characteristic

To understand the configuration of a BLE component, let's take the example below of a "remote control" project that controls the display of a slideshow of images (in another project):

[Video: BLE remote control example: a smartphone app controls an image slideshow shown on another device](https://www.youtube.com/embed/9o6GhbTO8_8?&hl=fr&cc_lang_pref=fr&cc_load_policy=1)

**Configuration steps:**

1. Click on **Components** and add a **BLE** component
2. In the component properties, choose the service type:
   - **PandaSuite**: the UUID identifier is automatically generated (ideal for communication between two PandaSuite applications)
   - **Other**: manually enter the UUID identifier (necessary to connect to an existing connected object)
3. Select the BLE component in the object list
4. Click on the right arrow to enter edit mode

[Image: Remote control project with two arrow buttons: the BLE component, pointed out in the object list, uses the PandaSuite service]

5. Click on the **+** button to add a characteristic
6. Customize the identifier or keep the automatically generated one

[Image: BLE component edit mode: two characteristics, Previous and Next, and the first one's UUID identifier in the properties]

### Sending a BLE characteristic

Once your characteristic is configured, you need to create an action to send it to connected devices.

**Steps for the sending device:**

1. Select a trigger component (for example, a button)
2. Click on the **+** to add a new action
3. Choose the trigger event (for example **Tap / Click**)
4. Select the action **Interact with a component**
5. Choose the **BLE** component and the action **Trigger characteristic**
6. Select the characteristic to send

[Image: Action on the left arrow button: on Tap / Click, Trigger characteristic on the BLE component sends the Previous characteristic]

### Receiving a BLE characteristic on another device

To create an application that responds to BLE characteristics sent by another device (for example, a remotely controlled screen), you need to create a second project.

**Steps for the receiving device:**

1. Create a new PandaSuite project
2. Add a **BLE** component to this project
3. Add a characteristic with **exactly the same UUID identifier** as in the sending project
4. Select the BLE component and click on the **+** to add an action
5. Choose the **BLE characteristic** as the trigger event
6. Define the action to execute when the characteristic is received (for example, change page, launch an animation, etc.)

[Image: Display project on a tablet: a received BLE characteristic triggers the Previous page action on the image gallery]

> **Tip**
>
> **Prerequisites**: both devices must be close to each other (effective range
> of 5 to 10 meters depending on the environment) and have Bluetooth enabled.
> Walls and obstacles may reduce the range.

## Ready-to-use templates

To get started quickly, use these two complementary templates that demonstrate a remote control scenario:

[Template: BLE Controller](https://pandasuite.com/dashboard/use-template/iuPEFYwB5IBMJWwgtBdo)

"Remote control" application to install on a smartphone for remote control.

[Template: BLE Display](https://pandasuite.com/dashboard/use-template/AVr2oXIp3ClP-qd6x6MZ)

Display application to install on a tablet or screen that responds to BLE commands.

> **Info**
>
> **Tip**: duplicate these templates and customize the BLE characteristics to
> create your own communication scenarios.
