In this article we examine the Seeedstudio “Bluetooth Bee” modules and how they can be used in a simple way in conjunction with Android devices to control the Arduino world. Here is an example of a Bluetooth Bee:
For the curious, the hardware specifications are as follows:
- Typical -80dBm sensitivity
- Up to +4dBm RF transmit power
- Fully Qualified Bluetooth V2.0+EDR 3Mbps Modulation
- Low Power 1.8V Operation, 1.8 to 3.6V I/O
- UART interface with programmable baud rate
- Integrated PCB antenna.
- XBee compatible headers
You may have noticed that the Bluetooth Bee looks similar to the Xbee-style data transceivers – and it is, in physical size and some pinouts, for example:
The neat thing with the BtB (Bluetooth Bee) is that it is compatible with Xbee sockets and Arduino shields. It is a 3.3V device and has the same pinouts for Vcc, GND, TX and RX – so an existing Xbee shield will work just fine.
In some situations you may want to use your BtB on one UART and have another for debugging or other data transport from an Arduino – which means the need for a software serial port. To do this you can get a “Bees Shield” which allows for two ‘Bee format transceivers on one board, which also has jumpers to select software serial pins for one of them. For example:
In the past many people have told me that bluetooth connectivity has been too difficult or expensive to work with. In this article I want to make things as simple as possible, allowing you to just move forward with your ideas and projects. One very useful function is to control an Arduino-compatible board with an Android-based mobile phone that has Bluetooth connectivity. Using the BtB we can create a wireless serial text bridge between the phone and the Arduino, allowing control and data transmission between the two.
We do this by using a terminal application on the Android device – for our examples we will be using “BlueTerm” which can be downloaded from Google Play – search for “blueterm” as shown below:
In our Quick Start example, we will create a system where we can turn on or off four Arduino digital output pins from D4~D7. (If you are unsure about how to program an Arduino, please consider this short series of tutorials). The BtB is connected using the Bees shield. This is based on the demonstration sketch made available on the BtB Wiki page – we will use commands from the terminal on the Android device to control the Arduino board, which will then return back status.
As the BtB transmit and receive serial data we will have it ‘listen’ to the virtual serial port on pins 9 and 10 for incoming characters. Using a switch…case function it then makes decisions based on the incoming character. You can download the sketch from here. If you were to modify this sketch for your own use, study the void loop() section to see how the incoming data is interpreted, and how data is sent back to the Android terminal using blueToothSerial.println.
BluetoothBee Demo Code - Flowcontrol Based Implementation
2010,2011 Copyright (c) Seeed Technology Inc. All right reserved.
Author: Visweswara R
Modified: John Boxall, December 2013
This demo code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
For more details about the product please check http://www.seeedstudio.com/depot/
#define RxD 9
#define TxD 10
#define DEBUG_ENABLED 1
blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
delay(2000); // This delay is required.
delay(2000); // This delay is required.
//Checks if the response "OK" is received
a = blueToothSerial.read();
if('O' == a)
// Wait for next character K. available() is required in some cases, as K is not immediately available.
b = blueToothSerial.read();
if('K' == b)
while( (a = blueToothSerial.read()) != -1)
//Wait until all other response chars are received
void sendBlueToothCommand(char command)
// get character sent from Android device
// decide what to do with it
blueToothSerial.println("pin 4 HIGH");
blueToothSerial.println("pin 5 HIGH");
blueToothSerial.println("pin 6 HIGH");
blueToothSerial.println("pin 7 HIGH");
blueToothSerial.println("pin 4 LOW");
blueToothSerial.println("pin 5 LOW");
blueToothSerial.println("pin 6 LOW");
blueToothSerial.println("pin 7 LOW");
Before using it for the first time you will need to pair the BtB with your Android device. The PIN is set to a default of four zeros. After setting up the hardware and uploading the sketch, wait until the LEDs on the BtB blink alternately – at this point you can get a connection and start communicating. In the following video clip you can see the whole process:
Where to from here?
There are many more commands that can be set using terminal software from a PC with a Bluetooth adaptor, such as changing the PIN, device name and so on. All these are described in the BtB Wiki page along with installation instructions for various operating systems.
Once again I hope you found this article interesting and useful. The Bluetooth Bees are an inexpensive and useful method for interfacing your Arduino to other Bluetooth-compatible devices. For more information and product support, visit the Seeedstudio product pages.
In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitter, Google+, subscribe for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other – and we can all learn something.
Latest posts by John Boxall (see all)
- Kit Review – JYE Tech DSO138 Digital Storage Oscilloscope - April 2, 2015
- Tutorial – Using DS1307 and DS3231 Real-time Clock Modules with Arduino - December 1, 2014
- Tutorial – L298N Dual Motor Controller Modules and Arduino - November 25, 2014