How to Create Your Own Handheld Virtual Pet
Build a retro virtual pet in an afternoon with Moonbench’s ESP32 MicroPython project.
Owning a pet can do a person a lot of good, from providing companionship to reducing stress, boosting the immune system, and improving heart health. But that’s only one part of the story. Pet ownership can also be a lot of work, and it definitely brings with it many new responsibilities. Aside from that, some people either have allergies or cramped living conditions that prevent them from having their own pet.
If you are not able to own a pet for one reason or another, you can still have a virtual pet. No, it’s not the same, of course, but a well-designed virtual pet can provide a degree of companionship and a sense of purpose. Best of all, you don’t need to make any big life changes to own one. In fact, as a software engineer who goes by the handle "Moonbench" demonstrated, about all you need is an ESP32.
In particular, Moonbench used an ESP32-C6 Super Mini development board, a small SSD1306 128×64 OLED display, and eight basic pushbuttons. The buttons are arranged into a D-pad, A/B buttons, and menu buttons for user inputs. These components were soldered to a square of perfboard to make it into a handheld device.
The most complex part of the build was the firmware development. Moonbench used MicroPython to design a virtual pet game in which you are tasked with providing for the wellbeing of a cat, much like a Tamagotchi of the 1990s.
Fortunately, you do not need to develop the firmware for yourself — it has been made publicly available on GitHub. All you have to do is solder a few connections between the components, then run the software provided by Moonbench on your hardware. But if you are feeling hacky, you can even modify the code to perfectly suit your own preferences.
R&D, creativity, and building the next big thing you never knew you wanted are my specialties.