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

Best way to send data from many sensors

Hi,

For an application I have a nRF51 at my disposal and I need to transfer about 3'000Bytes. I found in the documentation that the nRF51 can use the S130 SoftDevice which support BLE 4.2. The data I have to transfer come from 1 to 50 sensors and are divided in 2 categories with 3 respective 6 parameters each as follow:

Sensor No1

  • Data type A
  • --Parameter A1
  • --Parameter A2
  • --Parameter A3
  • Data type B
  • --Parameter B1
  • --Parameter B2
  • --Parameter B3
  • --Parameter B4
  • --Parameter B5
  • --Parameter B6

Sensor No2

  • Data type A
  • --Parameter A1
  • --Parameter A2
  • --Parameter A3
  • Data type B
  • --Parameter B1
  • --Parameter B2
  • --Parameter B3
  • --Parameter B4
  • --Parameter B5
  • --Parameter B6

Sensor NoX

  • Data type A
  • --Parameter A1
  • --Parameter A2
  • --Parameter A3
  • Data type B
  • --Parameter B1
  • --Parameter B2
  • --Parameter B3
  • --Parameter B4
  • --Parameter B5
  • --Parameter B6

I thought that a way to transfer these results would be to use 2 customized services (a service for type A and a service for type B) with 3 respective 6 characteristics (A1-A3 and B1-B6) each. Each characteristic should have up to 50 values. The number of values in each characteristic would indicate the number of sensors.

Has someone a better / a more suitable solution for this use case?

Thanks in advance for you ideas.

  • I have updated my question to give a better overview of your answers. Yes I'm designing a solution for one very specific use case.

  • To resumed the situation I'm now thinking of 2 possibles solutions:

    1. Having a new custom service with only one characteristic (mandatory) which has Notify and Write. I will implement a customized protocol to recognize the data piped within BLE. The values will be stored by the application
    2. Having a new custom service with one characteristic (mandatory) which has Notify and write and an other one (optional) which has read and write. For the notify characteristic I will implement a customized protocol to recognize the data piped within BLE. The values will be stored by the application. For the second characteristic the data will be stored in the stack in the value field and will contain some settings if available which are readable and writable. The Notify will carry many data values but the write command will carry only some data values and some commands. In my opinion splitting the settings and the data in two different characteristic make more sense but I'm still not 100% sure. I understand that you prefer choice 1 but can you please give me some advantages of this solution in comparison with the second choice?
  • I'm struggling to understand added value of that second optional Characteristic, what will be Read by Client there vs. what would be received in Notify on the other Characteristic upon some Write (containing command data). But if you want both things and have some use for it then why not.

  • Thank you for your help and for your suggestions!

  • Just wondering whether you've considered the BLE UART abstraction (ble_app_uart) as a method of transferring data and adding a binary protocol to encode/decode this? (I'm also weighing up a similar decision vs writing a specific BLE service)

Related