Introduction: DIY Electromyography

Picture of DIY Electromyography

Electromyography (EMG) is the measurement of nerve impulses to your muscles. Probably the most popular consumer device using EMG is the Myo, which is an armband that lets you do gesture control– check out their website to see some cool demos of why EMG is exciting.

The principle behind EMG is pretty simple: nerve impulses are electrical signals on the order of millivolts, and you can read those millivolts through your skin using electrodes.

In this Instructable, I'll show you how to read the muscle impulses in your bicep, using materials you can buy online and a bit of simple JavaScript code.

You can also find this project written up somewhat differently here: https://projects.tessel.io/projects/emg-over-the-gpio

Step 1: Materials

Picture of Materials

You will need:

  • Tessel
  • Servo module (optional, but fun)
  • Electrode leads
  • Electrodes (you need at least three electrodes, but you'll want spares since they're single use. The link is a 100-pack.)
  • Electrical parts (schematic) – you can get these on DigiKey. Get spares just in case you drop something.
    • AD622A (x2)
    • A00B (x2)
    • BBFDK (x1)
    • 1uH 230mA inductor (x1)
    • 10k resistor (x11)
    • 1nF capacitor (x7)
    • 1uF capacitor (x7)
    • 50k ohm potentiometer (x2)
    • Wires

Step 2: Make the Circuit

Picture of Make the Circuit

You will need to build a circuit to process the incoming signal from the electrodes.

This circuit takes input from five electrodes, amplifies the signal and applies some filtering, and sends it as an analog output. Specifically, it's set up to feed the analog output into the pins of Tessel's GPIO bank as two channels of information, with gains adjustable via the potentiometers.

You can breadboard this. We were kind of fancy and got a custom PCB printed, and then assembled with surface-mount components.

Step 3: Place Electrodes

Picture of Place Electrodes

You need three electrodes to get a signal:

  • One electrode, Vref, goes somewhere near the muscle you're measuring, but not on a muscle– so if you're measuring your bicep, you can put it on the back of your elbow.
  • One electrode goes in the center of your muscle. Flex to see your muscle and stick it right in the middle.
  • One electrode goes on the end of the muscle– so for your bicep, just above the inside of your elbow.

By now, you should have electrodes stuck to your arm, the snap-on electrode leads hooked up from your arm to the circuit, and the circuit wired in to Tessel's GPIO bank.

Step 4: Code

Picture of Code

Plug your Tessel in to your computer with a microUSB cable.

Now you're going to work from the command line. (If you've never done that before, it's not that hard. Here's a one-minute primer: Mac | Windows)

If you haven't used Tessel before, follow the instructions at tessel.io/start to install and get it up and running.

Now, clone my Github repo: https://github.com/Frijol/Tessel-GPIO-EMG (in the command line, enter: git clone https://github.com/Frijol/Tessel-GPIO-EMG.git)

Change directory into that folder of code (cd Tessel-GPIO-EMG).

Ok. Now here's what you have:

  • index.js: a library you can use for EMG. See APIexamples.js for examples of all of the available functions.
  • APIexamples.js: examples of every available API call from index.js.
  • test.js: prints the output from channels 1 and 2 of the GPIO module. Very simple, does not use API– just lets you see if the hardware is working.
  • strength-meter.js: turns a servo in proportion to the output from channel 2. Kind of messy, pre-API.

Run test.js with this command: tessel run test.js

Your terminal should spit out some numbers. Try flexing! The numbers on one of the channels should change noticeably when you're flexing vs. relaxed.

Step 5:

Picture of

Play! Hook up that output to something and control the something with your muscles.

Here's me hooked up to a robot snake.

Here's Jon demonstrating strength-meter.

Comments

briand1414 (author)2016-12-28

Are the values for R10,16,18 & 19 actually zero(0) ohms?

Thanks

briand1414

Yes, they are! They were added into the design in case adjustments were needed.

Does this system use a binary system where it simply uses on or off signal?

Nope, it's analog.

briand1414 (author)2017-05-07

Quick question: Some component values are labeled DNP. Not sure what this means.

Thanks

"DNP" is "Do Not Place" – so, nothing goes there! They are in the design just in case something needed adjustment in hardware, but we never needed to use them.

RimstarOrg (author)2015-05-13

I have got to try this! I was actually thinking about how I'd do something like this in conjunction with a 3D printed hand. Now that I see it in action... Thanks!

Glad to hear it! And funny you should mention... https://twitter.com/SelkeyMoonbeam/status/576529394518360064 building my own 3dp hand based on https://www.instructables.com/id/Voice-Controlled-Prosthetic-Hand-Forearm/

Nice!

gravityisweak (author)2014-08-26

It'd be cool to put sensors on all the major muscles and have it control a puppet or robot.

DaBootO (author)2014-08-26

I've got some Electrodes at Home! Didn't know how to use them - Until now! Thank you!

wilgubeast (author)2014-08-25

That's awesome.

About This Instructable

26,075views

267favorites

License:

Bio: An engineer, seamstress, cook, coder, and overall maker. Spent a summer at Instructables; got a degree in E: Neural Engineering at Olin College; made a ... More »
More by SelkeyMoonbeam:How to Build a Cabin Foundation in a Remote LocationOrienteering Using a Thumb CompassHow to Pack Hangers
Add instructable to: