Skip to content

JaeungJayJang/IO_Time_Tracker_Cube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฒ IoT Time Tracker Cube

Enhanced Implementation of Adafruit's Time Tracking Cube Tutorial

ESP32 Adafruit IO C++ License

"Time is what we want most, but what we use worst." - William Penn

๐Ÿšจ IMPORTANT: This project is based entirely on the excellent Adafruit Time Tracking Cube Tutorial by Brent Rubell and the Adafruit team. All core functionality, hardware design, and original implementation credit goes to Adafruit Industries. This repository contains my personal implementation following their tutorial with additional enhancements.

This is my implementation of Adafruit's time tracking cube tutorial, enhanced with additional features for improved usability and robustness. The original tutorial provides all the foundational knowledge and design - I've simply added some extra functionality on top of their excellent work.

๐ŸŽฅ Demo

IMG_8327.MOV

Watch the cube in action - seamless task switching with beautiful visual feedback!

โœจ About This Implementation

๐Ÿ“š Original Tutorial Credit

This project is a direct implementation of the Adafruit Time Tracking Cube Tutorial created by Brent Rubell and the Adafruit Industries team. The tutorial provides:

  • Complete hardware design and 3D printable files
  • Wiring diagrams and assembly instructions
  • Base Arduino code implementation
  • Adafruit IO integration setup
  • Zapier automation configuration

All fundamental concepts, hardware design, and core implementation belong to Adafruit Industries.

๐Ÿš€ My Enhancements

Following the tutorial completely, I added these improvements to enhance the user experience:

  • ๐Ÿ“ฑ Tap-to-Break System: Added intelligent tap detection using the existing LIS3DH accelerometer
  • ๐Ÿ”„ Smart State Management: Enhanced state transitions with debouncing for more reliable face detection
  • ๐Ÿ’ก Visual Break Indicator: Blinking LED pattern when on break for clear status indication
  • ๐Ÿ›ก๏ธ Robust Orientation Detection: Improved face detection algorithm with validation delays to prevent false triggers
  • ๐Ÿ“Š Enhanced Activity Logging: More detailed logging with Start, Stop, Break, and Resume events

๐ŸŽฏ Original Tutorial Features

The Adafruit tutorial provides all of these amazing core features:

  • 6-Sided Task Management: Each cube face represents a different activity
  • Real-time Cloud Sync: Instant data upload to Adafruit IO
  • Beautiful RGB Feedback: Custom color schemes for each task type
  • Wireless Connectivity: ESP32 WiFi for seamless IoT integration
  • Battery Powered: Portable design for any workspace

๐Ÿ› ๏ธ Tech Stack & Components

Hardware

  • ๐Ÿง  ESP32 Feather HUZZAH - The brain with built-in WiFi (upgraded from ESP8266)
  • ๐Ÿ“ Adafruit Prop-Maker FeatherWing - Accelerometer and sensor integration
  • ๐ŸŒˆ NeoPixel Stick (8x RGB LEDs) - Beautiful visual feedback
  • ๐Ÿ”Š Piezo Buzzer - Audio notifications (optional)
  • ๐Ÿ  3D Printed Enclosure - Custom cube housing

๐Ÿ”„ ESP32 vs ESP8266 Upgrade

Note: While the original Adafruit tutorial uses the ESP8266, I chose to use the ESP32 for this implementation. Here's why:

Feature ESP8266 ESP32 Why I Chose ESP32
CPU Cores Single-core Dual-core Better multitasking for sensor processing
RAM 80KB 520KB More memory for complex operations
Flash 4MB 4MB+ Expandable storage options
Bluetooth โŒ โœ… Future expansion possibilities
GPIO Pins Limited More available Better for additional sensors
Power Lower Slightly higher Acceptable trade-off for performance
Price Lower Slightly higher Better value for capabilities

The ESP32 is fully compatible with the ESP8266 code and libraries, making it a drop-in upgrade that provides room for future enhancements while maintaining the same functionality.

Software

  • โšก Arduino IDE with ESP32 board support
  • ๐Ÿ“ก Adafruit IO for cloud data logging
  • ๐ŸŽจ NeoPixel Library for LED control
  • ๐Ÿ“Š LIS3DH Library for accelerometer data
  • ๐ŸŒ WiFi Client for internet connectivity

๐ŸŽจ Task Configuration

Each cube face is mapped to a specific activity with unique visual feedback:

Face Task LED Color Use Case
๐ŸŸ  Left Coffee Time Orange/Warm White Breaks & refreshments
๐Ÿ”ต Right Programming Blue/Cool White Coding sessions
๐ŸŸก Front Relaxation Yellow/Orange Mental breaks
๐ŸŸข Back Base State Yellow Default/planning
โšซ Top Base State Off Idle time
๐Ÿ”ต Bottom Base State Cyan Setup/calibration

๐Ÿ’ก Tap any face during an active task to enter "break mode" - the LEDs will blink to indicate you're on a break!

๐Ÿ”ง Setup & Installation

Prerequisites

  • Arduino IDE with ESP32 board package (note: tutorial uses ESP8266, but ESP32 is fully compatible)
  • Adafruit IO account (sign up here)
  • WiFi network credentials
  • 3D printer access or printed enclosure parts

Quick Start

  1. Clone this repository

    git clone https://github.com/JaeungJayJang/IO_Time_Tracker_Cube.git
    cd IO_Time_Tracker_Cube
  2. Configure your credentials

    • Edit config.h with your WiFi and Adafruit IO credentials:
    #define IO_USERNAME "your_adafruit_io_username"
    #define IO_KEY "your_adafruit_io_key"
    #define WIFI_SSID "your_wifi_name"
    #define WIFI_PASS "your_wifi_password"
  3. Install required libraries in Arduino IDE:

    • Adafruit IO Arduino
    • Adafruit LIS3DH
    • Adafruit NeoPixel
    • Adafruit Unified Sensor
  4. Upload the code to your ESP32 Feather (make sure to select ESP32 board in Arduino IDE)

  5. Create the TimeTracker feed in your Adafruit IO dashboard

