can Matlab send Ganglion LSL data, to an Arduino, via serial port?

menowhba777menowhba777 sudan
edited August 2018 in Software
Hi

i recieve the EEG Data form Ganglion to matlab via LSL
like the pic : https://irenevigueguix.files.wordpress.com/2016/07/stream.gif?w=346&zoom=2

how can i sent this data to arduino and control according to this data ...
how i make a serial communication between ‏matlab and Arduino to read these data and control

Comments

  • wjcroftwjcroft Mount Shasta, CA
    Hi Menow,

    There are a number of Matlab tutorials and examples, showing how to output to a serial port. This is the same serial port your Arduino would be connected to,



    Regards,

    William

  • Hi
    william

    can i control with this data ...i install arduino package for matlab ...
    and for example after i read data i put
    s= vec data
    can i say if s> 100 turn on led for example

    can i control with this live data by detected any value in commond window ana make a clause

    thanks
  • wjcroftwjcroft Mount Shasta, CA
    The Instructable I gave earlier,


    is an example of sending temperature data from the Arduino to Matlab. You actually are doing the opposite, sending EEG data from Matlab to Arduino. So you will have to do some adaptation. There may be other examples on this search, did you look?


    First you decide on what EEG data you want to send. That might be a derived value, such as the alpha band power in the range of 8 to 12 hz. You can determine this with various DSP Digital Signal Processing operations in Matlab. Then you need to serialize that data or data stream, and send to the Arduino. You might also want to insert delimiters and other indicators into your serial stream. And depending on what baud rate you use, you may need to reduce the amount of data so that it fits in the serial bandwidth you have available.

    I suggest you look around for other examples of Matlab sending to Arduino.

    Regards,

    William

  • thanks william

    one more question

    whan i send data to matlab via lsl .. are you suggest send time series or other one !!??

    i will look around for examples



  • wjcroftwjcroft Mount Shasta, CA
    Matlab is receiving the COMPLETE time series via the LSL stream. It is up to you, what you want to send to the Arduino. My impression is that the signal processing is best done on the laptop in Matlab or other language. Then peripheral control operations, such as controlling an LED, are performed on the Arduino.

    The alpha band power is also a time series, but could be downsampled from the original rate of 200 hz. For example you might only send the alpha band values 10 times per second. OR, you might only send a notification when the LED changes state from 0 to 1 or 1 to 0. Etc. Entirely up to you.

    Regards,


  • thanks you very much.. i will try to do that

    and i tell you whats happened


    Regards ,
Sign In or Register to comment.