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

Sensor Data into Matlab

I am using a photo detector to sense heart beat data. That sensor data is being sent to my nRF51 DK's ADC and then transmitted out via Bluetooth. I want to collect that data in real(ish) time, in Matlab, so that my team can start running some DSP analysis on the data. For our project we cannot work with past data, it needs to be current data -- within a second or two.

So, I am receiving the nRF 51 DK packets in a nRF dongle in my computer's USB port. I downloaded Master Control Panel and it's great, but my information is trapped inside! Right now I'm writing scripts that will parse the log.txt file that the MCP generates, but I fear this is going to be inefficient.

I am hoping that there is someone here who can point me in a better direction. I'm trying to create this data path.. sensor -> 51DK -> dongle -> matlab, all streaming. At this point I have the voltages I want showing up in the MCP log.txt, I am just not sure that opening and closing files 100's of times a second is the most effective means of streaming my packet data into matlab.

Parents
  • Hi,

    I don't have experience with this in Matlab, but maybe you can use the PC-BLE-DRIVER for this. It includes examples using C or python as a wrapper around the library. Another alternative, if you only want to analyze the sensor data for testing purposes you could use the UART module to log the sensor data. The On-board Segger can be used as USB<->UART bridge (USB CDC)

  • Thank you for the replies. I just want to clarify a bit. Would this mean that I go sensor -> nrf51 -> nrf dongle -> (use PC-BLE-DRIVER lib to handle nrf dongle output) -> matlab (reads from some program I'd write for this). Or, does that library remove the need for the dongle? I couldn't really tell by looking at the README.

    If the dongle is creating a UART bridge, isn't the output (the USB end) of the dongle just a serial UART data signal? If it is, I think I should be able to plug this directly into matlab. As I understand it, matlab is able to interface with com ports by opening then, reading them, closing them ect. I just don't think I understand the format of the data by the time it hits the com port (after being received by the nrf dongle).

Reply
  • Thank you for the replies. I just want to clarify a bit. Would this mean that I go sensor -> nrf51 -> nrf dongle -> (use PC-BLE-DRIVER lib to handle nrf dongle output) -> matlab (reads from some program I'd write for this). Or, does that library remove the need for the dongle? I couldn't really tell by looking at the README.

    If the dongle is creating a UART bridge, isn't the output (the USB end) of the dongle just a serial UART data signal? If it is, I think I should be able to plug this directly into matlab. As I understand it, matlab is able to interface with com ports by opening then, reading them, closing them ect. I just don't think I understand the format of the data by the time it hits the com port (after being received by the nrf dongle).

Children
No Data
Related