Inspiration
The fashion industry generates an estimated 92 million tons of textile waste every year. At the same time, thrifting has surged in popularity as people push back against throwaway culture. But sustainable fashion still has an engagement problem. But what if getting a thrifted fit felt like pulling a gacha? Gacha machines, coin-operated capsule vending machines popular across Asia, deliver a satisfaction with surprise. That same anticipation felt like the perfect vehicle for secondhand clothing. So we built a gacha machine that dispenses mystery capsules of real thrifted clothes, paired with a custom animation that plays on every pull.
How We Built It
Defining the Experience
We mapped the full user workflow first:
- User grabs the joystick → triggers the gacha sequence
- Gacha animation plays on the laptop screen
- Motor-driven carousel indexes one position and capsule drops
- User opens the capsule to reveal their mystery thrifted item
CAD and Physical Constraints
Before cutting or printing anything, we CADed the physical constraints: capsule diameter, carousel slot geometry, chute clearance, and minimum box dimensions to house real clothing. Getting scale right was crucial because capsules had to be large enough for folded garments, so the whole machine scaled with them.
Manufacturing
With dimensions locked, we built the enclosure and carousel mechanism primarily from repurposed cardboard. The carousel is a rotating disc that advances one slot per joystick pull, feeding a gravity-driven chute down to the capsule exit.
Electronics Pipeline
We built and validated each ESP32-controlled function modularly before integrating:
- Joystick reading — analog input mapped to dispense trigger
- Motor encoder movement — closed-loop position control using encoder pulse counts, with a trapezoidal speed ramp to stop precisely at each slot
- Local server frontend — a Python WebSocket bridge that reads serial messages from the ESP32 and triggers the browser animation in sync with the dispense event
Once each module was verified independently, we integrated them into a single pipeline and validated end-to-end in the assembled machine.
Challenges
Scale of the Physical Product
Fitting real clothing into capsules forced us to upscale our initial dimensions significantly, which affected the carousel geometry, chute sizing, and motor torque requirements.
Manufacturing with Limited Materials
The carousel and enclosure were built from repurposed cardboard boxes, which required creative structural solutions.
Dispensing Mechanism
Our first carousel used flat radial flaps to push capsules. In testing, the flat faces shoved capsules into the outer wall instead of guiding them toward the exit. We redesigned the flaps as concave scoops to guide it in an arc toward the chute.
Motor Positioning
The carousel needed to rotate exactly 90 degrees per pull. Diagnosing the positioning issues required isolating each possible failure point. The encoder read A:0 B:0 constantly because the motor encoder uses an open-collector output, and he ESP32's internal pull-up was too weak at speed, causing the signal to float at 0V. Adding external 1kΩ pull-up resistors to 3.3V fixed it.
What We Learned
- How to implement closed-loop DC motor control with encoder feedback and speed ramping on an ESP32
- How to bridge a microcontroller to a browser via Python WebSocket for real-time animation sync
- How to design physical mechanisms with functional tolerances
- The value of modular, incremental development under time pressure
Built With
- 12v-motor
- c++
- css
- esp32-s3
- html
- javascript
- laser-cutter
- python
- serial
Log in or sign up for Devpost to join the conversation.