Arduino Tutorial: Bluetooth

In general, a distinction can be made between classic Bluetooth and Bluetooth Low Energy (BLE). The BLE was developed especially for low-power devices in the IoT area.

Like other radio technologies, Bluetooth uses the 2.4 GHz spectrum in the ISM band and has a range of 10 m to 100 m (at higher transmission powers, this means higher power consumption!). Bluetooth is an ad-hoc network and offers P2P (point-to-point) connections.

Classic Bluetooth supports up to one master and seven slaves in a piconet. It also relies on the star network topology, which means that other peripherals cannot communicate with each other.

A few important things to keep in mind: A master in one piconet cannot be a master in another, but a master in one piconet can be a slave in another. For example, classic Bluetooth can be used to transmit audio data, but not video.

We will now focus our discussion on the BLE protocol and how Bluetooth has evolved through this technology.

Three Bluetooth variants

Bluetooth Low Energy is completely different from classic Bluetooth. It was developed with a new protocol stack, a new profile architecture, and specifically to operate on low-power sources such as a coin cell battery.

It should be noted that this radio technology has not taken over or replaced the existing Bluetooth Classic radio. This has led to a sort of different Bluetooth directions that correlate with each other.

Bluetooth technology can be divided into three types of devices:

  • Bluetooth Classic - The traditional Bluetooth with a higher throughput, mainly used for wireless audio and file transfer. The "classic" radio supports Bluetooth Smart.
  • BluetoothSmart - Bluetooth Low Energy (BLE) has been branded as Bluetooth Smart and only transmits status information. It is specifically designed for low duty cycle applications (i.e., the radio is on for a short period of time). Bluetooth Smart devices cannot communicate with Bluetooth Classic devices.
  • Bluetooth SmartReady - These devices are essentially "hub" devices such as computers, smartphones, etc. They support both "classic" and "smart" devices, just as our smartphones can connect to a Bluetooth speaker to transmit audio and also communicate a fitness tracker.

Classic Bluetooth vs. Bluetooth Low Energy (BLE).

BLE uses the same 2.4 GHz ISM band as other wireless protocols. Unlike Bluetooth Classic's 79.1-MHz channels, Bluetooth Low Energy only has 40 channels that are 2 MHz wide.

BLE also uses 1-Mbps GFSK modulation, giving it a longer range than Bluetooth Classic.

BLE uses an adaptive frequency hopping algorithm to hop between available channels, using only a subset of the available frequencies, and it can recover quickly from packet loss due to a faulty channel. This technique ensures lower power consumption in the radio. Bluetooth Classic uses a pseudo-random hope sequence and changes the transmission frequency 1,600 times per second.

It should be noted that with BLE, up to 128 devices can be connected to a single master, as opposed to only seven devices with classic Bluetooth.

Bluetooth modules for Arduino

Wireless communication is becoming an increasingly important driver of innovation in the industry. More than ever before, you can easily use mobile devices to control and receive data from electronic devices.

Basically, you need a Bluetooth module and a development board to be able to establish a wireless communication channel with a device. Since Arduino microcontrollers are often used to send and receive data via Bluetooth and there are very many similar modules available, we will introduce some Bluetooth modules here.

If you are not sure which Bluetooth module you have in use, turn it on, make sure it works and see what name it transmits. If it transmits "HC-06" or "HC-05", you know it's Bluetooth 2.0 or 2.1. HMSoft, AT-09, BT05, CC2540, CC2541 all mean BLE.

Bluetooth 2.0/2.1 modules for Arduino

The HC-05 Bluetooth module

In the Arduino environment, if you see a video or tutorial with a Bluetooth-powered terminal, the wireless communication is most likely with an HC-05 module.

The low-cost HC-05 module is designed to establish a transparent wireless serial connection using Bluetooth SPP (Serial Port Protocol).

Another very important aspect, especially if you are starting out and want to use a Bluetooth module, you can find quite a few tutorials and guides on the Internet that will introduce you to wireless communication with robots, etc.

This module works both as a master and as a slave. For example, a robot can be designed as a master with a slave Bluetooth module or as a slave board for wireless connection with a PC.

The HC-06 Bluetooth module

The HC-06 module is also a very popular module that is very easy to set up with an Arduino board.

The module is suitable when wireless data transmission is required in slave mode. So the module cannot establish active communication, but works only when it is contacted. Like the HC-05, the HC-06 module can reach a range of up to 9 meters.

If you need a Bluetooth module to communicate with your smartphone and an Arduino board, the HC-06 will work fine. However, if you want to talk to another Arduino development board, the HC-05 module is the right choice.

The BlueSMiRF and Bluetooth Mate

Connecting to other devices via Bluetooth technology doesn't require much and is really easy.

The BlueSMiRF from Sparkfun is one of the Arduino compatible Bluetooth modules that has a transceiver installed on it. This means that the Bluetooth module can send and receive data from up to 100 meters away.

The BlueSMiRF is ready to use out of the box and is compatible with other Bluetooth devices that support SPP. The wireless module is ideal for applications that require a distance of up to 100 meters.

Bluetooth Low Energy (BLE) Modules for Arduino

Seeed Studio Bluetooth V4.0 HM-11 BLE Module

This SMD BLE module is based on the TI cc2541 chip and enables the construction of robust network nodes with low total unit cost and best suited for low power systems. The module is small and easy to use. With the manufacturer's pre-programmed firmware, you can quickly establish BLE communication using the AT command. Support BLE communication with iPhone, iPad and Android 4.3.

Adafruit Bluefruit LE - Bluetooth Low Energy (BLE 4.0) - nRF8001 Breakout.

This breakout module allows you to easily connect wirelessly between your Arduino and any compatible iOS or Android (4.3+) device. This works by simulating a UART device and sending ASCII data back and forth between the devices, allowing you to decide what data is sent and what happens to the data at either end of the connection.

>>> The presented and more Bluetooth modules for Arduino can be found here!

Passend zu diesem Artikel

View all
Sonstige Bluetooth V4.0 HM-11 BLE Module
Sale price8,00 €
Not in stock, available for backorder
Sonstige HC-08 Bluetooth Module
Sale price7,77 €
In stock
Adafruit Adafruit Bluefruit LE Friend - Bluetooth Low Energy (BLE 4.0) - nRF51822 - v3.0
Sale price22,05 €
Not in stock, available for backorder
Waveshare Waveshare Bluetooth 4.0 NRF51822 Core Board
Sale price8,34 €
Not in stock, available for backorder
Olimex Olimex ESP32-POE-EA-IND
Sale price23,54 €
In stock
Olimex Olimex ESP32-POE-IND
Sale price21,39 €
In stock
Olimex Olimex ESP32-GATEWAY
Sale price18,18 €
In stock