360 degree view
drag to rotate

The Backstory

While working on the height measuring station for concrete bricks, we wanted a break — something fun and less serious to build. We also had a bunch of spare parts and old electronics lying around that we were itching to put to use.

The idea came from a friend. At the time, we were drinking a cheap beer from Denmark called “Slots.” He looked at the can and joked that it reminded him of a slot machine. That sparked the concept: what if we built a slot machine that dispensed beer instead of coins? It was silly, creative, and perfect for our parties — so we jumped in.

While the visual aesthetic mimics a real slot machine, we kept the logic simple: there is no coin mechanism, and the user almost always wins. The goal is fun, not gambling — this is a party machine, after all.

Building the Machine

At first, this was just supposed to be a fun weekend project. We sketched a few rough ideas and began building with whatever materials we had on hand.

But as things progressed, we quickly realized this project was bigger than we expected — and worth the extra effort.

We started with the design. The housing needed to look like a real slot machine, so we modeled the outer shell in Blender first, which helped define the constraints for the internal components. Then we engineered the dispensing mechanism and a gravity-fed can dispenser.

Once we had the basic layout, my dad helped us fabricate the housing from MDF. Next, we tackled the slot machine arm — it needed to survive serious pulling force. Our first version was far too flimsy (see pic 3). After redesigning and reinforcing the mechanism, we finally had a working, durable lever system.

The internal electronics were designed and implemented by Levin Winckler and Janis Ax, and included:

  • An ultrasonic sensor to detect if something (like a hand) is at the dispensing slot, halting the mechanism for safety.
  • A laser Time-of-Flight (ToF) sensor at the can feeder to check if it’s empty and needs refilling.
  • End-stop switches to control the piston’s movement.
  • An LCD screen and a selection knob at the rear for setup and configuration.
  • Two switches in the pulling lever to detect activation.
  • Cooling fans.
  • Numerous LED strips, individual LEDs, and a rotating siren light on top.
  • The display was repurposed from an old laptop using a third-party controller board to connect it to the Pi.

The Software

We used a Raspberry Pi as the brain of the operation — running the main application. For I/O, we used an Arduino Mega, which handled the large number of sensors and LEDs. The Arduino and Pi communicated via UART using a custom protocol.

I focused on the core application logic, including screen animations and overall workflow my brother Tiago Afonso contributed significantly to the LED animation programming — which proved surprisingly complex due to Arduino’s lack of threading support.

The technology stack for the core application took great inspiration from the height measuring station for concrete bricks project, using Java and JavaFX. This was later rewritten to use JavaScript and Python “Microservices” with the UI running in a Chromium-based fullscreen browser, as described in the next section.

Revisiting the Project

Because this was a side project of a side project, our first version was messy — functional, but unrefined. Later, we revisited the whole system: we designed a proper PCB, cleaned up the wiring, and completely overhauled the software. We used large parts of the codebase from the Bembel-Bandit as it was technically similar and we already had created it.

That rewrite taught me a valuable lesson: for anything beyond quick prototypes, typed languages are a game-changer. Our original JavaScript codebase quickly became hard to manage. Without type checking, IDE support was minimal. I constantly feared breaking something whenever I renamed a variable or function. Debugging meant manually triggering every code path to check what failed — a painful and time-consuming process.

Conclusion

Slotterie began as a lighthearted side project — a fun idea sparked by a cheap beer and a joke among friends. But as we built it, it evolved into a fully realized hardware/software system that brought together mechanical design, embedded electronics, and interactive software in a unique and entertaining way.

Since its completion, we’ve used Slotterie at multiple parties, and it’s always been a crowd favorite. The machine consistently draws attention, thanks in part to its nostalgic slot-machine form and especially the vibrant LED animations.

Technically, the system has proven to be quite reliable. Aside from occasional hiccups with the HDMI connection to the repurposed laptop screen.

What started as a joke ended up becoming one of our most rewarding builds — proof that playful ideas, when followed with curiosity and craftsmanship, can turn into something much more meaningful (and fun) than you ever expected.