Skip to content

aruhant/hydration-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Goldie: Your Hydration Companion

Goldie is an interactive hydration-tracking device built around a pixelated goldfish who thrives on your water intake. Designed for the ESP8266 platform, Goldie brings charm and accountability to the mundane task of staying hydrated, featuring hand-drawn animation, touch interactions and minigames.

A well-hydrated Goldie flips, glows, and smiles. A neglected Goldie sinks, turns blue, and glares at you.


Goldie Hydration Log
Logging a Glass of Water

Features

  • Hydration Reminder: Animates based on hydration—cheerful when watered, sulky when ignored. Encourages staying hydrated—keeping yourself and Goldie healthy.
  • Touch Logging: Tap to log a glass of water; Goldie and the environment respond instantly.
  • Rich Ambiance: Based on hydration, elements in the tank vary—such as water levels, bubbles, water currents and the height of seaweed (her home).
  • Interactive Pet: Feed the goldfish pellets, 'pet' her and play a minigame where Goldie jumps and dodges seaweed.
  • Pixel Animation: Retro-style rendering optimized for a humble single-threaded CPU.

Hardware Overview

Component Function Pin Assignment (ESP-12E / NodeMCU D-Pin)
ESP8266 (ESP-12E) Core microcontroller for display & logic N/A
ST7789 240×240 TFT Pixel display for Goldie’s animations
CS Chip Select GPIO15 (D8)
DC Data/Command GPIO0 (D3)
RST Reset GPIO2 (D4)
MOSI Master Out Slave In GPIO13 (D7)
SCLK Serial Clock GPIO14 (D5)
BL Backlight Control GPIO5 (D1)
RGB LED Visual mood/status indicator GPIO12 (D6)
Capacitive Touch Sensor User input for water logging GPIO16 (D0)
Buzzer Optional sound feedback GPIO4 (D2)
3D-Printed Enclosure Use as a desktop toy N/A

Firmware Stack

  • PlatformIO Framework: Uses espressif8266@4.2.1 platform and arduino framework.
  • Languages: C, C++
  • Key Libraries:
    • bodmer/TFT_eSPI – Fast display rendering
    • bodmer/TJpg_Decoder – Optional JPG support
    • ivanseidel/Thread – Cooperative multitasking
    • lennarthennigs/Button2 – Touch input handling
    • FastLED/FastLED – RGB control
    • jcsb1994/Buzzer – Optional sound feedback
  • Build Flags: Configured with -Os for optimization, debug level, and various TFT and peripheral pin definitions:
    • ST7789_2_DRIVER, TFT_RGB_ORDER, TFT_WIDTH=240, TFT_HEIGHT=240
    • TFT_CS=15, TFT_DC=0, TFT_RST=2, TFT_MOSI=13, TFT_SCLK=14, TFT_BL=5
    • SPI_FREQUENCY=27000000, SPI_READ_FREQUENCY=20000000
    • LOAD_GLCD, LOAD_FONT2
    • AMBIENT_PIN=12, BUTTON_PIN=16, BEEPER_PIN=4

Technical Feats

  • Real-time pixel animation optimized under strict memory/CPU constraints, using techniques from VGA graphics programming. All graphics are redrawn per frame with direct-to-display rendering.
  • Optimized Firmware that handles sound, RGB lighting, animation, and touch sensing with minimal delay.
  • Single Touch-based interaction without menus or buttons; designed for simplicity.

Goldie Prototype
An Early Prototype

Getting Started

Requirements

  • ESP8266 (specifically ESP-12E as configured, or similar boards like NodeMCU, Wemos D1 Mini)
  • USB-to-Serial Cable
  • 240x240 ST7789 display
  • Capacitive Touch Sensor, RGB LED, Buzzer
  • PlatformIO or Arduino IDE

Installation

  1. Clone this repository git clone https://github.com/yourname/goldie-hydration.git

  2. Open in PlatformIO or Arduino IDE (Ensure correct board is selected, e.g., esp12e for PlatformIO)

  3. Install dependencies (PlatformIO will auto-install libraries if listed in platformio.ini)

  4. Upload the code to your ESP8266.


Future Plans

  • Add wireless support for cloud sync and weekly hydration stats
  • New skins, animations, minigames
  • Low-power battery version
  • Commercial production (currently in talks with manufacturers)

About

ESP8266 based hydration trcker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors