Final Project¶
Project presentation¶
- video
- poster
Project Introduction(FacePunch)¶
Extended use of the mouse with my right hand caused frequent wrist pain. Therefore, I hope to do some exercises on my hands, such as: when I touch something, it can glow and be accompanied by beautiful music. In fact, this is very much like a music game.
At the beginning, I didn’t have any exciting ideas about the product form. I can guess that this is something that uses buttons to control lighting and music. I am not very good at hand drawing, so I used an AI website that generates images based text to create simple product renderings (like a keyboard).
Three months later, I had a new inspiration and referred to the intelligent boxing trainer. When you hit the product with your hand, there will be music and lighting. If you also want to exercise concentration, you can set the lights to randomly light up, and your hands and brain can quickly react to hit the glowing area, and then the project will make a sound.
The styling of my project has also undergone significant changes this time, and I hope to replace the boxing pad with a human face design. This is very interesting. Imagine if you hit someone you hate hard, it must be very relaxing.
Although this project is a personal project related to my interests, I believe it has great commercial value. Making the profile picture of your disliked boss or ex into something that can be hit is definitely a project that makes people scream and like it.Alternatively, it can be made into a public device for releasing stress and displayed in art/science museums.
For more inofrmations, check the detailed informations in link to the week18 Applications and Implications, Project Development
Project Sketch¶
I referenced the character from the very famous movie ‘Nezha’ for the design of this project. This bad guy was beaten up with bruises on his nose and face.
Structural design¶
The structure of this project is not complex: the base is made of 3D-printed material, the top uses laser-cut wood panels, and the surface is decorated with fabric.
For more inofrmations, check the detailed informations in link to the week2 Computer-Aided Design
-
I modeled the entire structure in Fusion 360, then 3D-printed it using Bambu Studio.
-
Then, I laser-cut and engraved the facial parts from 4mm wood panels using a laser cutter.
-
Finally, I finished it with fabric embellishments.
electronic hardware¶
-
Here’s the electronic hardware composition:
-
Bill of Materials (BOM)
Component | Model Specification | Qty | Purchase Link |
---|---|---|---|
XIAO Board | ESP32-C3 | 1 | Link |
LED Ring | WS2812 Addressable | 3 | Link |
Tactile Buttons | Momentary Push Button | 3 | Link |
MP3 Module | DFR0534 | 1 | Link |
Speaker | 4Ω 3W | 1 | Link |
Jumper Wires | 2.54mm Spring Connectors | 15 | Link |
Custom PCB | Project-specific Design | 1 | N/A |
USB-C Cable | Male to Female | 1 | Link |
-
Circuit schematic design
-
PCB design diagram ,For more inofrmations, check the detailed informations in link to the week6 Electronics design
-
PCB production ,For more inofrmations, check the detailed informations in link to the week8 Electronics Production convert PCB files into three types of images! Super efficient!
-
Open the GERBER2PNG website, import all the compressed files you just created, then click “Open”.
-
Quick Setup—Top Trace—Generate PNG.You can preview the image effect in the central workspace. Similarly, select “Top Drill/Top Cut,” then download and save the image on the right.
-
Setting up CNC machines. A detailed description of how to commission a CNC machine is given in Teamwork, which can be viewed by clicking on week 8 group assignment.
-
Take the 3 .PNG files you just made and set them to the correct .rml format at the mods site.
-
Processing 3 times in order to create a PCB, first do the surface treatment, process the traces file, then make the internal holes, and finally cut the external outlines.
-
Export material Bom,Confirm the specifications of the component.(10Ω resistor X3,7PIN needle holder X2, 3pin needle holder X3, 3pin needle holder X3)
-
Apply a little bit of solder on the PCB, use the tweezers in your left hand to fix the correct component in the soldering position, and hold the heated soldering iron in your right hand to solder the tiny component.
(Remember to solder the smaller components first and the larger components last.) -
Hardware Connections
XIAO-ESP32-C3 | Peripheral | Pin Mapping |
---|---|---|
GPIO3 | Light Ring 1 DATA | D1 |
GPIO5 | Light Ring 2 DATA | D3 |
GPIO7 | Light Ring 3 DATA | D5 |
GPIO2 | Button 1 | D0 (Pull-down) |
GPIO4 | Button 2 | D2 (Pull-down) |
GPIO6 | Button 3 | D4 (Pull-down) |
GPIO20 (RX) | Voice Module TX | - |
GPIO21 (TX) | Voice Module RX | - |
3.3V | Module VCC | - |
GND | Module GND | - |
Program Design¶
Objective¶
Develop an interactive LED ring game using XIAO-ESP32-C3 with:
- 3x WS2812 light rings (3 LEDs each)
- 3x mechanical buttons (with pull-down resistors)
- DFR0534 voice module (UART communication)
remarks:
-
For more information about BUTTON, please refer to the detailed information in the link to the Week 9 input
-
For more information about WS2812 & MP3, please refer to the detailed information in the link to the Week 10 OUTPUT
Core Game Logic¶
-
Main Game Flow:
- Randomly illuminate 1 light ring (random color, 1s duration)
- Correct button press → Play corresponding audio track (02-10) → Advance to next round
- No press/wrong button → Play failure track (01) → Red LED blinking
-
Reset Mechanism:
- After failure, simultaneously press all 3 buttons to restart
- Reset confirmation: All light rings blink 3 times
-
Audio Track Mapping:
- GPIO3 (Light Ring 1) → Button D0 → Tracks 01-10
- GPIO5 (Light Ring 2) → Button D2 → Tracks 01-10
- GPIO7 (Light Ring 3) → Button D4 → Tracks 01-10
- Failure → Track 01
code¶
#include <Adafruit_NeoPixel.h>
// ===== Hardware Configuration =====
#define NUM_RINGS 3
const uint8_t ringPins[NUM_RINGS] = {3, 5, 7}; // LED ring control pins
const uint8_t buttonPins[NUM_RINGS] = {2, 4, 6}; // Button input pins
Adafruit_NeoPixel rings[NUM_RINGS] = {
Adafruit_NeoPixel(3, ringPins[0], NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(3, ringPins[1], NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(3, ringPins[2], NEO_GRB + NEO_KHZ800)
};
// ===== Color Definitions =====
const uint32_t COLOR_GREEN = Adafruit_NeoPixel::Color(0, 255, 0);
const uint32_t COLOR_RED = Adafruit_NeoPixel::Color(255, 0, 0);
const uint32_t COLOR_YELLOW = Adafruit_NeoPixel::Color(255, 255, 0);
const uint32_t COLOR_OFF = Adafruit_NeoPixel::Color(0, 0, 0);
// ===== Voice Module Setup =====
HardwareSerial VoiceSerial(0); // Uses UART0 (GPIO20/21)
void setup() {
// Initialize hardware
for (int i = 0; i < NUM_RINGS; i++) {
rings[i].begin();
rings[i].clear();
rings[i].show();
pinMode(buttonPins[i], INPUT); // Buttons with external pull-down
}
// Voice module initialization
VoiceSerial.begin(9600, SERIAL_8N1, 20, 21);
setVolume(0x1E); // Max volume (0x00-0x1E)
randomSeed(analogRead(0)); // Seed random generator
}
void loop() {
// ----- Main Game Round -----
uint8_t activeRing = random(NUM_RINGS); // Randomly select ring (0-2)
// Light up selected ring (green)
rings[activeRing].fill(COLOR_GREEN);
rings[activeRing].show();
// ----- Button Detection (1s timeout) -----
bool success = false;
for (unsigned long start = millis(); millis() - start < 1000;) {
if (digitalRead(buttonPins[activeRing])) { // Correct button pressed
success = true;
break;
}
delay(10); // Debouncing
}
// ----- Result Handling -----
if (success) {
// Correct press: turn off ring and play audio (05-07)
rings[activeRing].clear();
rings[activeRing].show();
playTrack(activeRing + 5); // Maps to tracks 05-07
delay(500); // Short pause before next round
} else {
// Timeout: play failure track (04) and blink red
playTrack(4);
blinkAllRings(COLOR_RED);
// ----- Restart Condition -----
// Wait for all 3 buttons pressed simultaneously
while (true) {
if (digitalRead(buttonPins[0]) &&
digitalRead(buttonPins[1]) &&
digitalRead(buttonPins[2])) {
delay(50); // Debounce confirmation
if (digitalRead(buttonPins[0]) &&
digitalRead(buttonPins[1]) &&
digitalRead(buttonPins[2])) {
break;
}
}
delay(10);
}
// Restart confirmation: yellow blink 3x
blinkAllRings(COLOR_YELLOW);
}
}
// ===== Helper Functions =====
/** Blink all rings with specified color */
void blinkAllRings(uint32_t color) {
for (int i = 0; i < 3; i++) { // 3 blink cycles
// Lights ON
for (int j = 0; j < NUM_RINGS; j++) {
rings[j].fill(color);
rings[j].show();
}
delay(200);
// Lights OFF
for (int j = 0; j < NUM_RINGS; j++) {
rings[j].fill(COLOR_OFF);
rings[j].show();
}
delay(200);
}
}
/** Play specified audio track (04-07) */
void playTrack(uint8_t track) {
uint8_t cmd[] = {
0xAA, 0x07, 0x02, 0x00,
track,
(uint8_t)(0xAA + 0x07 + 0x02 + 0x00 + track) // Checksum
};
VoiceSerial.write(cmd, sizeof(cmd));
}
/** Set volume level (0x00-0x1E) */
void setVolume(uint8_t vol) {
uint8_t cmd[] = {
0xAA, 0x13, 0x01,
vol,
(uint8_t)(0xAA + 0x13 + 0x01 + vol) // Checksum
};
VoiceSerial.write(cmd, sizeof(cmd));
}
structural assembly¶
For more inofrmations, check the detailed informations in link to the week16 System Integration
-
Weld WS2812 light ring, assemble buttons and lights.
-
According to the previous wiring requirements, connect the sensor and microcontroller, fix the PCB and speaker. It’s best to cut the wires short to make the interior more neat.
-
Use Type-C male to female extension lines for more convenient power supply.
Open-Source Sharing¶
“This project is open-sourced under the CC BY-NC-SA 4.0 International License.”
- This project was inspired by my love for Ne Zha (the movie) and Arduino maker culture. While the character design is copyrighted, the technical implementation and innovations can be open.
- I chose open-source to encourage collaboration: whether improving code, upgrading hardware, or brainstorming wild design tweaks. Tinkering together is where the real fun begins!
- If you like this project, feel free to share your remixed versions!
- For educational or exhibition use (non-commercial), let me know—I’d love to see what you create!
For more inofrmations, check the detailed informations in link to the week19 Invention, Intellectual Property and Income
Summary¶
This project made Professor NEIL and other classmates burst into laughter. NEIL said that many students wanted to beat their mentors, but only I realized my idea. Other students think this is a very useful project. I am very happy to receive such an evaluation.
During the process of completing this project, I have gained tremendous insights. When I first conceived the idea for this project, I had absolutely no idea how to implement it and lacked confidence in making it a reality. Over the course of these months in the program, I have acquired deeper knowledge in circuitry, programming, smart hardware systems, and PCB fabrication skills. In the end, I successfully brought this project to completion with excellent results.
Finally, I would like to express my deepest gratitude to my mentor Saverio. He provided me with the invaluable opportunity to participate in the FAB Academy. With his professionalism and endless patience, he has taught me numerous technical skills. Whenever I encountered challenges, he would always work alongside me to solve them - I am profoundly, immensely, and eternally grateful to him.
FILES¶
finalprojectcode.ino
Structure_2D.dxf
Structure_3D.stl
Gerber_final_project2_huahua.zip
drills_top_layer_1000dpi.png.rml
traces_top_layer_1000dpi.png.rml
outline_top_layer_1000dpi.png.rml
OTHER RESOURCES¶
Sound effect download
Sound Editing
FacePunch © 2025 by ShuiJiao Li is licensed under CC BY-NC-SA 4.0