USB Biofeedback Game Controller

 by Gundanium
Contest WinnerFeatured
Untitled2.png
DSC01501.JPG
DSC01451.JPG
Building upon our last tutorial, which taught you how to build a muscle sensor, we've decided to give you a project that really showcases the power of our muscle (EMG) sensors. Advancer Technologies’ “USB Biofeedback Game Controller” harnesses the power of electromyography to allow players to directly control video games with their muscles. At the core of this plug-in-play controller is the powerful yet low-cost Arduino UNO microcontroller, a favorite among hobbyist and students, acting as a HID keyboard interface. Integrated with the Arduino UNO are four of our new Platinum Series Muscle (EMG) Sensors, allowing four muscles to act independently or in combination with each other to control over four buttons. In our setup, we elected to use a six button setup with the left forearm controlling the B button (RUN/ATTACK), the right forearm controlling the A button (JUMP), the left bicep controlling the LEFT button, the right bicep controlling the RIGHT button, and combinations for UP and DOWN.

This tutorial will teach you to build a USB Biofeedback Game Controller. Use it to play any computer game (that uses keyboard inputs) using your muscles as the controller.




Check out our previous Instructable to learn how to build your own Muscle Sensor

or

Drop by our webstore to purchase muscle sensor circuit boards, sensors, kits, cables and electrodes
Muscle Sensor Kit......includes all circuit parts
Muscle Sensor............fully assembled sensor (international shipping available)

Note: This sensor is not intended for use in the diagnosis of disease or other conditions, or in the cure, mitigation treatment, or prevention of disease, in a man or other animals.

About Advancer Technologies
Advancer Technologies is a company devoted to developing innovative game-changing biomedical and biomechanical technologies and applied sciences. Additionally, Advancer Technologies promotes all forms of interest and learning into biomedical technologies. To help cultivate and educate future great minds and concepts in the field, they frequently post informative instructions on some of their technologies. For more information, please visit www.AdvancerTechnologies.com .
 
Remove these adsRemove these ads by Signing Up

Step 1: Materials

Materials.png
Basics
1 x Arduino Uno R2 (needs the atmega8u2 USB chip which is only available on newer Arduino MCUs)
1 x Arduino Project Enclosure
1 x USB cable for your Arduino
4 x Advancer Technologies Platinum Muscle Sensor 
1 x Advancer Technologies Muscle Sensor Power Supply (without headers)
1 x 12V Power Supply (Wall wart) 
4 sets of EMG Cables and Electrodes

Misc.
Jumper cables or solid core wire
3 x 1" length pieces of 24-30 AWG wire (1/8" stripped off each end)
3 x 2" length pieces of 24-30 AWG wire (1/8" stripped off each end)
3 x 3" length pieces of 24-30 AWG wire (1/8" stripped off each end)
3 x 4" length pieces of 24-30 AWG wire (1/8" stripped off each end)
3 x 3 position Female Receptacle 
1 x 3 position Female Housing
3 x Crimps for Female Housing
Plastic board (ABS)
1 pack x 3/8" 4-40 Screws (91772A108)
2 packs x 4-40 Nuts

Tools
Soldering Iron
Scissors or Tin Snips
Crimping tool
Screw driver
Drill with 1/8" bit
Sandpaper
Dremel tool or other cutting tool

Software
Arduino
Processing

