The Bluetooth Low Energy (BLE) Shield for Arduino is a Shield that enables Arduino projects to communicate with Bluetooth Smart devices such as the iPhone 4s, iPhone5, iPad 3rd and 4th generation as well as the iPad Mini without Jailbreaking.
Simply attach the BLE Shield to an Arduino and write and read data to and from the Arduino using the Serial Port which can be the hardware Serial on pins 0 and 1 or a software serial port on pins 2 and 3. The selection is done using the switch on the BLE Shield.
How does the BLE Shield work?
The BLE Shield is using a Bluetooth Low Energy Module BLE112 from Bluegiga. It provides three services, where two services are BLE related services which are mandatory for BLE peripherals, and one service which is specific to the BLE Shield, the BLE Shield Service.
BLE-Shield Service (UUID: F9266FD7-EF07-45D6-8EB6-BD74F13620F9)
- Characteristic BD-Address (UUID: 38117F3C-28AB-4718-AB95-172B363F2AE0)
- Characteristic RX (UUID: 4585C102-7784-40B4-88E1-3CB5C4FD37A3)
- Characteristic RX-Buffer Count (UUID: 11846C20-6630-11E1-B86C-0800200C9A66)
- Characteristic RX-Buffer-Clear (UUID: DAF75440-6EBA-11E1-B0C4-0800200C9A66)
- Characteristic TX (UUID: E788D73B-E793-4D9E-A608-2F2BAFC59A00)
The view towards the mentioned characteristics is when you look from e.g. the iPhone to the BLE Shield. The data which is sent over the TX characteristic (max. 16 bytes of data) is transferred to the Arduino’s RX pin. Either pin 0 or pin 2 of the Arduino depending on the switch position of the shield. The transmitted data is then available to the Arduino using Serial.read() calls. On the other side the iPhone can read data from the Arduino using the RX characteristic. Here is a small difference compared to the TX characteristic. The data on the RX characteristic is only available after the internal 16 byte buffer is completely filled up. This means, if you are e.g. transferring a byte, you need to fill the buffer with leading zeros for instance. This internal buffer was necessary to implement, since otherwise the data you transfer from the Arduino to the iPhone is fragmented. This is a problem when you expect structured data sent from the Arduino, which is notified or indicated.
The RX characteristic can be read or notified. If you enable notifications on the RX characteristic there is no need to poll for new data. The BLE Shield will send you the 16 byte buffer automatically once it is filled up. Both the RX Buffer Count and Buffer Clear Characteristic are used to control this buffer. Read how many data has been already written from the Arduino to the buffer, or clear the buffer to zero.
Tested Arduino Boards
I have tested the following Arduino and Arduino Compatible boards with the BLE-Shield:
- Arduino UNO (http://arduino.cc/en/Main/ArduinoBoardUno)
- Arduino Diecimila (http://arduino.cc/en/Main/ArduinoBoardDiecimila)
- Freetronics Eleven (http://www.freetronics.com/collections/arduino/products/eleven)
- Arduino Pro 328 3.3V/8MHz (https://www.sparkfun.com/products/10914)
- Seeeduino v3.0 (http://www.seeedstudio.com/depot/seeeduino-v30-atmega-328p-p-669.html?cPath=132_133)
- Arduino Leonardo (Note 1) (http://arduino.cc/en/Main/arduinoBoardLeonardo)
Tested Netduino Boards
Beginning on February 11th, the BLE-Shield is compatible with some NetDuino boards. A sample project for Microsoft Visual C# 2012 Express is available from my github repository as well.
NetDuino2 (http://www.netduino.com/netduino2/) Serial Port COM1 (D0/D1) and COM2 (D2/D3) is supported.
Since the Arduino BLE-Shield is open sourced you can access the Eagle Schematic and Board files as well as the Firmware from my github repository at: https://github.com/michaelkroll/BLE-Shield
iPhone App Source
The open sourced iPhone App to control the BLE-Shield is available from my github repository at:https://github.com/michaelkroll/BLE-Shield as well.
- Using the Arduino Leonardo, the Serial Port switch must be on the Tx0/Rx1 position. The switch setting Tx2/Rx3 cannot be used, since it seems that SoftwareSerial is not supported on Pins 2 and 3. See the modified sample sketch for the Leonardo on the github repository in the Arduino directory.