Community /

Using Open Bionics with OpenBCI

For the last week and a half I’ve been working on a cool little project that involves moving a robotic hand (Open Bionics) using EMG and EEG signals from my OpenBCI board! As shown below, the hand will open/close with 2 jaw clenches and will “rock on” when a user closes his/her eyes!

To begin with I took a look at Open Bionic’s amazing tutorial to assemble and test the robot hand. This process was simple enough, the tutorial basically covers everything needed to get the hand up and running. The next step for me was to print out and build a forearm for the hand. I used this great little site called tinkercad as I am a novice when it comes to 3D modeling software. Tinkercad is easy to use and is a great tool for making quick and simple 3D models (The default names it gives your projects are pretty neat too :P)!

 

Above is the model I used for the forearm, and to the left is a simple “wrist” that I designed for part 2 of this project. It should be noted that if you are going to use these files, the wrist model will actually not fit in to the forearm. I would recommend editing my file by shaving the bottom rectangle by a good margin and then just drilling through the forearm, which is what I did for part 1 of this project.

After everything was printed out I got started! I am fortunate to be working at OpenBCI this summer, so I had a lot of resources and code to basically just modify and hack at to get the project working. My code utilizes a lot of code from other projects here at OpenBCI. Most notably I used Conor Russomanno’s code from his NeuroHack talk which includes a basic trainer for jaw clenches and eye blinks. We will be utilizing his jaw clenching code primarily for this project, however if you wanna play around with his source you can definitely make improvements and additions of different gestures!

If you’re familiar with the 10-20 system (pictured below), I placed my electrodes at Fp1, Fp2, T7, T8, P7, P8, and Oz. It should be noted that Conor’s code is intended to use 8 electrodes, so if you’re having trouble training the model try adding another electrode somewhere close-ish to a jaw clenching area (I would recommend either FT7, FT8, TP7 or TP8). It is also important to note that the Oz electrode must be plugged into the N7P position on your OpenBCI board. This is because the Oz electrode will be monitoring your alpha wave signals. For more info on this, check out EEGHacker’s awesome project in controlling a hex bug. I used a lot of his code to deal with peak detection for this project and for my SSVEP project.


The UltraCortex is not necessary but makes testing so much easier! Dry electrodes are the best!
Anyway if you use my code you should be able to to trigger the “Rock On” gesture by closing your eyes. The code waits for your occipital lobe to output alpha waves (which run on the FFT plot at 10hz) and will then trigger the command! I have also built in some redundancies to stop the hand from getting confused, which happened quite a bit during development.
In order to pull up the training screen on your OpenBCI GUI for jaw clenching, you have to key the “.” key in. After you train it a bit, press the “up arrow” key on your keyboard to start recording jaw clenches. When you clench your jaw twice you should be able to close the hand into a fist. There should be a red dot in the middle of the GUI that will turn green when you have keyed the command correctly.
I think that’s it! Look forward to Part 2 which will be out soon. It will hopefully include a fully working wrist and new gestures. Feel free to drop a comment if you have any questions, I’d love to answer and help out!

Leave a Reply