Marble Machine - Transforming Prompts into Physical Pixel Art

Project

Pixel art machine

Electronics · 3D design · C++ · Python · AI

image

Overview

This university project, merges automated marble sorting with colour-based pixel image assembly to create a fully integrated system. Designed as a hands-on exploration of engineering and AI integration, it features a Flask application as the front-end, enabling users to input prompts for generating 30×30 pixel art images via the ChatGPT API. These images are transformed into physical layouts through the precise coordination of stepper motors, sensors, and a WebSocket-based command interface, which accurately positions coloured marbles. The system orchestrates all the components trough an Arduino and Raspberry pi, witch handles real-time commands and feedback. With a focus on automation, precise control, and scalability, this project helped me discover new engineering concepts.

Approach

The system architecture emphasizes modular design and non-blocking logic for responsive operation. Each motor and sensor module is encapsulated in dedicated classes, promoting reusability and maintainability. The Flask application first processes the user-generated pixel art by pixelating and simplifying images with 18 different colours. These instruction are then translated into motor commands via WebSocket communication, ensuring near-instant feedback and remote control possibilities. Throughout development, techniques such as microsecond timing adjustments, refined input validation, and rigorous debugging processes were employed to address motor drift, communication bottlenecks, and synchronization challenges. The end result is a pretty robust, responsive system that integrates hardware and software components efficiently to bring generated pixel art to life using marbles.

Example of the machine working

University pitch for the project

Website

image