how to connect a Ganglion board to an Arduino board?

MdSakibulAlamMdSakibulAlam Bangladesh
edited September 2018 in Ganglion
How to connect ganglion board with arduino?

Thank you

Comments

  • wjcroftwjcroft Mount Shasta, CA
    Sakibul, hi.

    Can you explain your application in more detail?

    The 'easiest' way to control an Arduino output by EEG (from Ganglion) -- would be to use a laptop as an intermediary. The laptop will receive the Ganglion EEG data stream. Then do some signal processing, of your choice. For example looking at some band powers such as alpha or beta.

    Then to output to the Arduino (for example to control an LED or motor, etc.), the laptop program will send 'commands' to the Arduino, over the serial COM port.

    Regards,

    William

  • MdSakibulAlamMdSakibulAlam Bangladesh
    edited September 2018
    Hi William,
    I just want to on-off a speaker using ganglion board through ardunio.What i have to do to establish connection between these two.

    Thank You
  • wjcroftwjcroft Mount Shasta, CA
    The easiest way is what I outlined previously. The Arduino itself lacks the Bluetooth Low Energy communications which is used to talk to the Ganglion.
  • wjcroftwjcroft Mount Shasta, CA
    See some related threads, using the Google Advanced Search button in the right column,


  • If you are willing to do the driver interfacing, here is an example of a BLE dongle for Arduino, without software:



  • MdSakibulAlamMdSakibulAlam Bangladesh
    edited September 2018
    Hi William,
    Can you give any source code for arduino that shows or collect data from ganglion board and turns on/off led?As i am new with ganglion board,everything seems fishy.It will be very helpful if you provide exact source or any tutorial.Thanks for your response.

    Regards

    Sakibul
  • wjcroftwjcroft Mount Shasta, CA
    Sakibul, hi.

    Did you look through the previous search link results? Here are a couple of the matches,



    ----

    @Billh, yes thanks. That is one way to get BLE on an Arduino. Another would be the BLE112 (serial port interface) that is the basis for the BLED112 (usb serial port interface). Since timing constrains and BLE packet loss have proven daunting on many platforms (Android, Linux, etc.) using built in BLE hardware -- the buffered approach of the BLEx112 has definite advantages.


    But realistically, building a BLE and Ganglion protocol driver for Arduino would be a lot of (quite technical) programming work. Not to mention the signal processing on the Arduino. Which is why the laptop approach has the most history of user projects.

    Best regards,

    William

  • Hi William,
    I have already go through previous links and also connected arduino using network widget but after that how do i control the led?Now i am stuck in arduino coding part.

    Thank you
  • wjcroftwjcroft Mount Shasta, CA
    See some of these links. The OpenBCI_GUI / Focus Widget can output a serial stream with indication of 'Focus'. Your Arduino program will read that serial stream and use the received serial data to control whether LED is on or off.




    [link above should not apply to your situation, since you will only use Focus Widget serial stream, not Networking serial stream.]

    Focus Widget source code,


  • wjcroftwjcroft Mount Shasta, CA
    Oops, rereading this link,


    The Focus Widget used to have a separate 'serial' mode in the user interface. That has been removed and now it all happens via the Networking Widget,


    The first link also shows some sample Arduino code.

    I have not tried this myself. You'll have to fiddle around with some of this to get it to work. Be sure the baud rates match on the Arduino and the COM port setup in the networking widget. You might have a serial port monitor running on a COM port to check to see that the proper ascii strings are being output to the serial port / Arduino.

    You can also adjust some of the thresholds in the Focus widget, if for example, you wanted it to detect Alpha ('meditation'), instead of 'Focus'.
  • edited October 2018
    wjcroft,

    I agree the software writing of a Processing port and package to run OpenBCI GUI on Arduino seems daunting.

    If I needed to work with an Arduino I'd do it via wifi shield on both the OpenBCI device and the Arduino, not bluetooth.

  • Hi,
    My ganglion board giving data in high frequency ,how do i solve this problem?

    Thanks
  • wjcroftwjcroft Mount Shasta, CA
    I would take a look at the two Processing files: W_Focus.pde and W_networking.pde.

    Working together they send out the 'state' that reflects the analysis of the EEG (based on alpha and beta band powers), to determine if you are 'focused' or not. I believe the end result is sent to the serial port (in ascii) as either a '1' or '0', one value per line.

    The Ganglion is sampling at 200 hz. I have not examined the Focus / networking widget code in detail, but it would make sense that those calculations would occur on a down-sampled basis. Such as only 5 or 10 values sent to the serial port per second. But I'm not sure, you should check the code. And if you want or need to, you could implement the downsampling idea.

    Regards,

  • MdSakibulAlamMdSakibulAlam Bangladesh
    edited October 2018
    Channels are not giving right data,how to reduce those data,even i concentrate channels show more then 100 uVrms.I have go through pde files mentioned above.How to edit those .pde file and load to ganglion board?

    Thanks
  • wjcroftwjcroft Mount Shasta, CA
    edited October 2018
    "channels show more then 100 uVrms"

    If your EEG is noisy, it means you need to have better electrode connections. Try following all the steps of the Ganglion tutorial,


    "How to edit those .pde file"

    The GUI is a Processing language program,


    "and load to ganglion board?"

    No, the Ganglion firmware is not altered. Program runs on the laptop in Processing language,

  • I have tried everything, i find in forum but i can not turn on led placed on arduino,anyone here help me to sort out the problem.

    Thanks
  • wjcroftwjcroft Mount Shasta, CA
    Did you get your EEG channels to behave properly? Earlier you said you were getting 100 uV signals. If you have noise, suspect your electrode's connection to scalp. Did you check impedance?
  • MdSakibulAlamMdSakibulAlam Bangladesh
    edited November 2018
    Hi,
    Everything running well ,now i can focus,but i am stuck at the last part with ardunio,i use the same code given in w_focus folder as instructed but the led remains off.

    Thanks
  • wjcroftwjcroft Mount Shasta, CA
    I made some suggestions regarding terminal emulators so you can check what is being sent out through the serial port. Did you try that? Alternately you can modify the source code of the W_Focus widget to print debug statements on the console log, showing what values are being sent out the serial port. Does that make sense?

    Are you sure you have a good serial port connection, matching baud rates, etc.?

    Have you tried connecting a terminal emulator to the arduino com port and sending test values to see the reaction of the led? Etc.

    Keep trying logical steps to inspect and debug what is going on.
  • Yes,all done, when its focused the gui sending true,and when not focused sends false but arduino does not respond on this,i also separately use arduino serial terminal to pass value.
  • wjcroftwjcroft Mount Shasta, CA
    edited November 2018
    So your next step would then be to connect a terminal emulator to the arduino and send alternate true and false. If the led does not change, then you have a bug in your Arduino code.

    There is nothing wrong with OpenBCI or the Focus widget.

    Have you tried the simplest possible Arduino program, that is, to alternately blink the LED on and off? Not using any serial input.

  • Yes i have done that,also pass 1 or 0 to turn on/off through serial terminal.
  • wjcroftwjcroft Mount Shasta, CA
    OK, if the Focus widget is working, and you see the serial output. And the Arduino works, by sending human serial commands. Then there must be something odd with your serial port connection. Are you sure you have the TX RX connected to RX TX, that kind of thing? Matching baud rates? Can you make your Arduino supply some debug info, such as blink another LED when each value is received, regardless of true / false. Etc. 

    If you have confirmed that the Widget is sending serial correctly, and the Arduino is receiving serial correctly --- then there are not too many other things that can be the culprit. Just keep trying different debug strategies. You must have some issue with your COM port. Likely the baud rates are not matching.

  • The baud rate is same in both rate,can you explain RX TX to TX RX thing?
  • wjcroftwjcroft Mount Shasta, CA
    If you had the terminal emulator able to turn the LED on or off, that means it is likely ok. For a serial port to work, transmit TX, must be connected to receive RX on the other side. And vice versa.

    I'm running out of suggestions. You say you had another laptop with a terminal emulator, connected to the output port that the Widget was using: and you saw the 0's go to 1's, when you were in the focus state? Conversely when your focus was lost, the 1's turned back to zeros? That means everything is fine with the (1) the serial port, (2) the Focus widget, (3) your eeg connections.

    The problem must be with your Arduino. Are you sure you are manually able to turn the LED on or off by human-typing 1's or 0's into the Arduino port? That means your Arduino program is doing what you programmed it to do. I don't understand why it is not responding to the 1's and 0's from the Widget.

    Another area you could check, with everything connected, is the Device Manager, COM port Properties. You should see the right baud rate in there, 1 stop bit, etc.

  • MdSakibulAlamMdSakibulAlam Bangladesh
    edited November 2018
    Thanks a lot for your response,do you refer anyone with the arduino part?Do i have connet RX TX with ganglion board or something else?or any project related to this
  • Hi wjcroft ,
    Thanks a lot,Good news is ,its working ,i can control led using focus widget.
Sign In or Register to comment.