Maximise sampling rate via Bluetooth Serial

Hi everyone,
I need to transmit 16bit unsigned integers from an external ADC wirelessly, with the maximum sample rate possible.

I have configured the arduino nano 33 iot to allow for standard bluetooth using this method. This essentially means I have connected through UART to the NINA W102 (based on the ESP32 module).

I have created a test code (ignoring the ADC for now) and recorded the Serial speeds through the virtual COM port.


unsigned long startTime = 0;

void setup() {

     pinMode(NINA_RESETN, OUTPUT);  
     pinMode(LED_BUILTIN, OUTPUT);        
     digitalWrite(NINA_RESETN, HIGH);
     Serial.begin(115200);
     SerialNina.begin(115200);
     delay(20000); // wait for 20 seconds to allow user to setup bluetooth on PC
     startTime = millis();
}

void loop() {
  //for 10 seconds, print 16 bit numbers as fast as possible
  while(startTime + 10000 > millis()){
    for(uint16_t i=0; i<30;i++){
      SerialNina.println(i);
      }
  }
}

I am getting around 2.2kHz currently through the Bluetooth Serial through COM, which is not enough. I have also tried normal Serialprint() and received around 10kHz from the wired COM port, which is more acceptable.

Any ideas why there is such a difference since bluetooth 4.0 should be able to transmit much faster? Do I need to use an encoding method like Packet Serial or add a buffer? Also what is the most efficient way of sending data from multiple channels?

I have also used the WiFi functionality of the nano 33 iot, but receiving around 100Hz using a local server on my PC.

Any advice greatly appreciated, this project is incredibly important to me.
Thanks in advance,
Will

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.