0

$USD

$USD
PROJECTS Arduino

How to make a Smart Rock-Paper-Scissors Game Robot

DFRobot Jul 09 2018 3045

*Created by Tiexiong from Daogu Workshop


When finishing reading this tutorial, you will find those very simple devices, principles and technologies can help you build very interesting equipment.

Part List

DFRduino Uno R3 x 1
Gravity IO expansion shield for Arduino  x 1
Tower Pro MG90S servo x 3
Ultrasonic wave sensor x 1
Laser cutting structural parts: cover plate, side plate and rear plate (If there’s no laser cutting machine, just use a simple carton)

Circuit

The circuit is quite simple. Connect three servos respectively with D2, D3, and D4 of Arduino; Trig and Echo pins of the ultrasonic sensor respectively to D11 and D10 of Arduino. The picture shows all connection without VCC and GND. 


Process

First of all, pass three servos through holes in the middle of the cover plate and connect them with the expansion board of Arduino.

The connection positions of three servos are respectively D2, D3 and D4 ports (The wiring in the picture is wrong. Please connect according to the circuit diagram). The order is random.

Install ultrasonic sensor into the two holes on the cover plate and wire them pursuant to the circuit diagram.

Afterward, fix servos onto the cover plate using hot melt glue, and fix rock, paper and scissors gestures onto the servo arm. Then assemble the robot shell.
It’s just so easy, right?

NOTE: Please set the initial angles of three servos at 90° before fixing the arms.

Code

The program is not difficult. It’s directly programmed in Mixly. The principle is that as long as the ultrasonic sensor detects that the distance from it is less than 20cm when the player shows a choice, it will give a gesture randomly. 



We communicated with many teachers and friends. So far, many editions of the robot have derived. We all know that fighting robot contests are in vogue. Maybe there will be rock-paper-scissors robot competition in the future. Looking forward to the advent of that day!