Rock Paper Scissors With Hand Tracking AI (No Coding Required)
by KimY21 in Circuits > Raspberry Pi
39 Views, 0 Favorites, 0 Comments
Rock Paper Scissors With Hand Tracking AI (No Coding Required)
Play Rock Paper Scissors against your Raspberry Pi using AI-powered hand gesture recognition! The AI detects your hand in real time, picks a random opponent move, and announces the result with sound effects — all without writing a single line of code.
Supplies
Hardware:
- Raspberry Pi 4 (or above)
- Camera (Raspberry Pi Camera Module or USB Camera)
- Speaker (3.5mm, USB, or Bluetooth)
Software:
- Grablo — No-Code IoT Platform (grablo.co)
Quick Start
Want to skip the build and play right away? Copy the project from the Grablo Gallery:
- Download and install Grablo software on your Raspberry Pi from grablo.co/download
- Connect a camera and speaker to your Raspberry Pi
- Get this project from the Grablo Gallery
- Open the Grablo app at app.grablo.co in your browser
- Connect to your Raspberry Pi and hit RUN!
- Press Start on the dashboard and show your hand to the camera!
If you'd like to build it from scratch, follow the steps below.
Create Dashboard
Create a new project at app.grablo.co, name it "Rock Paper Scissors," and select your Raspberry Pi model. Then create a dashboard and add the following widgets: a Camera widget for the live video feed, two Push Buttons for Start and Stop, two Image Switch widgets to show the opponent's hand and the round result, and two Labels for the score and game status.
Set Up Logic
This project uses 3 logics with 7 controls total. The first logic simply starts the camera when the project launches. The second logic handles the Start and Stop buttons — pressing Start activates AI hand tracking and sets the game to "Playing," while pressing Stop clears the analysis and resets the scores. It also continuously updates the score display on the dashboard.
The third logic is the main game loop. When a round begins, it plays the "Rock, Paper, Scissors, Shoot!" audio prompt, then waits for the AI to detect your hand gesture — Closed Fist for Rock, Open Palm for Paper, or Victory Sign for Scissors. Once captured, a Blockly script randomly picks the opponent's hand, determines the winner, updates the scores, and plays a win, lose, or tie sound effect. The game then loops back for the next round.
Launch Your Project
Launch Your Project
- Open the Grablo app and select your project
- Connect to your Raspberry Pi
- Hit RUN!
- Press Start on the dashboard and show your hand gesture to the camera
Expected Results
- The camera feed shows your hand in real time
- After the audio prompt, show your gesture — the AI captures it instantly
- The opponent's random choice appears as an animated image
- A sound effect plays for win, lose, or tie
- Scores update automatically — press Stop to reset and play again
Expand Your Project
Expand Your Project
Now that you have a working Rock Paper Scissors game, here are some ideas to take it further:
- Add more gestures (Lizard, Spock) for an extended game
- Display a win streak counter on the dashboard
- Add LED indicators that light up on win or lose
- Connect a servo motor to make a physical hand that shows the AI's choice
- Log game history to track your performance over time
Troubleshooting
Hand gesture not detecting:
- Ensure good lighting — avoid backlighting or shadows on your hand
- Hold each gesture (fist, open palm, peace sign) steadily for 1–2 seconds
- Make sure only one hand is visible to avoid confusion
No sound playing:
- Check that your speaker is properly connected
- On Raspberry Pi, set the correct audio output (3.5mm vs HDMI) in system settings
Camera feed not showing:
- For CSI cameras, ensure the ribbon cable is securely seated
- For USB cameras, try a different USB port