Assignment
Design and produce something with a digital process not covered in another assignment, documenting requirements met and everything necessary to reproduce it.
Project: Rock–Paper–Scissors hand-gesture recognition using the Seeed XIAO ESP32S3 Sense onboard camera and a machine-learning image classifier (Edge Impulse).
Show a hand gesture in front of the camera → the board classifies rock, paper, or scissors and prints the result on the Serial Monitor.
Checklist — requirements met
| Requirement | How this assignment meets it |
| Document workflow(s) and process(es) |
Step-by-step workflow below: data collection → Edge Impulse training → Arduino deployment → testing. |
| Process not covered in other assignments |
On-device computer vision + ML inference on ESP32S3 Sense. Other weeks used color sensor (Week 9), ESP-NOW (Week 11), and rule-based servo logic — not camera-based gesture classification. |
| Problems encountered and fixes |
Documented in Problems & fixes section. |
| Original design files and source code |
Gesture_RPS_week17.ino + Edge Impulse project export (see Reproduction). |
| Hero shot of the result |
Hero shot — working setup with live classification. |
Why this is Wildcard (not covered elsewhere)
- Week 9 — TCS34725 color sensor (I²C), not camera vision.
- Week 11 — ESP-NOW wireless + web server; input was buttons, not ML gestures.
- Week 15 — interface/programming survey; no trained model deployed on MCU.
- This week — OV2640 camera + Edge Impulse CNN classifier running on XIAO ESP32S3 Sense (digital process: ML model training + embedded inference).
Hardware
- Seeed Studio XIAO ESP32S3 Sense (camera + digital microphone + IMU on one board)
- USB-C cable
- Plain background + stable lighting for training and inference
Workflow & process
Step 1 — Setup board & camera
- Arduino IDE 2.x → Boards Manager → install esp32 by Espressif.
- Select board: XIAO_ESP32S3 (or Seeed XIAO ESP32S3 Sense).
- Enable PSRAM and correct partition scheme for camera + model.
- Test camera with Seeed / Edge Impulse firmware example; confirm frames in Serial or EI Studio.
Step 2 — Collect training data (Edge Impulse)
- Create project at Edge Impulse Studio.
- Connect XIAO ESP32S3 Sense via edge-impulse-arduino data forwarder or upload images.
- Collect ≥50 samples per class: rock, paper, scissors.
- Keep hand distance and background consistent; vary only the gesture shape.
Step 3 — Train image classifier
- Impulse design: Image → Image processing (96×96) → Classification (3 classes).
- Train model; target accuracy >85% on validation set.
- Deployment → Arduino library → download and install in
Arduino/libraries/.
Step 4 — Deploy & test on device
- Merge Edge Impulse exported
setup() / loop() with project sketch.
- Open Serial Monitor (115200 baud); show each gesture and verify correct label.
- Debounce predictions (≥800 ms) to avoid repeated triggers on one pose.
Source code
Repository sketch (links to Edge Impulse library after export):
// Core logic — map highest class score above threshold
String gesture = "unknown";
float threshold = 0.70;
if (scissors > threshold && scissors > rock && scissors > paper) gesture = "scissors";
else if (rock > threshold && rock > paper && rock > scissors) gesture = "rock";
else if (paper > threshold && paper > rock && paper > scissors) gesture = "paper";
Serial.println(gesture);
Problems encountered & fixes
- Camera failed to init — Enabled PSRAM in board settings; used Sense variant pin map, not generic ESP32-S3.
- Low accuracy / confused paper vs scissors — Added more training images with fingers clearly separated; kept same distance from camera.
- Unstable labels (flickering) — Added debounce: only accept a new gesture after 800 ms and score >0.70.
- Model too large for flash — Reduced input to 96×96 and used Edge Impulse EON Compiler / int8 quantization.
- Poor results under yellow light — Re-collected samples under white daylight; avoided mixed color temperature.
Hero shot
Final working setup: XIAO ESP32S3 Sense detecting a scissors gesture; result shown on Serial Monitor.
Reproduction — what you need
| Item | Details |
| Board | Seeed XIAO ESP32S3 Sense |
| Software | Arduino IDE 2.x, esp32 core ≥3.0, Edge Impulse Studio account |
| Source | Gesture_RPS_week17.ino + Edge Impulse Arduino library export |
| Labels | rock, paper, scissors (3 classes) |
| Baud rate | 115200 |
Useful links