Starting Bluetooth with Arduino

If you want to get started building Bluetooth projects then using Bluetooth with an Arduino is a great way to go. It’s much easier to use Arduino to connect sensors and get a project going. The Arduino example code is great for this.

For the Bluetooth part you’ll find that there are a lot of Bluetooth modules, boards and shields for Arduino. We’re going to go through some of them so you understand the tradeoffs and pick the right one for you.

Serial Modules

Connections between Arduino Bluetooth Module and Arduino board using UART

Some of the first modules used to connect Arduino with Bluetooth were Serial Bluetooth Modules. These modules connect to the Arduino using UART or RS232 and use a standard command set. All you need is to connect, Power (3.3V or 5V), Ground and the UART lines. Be careful because some modules won’t support 5V and you will need to access 3.3V. The Arduino usually has 5V outputs that will need to be converted to 3.3V (unless the module is 5V tolerant).

After connecting the module to the Arduino, it’s relatively simple to talk to the Bluetooth module by sending command strings. Once the connection is established, you can also send data. When connected to a computer, you will usually get a COM port that will receive the data. So you can open a COM port and get the UART data sent by the Bluetooth Module.

These Bluetooth modules are usually using Classic Bluetooth v2.0 + EDR or v2.1 + EDR. You can find them on eBay, Amazon and other different places for around $5 to $7.

The disadvantage is that most of these modules have no Bluetooth Smart support, so you usually won’t be able to communicate with an iPhone which requires authentication. They’re also power hungry.

You can find generic modules on eBay and other online marketplaces.

Arduino Bluetooth Shields

Since the release of the Bluetooth v4.0 specification, several Bluetooth Low Energy shields have come out that are easy to buy from various places. Although the standard SPP Bluetooth shields are available, BLE shields have become popular because they allow you to connect to an iPhone and Android phone quickly.

These shields are based on some of the most popular BLE chipsets out there. The nRF8001, nRF51822, CC2540, and CC2541 are popular in these designs because Texas Instruments and Nordic Semiconductor make design information easily available.

RedBearLabs makes a popular shield using the nRF8001. The nRF8001 is a Peripheral only device with a few other limitations (it cannot do beacons because of a limit on the size of packets it can transmit).

nRF8001 BLE Shield Board for Arduino

A few shields use modules such as BlueGiga’s Bluetooth Module or other modules, creating an almost fully FCC certified solution.

It’s important to take a look at the interface provided by these devices because they usually implement custom code and commands.

Shield Bluetooth Price
Red Bear Lab BLE Shield Bluetooth Low Energy $24.90
Adafruit Bluefruit EZ-Link Shield SPP Serial Port $24.95

Arduino Bluetooth Boards

If you don’t have an Arduino or if you’re open for a switch, there are a few Arduino boards with Bluetooth modules already integrated that make it easier to put sensors.

A big advantage of a module on the main board is that there’s more space to add various sensor boards to the headers. You will have less issues with stacking shields, and the Bluetooth Module won’t be as affected by them.

Arduino Board with Bluetooth Low Energy capability

The Arduino BT is an Arduino board with the BT module already mounted with support by the Arduino Team. This module is a classic Bluetooth module. You will need to pair it with your computer and then you can send commands to it through UART as if your computer was connected directly to the Arduino board.

Picking the Right Bluetooth for Arduino

We talked about the form factors of the boards and a general overview of what’s available, but there’s a lot more to choosing the right BLE or Bluetooth Module for your project.

Board Size

The typical Arduino size is 2.7 Inches Long x 2.1 Inches wide, and the shields that mount on top are about that size. This is fine in a lot of cases, but If you need a smaller device, there are a few Arduino compatible boards that are much smaller and focus on BLE.

Red Bear Lab BLE Mini is one example, but there are several others that will work.

You’ll need to look carefully how much compatibility these boards have with Arduino. The size differences makes them a bit different, but many leverage the Arduino environment and code.

Data Rate

If you’re looking to replace a UART cable with a wireless solution, Bluetooth with EDR (Classic) may be your best bet. BLE was not designed for high throughput and although it can achieve 115200bps, you may have issues getting it to work reliably.

If you just want to send sensor data streaming at relatively low rates, BLE would be best here, but if you need very high speed transfer then SPP may be best.

Output Power

Classic Bluetooth boards sometimes have higher output power than the BLE boards, which can give them longer range. Most BLE modules will provide 0dBm to 4dB maximum output power, while Bluetooth based modules sometimes provide 10dBm.

With 10dBm you could get 100m or more, which is really nice for projects when you’re getting data from sensors outside the home.

Compatibility and Interoperability

Most laptops and many destop computers support Bluetooth. You can usually easily pair your Bluetooth module to your computer and get a Virtual COM Port that will display the data being sent to the module over UART.
Bluetooth Low Energy v4.0 is trickier. Support for it started with Windows 8. Older computers may not support it at all, depending on the chip in your computer.

Apple has been supporting BLE in their Mac computers for quite a while, and Mac OS X can connect to both Classic Bluetooth and BLE devices easily.

If you’re looking to connect to a Smartphone, a Classic Bluetooth Module with SPP can connect to an Android phone without a lot of problems, but connecting to an iPhone or iPad won’t be possible unless your module is iPad and iPhone compatible. This usually requires a separate authentication chip and firmware which most boards and modules out there don’t support.

Bluetooth Low Energy is much simpler. You can pick up any BLE board and it will be able to connect to an iPhone, iPad or Android phone. This gives it a big advantage.

Battery and Power

If you’re going to be powering the Arduino straight from USB or DC Jack, then power isn’t an issue. But if you may be using a battery it’s important to realize that some of the Bluetooth Modules out there are really power hungry if they are not LE. BLE was designed to run on Coin Cell batteries, although Arduino itself was not.

You’ll need to check the documentation of your module or board, but Bluetooth can typically accept a wide voltage range between 2.0V to 3.3V, with some supporting 5V (with an on-board regulator). If the battery voltage is too low, you’ll need to put a few batteries in series. If it’s too high, an LDO or DC/DC converter can help.

The peak currents of BLE are much lower than regular Bluetooth. This is important for batteries that have limited peak currents like coin cell batteries. Lithium Ion/Poly batteries and Alkalines won’t have a problem running either as long as the voltage is correct.

Audio

Bluetooth was designed for audio applications. You’re familiar with headsets, but building your own can be almost impossible. A few modules out there like the RN-52 Module from Sparkfun have I2S connections needed to transmit the speech and music. The Low Energy version of Bluetooth is not designed for audio, so you’ll need to get a Classic module.

Conclusion

If you’re looking to get started with Bluetooth, then Arduino is a great way to begin. You may not be creating actual products, but the Arduino platform makes it easy to put together a nice project without having to deal with a lot of the low level issues when building Bluetooth products.

SUBSCRIBE

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Related Articles