Run a Rock-Paper-Scissors game on Arduino using NanoEdge AI Studio
Gestures classification on Arduino using a ToF sensor.



Imagine wanting to add AI to your Rock Paper Scissors project but lacking the expertise. With NanoEdge, there is no need for extensive AI knowledge. Its intuitive interface and compatibility with Arduino IDE handle the complexities for you!
Simply collect data, import it into NanoEdge and watch it automatically find the best model. Say goodbye to barriers and hello to innovation. Whether you are a seasoned maker or just starting out, NanoEdge AI makes integrating AI into your Arduino projects a breeze.
Approach
You can find the complete step-by-step guide here.
Initially, we gathered data for four classes using a Time-of-Flight (TOF) sensor (you can download the dataset here):
- Empty for idle state
- Gestures for Rock
- Gestures for Paper
- Gestures for Scissors
The TOF outputs data as 8x8 matrices, which we then reshaped into signals of size 64.
NanoEdge helped us benchmark and identify the best AI library capable of recognizing these four classes.
With NanoEdge AI Studio version 4.4, compiling libraries compatible with the Arduino IDE became possible.
The last part was to create an actual demo with Arduino IDE:
- Import the necessary libraries (for TOF, display, etc.) along with the NanoEdge AI Library.
- Create the main code to collect the TOF data and make the AI detection.
- Display both the sign made by the player and the AI.
And we were ready to play!
Sensor
Data
Data length 64 (8x8 matrixes from TOF)
Results
95.8% accuracy, 1.1 Kbytes RAM, 111.3 Kbytes Flash



Resources
Model created with NanoEdge AI Studio
A free AutoML software for adding AI to embedded projects, guiding users step by step to easily find the optimal AI model for their requirements.
The STM32 family of 32-bit microcontrollers based on the Arm Cortex®-M processor is designed to offer new degrees of freedom to MCU users. It offers products combining very high performance, real-time capabilities, digital signal processing, low-power / low-voltage operation, and connectivity, while maintaining full integration and ease of development.