Which is the best way of sending the data read from a sensor?

Hi,

I need to read the data from an acceleration sensor. I tried with a custom program of mine to simulate some data, but it is delaying too much.

I tried reducing the notification interval, but sometimes it just jumps numbers so to say, it should show 1,2,3. But now it shows 1,3,5.

Am I missing something?

Thank you!

  • Hi Adrian,

    Adrian1504 said:
    Here, what do you mean?

    I was refering to the more data field in the packets in the sniffer trace. When that is not set, that indicate that the nRF does not have more data to send, and the connection event will be closed. So it seems you are not providing data to the BLE stack fast enoug (for higher throughput).

    Looking at your code I see you send data in your ble_notify_thread() and this waits for a semaphore buffer_sem given in simulate_data. What throuhgput do you get if you skip this part and just send the same dummy data over and over (no acellerometer data and no semaphore)? The way the code looks now I cannot see if the limiting factor here is getting the accelerometer data or sending the data over BLE.

  • Hi Einar,

    Thank you for your answer.

    I tried what you suggested, and yes, now I receive more. So I am receiving 25920 int 32 which I think makes it .8 Mbps. Since I think now the problem is the reading of the accelerometer data, I changed my program to read the FIFO, instead of reading register each time it was accessed. I am now getting .5 Mbps, which is good, but I'd like to increase it to .8 that was amazing. Would you know of any way I could make this better?

    Maybe making 2 buffers and sending one and then the other? Increasing the frequency of SPI?

    I will try them, but if you have any advice, I would be really interested in reading it.

    Best regards,
    Adrian Lopez.

  • Hi Adrian,

    I am not familiar with the adxl355, but how fast can you read data from it? There is probably a maximum sampling rate etc. That should be specified in the data sheet. I would suggest that you first look into what you can actually achieve theoretically. And then start testing without bluetooth this time, just logging (not very often) how much data you have recieved, and ignore the data.

Related