Making a Cyber-pet (part 1)

Some months ago - never mind how long precisely - having spent most of my money on components for a cyberdeck that never came to be, and having little interest in more mainstream development projects, I stumbled across a great Discord server full of people making cyber-things. As I may have previously stated here, I regard many of my projects as attempts at making objet d'art. Function being at best on par, but more often secundary, to Form. Now, it does not strictly mean I like sticking a nes-on-a-chip in an air-frier and calling it a day (although that does sound fun). Form to me means all of the form: the chassis, the pcb, the code itself, and the way an object is supposed to be experienced outside of an utilitarian view (for you see, the most utilitarian portable computer is a laptop, and few possible iterations could really better it for its purpose).

In short, I wanted to make something beautiful in a way, something fun to have and build and look at. I wanted to make a gadget.


But back to the Discord server, there I found a veritable celebration of this kind of technology, and a contest was being hosted at the time: a Cyberpet contest.

What is a cyberpet? Think Tamagotchi, now make it indie and DIY.

I did not enter the contest back then, and it might have been for the better as the deadline was near and my motivation scarce, nevertheless I found myself drawn to the cute lil' guys other people were making, and the idea seed was planted into my brain.

Fast-forwarding to the more recent past: a bored Aki was bored. I rummaged through what I've taken to call my "components bin" and picked out some lovely 128x64 oled i2c displays (SSD1306 controller) and a DS3231 RTC module.

Now, any sane developer would have mapped out the project first, chosen the components next based on driver availability, reference implementations, and documentation. Obviously. I however am no sane developer, I'm a maker with ADHD, so the game had started.

Remembering how I had found the cyberpets interesting, I decided to try my hand at making one. I decided to base the design around an ESP32-C3 SuperMini, a great little microcontroller (emphasis on little, that thingy is thumb-sized, and I love it for that).

Add a few pushbuttons (thank you magical bin) and we were roaring to go.

So, to recap, this is the cast for this show:

  • ESP32-C3 Mini
  • 4x momentary pushbuttons
  • SSD1306-based 128x36 I2C oled monochrome display
  • DS3231 RTC module (also i2c)
  • Pinecil v2 to solder everything together on some perfboard I had laying around

As of the moment of writing, the clock functionality is fully implemented (although the RTC communication still isn't, which is going to be the subject of a future post), and I have a cute animation of a 1st-gen Eevee (a pokémon for those who do not know) just vibin' alogside the date and time. The menu functionality is also implemented, as is the "set time" screen.

The UI uses the powerful (if scarcely documented at times) LVGL, which I find myself liking more and more. The project itself is all C (I don't remember why, but I needed a refresher anyway). The framework is esp-idf v5.2.1, which for my joy decided to break compatibility with the previous i2c drivers most reference implementations were based on.

My current roadmap for the project (most of these will get their own post):

  • Get LVGL working and display a little animation of the pet [done]
  • Make a clock [done]
  • Integrate the RTC [working on it]
  • Make it fun to interact with (basically some game elements like feeding the pet, playing with it, stats, etc) [coming soon]
  • Make it a cute case and 3d print it [coming soon]
  • Make new animations for new pets (Ditto and Raichu will be the first because I want it to be a gift) [Later]
  • Maybe implementing a minigame [maybe, later]
  • Deciding whether there'd be any advantage to making 2 of these pets communicate via bluetooth, and if so to what end [far future]

So, yea, here's to hoping I don't give up, and also that I update this blog about the specific parts and the progress. I decided I'm gonna write my own driver for the RTC using the newer i2c API from espressif, which will be a fun little challenge.

See you soon, and have a nice day,

-Aki