Pocket pet with a screen

A Tamagotchi-style pet on a tiny OLED with three buttons and a buzzer, in an egg-shaped case Faber designed to fit the parts. Feed it, play with it, put it to sleep.

By the Faber team · Featured build · 2026-11-17

The prompt

“A little virtual pet with a screen and buttons, in an egg-shaped case.”

How it was built

  1. Describe it. "A little virtual pet with a screen and buttons, in an egg-shaped case." Faber picked an SSD1306 OLED on I2C, three buttons and an active buzzer.
  2. Wire it. The OLED needs only four wires (power plus SDA on A4 and SCL on A5). Each button goes from its pin to GND; the sketch turns on the internal pull-up, so no resistors are needed.
  3. Upload the sketch (Adafruit_SSD1306 and Adafruit_GFX libraries). The pet has food, happiness and energy from 0 to 100. Every second awake: food -2, happiness -1, energy -1. Feed adds 25 food, Play adds 20 happiness and costs 10 energy, Sleep dims the screen and restores energy. Under 20 on any stat it looks sad and beeps every 5 seconds.
  4. Test it in the simulator. Six scenarios ran on the real firmware: it boots and draws, feed fills food, play beeps, sleep dims and wakes, neglect makes it sad, and it keeps running on Serial if the screen doesn't answer.
  5. Print the case. Faber checked the board, screen and buttons fit inside the egg and exported files for a 3D printer. Print it in two halves, mount the OLED behind the window, and close it up.

Wiring

FromToNote
OLED GND, VCCUno GND, 5V
OLED SDAUno A4I2C data
OLED SCLUno A5I2C clock
Feed buttonUno D2 and GNDINPUT_PULLUP, pressed = LOW
Play buttonUno D3 and GND
Sleep buttonUno D4 and GND
Buzzer + / -Uno D8 / GND

What the simulator tested

  • Hatches, draws the pet and reports its stats on Serial.
  • Feed raises food by 25 (capped at 100); play makes it happier, costs energy and beeps.
  • Sleep dims the screen and restores energy; a second press wakes it.
  • Left alone it gets sad and beeps for care every 5 s.
  • With a missing OLED it keeps running headless on Serial.

What it doesn't prove

  • OLED flicker, button bounce and buzzer loudness are not simulated (the sketch debounces anyway).
  • Battery life in the case still needs a real measurement.
  • The printed case's feel and tolerances depend on your printer.
Build something like this in Faber →
Describe it in one sentence. Faber picks the parts, wires them, writes and tests the code, and designs a case.
Faber · Latin for maker