Muscle controlled robot

Muscle-Controlled Robot Hand with EMG Sensor | Kids Robotics Project
Intermediate Robotics Project

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!

💡 Kid Fact: Doctors use the same idea to build bionic hands that help people who have lost a hand pick things up again.

🧰 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)
🛡️ Safety first: power your EMG sensor from a battery or a laptop on battery, never from a wall-plugged device while the pads are on your skin. Always build with an adult nearby.

🔧 The Circuit Diagram

Arduino Uno A0 · 5V · GND · D9 MyoWare Muscle Sensor ENV → A0 5V / GND Servo Motor Signal → D9 4×AA Battery servo power shared GND
PartPinConnects to
MyoWareVIN / +Arduino 5V
MyoWareGND / –Arduino GND
MyoWareENV (or SIG on older board)Arduino A0
ServoSignal (orange)Arduino D9
ServoPower (red)Battery pack +
ServoGround (brown)Battery – and Arduino GND

👣 Step-by-Step Build

1

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.

2

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.

3

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.

4

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.

5

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!

6

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

  1. Calibrate: it measures your relaxed muscle so it knows what "normal" looks like.
  2. Smooth: it averages 10 readings so tiny electrical noise doesn't make the hand twitch.
  3. 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 SENSITIVITY to 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.

Made for young inventors who love robots 💜 — a beginner-friendly STEM & robotics project.

Comments

Product Cards
Buddy Bot eBook
⭐ New 2026 Release
Build Your
Own Robot!
3D design, wiring &
Arduino coding.
★★★★★ Young inventors love it!
🖨️
3D Print
All parts
⚡
Wire it
Circuit guide
💻
Code it
Arduino IDE
🤖
Watch it
Walk & react
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Website Offer
₹499 ₹300
🌍 International: $5 USD
One-time · Instant digital delivery
🔒 Secured by Razorpay · Your data is safe
📄 Download Free Sample Copy
🔒 Secured by Razorpay · Your data is safe
🍓
Raspberry Pi Pico Mastery
21 Projects
⚡ Launch Price — 80% OFF
Learn Pico
Build 21 Projects!
MicroPython · Wokwi
IoT · Certificate
★★★★★ Perfect for beginners!
🖥️
Wokwi
No hardware
🐍
MicroPy
From zero
🔨
21 Projects
IoT + sensors
📄
Certificate
Verified cert
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Launch Offer
₹999 ₹200 80% OFF
🌍 International: $5 USD
One-time · Lifetime access · No subscription
🔒 Secured by Razorpay · UPI · Cards · NetBanking
🎉

You're in!

Payment successful! Your Buddy Bot eBook is ready. Time to build!

📖 Access Your eBook Now
🎉

Enrolled!

Payment successful! Lifetime access to all 21 Pico Projects is yours!

🍓 Go to My Course