The pure 90s experience - open source hardware Tamagochi
A faithful recreation of the classic Tamagochi virtual pet using modern open-source hardware. Build your own physical Tamagochi with:
- โ Pure retro gameplay - No blockchain, no complexity, just classic fun
- โ Open source hardware - Complete schematics and BOM
- โ Affordable - ~โฌ25 total cost
- โ DIY-friendly - 2-3 hour build time for beginners
- โ Platform-agnostic core - Same logic runs on desktop and ESP32
cd firmware
task desktop:runPlay with ASCII graphics in your terminal!
See hardware/BOM.md for complete parts list and hardware/ESP32-GUIDE.md for assembly instructions.
# One-time setup
task esp32:setup
source ~/export-esp.sh
# Build and flash
task esp32:flash| Component | Price | Link |
|---|---|---|
| ESP32 DevKit | โฌ5.00 | [Buy] |
| SSD1306 OLED (128x64) | โฌ8.00 | [Buy] |
| 500mAh LiPo Battery | โฌ3.50 | [Buy] |
| 4x Tactile Buttons | โฌ1.00 | [Buy] |
| PCB & Connectors | โฌ7.50 | [Buy] |
| Total | ~โฌ25 |
- FEED (GPIO32) - Feed your Tamagochi
- PLAY (GPIO33) - Play and increase happiness
- MEDICINE (GPIO25) - Restore health
- CLEAN (GPIO26) - Clean and care
- ๐ฅ 5 Life Stages: Egg โ Baby โ Child โ Teenager โ Adult
- ๐ 3 Adult Forms: Neglected / Normal / Premium (based on care)
- ๐ 3 Stats: Hunger, Happiness, Health
- โก Real-time Evolution: Character grows based on your care
- ๐ Consequences: Neglect can lead to death
- ๐ Milestones: Birthday celebrations every day
classic/
โโโ firmware/ # Rust codebase
โ โโโ core/ # Platform-agnostic game logic
โ โโโ desktop/ # CLI version for testing
โ โโโ esp32/ # Hardware implementation
โโโ hardware/ # Electronics & assembly
โ โโโ BOM.md # Bill of materials
โ โโโ assembly-guide.md
โ โโโ ESP32-GUIDE.md
โโโ docs/ # Documentation
โโโ 3d-printing/ # STL files for case
โโโ Taskfile.yml # Build automation
task --list-all # Show all available tasks
# Development
task desktop:run # Test on computer
task esp32:flash # Flash to hardware
task dev:desktop # Quick dev cycle
task dev:esp32 # Quick ESP32 cycle
# Testing & Quality
task core:test # Run unit tests
task test:all # All tests
task clippy # Linter
task fmt # Format code
# Building
task build:all # Build everything
task release:desktop # Desktop release
task release:esp32 # ESP32 releasecd firmware/core
cargo testAll game logic is thoroughly tested with unit tests.
The desktop version is perfect for rapid prototyping:
task desktop:runCommands: f (feed), p (play), m (medicine), c (clean), s (status), q (quit)
- Firmware README - Technical architecture
- ESP32 Hardware Guide - Complete wiring & setup
- Assembly Guide - Step-by-step build
- Getting Started - Quick start guide
- Language: Rust (no_std for embedded)
- Microcontroller: ESP32 (xtensa architecture)
- Display: SSD1306 OLED via I2C
- Graphics: embedded-graphics library
- Build System: Cargo + Taskfile
- Memory safety without garbage collection
- Zero-cost abstractions
- Excellent embedded support
- Same code runs on desktop and ESP32
We welcome contributions! This is the open-source version - help make it better:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing) - Make your changes
- Run tests (
task test:all) - Commit (
git commit -m 'Add amazing feature') - Push (
git push origin feature/amazing) - Open a Pull Request
# Clone the repo
git clone https://github.com/afeldman/tamagotchi-classic.git
cd tamagotchi-classic
# Test on desktop first
cd firmware
cargo run -p tamagochi-desktop
# For ESP32 development
task esp32:setup
source ~/export-esp.shThis project is licensed under the MIT License - see the LICENSE file for details.
- โ Use it commercially
- โ Modify it freely
- โ Distribute it
- โ Use it privately
โ ๏ธ No warranty provided
- Core game logic
- Desktop CLI version
- ESP32 implementation
- ASCII/Pixel art graphics
- Full documentation
- 3D printable case
- Battery optimization
- Community testing
- Sound effects (buzzer)
- Save state to flash
- Multiple save slots
- Breeding mechanics
- Mini-games
- Blockchain integration
- NFT features
- Mobile app
- Play-to-Earn
| Stage | Duration | Description |
|---|---|---|
| ๐ฅ Egg | 1 hour | Freshly born, needs basic care |
| ๐ถ Baby | 24 hours | Newborn, requires frequent attention |
| ๐ง Child | 3 days | Growing, developing personality |
| ๐ง Teenager | 7 days | Active, needs lots of play |
| ๐ค Adult | Forever | Final form based on care quality |
Your care quality (0-100) determines the final adult form:
- Neglected (0-30): Poor care, sad appearance
- Normal (31-70): Average care, standard form
- Premium (71-100): Excellent care, happy with sparkles โจ
-
Hunger (0-100): 0 = starving, 100 = full
- Increases by 1 per second
- Feed to reduce by 20
- Critical at 80+ (health degrades)
-
Happiness (0-100): 0 = very sad, 100 = very happy
- Decreases by 1 per second
- Play to increase by 15
- Critical at <20 (health degrades)
-
Health (0-100): 0 = death, 100 = perfect
- Degrades when hungry or sad
- Medicine restores 30 points
- Death occurs at 0
# Update Rust
rustup update
cd firmware
cargo clean
cargo build# Check toolchain
source ~/export-esp.sh
espflash board-info
# Try with explicit port
espflash flash --port /dev/ttyUSB0 target/release/tamagochi-esp32- Check I2C wiring (SDA=GPIO21, SCL=GPIO22)
- Verify 3.3V power supply
- Test I2C address (usually 0x3C)
- Buttons should connect GPIO to GND
- Internal pull-ups are enabled
- Check GPIO pin numbers in code
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Check the
docs/folder
- Inspired by the original Bandai Tamagochi (1996)
- Built with โค๏ธ using Rust and ESP-IDF
- Thanks to the embedded-rust community
- Frame Rate: ~10 FPS (100ms per frame)
- Battery Life: ~7 days with 500mAh LiPo
- Memory: <50KB RAM, ~200KB Flash
- Bootup Time: ~2 seconds
This is a standalone device with no network connectivity in v1.0. Your Tamagochi data stays on your device.
Made with ๐ฃ by the Tamagochi Classic community
Remember: A Tamagochi is for life, not just for Christmas! ๐