This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to connect NRF 8001 BLE with Arduino

Can anyone tell me how to connect NRF 8001 with Arduino mega 2560. I have developed an iPhone application and just want to connect with NRF 8001.Please tell me how to connect NRF 8001 with Arduino mega 2560 and make the BLE chip discoverable?

  • I have one last question, suppose i have connected nRF 8001 to arduino using BLE duino schematic and my iPhone is able to discover the BLE. Now how will i be able to communicate with arduino + BLE through iPhone. Like Red Bear labs people has developed their own libraries and i simply use BLE_Read() and BLE_WRITE() etc function to read and write in Arduino IDE. How will i be able to communicate? This is my major concern.

    Secondly,what is use of services.h file,you guys have also included this file in your Arduino compatible libraries and Red bear Lab have also included this?

    Third,what is the need of running any "setup.bat" file in nrfStudio? will nRF 8001 chip be connected to pc when we should run this file. If yes then how to connect nRF 8001 with pc when running this .bat file?

    Please each of the above question, you can call me stupid but i need these answers then only it will make things clear in my mind.

  • You should read the nRF8001 datasheet here , www.nordicsemi.com/.../nRF8001 . You should also take a look at the example Arduino projects and the documentation for the BLE library available . The simplest example is the ble_uart_project_template. ( A hello world example will be added in the next release) The lib_aci.h contains the required functions to be used to send and receive data. These functions are direct mappings to the ACI messages or utility functions. For example lib_aci_send_data is used to send data and this is the ACI Send Data command (see the datasheet for details).

    The nRF8001 uses the nRFgo studio as the visual editor for Bluetooth GATT, GAP and hardware settings, these settings are saved in an XML file.

    The batch file runs the nRFgo studio in command line mode to generate the services.h file from the XML file. This batch file is required to be run every time a change is made in the XML file so a new services.h can be generated You can also manually generate the services.h from nRFgo studio -> nRF8001 Configuration , nRF8001 Setup -> Generate source files -> Generate only Services.h This services.h contains ACI Setup messages used to load the setup created into the nRF8001 as #defines.

    So the nRF8001 does not need to be connected to the PC at any point.

    You should then #include the services.h in your Arduino project or any other micro controller project The #defines in the services.h are used in the lib_aci_init to initialize the data structures for the BLE library. The do_aci_setup function is then used to setup the nRF8001. See the example project and documentation for more details.

  • Hi Saurabh,

    Regarding L1, C8 and C15 value, they belong to the PI tuning network and their values are to be calculated when tuning the antenna using a network analyzer. You can refer to our white papter nWP17 http://www.nordicsemi.com/eng/nordic/download_resource/20347/2/18867584 for more detail on antenna tuning.

  • Thanks for the awesome reply. It has made most of the things clear,now i can start development on this project.I have ordered my pcbs for manufacturing but in the mean time i want to start using Olimex Module so that i can start programming.Can this module be directly connected with Arduino Mega?Which pins i have to connect? And when connected with Arduino will my iPhone be able to discover it and connect with it? Will this module has its services and characteristic?

    Thanks in advance.You are awesome!!

  • The lib_aci_init function allows you to choose the pins to be used for interfacing to the nRF8001.

    The SPI pins of the nRF8001 need to be connected to the SPI pins of the Arduino Mega, however since the Arduino Mega is a 5v board and the nRF8001 is a 3.3v chip (the olimex module is also 3.3v) , some level conversion is preferred. To make the design low power you can use a 3.3v based Arduino clone like this that has a 5v and 3.3v switch so both the micro-controller and the nRF8001 operate at the same voltage level.

    The module does not have any Services or Characteristics pre-loaded, all the Services and Characteristics get loaded from the micro-controller i.e from the services.h and do_aci_setup() , using ACI Setup Commands.

Related