Electromyography (EMG) sensors detect the electrical signals produced by your muscles when they contract. This technology — once confined to hospital neurophysiology labs — is now accessible to Arduino hobbyists, robotics students, and biomedical engineering enthusiasts through affordable modules like the MyoWare 2.0 Muscle Sensor. In this guide, we’ll walk through the complete picture: how EMG signals are generated, how the MyoWare 2.0 works, how to wire and code it with Arduino, and how to build a gesture-controlled prosthetic hand or robotic arm.
Understanding EMG Signals
Every time a muscle fibre contracts, it generates a tiny electrical potential called a Motor Unit Action Potential (MUAP). A single muscle contains hundreds to thousands of motor units firing asynchronously. The EMG signal you measure on the skin surface is the spatial and temporal summation of all these MUAPs — a composite signal that looks like random noise but contains rich information about muscle activation level and timing.
Signal Characteristics:
- Amplitude: 50 μV to 5 mV (raw surface EMG). After amplification, this becomes a workable voltage range.
- Frequency range: 20 Hz to 500 Hz, with most energy between 50–150 Hz
- Noise sources: Motion artifact (below 20 Hz), power line interference (50 Hz in India), electrode impedance noise
- Time resolution: Onset of contraction visible within 10–30 ms of nerve activation
Processing EMG: Raw EMG is biphasic (swings positive and negative). To get a useful signal representing muscle activation, you need to: (1) Amplify the signal 1000–10000×, (2) Bandpass filter to 20–500 Hz to remove motion artifact and high-frequency noise, (3) Rectify (take the absolute value), (4) Smooth with a moving average or RMS calculation. The MyoWare 2.0 performs all of this on the chip.
MyoWare 2.0: Features and Specifications
MyoWare 2.0, designed by Advancer Technologies (now part of SparkFun), is the second generation of a widely respected muscle sensor platform designed specifically for makers and researchers. It’s a significant upgrade over the original MyoWare in several key areas.
Key Specifications:
- Power supply: +/- 1.5V to +/- 3.5V (dual supply) or 1.8V–5V single supply with Power Shield
- Output: Two outputs — RAW (amplified biphasic EMG) and ENV (rectified, smoothed envelope)
- SNR improvement: ~6 dB better than MyoWare 1.0 due to redesigned instrumentation amplifier
- Integrated electrodes: Snap connectors for standard ECG/EMG snap electrodes
- Gain adjustment: Onboard potentiometer for gain tuning
- LED indicator: On-board LED that brightens with muscle contraction intensity
- Shield system: Modular shield ecosystem (Power Shield, Link Shield, IMU Shield)
- Dimensions: 47.5mm × 22.4mm
MyoWare 2.0 vs MyoWare 1.0 Differences:
| Feature | MyoWare 1.0 | MyoWare 2.0 |
|---|---|---|
| Power supply | +3.3V to +5V single | Bipolar or single (with shield) |
| Outputs | SIG (ENV only) | ENV + RAW |
| Noise performance | Good | ~6dB better |
| Shield compatibility | None | Full ecosystem |
Electrode Placement Techniques
Electrode placement is the single most important factor in getting clean EMG signals. Poor placement yields noisy, unreliable data regardless of how good your sensor is.
The Three-Electrode Configuration: EMG sensors use a differential measurement with two active electrodes and one reference (ground). Place the two active electrodes along the muscle belly (longitudinal axis), separated by 2 cm. The reference electrode goes over a bony, electrically inactive landmark (elbow, wrist bone, ankle).
Common Muscle Sites for Beginners:
- Biceps brachii: Upper arm, front surface. Flex elbow to find the muscle belly. Easy to access, strong signal. Great for basic grip/flex detection.
- Forearm flexors (wrist flexion): Inner forearm, 1/3 of the way from elbow to wrist. Controls finger and wrist flexion. Essential for prosthetic hand control.
- Forearm extensors (wrist extension): Outer forearm, same position on dorsal side. Pair with flexors for 2-gesture control.
- Quadriceps (vastus lateralis): Outer thigh. Strong signal. Good for lower limb prosthetic or exoskeleton research.
- Tibialis anterior: Shin, front. Controls foot dorsiflexion. Used in drop foot devices.
Skin Preparation: Clean the electrode site with isopropyl alcohol to remove oil and dead skin. For research, light abrasion with abrasive electrode gel (Nuprep) reduces skin impedance from >100 kΩ to <5 kΩ, dramatically improving signal quality. For maker projects, alcohol cleaning is sufficient.
Wiring MyoWare 2.0 to Arduino
MyoWare 2.0 with the Power Shield (for single-supply 5V operation):
MyoWare 2.0 + Power Shield → Arduino Uno
-------------------------- -----------
+5V (via Power Shield) → 5V
GND → GND
ENV (Envelope Output) → A0
RAW (Raw EMG, optional) → A1
Without the Power Shield, MyoWare 2.0 requires a bipolar supply (+3.3V and -3.3V). You can generate -3.3V using an ICL7660 charge pump or a dual-output LiPo battery pack. For Arduino beginners, the Power Shield simplifies this to a single 5V supply.
Important Notes:
- Shield the electrode cables with braided cable or use MyoWare’s Link Shield for cable management
- Keep electrode cables short (under 30 cm) to minimize interference pickup
- Run the system on battery power for best results (laptop on battery, not mains)
- If using USB power, add a 100μF electrolytic + 100nF ceramic capacitor across 5V and GND on the breadboard
Arduino EMG Code and Signal Processing
Here’s a complete sketch for reading the MyoWare envelope signal and computing real-time RMS for robust muscle activation detection:
// MyoWare 2.0 EMG Reader with Threshold Detection
// ENV output → A0, RAW output → A1
const int ENV_PIN = A0;
const int RAW_PIN = A1;
// Calibration thresholds (tune these for your body/muscle)
int restBaseline = 0; // Average ADC value at rest
int contractionThresh = 0; // Threshold for detecting contraction
// Moving average for smoothing
const int MA_WINDOW = 20;
int envBuffer[20];
int envIndex = 0;
long envSum = 0;
void setup() {
Serial.begin(115200);
Serial.println("MyoWare 2.0 EMG Sensor");
Serial.println("Calibrating... Stay relaxed for 3 seconds");
delay(1000);
// Collect baseline
long baselineSum = 0;
for (int i = 0; i < 100; i++) {
baselineSum += analogRead(ENV_PIN);
delay(30);
}
restBaseline = baselineSum / 100;
contractionThresh = restBaseline + (restBaseline * 0.3); // 30% above baseline
// Init moving average buffer
for (int i = 0; i < MA_WINDOW; i++) {
envBuffer[i] = restBaseline;
envSum += restBaseline;
}
Serial.print("Baseline: "); Serial.println(restBaseline);
Serial.print("Threshold: "); Serial.println(contractionThresh);
Serial.println("Time,ENV,Smoothed,State");
}
void loop() {
int envRaw = analogRead(ENV_PIN);
// Update moving average
envSum -= envBuffer[envIndex];
envBuffer[envIndex] = envRaw;
envSum += envRaw;
envIndex = (envIndex + 1) % MA_WINDOW;
int smoothed = envSum / MA_WINDOW;
bool isContracting = (smoothed > contractionThresh);
// Convert to percentage of max contraction
float activationPct = constrain(
(float)(smoothed - restBaseline) / (1023 - restBaseline) * 100,
0, 100
);
Serial.print(millis());
Serial.print(",");
Serial.print(envRaw);
Serial.print(",");
Serial.print(smoothed);
Serial.print(",");
Serial.print(isContracting ? "CONTRACT" : "REST");
Serial.print(",");
Serial.println(activationPct, 1);
delay(20); // 50 Hz sampling
}
Gesture Recognition Implementation
With a single EMG channel, you can detect contraction vs. rest. With two channels (e.g., forearm flexors + extensors), you can recognize 4 states: both relaxed, flexor active, extensor active, both active (co-contraction). This is the basis of most prosthetic control systems.
// Two-Channel Gesture Recognition
// Flexor EMG → A0, Extensor EMG → A1
enum Gesture { REST, FLEX, EXTEND, COCLENCH };
Gesture classifyGesture(int flexVal, int extVal, int flexThresh, int extThresh) {
bool flexActive = (flexVal > flexThresh);
bool extActive = (extVal > extThresh);
if (!flexActive && !extActive) return REST;
if ( flexActive && !extActive) return FLEX;
if (!flexActive && extActive) return EXTEND;
return COCLENCH; // Both active
}
void executeGesture(Gesture g) {
switch (g) {
case REST: /* Open hand / neutral */ break;
case FLEX: /* Close hand / grip */ break;
case EXTEND: /* Open hand actively */ break;
case COCLENCH: /* Mode switch / trigger */ break;
}
}
For more sophisticated gesture recognition (distinguishing fine finger movements like peace sign vs. thumbs up), you need 4–8 EMG channels and machine learning. Libraries like scikit-learn with LDA (Linear Discriminant Analysis) classifiers are commonly used. The open-source Myo Gesture Control Armband SDK (now discontinued but documented) used 8 channels + IMU for full hand gesture recognition.
Building a Prosthetic Control System
A functional EMG-controlled prosthetic hand involves these components:
- Signal acquisition: 1–2 MyoWare 2.0 sensors on forearm residual limb or healthy forearm
- Processing: Arduino Nano or ESP32 for real-time signal processing and gesture classification
- Actuation: 1–6 micro servo motors (MG90S recommended for finger joints) or tendon-driven mechanisms
- Structure: 3D-printed hand (e-NABLE Community designs are open-source and free), fishing line tendons
- Power: 5V 3A power bank (provides clean power, not 50Hz noise from mains adapters)
Control Logic for a 3-Grip Prosthetic Hand:
- Rest state (no EMG): Hand in open/neutral position
- Single short flex: Power grip (all fingers close)
- Single short extension: Release (all fingers open)
- Double flex (within 500ms): Switch to pinch grip mode
- Co-contraction (both channels simultaneously): Mode cycle
This proportional control can also be implemented: the activation percentage (0–100%) maps directly to how far the servo rotates. Stronger contraction = tighter grip. This proportional myoelectric control is the standard in clinical prosthetics.
Assembly Tips:
- Use silicone EMG electrode pads over silver-silver chloride disposable electrodes for best signal
- Secure the MyoWare board flat against the skin using medical tape or an armband
- Route wires through the arm socket liner to minimize motion artifact
- Add a debounce timer (100ms minimum) to prevent false triggering from noise spikes
INA219 I2C Bi-directional Current/Power Monitor
Monitor the current draw of servo motors in your prosthetic hand project. The INA219 provides I2C-based power monitoring — essential for battery life management in wearable builds.
Alternative EMG Sensors
OYMotion GForce EMG Armband
A commercial 8-channel EMG armband with Bluetooth. Pre-trained gesture recognition, API available. More expensive than MyoWare but eliminates electrode placement challenges. Good for HCI research.
OpenBCI Cyton Board
8-channel biosignal acquisition board used in neuroscience research. Supports EMG, EEG, ECG. High-quality ADC (24-bit vs Arduino’s 10-bit), proper medical-grade instrumentation amplifiers. Significantly more expensive but research-grade quality.
DIY Instrumentation Amplifier
Build your own with INA128 or AD8221 instrumentation amplifier + active bandpass filter (OPA2134 op-amps). For advanced electronics students, this provides deepest understanding and maximum flexibility. Requires PCB fabrication or careful point-to-point wiring.
Olimex EMG Shield
An Arduino shield format EMG sensor. Budget-friendly, easy to use, but lower SNR than MyoWare 2.0. Good for basic detection tasks.
Advanced Applications
Prosthetic Limb Control: The primary clinical application. Commercial systems (Otto Bock, Fillauer) use sophisticated myoelectric control. Student-grade versions with MyoWare are functional for demonstrations and research.
Exoskeleton Assistance: EMG intent detection drives powered orthoses for stroke rehabilitation. When the patient tries to move their arm (weak EMG signal), the exoskeleton amplifies the movement. Clinically proven in stroke rehabilitation.
Gaming and VR Control: Muscle-based game controllers offer a novel input modality. Clench fist to jump, extend wrist to shoot. Combines well with IMU data for full arm gesture control in VR.
Sports Performance: Athletes use EMG to analyze muscle activation patterns during training. Are you over-relying on one muscle group? EMG biofeedback enables correction before injury occurs.
Fatigue Monitoring: As a muscle fatigues, the EMG frequency spectrum shifts downward (median frequency decreases) while amplitude may increase. This “fatigue index” is used in occupational ergonomics to prevent repetitive strain injury.
20A Range Current Sensor Module ACS712
Power sensing for your prosthetic servo motors. The ACS712 20A module handles the current demands of multiple servos and reports back to your controller for load-aware grip force management.
Frequently Asked Questions
Is the MyoWare 2.0 safe to use on the body?
Yes. MyoWare 2.0 is designed for surface EMG, using only millivolt-level signals that are passive measurements of your body’s own electrical activity. No current is injected into the body. The sensor is isolated from mains power. It is safe for educational use, though it is not a medical device and should not be used for clinical diagnosis.
What muscles give the best EMG signal for beginners?
The biceps brachii (upper arm) and forearm flexors give the strongest, most accessible signals for beginners. These large, superficial muscles with a clear contraction motion are easiest to isolate and measure cleanly. Start here before moving to smaller, deeper muscles.
Can I detect individual finger movements with EMG?
Partially. Finger movements share many of the same forearm muscles, making individual finger isolation difficult with surface EMG. With 4+ channels strategically placed on the forearm, you can distinguish hand gesture patterns (fist, open hand, pinch, etc.) using machine learning, but not truly individual fingers.
Why does my EMG signal drop out intermittently?
Usually electrode contact issues. Causes: (1) Hair under electrode pad — shave the site. (2) Dry electrode gel — add a drop of isotonic saline or replace disposable electrode. (3) Cable movement — tape cables to skin to prevent motion artifact. (4) Electrode placed over a tendon instead of the muscle belly — reposition.
Does MyoWare 2.0 work with Arduino Uno?
Yes, but you need the MyoWare Power Shield to use it at 5V with a standard Arduino. Without the Power Shield, MyoWare 2.0 requires a bipolar supply (±1.5V to ±3.5V). The Power Shield converts a single 5V supply to the required bipolar rails internally.
What sampling rate should I use for EMG?
Minimum 1000 Hz (1 kHz) for raw EMG to satisfy Nyquist criterion (EMG bandwidth up to 500 Hz). For envelope (smoothed) signals from MyoWare’s ENV output, 50–100 Hz is sufficient. Arduino Uno can do 9615 Hz per channel at maximum ADC speed if needed.
Conclusion
The MyoWare 2.0 EMG muscle sensor makes it practical for students, hobbyists, and researchers to explore the fascinating world of human-machine interfaces driven by muscle signals. From simple flex-to-control demos to full myoelectric prosthetic hands, the applications are both technically challenging and deeply meaningful.
The key is starting simple — get clean signals from a bicep contraction, threshold them reliably, then progressively add complexity. The prosthetic control system described above is achievable over a weekend with the right materials and patient electrode placement. More sophisticated gesture recognition requires machine learning but is well within reach for motivated engineering students.
India has a significant prosthetics access gap, and affordable DIY solutions built on platforms like MyoWare 2.0 are making a real difference in research institutions and innovative startups across the country. Your project today could be the prototype for tomorrow’s accessible prosthetic device.
Add comment