Overview
Want to activate your project by flexing a bicep, raising an eyebrow, or clenching a fist? The MyoWare Muscle Sensor can help you make that happen.
This sensor uses EMG (electromyography) to sense the electrical activity of your muscles. It then converts that into a varying voltage that can be read on the analog input pin of any microcontroller.
What you will need for this exercise:
- MyoWare Muscle Sensor
- EMG Electrodes
- Adafruit Feather 32u4 Basic Proto (or any other Arduino-compatible that has analog input pins)
- breadboard
- a strip of (3) male/male jumper wires
- silicone cover stranded core wire
- Adafruit USB isolator
- USB mini cable
- USB micro cable
- E6000 or Quick Hold adhesive (optional)
- zip tie
Before you begin, please review and understand the following prerequisite guides:
Page last edited January 21, 2016
Text editor powered by tinymce.
Preparing the Sensor
In order to connect the muscle sensor to a breadboard we will need to add some wires. Check out how to do this in the steps below.
The third electrode is connected to the circuit board with a black wire. While this connection is already fairly robust, you can reinforce it with glue if you think it will be put under repeated strain.
Separate and strip the newly exposed ends of the jumper wires. Put a short piece of heat shrink tubing on each end of silicone coated wire. Bring exposed ends together.
Solder together exposed ends of silicone coated wires to jumper wires.
Cover with heat shrink tubing and use heat gun to secure in place.
Use helping hands to secure the MyoWare sensor board and the exposed silicone coated wire ends.
Solder in place. Be sure to match red wire to "+", back to "-", and the remaining color to "SIG".
Your MyoWare Muscle Sensor is ready for business!
Page last edited January 21, 2016
Text editor powered by tinymce.
Circuit
Now that your sensor is ready you can go ahead and assemble your circuit. It should look something like this:
The connections that are being made are as follows:
- MyoWare "+" to Feather 3V
- MyoWare "-" to Feather GND
- MyoWare "SIG" to Feather A0
Also included in this circuit is an Adafruit USB Isolator. It is connected to the computer using a USB mini cable and connected to the Feather using a USB micro cable.
It is extremely important to take safety precautions when using sensors that connect directly to your body. The USB Isolator provides protection against any unexpected surges or spikes. This is only necessary if you are wearing the sensor while your circuit is still plugged into your computer. It is not necessary if you are operating exclusively off of battery power. For a battery-operated wireless communication approach to using this sensor check out the 'Sup Brows project guide.
Page last edited January 21, 2016
Text editor powered by tinymce.
Code
This sensor provides an analog signal that can be read by the analog input on your microcontrol, just like many of the common sensors you might use.
Simply open up Arduino and go to File -> Examples -> 01.Basics -> AnalogReadSerial. Then upload this code to your Feather board.
Page last edited January 21, 2016
Text editor powered by tinymce.
Placing Electrodes
Once your code is uploaded you are ready to start sensing! There are many muscles that you can monitor using this sensor - basically any that sit close to the skin. The sensor should always be placed along the length of the muscle, with the electrode closest to the wire connections placed at the middle of the muscle and the second electrode on the circuit board towards to end of the muscle. The third electode attached to the black wire should be placed away from the muscle that is being sensed.
For this example we'll be doing some sensing on the forearm which is a great way to tell when you've clenched your fist. Use the following steps to get your electrodes in place.
Add electrodes to all 3 connectors on the sensor. Remove the paper backing of the two electrodes on the circuit board.
Put the circuit board in place. The side of the circuit board with the wires should be close to the center of the muscle and the other side should be close to the end of the muscle.
Peel the paper backing off of the electrode on the black wire and place it somewhere away from the muscle you are sensing.
Your sensor is in place and you're ready to get sensing!
Page last edited January 21, 2016
Text editor powered by tinymce.
Sensor Values
Now that your circuit has been created, the code uploaded, and the sensor placed on the muscle you are ready to start looking at some sensor values!
Open up the Serial Monitor in Arduino and make a fist. As you flex the muscle the values should go up and when you release they will go back down.
Page last edited January 21, 2016
Text editor powered by tinymce.
What's Next
Now that you've got the MyoWare sensor up and running you can start thinking about all the possibilities of what you can do with it! Here are some ideas for things to try next:
- Use the sensor values to turn on an LED or spin a motor when you flex your arm.
- Look up EMG electrode placement and try to sense other muscles.
- Check out the sensor's datasheet to learn more about it.
- Try our wireless 'Sup Brows project to trigger internet-connected actions
- Imagine the biggest and smallest thing you could make happen with the flexing of your muscles!
Page last edited January 21, 2016
Text editor powered by tinymce.