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?

Parents
  • 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.

Reply
  • 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.

Children
  • 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!!

Related