Introduction: 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
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
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
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
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:
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.

Participated in the
Remote Control Contest

Participated in the
Tech Contest

Participated in the
Epilog Challenge VI
13 Comments
Question 4 years ago on Step 2
can i get a electronics lab to make this for me to use in a study of lower back pain... these cost a stack to buy.
6 years ago
Are the values for R10,16,18 & 19 actually zero(0) ohms?
Thanks
briand1414
Reply 6 years ago
Yes, they are! They were added into the design in case adjustments were needed.
Reply 6 years ago
Does this system use a binary system where it simply uses on or off signal?
Reply 6 years ago
Nope, it's analog.
6 years ago
Quick question: Some component values are labeled DNP. Not sure what this means.
Thanks
Reply 6 years ago
"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.
8 years ago on Introduction
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!
Reply 8 years ago on Introduction
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/
Reply 8 years ago on Introduction
Nice!
8 years ago on Introduction
It'd be cool to put sensors on all the major muscles and have it control a puppet or robot.
8 years ago
I've got some Electrodes at Home! Didn't know how to use them - Until now! Thank you!
8 years ago on Introduction
That's awesome.