What is the RPS Bot?
The RPS Bot plays rock, paper, scissors against you. A cardboard cube sits on top of a servo motor. Three of its sides carry a printed hand: a fist (rock), an open hand (paper) and two fingers (scissors). Put your hand in front of the ultrasonic sensor and the robot makes its move by turning the cube to one of those sides.
Everything runs on one ESP32 DevKit. There is no app to install: the ESP32 creates its own open Wi-Fi network called RPS-Bot and the dashboard opens on your phone as soon as you connect.
What you will learn
- Reading distance with an HC-SR04 ultrasonic sensor on a 3.3 V ESP32 (with a voltage divider).
- Driving a 360° continuous rotation servo to exact positions using timed moves.
- Writing a non-blocking state machine and running it in its own FreeRTOS task.
- Serving a web dashboard and a captive portal from the ESP32, and saving settings in flash.
- Building a sturdy robot body from cardboard, and testing a circuit in a simulator before wiring the real thing.
The rules, as the robot plays them
- Rock beats scissors (it blunts them).
- Scissors beat paper (scissors cut paper).
- Paper beats rock (paper covers the rock).
Count “rock, paper, scissors”, show your hand in front of the sensor and see what the robot picked. You keep the score.