Build a Robot Hand You Control with Your Own Muscles!
Squeeze your fist and watch a robot hand copy you! Learn how an EMG muscle sensor and an Arduino work together, just like a real bionic hand.
⚡ What Is an EMG Sensor?
Every time you squeeze your hand, your brain sends tiny electrical signals to your muscles. An EMG sensor (electromyography sensor) listens to those signals through sticky pads on your skin. The Arduino reads the signal and tells a small motor to close the robot fingers. Stronger squeeze = stronger signal = tighter robot grip!
🧰 What You'll Need
- 🔲 Arduino Uno
- 💪 MyoWare muscle sensor
- 🩹 3 snap-on electrode pads
- ⚙️ SG90 or MG90S servo motor
- 🧵 Fishing line or strong thread
- 📦 Cardboard, straws & elastic (hand)
- 🔌 Breadboard & jumper wires
- 🔋 Battery pack (4×AA, for servo)
🔧 The Circuit Diagram
| Part | Pin | Connects to |
|---|---|---|
| MyoWare | VIN / + | Arduino 5V |
| MyoWare | GND / – | Arduino GND |
| MyoWare | ENV (or SIG on older board) | Arduino A0 |
| Servo | Signal (orange) | Arduino D9 |
| Servo | Power (red) | Battery pack + |
| Servo | Ground (brown) | Battery – and Arduino GND |
👣 Step-by-Step Build
Make the robot hand
Cut a palm and four fingers from thick cardboard. Glue short pieces of straw along each finger. Thread fishing line through the straws from fingertip to palm, and add a strip of elastic on the back so fingers spring open.
Attach the servo
Tape the servo to the palm. Tie all the fishing lines to a servo horn so that when the servo turns, it pulls every finger closed.
Wire the circuit
Follow the diagram and table above. Remember: the servo gets power from the battery pack, but its ground must be shared with the Arduino.
Place the sensor pads
Stick two pads on the thickest part of your forearm (the muscle that bulges when you make a fist), about 3 cm apart. Stick the third pad on a bony spot, like the back of your wrist or elbow. Snap the sensor on.
Upload the code
Open the Arduino IDE, paste the sketch below, and upload it. Keep your arm relaxed for the first 3 seconds, the robot is learning your "resting" signal!
Squeeze and play
Make a fist and watch the robot hand close. Open your hand and it relaxes. If it's too jumpy or too lazy, adjust SENSITIVITY in the code.
💻 The Code
#include <Servo.h>
Servo fingerServo;
const int emgPin = A0;
const int servoPin = 9;
const int SAMPLES = 10; // how many readings to average
int SENSITIVITY = 250; // bigger = need a harder squeeze
int readings[SAMPLES];
int index = 0;
long total = 0;
int baseline = 0; // your relaxed-muscle signal
float currentAngle = 0;
void setup() {
Serial.begin(9600);
fingerServo.attach(servoPin);
fingerServo.write(0);
// Calibration: stay relaxed for 3 seconds
Serial.println("Relax your muscle... calibrating");
long sum = 0;
for (int i = 0; i < 150; i++) {
sum += analogRead(emgPin);
delay(20);
}
baseline = sum / 150;
for (int i = 0; i < SAMPLES; i++) readings[i] = baseline;
total = (long)baseline * SAMPLES;
Serial.println("Ready! Squeeze your fist.");
}
void loop() {
// 1) Smooth the signal with a moving average
total -= readings[index];
readings[index] = analogRead(emgPin);
total += readings[index];
index = (index + 1) % SAMPLES;
int smooth = total / SAMPLES;
// 2) Turn muscle strength into a finger angle (0-150 degrees)
int strength = constrain(smooth, baseline, baseline + SENSITIVITY);
int targetAngle = map(strength, baseline, baseline + SENSITIVITY, 0, 150);
// 3) Move the servo gently so the hand isn't jittery
currentAngle += (targetAngle - currentAngle) * 0.2;
fingerServo.write((int)currentAngle);
Serial.print(smooth);
Serial.print(" angle: ");
Serial.println((int)currentAngle);
delay(20);
}
🧠 How the Code Thinks
- Calibrate: it measures your relaxed muscle so it knows what "normal" looks like.
- Smooth: it averages 10 readings so tiny electrical noise doesn't make the hand twitch.
- Map: it turns a weak squeeze into a small finger move and a strong squeeze into a full grip.
🛠️ Troubleshooting
- Hand twitches randomly? Re-stick the pads, clean your skin with a tissue, and recalibrate.
- Nothing moves? Lower
SENSITIVITYto 150 or check the A0 wire. - Servo resets the Arduino? Power it from the battery pack, not the Arduino 5V pin.
🚀 Level-Up Ideas
- Use 5 servos so each finger moves on its own.
- 3D-print a hand design for a stronger grip.
- Add a second sensor to switch between grip modes.
- Show the muscle signal as a live graph with the Arduino Serial Plotter.
❓ Quick Questions
Is the EMG sensor safe?
Yes, when powered by batteries and used with adult supervision. It only listens to your muscle, it doesn't send electricity into you.
What age is this project best for?
Ages 12 and up, or younger with an adult helper, since it combines sensors, a motor and code.
Can I use a different muscle sensor?
Yes! Any EMG module with an analog output works. Just connect its output to A0 and recalibrate.
Comments
Post a Comment