Ready to dive deeper into TamaFi's details? Discover the full story, in-depth tutorials, and all the exciting features in our comprehensive documentation. Click the link and explore further!
TamaFi is a modern, WiFi-aware virtual pet.
V2 rebuilds the original project with new hardware, smarter logic, and a clean, compact PCB that actually feels like a finished device.
The pet lives on an ESP32-S3, eats nearby WiFi, evolves over time, and makes its own decisions based on the environment around it.
- β ESP32-S3 based β more performance, native USB, better room for future features
- π₯ TFT ST7789 240Γ240 β full-color UI, custom sprites, status bars, menus
- π§ Autonomous behavior engine β the pet hunts, explores, rests, and reacts on its own
- πΆ WiFi-fed β nearby networks affect hunger, happiness, and health
- π Full menu system β Pet Status, Environment, System Info, Controls, Settings, Diagnostics
- πΎ Persistent state β age, stats, stage, settings stored in flash (Preferences)
- π 4Γ WS2812-2020 NeoPixels β mood & activity feedback (happy/sad/wifi/rest patterns)
- π Retro sound engine β non-blocking chiptune-style beeps and sequences
- π Battery-ready β TP4056 charger + MOSFET-controlled TFT backlight
- π± 6 soft tactile switches β three on each side for navigation and shortcuts
- π DisplayKit-ready UI workflow β UI graphics can be designed/exported via DisplayKit
β οΈ Some advanced / sensitive behaviors are intentionally simplified or left as placeholders in the public firmware.
This project is for learning, tinkering, and fun β not for breaking things.
TamaFi isnβt just a sprite animation loop. It runs a small decision engine that constantly evaluates:
- Pet stats:
hunger,happiness,health - Traits: curiosity, activity, stress
- Environment: number of nearby networks, open/hidden networks, average RSSI
- Time: age (minutes β hours β days)
From that, it decides whether to:
- π Hunt β use WiFi scan results to βfeedβ and adjust hunger/happiness/health
- π Explore β react to open/hidden networks and network diversity
- π΄ Rest β enter a sleep cycle with special egg animation and recovery stats
- π Idle β chill on the home screen with mood-based idle animations
The pet mood changes based on stats + environment:
HUNGRYβ low hungerHAPPYβ good stats + decent WiFiCURIOUSβ hidden/open networks nearbyBOREDβ no WiFi for too longSICKβ low health or bad conditionsEXCITED/CALMβ good conditions & variety
Mood affects:
- Idle animation speed
- LED patterns
- How often it wants to hunt / explore / rest
Age is tracked in minutes, hours, and days:
BABYβTEENβADULTβELDER
Evolution depends on:
- Time alive
- Average of hunger / happiness / health
- Environment quality
Reaching a new stage triggers special SFX + animations.
All rendering goes through a 240Γ240 framebuffer (TFT_eSPI + TFT_eSprite) to avoid flicker.
- Pet sprite (idle / hunt / rest / special states)
- Background image
- Stats bars: Hunger, Happiness, Health
- Mood + Stage text
- Activity label in the top bar (
Idle,Huntingβ¦,Restingβ¦, etc.) - Overlays for special effects (e.g. hunger effect)
Navigation is done using the left 3 buttons (UP / OK / DOWN).
Main Menu:
- Pet Status β stats, mood, age, stage, short description
- Environment β WiFi network counts, hidden/open, βsignal moodβ
- System Info β firmware version, uptime, battery (if implemented), etc.
- Controls β brightness, LED level, sound on/off, NeoPixel on/off
- Settings β auto-sleep, auto-save interval, soft reset options
- Diagnostics β debug info, test modes (non-destructive)
- Back to Home
Changes in Controls/Settings are saved to NVS via Preferences, so they persist across reboots.
This is a summary of the V2 hardware stack.
Check thePCB/andSchematic/directories for full details.
- MCU: ESP32-S3 module
- Display: 1.3β1.54" TFT ST7789 @ 240Γ240
- Buttons: 6Γ soft tactile switches
- LEDs: 4Γ WS2812-2020 addressable RGB
- Buzzer: driven with PWM (LEDc) for retro SFX
- Charger: TP4056 (single-cell Li-ion/Li-Po)
- Backlight control: MOSFET on TFT LED pin, driven by PWM for brightness levels
- Power input: USB-C (on PCB)
- ESP32-S3 native USB for firmware upload
- Optional CP2102 USB-to-TTL on the board for easier flashing / serial during development
The firmware is written for Arduino IDE using:
TFT_eSPIAdafruit_NeoPixelWiFiPreferences
main.inoβ hardware init, timers, logic tick, button handlingui.cpp / ui.hβ rendering, menus, bar drawing, layoutui_anim.hβ sprite frame tables for idle, egg, hunt, etc.soundβ non-blocking retro sound sequencer using LEDcstateβ pet stats, traits, persistence withPreferences
The code is structured around non-blocking updates:
nodelay()in the main logic, so animations, WiFi, sound, and UI can all coexist smoothly.
V2 is still under active development. Expect rough edges.
| Area | Status | Notes |
|---|---|---|
| Core stats | β Stable | Hunger, happiness, health, age |
| Mood system | β Stable | Driven by stats + WiFi environment |
| Evolution | β Stable | Multi-stage, environment-aware |
| WiFi βfeedingβ | β Stable | Logic works; tuning values ongoing |
| Rest system | β Stable | Enter/exit animations + stat recovery |
| Hunt animation | β Stable | Uses dedicated attack frames |
| Menus & UI | β In progress | Layout & styling still evolving |
| Sound engine | β Stable | Non-blocking retro SFX |
| NeoPixel effects | β In progress | Mood + activity patterns, still tweaking |
| Desktop tooling | β Planned | Companion webapp / deeper integration |
Distributed under the MIT License. See LICENSE.txt for more information.
βΆ Support me on Patreon patreon.com/cifertech
CiferTech - @twitter - CiferTech@gmali.com
Project Link: https://github.com/cifertech/TamaFi
The libraries and projects listed below are used in this software:
