RedBear

Getting Started with BLE Shield

We recommend using Codebender, an online development and collaboration platform for all Arduino users, please read to our Quick Start with Codebender to start playing with your BLE Shield in just a few easy steps.


Objective

  • Getting BLE Shield 2 to work with our BLE Controller App for Android or iOS.

Requirements

  • Basic knowledge with using Arudino and the IDE - Arduino Getting Started
  • iOS Devices supporting Bluetooth 4.0 Low Energy:
    iPhone 5s/5c/5, iPhone 4S, iPad Air/3rd-Gen/4th-Gen, iPad mini, iPod Touch (5th-Gen) running iOS Version 7.0 or above
  • Android Devices with BLE support and running Android Version 4.3 or later, such as: Nexus 4, Nexus 5 and Nexus 7
    (please visit our Android Support page for list of compatible Android devices)

  • Arduino or Arduino compatible board, with operating voltage at 3.3V or 5V, such as:
    Uno, Mega and Leonardo

  • A host machine with Arduino IDE installed. Able to upload basic sample sketches to Arduino Board, such as:
    Mac, Windows or Linux PC

Hardware Checklist

Arduino UNO

Arduino UNO

 
BLE Shield

BLE Shield

 
USB Cable

USB Cable

 

We are using an iPod Touch 5 (iOS 7.1.1) with BLE Controller iOS App installed and a Windows 7 PC with Arduino IDE installed with this getting started guide.


Software Checklist


Libraries Setup / Update

Important: Blend, Blend Micro and our BLE Shield share the same libraires. If you have followed our other "Getting Started" guide and installed the above libraries, you can skip this section go to "BLE Shield Setup"

  1. Check your "Sketchbook location" in Arduino IDE (it is for storing Arduino support files), go to menu File > Preferences... (on Mac OSX, go to menu Arduino > Preferences...)

    alt text

  2. Exit/Quit Arduino IDE

  3. Remove older versions of Nordic & RedBearLab Libraries, go to your Sketchbook folder (e.g. C:\Users\\Documents\Arduino\ on Windows) and delete the following folders
    • "BLE"
    • "BluetoothLowEnergy"
    • "RBL_BLEShield"
    • "Nordic_BLE"

  4. Unzip the "ble-sdk-arduino-0.9.0.beta.zip" and "nRF8001-20140509.zip" packages

  5. Restart Arduino IDE and select menu Sketch > Import Library... > Add Library...

    alt text

  6. Navigate to folder "ble-sdk-arduino-0.9.0.beta" > "libraries", select the "BLE" folder icon and click "Open" to import

  7. Select menu Sketch > Import Library... > Add Library... again, navigate to folder "nRF8001-20140509" > "Arduino" > "libraries" and import "RBL_nRF8001" folder

  8. Now both Nordic's "BLE" and our "RBL_nRF8001" should appear at the 'Contributed' section of Import Library menu

    alt text

  9. Your "Arduino" > "Libraries" folder should contain the "BLE" and "RBL_nRF8001" folders

    alt text

BLE Shield Setup

  1. Disconnect the Arduino Uno from Host PC and any other Power Sources

  2. Mount BLE Shield 2 onto Arduino Uno

    alt textalt text

  3. Set the REQN and RDYN jumper on the BLE Shield 2

    alt text

    Default settings (unmodified sketch from RBL nRF8001 Library)

    Nordic ACI Arduino Pin
    RDYN 8
    REQN 9


  4. Connect Arduino Uno to Host PC with USB cable

    alt text

  5. Check the Power LED on both Arduino and BLE Shield 2 are lit up

    alt text


Run the Demo App

  1. Open the BLEControllerSketch, Arduino IDE Menu: File > Examples > RBL_nRF8001 > BLEControllerSketch

    alt text

    alt text

  2. Select Board and Serial Port

    Arduino IDE Menu: Tools > Board > (Your Arduino Model)

    alt text

    Arduino IDE Menu: Tools > Serial Port > (Your Serial Port)

    alt text

  3. Upload the Sketch - click on the Right Arrow button at the IDE toolbar to begin upload (it will compile first)

    alt text

    alt text

    alt text

iOS Setup

  1. Download BLE Controller from Apple App Store

    alt text

  2. Turn on Bluetooth, unlike traditional Bluetooth devices (e.g. Bluetooth 2.1, 3.0), BLE devices will not be shown on this screen

    alt text

  3. Start BLE Controller

    alt text

  4. Click "Scan", if everything is correct, the list will show your BLE devices, select BLE Shield to connect

    alt text

  5. On success, it will shows all pins of your Arduino board

    alt text

  6. Change the pin mode and set the pin state to control

    alt text

  7. Click the 'X' button to disconnect. (Located at top-right corner)

Android Setup (Nexus 5)

  1. Download BLE Controller from Google Play Store

    alt text

  2. Turn on Bluetooth

    alt text

  3. Start BLE Controller

    alt text

  4. Click "Scan" - if everything is correct, the list will show your BLE devices, select BLE Shield to connect

    alt text

  5. On success, it will shows all pins of your Arduino board

    alt text

  6. Change the pin mode and set the pin state to control

    alt text

  7. Click the 'RedBear' icon to disconnect. (Located at top-left corner)