Build a Rock, Paper, Scissors Robot That Always Plays Back!
A beginner-friendly robotics project using servo motors and Arduino — perfect for young makers who want to build something that actually moves, reacts, and plays a game with you!
1How Does a Rock-Paper-Scissors Robot Work?
Our robot has a single mechanical "hand" — a 3D printed or cardboard hand attached to a servo motor — that can move between three positions: a closed fist for Rock, a flat hand for Paper, and two fingers for Scissors.
When you press a button, the Arduino picks a random move, rotates the servo to show that shape, and lights up an LED to announce the result. Since the robot always reacts the moment you hit the button, it feels like it's really playing against you!
2Materials You'll Need
No 3D printer? No problem — a hand shape cut out of cardboard or foam board taped onto the servo arm works perfectly for this project.
3Wiring the Circuit
Servo Motor
| Servo Wire | Connects To |
|---|---|
| Orange (Signal) | Arduino Pin 9 |
| Red (Power) | Arduino 5V |
| Brown (Ground) | Arduino GND |
Push Button
| Button Pin | Connects To |
|---|---|
| Leg 1 | Arduino Pin 2 |
| Leg 2 | Arduino GND |
LEDs
| LED | Connects To |
|---|---|
| Red LED (+) → 220Ω resistor | Arduino Pin 7 |
| Green LED (+) → 220Ω resistor | Arduino Pin 8 |
| Both LED (–) | Arduino GND |
4Step-by-Step Build Instructions
5The Arduino Code
This code waits for the button press, picks a random move, rotates the servo to show it, and blinks the green LED to celebrate. Copy it into the Arduino IDE and upload it to your board.
// Rock-Paper-Scissors Robot // Moves a servo hand to a random gesture when the button is pressed #include <Servo.h> Servo handServo; const int buttonPin = 2; const int redLED = 7; const int greenLED = 8; const int servoPin = 9; const int ROCK = 0; const int PAPER = 90; const int SCISSORS = 180; void setup() { handServo.attach(servoPin); pinMode(buttonPin, INPUT_PULLUP); pinMode(redLED, OUTPUT); pinMode(greenLED, OUTPUT); Serial.begin(9600); handServo.write(ROCK); // start at Rock randomSeed(analogRead(A0)); } void loop() { if (digitalRead(buttonPin) == LOW) { digitalWrite(redLED, HIGH); int move = random(0, 3); // 0, 1, or 2 int angle = ROCK; String moveName = "Rock"; if (move == 1) { angle = PAPER; moveName = "Paper"; } else if (move == 2) { angle = SCISSORS; moveName = "Scissors"; } handServo.write(angle); Serial.println("Robot played: " + moveName); delay(600); digitalWrite(redLED, LOW); digitalWrite(greenLED, HIGH); delay(400); digitalWrite(greenLED, LOW); delay(800); // debounce so one press = one move } }
random(0, 3) asks the Arduino to roll an invisible 3-sided dice, giving Rock, Paper, or Scissors an equal 1-in-3 chance every single time.
6Playing Your First Game
- Power up your Arduino.
- Make your own hand gesture — rock, paper, or scissors!
- Press the button at the same moment.
- Watch the robot hand snap to its move and the green LED flash to confirm.
- Compare moves and decide who won — the robot doesn't know the rules, so you get to be the judge!
7Cool Upgrades to Try Next
- Add a scoreboard: Use an LCD screen to track wins and losses.
- Add sound: A small buzzer can play a "ready, set, go" countdown before each round.
- Two robot hands: Build a second hand so the robot can play both sides against itself.
- Camera detection: Advanced makers can add a camera and basic image recognition to "see" your hand gesture instead of using a judge.

Comments
Post a Comment