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

Data streaming from multiple sensors (BLE + UART + TWI)

Hi, I want to use BLE for following situation and I wonder if it is achievable. I have a 3 boards with nrf51822. Two of these boards have mpu6050 sensors connected to nrf51822 via TWI (I2C). These two boards work as BLE peripheral and server. Third board is BLE central and client device. What I want to do is:

  1. read data via I2C from sensors on each peripheral
  2. send data from both peripherals to central via BLE.
  3. send collected data from central via UART (to computer). Generally central works as USB BLE dongle.

The problem might be because i want to send packet of no more than 20 bytes (I know that max 20 bytes per notification is possible) with frequency min 30 Hz (50 Hz is recommended).

Here are my questions:

  1. Is it possible to read 20 bytes from TWI and send it via BLE (peripheral) with mentioned frequency? I'm asking because I read that BLE generally "blocks" uC during his work. But in my situation I first read data and next I send it via BLE so i believe it is not problem.
  2. Is it possible by central to read data from 2 pheripherials via BLE and send it via UART with mentioned frequency ?
  3. How many such peripherals central can handle?
  • What do you mean by oversample sensors? I believe that sample rate should be the same as algorithm step time. For example if i want to run algorithm every 20ms then I should configure MPU sample rate to 50Hz. Of course I should also configure MPU low pass filter to 20Hz or even lower. I afraid i can't split kalman filter algorithm. Kalman filter in this case works not as 'plain' filter for sensors data. It would be more correct to call it Kalman estimator instead Kalman filter because it estimate 3D position from raw data. Of course theoretically I can artificially divide algorithm into to parts but I think it doesn't make sense as long as nrf51822 uses cortex M0 uC which is inefficient for complex floating point mathematic operations.

Related