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)

  • You have two solutions:

    1. Two nRF51 (lets say both are nrf51 dk). First nrf51 has sensor connected and it gets data from sensor. Through special created service, or pseudo-uart (ble-nus) it sends the data to second DK which is connected to PC. Second DK is shown on PC as j-link device with uart capabilities so you can open it as a normal serial port (ex. in putty or matlab). program on second nrf51 displays received data on that port.

    2. Simple version: one nrf51 (ex. nrf51-DK with on-board segger chip). you connect sensor to it, write program that takes data from sensor and displays it on serial port (with segger chip help). you read it from serial port on PC. (putty, matlab etc...)

Reply
  • You have two solutions:

    1. Two nRF51 (lets say both are nrf51 dk). First nrf51 has sensor connected and it gets data from sensor. Through special created service, or pseudo-uart (ble-nus) it sends the data to second DK which is connected to PC. Second DK is shown on PC as j-link device with uart capabilities so you can open it as a normal serial port (ex. in putty or matlab). program on second nrf51 displays received data on that port.

    2. Simple version: one nrf51 (ex. nrf51-DK with on-board segger chip). you connect sensor to it, write program that takes data from sensor and displays it on serial port (with segger chip help). you read it from serial port on PC. (putty, matlab etc...)

Children
No Data
Related