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

BLE real time data transmission nrf51 DK code

Hi Guys,

I need to implement real time streaming of accelerometer and gyro values from the nrf51 DK to either a desktop or android system. Could someone please help me on how to go about with this and if there are any desktop clients JAVA for reading data from the nrf51 board over BLE? Basically, I need to concentrate on data streaming and I need a data rate of 50kbps or so, is that achievable with nrf51? Also, are there any GATT profiles for accelrometer data because I couldnt find any

Thanks and Regards, Neil

  • Depends on your requirements, but one possibility is to present the embedded device to the host as a HID device which permits you to expose the sensor data via HID (see HID Sensors Page in HID Usage Tables v1.12). There's already sensor framework support in Windows, OSX, Linux, and Android hosts for dealing with sensor data via HID.

  • What about the data rates would it be better then simple GATT profiles? and would it be streamed data?

  • Hi

    Here is a list of the official BLE profiles.

    For the requirement of 50kbps, it is on the limit of what BLE can do. The maximum theoretical throughput is 128kbps with transmission of 6 packets per second (maximum for nRF51) and the minimum connection interval of 7.5ms. Throughput of Android phones is different from phone to phone. Some phones support 4 packets per connection interval while other only support 1 packet per connection interval. Some phones support 7.5ms connection interval while others support minimum 20ms or 30ms.

    You could connect with a nRF51 dongle to connect via BLE to a PC. We currently offer S120 BLE central softdevice for this but it supports only one packet per connection interval, so it will not be able to transmit/receive 50kbps. More on the throughput is here and here

    BLE is not very good on throughput, primarily because it was designed for low power.

    Another option would be to use proprietary protocol with the nRF51, like the Gazell, to obtain higher througput, but then you will lose connectivity with phones.

  • Thanks for your answer.

    Nick Pelis above suggested to use HID over GATT. Would that be better in terms of the useful data I would able to send to the desktop?

    I have a XPS 15 so I think it should support 6 packets/7.5ms intervals? I need to actually get 9DOG values and send it to my desktop/mobile . I am thinking about the best way to do this. What about ANT? Does Gazell have desktop codes to receive the signals?

    Thanks and Regards, Neil

  • The max throughput with ANT is 60kbps, however this is without re-transmissions, so achieving 50kbps is not realistic in the long run.

    The max throughput with Gazell is up to 500kbps, however then you would require a nRFLU1P USB dongle on the PC side to also run Gazell, theoretically I guess you can then design this with either CDC or HID class for the nRF24LU1P (you might also use libusb, but not sure if that works with Android). It would require some work to get the nRF24LU1P firmware running, in addition you will need to create the application on the peripheral and OS, but technically possible, and likely the best solution in terms of throughput.

    In terms of BLE the max throughput is up to 128kbps, however due to the way BLE will re-transmit; if a packet fails it will have to wait until next connection interval (min. 7.5ms) before it will re-transmit. Then the max throughput can reduce rapidly depending on interference in the system. You might be able to achieve 50kbps over time, but the latency can be very high (e.g.>100ms) in some scenarios.

    Indepedant of what profile you choose to use to interface the data stream (HID, CDC, proprietary way...) the raw throughput will be the same for any BLE implementation really, given the connection parameters is the same, the difference will be the api mainly.

    For a PC application using HID it should in theory work the same independant if it's USB or BLE that is the transport layer. Some resources to get started on a PC application using HID or BLE: msdn.microsoft.com/.../jj128407(v=vs.85).aspx code.msdn.microsoft.com/.../

    In terms of source code to get started with the nRF51 or nRF24LU1P you need to look at the SDK's for each of the chips.

Related