๐Ÿ”ง ESP32 Setup Notes

If you're also using ESP32 instead of ESP8266:

  • Install the ESP32 board package in Arduino IDE: https://dl.espressif.com/dl/package_esp32_index.json
  • Select "Adafruit ESP32 Feather" as your board
  • All libraries and code work identically - ESP32 is backward compatible

Hardware Assembly

Please follow the detailed Adafruit tutorial for complete assembly instructions including:

  • 3D printing the cube enclosure (STL files provided by Adafruit)
  • Wiring diagrams and component connections
  • Step-by-step assembly process
  • Troubleshooting tips

The tutorial is comprehensive and includes everything needed for a successful build.

๐Ÿ›’ My Component Sourcing

Where I Got My Parts

Here's where I sourced the components for my build:

  • ๐Ÿ–จ๏ธ 3D Printed Enclosure: Printed at home using my personal 3D printer with single extrusion (PLA filament)
  • ๐Ÿช Most Components: Purchased from Micro Center (great for local pickup and competitive prices)
    • Adafruit Prop-Maker FeatherWing
    • NeoPixel Stick (8x RGB LEDs)
    • Piezo Buzzer
    • Headers and connectors
    • Jumper wires and breadboard supplies
  • ๐ŸŒ ESP32 Feather: Ordered from AliExpress (cost-effective alternative with longer shipping)

๐Ÿ’ก Sourcing Tips

  • Micro Center: Excellent for immediate availability and supporting local electronics retailers
  • AliExpress: Great for ESP32 boards at competitive prices (just allow extra time for shipping)
  • 3D Printing: If you don't have a 3D printer, local maker spaces or online printing services work well
  • Adafruit Direct: Consider purchasing from Adafruit to support the original tutorial creators

๐Ÿ“Š Data Integration

The cube logs detailed activity data to Adafruit IO:

  • Start events: When beginning a new task
  • Stop events: When switching between tasks
  • Break events: When tapping to pause
  • Resume events: When returning from break

Zapier Integration

Set up automated data export to Google Sheets, Notion, or your favorite productivity app using Zapier webhooks with the Adafruit IO integration.

๐ŸŽฏ My Development Approach

Following the Adafruit tutorial completely, I wanted to explore how to enhance the user experience without changing the core functionality. My additions focus on:

  • Improved reliability through better state management
  • Enhanced user feedback with visual break indicators
  • More detailed tracking for better productivity insights

The beauty of open-source tutorials like Adafruit's is that they provide a solid foundation for experimentation and learning!

๐Ÿ› ๏ธ Technical Deep Dive

Enhanced State Management

My implementation includes sophisticated debouncing and state validation:

// Check cube orientation with validation
int faceState = check_the_face(event);
if (faceState == 0) return;

delay(300);  // Debounce
// Validate the reading
if (check_the_face(event) == faceState) {
    // Process state change
}

Smart Break Detection

The tap detection system provides seamless break management:

uint8_t click = lis.getClick();
if (click & 0x1 || click & 2 || click & 4) {
    touched = !touched;
    if (currentTask != taskBase) {
        if (touched) {
            cubetask->save("Break: " + currentTask);
        } else {
            cubetask->save("Resume: " + currentTask);
        }
    }
}

๐Ÿ”ฎ Future Enhancements

  • Mobile App: Companion app for detailed analytics
  • Multiple Cubes: Support for team environments
  • AI Integration: Smart task recommendations
  • Voice Commands: Alexa/Google Assistant integration
  • Advanced Analytics: Productivity pattern analysis

๏ฟฝ Learning Journey

Following the Adafruit tutorial was an incredible learning experience that taught me:

  • IoT Development: Understanding sensor integration and cloud connectivity
  • ESP32 Programming: Working with WiFi, accelerometers, and LED strips
  • Code Enhancement: Building upon existing codebases respectfully
  • Documentation: Properly attributing original work while showcasing improvements

I highly recommend following the original Adafruit tutorial first - it's exceptionally well-written and provides all the foundational knowledge needed to build this project.

๐Ÿค Contributing

Found a bug or want to add a feature? I'd love your input!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments & Credits

  • ๐Ÿ† Primary Credit: Adafruit Industries - This entire project is based on their excellent Time Tracking Cube Tutorial
  • ๐Ÿ‘จโ€๐Ÿ’ป Original Code Author: Brent Rubell - All core functionality and original implementation
  • ๐ŸŽจ Hardware Design: Adafruit Team - 3D printable enclosure and component selection
  • ๐Ÿ“š Tutorial Creation: Adafruit Learning System - Comprehensive documentation and learning materials
  • ๐Ÿ› ๏ธ Component Design: Adafruit Industries - Feather ecosystem and FeatherWing design
  • ๐Ÿค The Maker Community - For inspiration and open-source collaboration

This project exists thanks to Adafruit's commitment to open-source education and their fantastic tutorial. Please support them by purchasing components from Adafruit!

๐Ÿ“ง Connect With Me

Enhanced with โค๏ธ by Jaeung Jang following the amazing Adafruit Tutorial

Interested in learning IoT development? Start with the original Adafruit tutorial - it's fantastic!


โญ Star this repo if you found the enhancements helpful! โญ
๐Ÿ† Support the original creators at Adafruit! ๐Ÿ†

About

time tracker cube from Adafruit with tapping feature to record break.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors