activating Arduino servo via OpenBCI EMG

edited August 2016 in Software
Hi!
I am currently trying to make a servo motor move when it gets input from  EMG signals.

And I want to connect my 32 bit Open BCI board to an Arduino uno without having to have a computer linked to the Open BCI.
Is this possible?  How should I do to make this work? which pins are used to output the signal (I will only use two of the sensors) and is it possible to connect them straight into the Arduino? Or does it need anything that amplifies the signal before it gets to the Arduino?  


// Djoeff

Comments

  • biomurphbiomurph Brooklyn, NY
    Depending on what kind of signaling you want to do, this should not be too hard a task. 
    Check out the 32bit board documentation on this page
    where it describes the pins that are available to use.
    The biggest challenge would be interfacing the 3.3V on the OpenBCI with the 5V of the Arduino board you're using.
    This level shifter from Adafruit looks like it will do the job nicely
    How are you planning to communicate between the two devices?
  • Thanks a lot!
    My idea is to use the output from the Open BCI board and use it as input to the arduino. 

    I want the communication to be done by wire not by BLE, is that possible? 
  • biomurphbiomurph Brooklyn, NY
    Yes, you can connect one or more of the broken out GPIOs on the OpenBCI board, and connect that to the pin(s) on your Arduino.
    The thing is, the Arduino UNO runs on 5V, so you will need the level shifter (or a level shifter) to ensure that the 5V<>3V systems play nice with each other.

    Can you tell us more about your idea and plan? That would help us to give you the best advice.
  • wjcroftwjcroft Mount Shasta, CA
    edited October 2015
    @djoeff , hi.

    Depending on what type of microcontroller you are using, some of these support "usb host mode", which you could plug our dongle into.

    http://openbci.com/forum/index.php?p=/discussion/510/openbci-with-raspberry-pi-or-similar-uc-linux

    William
  •  I am making an exoskeleton, for the elbow joint, that should use the EMG signals of the bicep to contract and tricep to extend the arm. 
    So what i want to do is to have the servo contract the arm when the bicep is activated and extend it when the tricep is activated.

    And my idea (if it is possible) is to connect one EMG electrode to the bicep and connect its corresponding GPIO pin via an level shifter and connect it to a pin on the Arduino (the same thing for the tricep with another pin on the arduino)
    The arduino should only do a digitalread of the pins and do the corresponding action to which muscle is contracted.

    Is this possible? In that case do the electrodes connected to the BCI board have a certain GPIO pin?  
  • wjcroftwjcroft Mount Shasta, CA
    @djoeff ,

    > In that case do the electrodes connected to the BCI board have a certain GPIO pin? 

    Umm, it's possible you could reprogram your 32 bit board to do something like that, but my impression is that that approach would be "the hard way".

    What about this setup: use the OpenBCI as normal with it connected to a laptop via the dongle. The Processing or Python code on that laptop would determine when your EMG signals meet the criteria you are looking for. And perhaps also compute the "magnitude" of the contraction based on how big the EMG signal is.

    Then you connect your Arduino through another usb port (or serial port) to the laptop. The Processing / Python code sends commands to the Arduino to activate the arm as desired. This could be as simple as a one line command: with B or T as the indicator for Bicep or Tricep, followed by an integer number from 1 to 1000 indicating the magnitude of that command. The Arduino sketch then handles the servo activation. Separating the functions like this also guarantees you are not sending noise back to the OpenBCI board, which is sensitive to microvolt level signals.

    William

  • biomurphbiomurph Brooklyn, NY
    I agree with wjcroft on this. You're going to get alot more use out of the OpenBCI data if you use software to interpret the signal.
    Have you had a chance to hook yourself up to the OpenBCI system and look at activity of the muscle groups you are interested in?
    That would be the first step. Also, when you simply raise and lower your forearm, you are pretty much using your bicep only for that. The bicep is more, or less, contracted to raise the forearm to different height. 

    On the other hand, if you just want a simple translation of bicep, tricep activity to move motors, that's totally doable. But again, it's best to start working with software like the OpenBCI GUI to determine what threshold of muscle activity you want to trigger the event. Then, you can translate that to code on the OpenBCI board, and make the connection to the second Arduino.
  • Thanks a lot  for the help guys!
    I am now trying to make the board to show me the data on my computer, I am using the Python code to make this happen

    I am using a 2011 macbook pro and osx 10.10.5 

    Is there any good solutions to this problem or should i try something else?
Sign In or Register to comment.