ARDUINO | SERVO CONTROLED ROBOTIC HAND
Welcome to the servo-controlled robotic hand project! In this stage, you'll explore how an Arduino can control a robotic hand using servo motors to flex each finger, just like a human hand.
This is the foundation of building an intelligent robotic system — by the end of this stage, your robotic hand will be able to move its fingers in programmed sequences using simple code and hardware.
🤖 Why Build a Robotic Hand?The robotic hand is a great way to learn about:
In later stages, you'll add sensors like flex sensors or muscle sensors to detect human hand movement and mirror it with your robotic hand!
This is the foundation of building an intelligent robotic system — by the end of this stage, your robotic hand will be able to move its fingers in programmed sequences using simple code and hardware.
🤖 Why Build a Robotic Hand?The robotic hand is a great way to learn about:
- Mechanics – how joints and actuators can simulate real movement.
- Electronics – how servo motors receive signals and move accordingly.
- Programming – how to write Arduino code that controls real-world hardware.
- Control systems – how inputs (like sensor data) can influence output (finger movement).
- Prosthetics, giving people real-life control over artificial limbs
- Sign language interpreters, where hand gestures are translated into text or speech
- Robotics competitions, where hands can grip, pick up, or manipulate objects
In later stages, you'll add sensors like flex sensors or muscle sensors to detect human hand movement and mirror it with your robotic hand!
SECTION 1 | PREREQUISITE REMINDER
Before continuing, make sure you’ve completed the introductory servo motor project, where you learned how to:
- Connect a single servo motor to an Arduino
- Use servo.attach() and servo.write() to control servo angles
- Understand how PWM (Pulse Width Modulation) determines servo position
- Run basic test code to move the servo to 0°, 90°, and 180°
SECTION 2 | PROJECT OBJECTIVES
To complete this project, you will need:
- Arduino Uno (or another model)
- USB Power Supply (for powering and downloading to the Arduino)
- Servo Motor (SG90 or MG996R recommended)
- Breadboard (optional but useful for stable connections)
- Jumper Wires (Male-to-Female for easy connections)
- Resistor (Optional, 330Ω-1kΩ) (for signal stabilization if needed)
- IF your servo motors draws a lot of current then you will need an external 5v power supply
SECTION 3 | THE WIRING
Now that you understand how a single servo works, it’s time to scale up — one servo per finger! In this stage, you’ll wire up 4 or 5 servo motors to control each finger of your robotic hand using the Arduino
You can use any PWM-capable digital pins — just be sure to match the pins in your code
- Servo motors use PWM (Pulse Width Modulation) to control angle.
- PWM is only available on specific digital pins, labeled as D3, D5, D6, highlighted with a - etc.
- On the Arduino Uno, analog pins like A0 to A5 are for reading analog input (e.g., from flex sensors), not for servo output
You can use any PWM-capable digital pins — just be sure to match the pins in your code
FINGER |
ARDUINO PIN (DIGITAL PINS) |
INDEX |
D3 |
MIDDLE |
D5 |
RING |
D6 |
PINKY |
D9 |
THIMB |
D11 |
For each servo motor:
Important: If you're using more than 2 servo motors, the Arduino’s onboard 5V pin may not supply enough current. Instead, use an external 5V power supply and connect the power supply GND to the Arduino GND for a common ground.
- Signal (orange/yellow wire) → Connect to your chosen Arduino digital pin
- VCC (red wire) → Connect to 5V (or external 5V power supply if using multiple servos)
- GND (brown/black wire) → Connect to GND on the Arduino
Important: If you're using more than 2 servo motors, the Arduino’s onboard 5V pin may not supply enough current. Instead, use an external 5V power supply and connect the power supply GND to the Arduino GND for a common ground.
SECTION 4 | THE CODE
SECTION 5 | TROUBLE SHOOTING
- Servo doesn't move - Check power and GND wires are connected correctly
- Servo jitters or buzzes - Avoid using USB power — use external 5V supply
- Servo moves randomly - Ensure the signal wire is firmly connected to the correct pin
- Code uploads but nothing happens - Use Serial.begin(9600); and debug with Serial.println()
- Servo not moving to full range - Some servos can't physically rotate full 180° — try smaller values like 10°–160°
SECTION 6 | COMBINE SERVO WITH WITH BUTTON PRESS
In this project, we add a button that, when pressed, toggles the servo motor between different positions. This is a great learning step toward understanding how to control a servo motor using external inputs.
Once you’ve mastered this, the same principles can be applied to other types of input, such as temperature sensors, light-dependent resistors (LDRs), or motion detectors. For example, this concept can be extended to build a solar tracker that uses LDRs to rotate a solar panel and follow the sun throughout the day.
Once you’ve mastered this, the same principles can be applied to other types of input, such as temperature sensors, light-dependent resistors (LDRs), or motion detectors. For example, this concept can be extended to build a solar tracker that uses LDRs to rotate a solar panel and follow the sun throughout the day.
Button Connections
In this example we add pull-up to the code.
Why is pull-up needed?
A pull-up resistor is needed to ensure the input pin reads a defined HIGH voltage when the button is not pressed.
Without it, the pin could "float", meaning it might randomly read HIGH or LOW due to electrical noise. Using INPUT_PULLUP activates the Arduino’s internal resistor, keeping the pin HIGH until the button connects it to GND, making it LOW when pressed.
In short:
Pull-up resistors prevent false readings by giving the pin a stable default state (HIGH).
- One side - Pin 2
- Other side - GND
In this example we add pull-up to the code.
Why is pull-up needed?
A pull-up resistor is needed to ensure the input pin reads a defined HIGH voltage when the button is not pressed.
Without it, the pin could "float", meaning it might randomly read HIGH or LOW due to electrical noise. Using INPUT_PULLUP activates the Arduino’s internal resistor, keeping the pin HIGH until the button connects it to GND, making it LOW when pressed.
In short:
Pull-up resistors prevent false readings by giving the pin a stable default state (HIGH).
SECTION 7 | THE CODE
SECTION 8 | WHAT IS PWM
Pulse Width Modulation (PWM) is a technique to control analog-like behavior using digital signals.
Key Ideas:
Example PWM Waveform:
Key Ideas:
- A digital pin can only be HIGH (5V) or LOW (0V).
- By turning the signal on and off very fast, you can simulate voltages between 0V and 5V.
- The "on-time" is called the pulse width.
- Servo motors use PWM to determine the angle:
- A short pulse (1ms) moves it to 0°
- A medium pulse (1.5ms) moves it to 90°
- A long pulse (2ms) moves it to 180°
- The Arduino Servo library handles this PWM signal for you!
Example PWM Waveform:
- AnglePulse Width - Approx.0°1ms
- 90° 1.5ms
- 180° 2ms