wan xi says: Apr 10, 2013. 9:42 PM
hello,,im having problem with Processing sketch.when i hit the Run button the window don't pop up.It show error..it said java.lang.ArrayIndexOutOfBoundsException: 1...WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
Exception in thread "main" java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: 1
at processing.core.PApplet.runSketch(Unknown Source)
at processing.core.PApplet.main(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at sketch_apr11a.(sketch_apr11a.java:55)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
... 2 more

...can help me.I am new with this software....
wan xi says: Apr 10, 2013. 9:38 PM
hello,,im having problem with Processing sketch.when i hit the Run button the window don't pop up.It show error..it said java.lang.ArrayIndexOutOfBoundsException: 1......can help me.I am new with this software
Capturea.JPGCapturea.JPG
lovetronic says: Apr 8, 2013. 6:15 PM
when i try to run the code in processing software, it replies me "serial does not run in 64-bit mode". i'm still new in this software. please help me.
elzurdo86 says: May 9, 2012. 6:49 PM
Hi , I got it to funciton but only until the third phase, the fourth one is still not working. I will post my advance later today to show you what im doing to see if you can give me a hand, also I was trying to upload the NES EMG files but it does not let me it shows as a pde and it has problems with a boolean type of variable. It seems like it is a processing sketch not an Arduino one. Also I was checking the steps to updgrade the firmware. Is it mandatory to do it? by doing that would I be able to upload the .pde file to the arduino?

I will wait for your reply. Thanks
Gundanium (author) in reply to elzurdo86May 9, 2012. 12:06 PM
Hi,

What version of Arduino's software are you using? This sketch won't work for the new release, v1.0. They moved some header files around. If I find time, I'll work on updating the sketches.

.pde was used by previous arduino files as well as processing files.

I'm not sure I understand what you are talking about in regards to the firmware.
elzurdo86 in reply to GundaniumMay 10, 2012. 8:46 AM
I-m using the Arduino UNO R3 which is different than the one in the link you posted. I haven't tried to update the firmware in this one since the pictures in the link does not match with the one that I have.
Gundanium (author) in reply to elzurdo86May 10, 2012. 11:12 AM
Are you talking about the Arduino hardware firmware? You shouldn't have to update the hardware firmware.

The Arduino development software has changed since I posted these instructions. The hardware firmware should be the same.
elzurdo86 in reply to GundaniumMay 10, 2012. 12:10 PM
So basically I just have to update the sketch for the Arduino and I should be good to go?. How do I set up the keyboard to play the nes game? . Is a special game? or can I download any NES emulator?
mahfatouh says: Apr 10, 2012. 5:39 PM
i downloaded the ardiuno code and when i am about to upload the code to the mcu in the verification , it gives me errors and the code cannot be upoaded. please help
elzurdo86 says: Mar 6, 2012. 3:45 PM
Hello, I'm trying to get this project going, but I'm not able to get anything from the sensors, I made this one with the arduino UNO, and I noticed that the one you have was perhaps a duemilanove? , I tried to compile and Arduino displayed the message, BYTE keyword no longer supported , instead use Serial.write. I changed all of the commands and the program didn't show any mistakes but after uploading everything to Arduino nothing happened. Can you give me a hand with this?
Gundanium (author) in reply to elzurdo86Apr 9, 2012. 6:10 AM
I've updated the Arduino and Processing code used to visualize the sensor output with the new Arduino code base. Let me know if you have any problems with it.
Gundanium (author) in reply to elzurdo86Mar 6, 2012. 4:15 PM
Nope the one I used was an UNO. They've updated the code syntax since this instructable was posted. From my quick google search, it looks like you were on the right track with replacing all .print with .write.

http://www.engblaze.com/changes-in-the-arduino-1-0-release/

I'll update the code when i can find some time.

You might want to look into grabbing an oscilloscope to debug your circuits. This is the first tool I always use prior to hooking things up to a MCU.
elzurdo86 in reply to GundaniumMar 6, 2012. 4:38 PM
Yes That is what I'm thinking. I will look for one and then post my results, hopefully I solved the problem . I'm pretty far away to buy another one :p
I had anorhter question , would it matter if I'm only using 1 EMG sensor for the processing sketch?

Gundanium (author) in reply to elzurdo86Mar 7, 2012. 6:18 AM
No it shouldn't matter. You might want to ground the unused analog pins on your Arduino tho. Their values will float otherwise.
ALEXANDER_F says: Mar 1, 2012. 6:41 AM
Wonderful idear ! But I beg one thing ,I can not downioad the zipped Arduino project in the step 13 ,is there any lovely one can mail me the zipped Arduino project ? My E-mail address : yinshi438788349@126.com .Thank you very much.
agsking says: Jan 16, 2012. 11:35 AM
Looks really cool but for $400 just for the sensors its kinda impractical :\

Good job though :D
epicnoobpwn says: Dec 20, 2011. 6:31 PM
Or you could grow big muscles, wrap arm straps around your biceps and flex to press switch. That would be a lot easier. I'm just saying.
elzurdo86 says: Dec 18, 2011. 6:15 PM
Great!, I'm actually starting to study Biofeedback as well, I just have a question about the noise that the circuits may get, is that a lot? or the circuit is designed to leave that aside.
Greetings from Mexico
ARIrish says: Dec 18, 2011. 2:04 PM
Finally I have a real reason to want to build up my weak and feeble arms...
13thvulture says: Dec 18, 2011. 1:04 PM
that is pretty cool, but does it actually provide some kind of workout, or is it just for fun?
Specautomatics says: Dec 16, 2011. 4:31 AM
Cool :-)
GuyWitheGlasses says: Dec 15, 2011. 8:57 AM
NES Kinect! Seems like my arms would get tired after hours of Mario Bros. action.
asocial says: Dec 15, 2011. 7:45 AM
great
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!