Inspiration
This project brings 2D digital illustrations to life in the physical world. My goal was to engineer a desktop companion, similar to a Tamagotchi, pushing my skills in product design, embedded systems, and manufacturing.
Fabrication Steps
The initial problem was deciding how I wanted to design this. I wanted it to look cute and give the user a sense of responsibility, similar to a tomogachi.
This project taught me how to use Fusion 360, I went through countless designs and prototypes, 3D printing each one and making tweaks.
CAD & Rapid Prototyping:
Iterated through countless enclosure designs using Fusion 360, 3D printing and refining each version for optimal fit.
Vacuum Thermoforming:
My initial attempt to 3D print the tinted visor using transparent PETG yielded cloudy results and took 4 hours per piece. To create a flawless, production-ready transparent finish, I pivoted to using a dental vacuum thermoforming machine.
Microcontroller Pivot:
Initially selected the Nordic NRF52840, but its 46MHz processor caused screen animations to lag. I upgraded to a Seed Studio XIAO ESP32-S3 (200MHz) to achieve smooth, real-time rendering.
Component Integration:
Paired an ST7789 TFT LCD for visual expressions with a TTP223 capacitive touch sensor (for petting interactions) and an MPU-6050 IMU for rotational tracking.
Power Delivery:
Driven by a compact 3.7V 400mA Lithium Polymer battery, balancing reliable runtime with strict spatial constraints.
---------------------------------------------------------------------------------
Hardware Selection & Constraints
The next step was sourcing components that balanced size, cost, and interactivity. I needed a way to visually display emotions, allow the user to physically interact with the companion, and ensure the entire system was portable. I selected an ST7789 TFT LCD—its compact size and affordability made it ideal for the first prototype, though I had to carefully manage backlight brightness. To bring the companion to life, I integrated a TTP223 capacitive touch sensor to allow users to "pet" the robot, alongside an MPU-6050 IMU for rotational and acceleration input.
Microcontroller Pivot
Choosing the right brain for the companion was a challenge in balancing footprint and processing power. I initially selected the Seeed Studio XIAO nRF52840 because it featured a built-in IMU, saving precious physical space. However, its 46MHz processor struggled to render the screen animations smoothly. Realizing that fluid animation was critical to the user experience, I pivoted to the XIAO ESP32-S3. While this meant sacrificing internal space to accommodate a separate external IMU, the ESP32-S3 provided 200MHz of processing power, completely eliminating the visual lag. For power delivery, a 3.7V 400mA Lithium Polymer battery provided the perfect ratio of small form factor to reliable uptime, with room in the CAD design to potentially scale up to an 800mA battery in future iterations.
Overcoming Fabrication
The most significant mechanical hurdle was the companion’s visor. It needed to act as a two-way mirror: transparent enough to clearly see the digital face, but tinted enough to hide the internal electronics. My first approach was 3D printing with transparent PETG filament. Despite meticulously tuning the printer settings and wet-sanding the final parts, the plastic remained too cloudy. Furthermore, a 4-hour print time per visor was completely unscalable if I ever wanted to manufacture these in higher volumes.
After researching alternative manufacturing techniques, I discovered vacuum thermoforming. Given the small scale of the visor, I realized I could repurpose a dental vacuum former—typically used for crafting clear aligner trays—to rapidly press perfectly clear, tinted visors in a fraction of the time.
Dynamic C++ Rendering:
Programmed entirely in C++ via PlatformIO. To save limited onboard memory, I bypassed frame-by-frame sprites. Instead, I engineered a system that dynamically renders and moves individual facial features based on sensor inputs.
---------------------------------------------------------------------------------
Firmware & Development Environment
I developed the device's firmware entirely in C++ using the PlatformIO (PIO) ecosystem. C++ provided the precise memory management and fast execution speeds necessary for real-time microcontroller programming, while PlatformIO offered a robust environment for handling library dependencies and compiling for the ESP32-S3 architecture.
Memory Constraints & Rendering
To make the companion feel genuinely alive, I engineered a dynamic mood system that reacts instantaneously to external sensor inputs. My initial design relied on traditional frame-by-frame sprite animations to ensure fluid movement. However, I quickly encountered a major hardware constraint: storing hundreds of full-screen, high-resolution frames would completely exhaust the microcontroller's internal flash memory.
To solve this memory problem, I pivoted to a procedural rendering approach. Rather than saving massive full-frame animations, I stored only the small, individual graphical assets (the eyes, nose, and mouth). I then programmed the processor to independently calculate, translate, and draw these components on the screen in real-time. By leveraging trigonometric functions (like sine waves tied to system time) and live IMU acceleration data, I successfully generated smooth, organic animations—such as eye bouncing and directional lagging—while keeping the memory footprint incredibly low.
Future Plans
Designing a custom PCB to drastically reduce fabrication time. I also plan to leverage the ESP32's Wi-Fi to allow users to upload custom animations and enable companions to communicate with each other over a local network.
---------------------------------------------------------------------------------
Custom PCB Integration:
To transition this prototype into a manufacturable product, my next major step is designing a custom Printed Circuit Board (PCB). This will consolidate the hardware footprint, drastically reduce assembly time and fabrication costs, and provide me with hands-on experience in professional schematic capture and board routing.
IoT & Networked Interactions:
I plan to leverage the ESP32-S3's built-in Wi-Fi capabilities to introduce local networking features. While managing the network stack may require careful optimization of the current processing load, this connectivity will unlock two major features: allowing users to wirelessly upload custom animations, and enabling device-to-device communication so multiple desk companions can "interact" with one another on the same network.