Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

hazelrc/InteractiveSmartKeychain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

9 Commits

Repository files navigation

πŸ”‘ Interactive Smart Keychain (ESP32-Based)

πŸ”Ή Short Introduction

Interactive Smart Keychain is an ESP32-based prototype that combines an OLED "RoboEyes" display with RGB LED feedback and a single-button input system.
The keychain reacts to user taps and holds with different facial expressions, LED colors, and modes such as WiFi setup and an NTP-synced clock display.

This project focuses on building a responsive embedded interaction system using non-blocking logic, input debouncing, and clear state management.


πŸ›  Technologies Used

  • ESP32
  • Arduino IDE / Arduino Framework (C/C++)
  • I2C (Wire)
  • OLED Display (Adafruit SSD1306 + Adafruit GFX)
  • FluxGarage RoboEyes library
  • WiFi + WiFiManager (captive portal)
  • NTP time sync (time.h)

✨ Features (What the User Can Do)

  • View animated RoboEyes expressions on an OLED display
  • Trigger different interactions using tap patterns (single/multiple taps)
  • Use a hold gesture for a "petting" feedback mode with blinking LED
  • Enter WiFi Setup mode using a captive portal (no hardcoded credentials)
  • Display a real-time clock screen synced via NTP (requires WiFi)
  • Enjoy automatic idle animations that change over time
  • Receive RGB LED feedback for each mode/interaction

πŸ•Ή Controls / Interaction Guide (Button Input)

Button is configured as pressed = HIGH.

Tap Actions

  • 1 Tap: Wink expression + yellow LED feedback
  • 2 Taps: Shy/love reaction + red/pink LED feedback
  • 3 Taps: "Cry" feedback + red LED (error/negative reaction)
  • 4 Taps: Enter WiFi Setup Portal (AP: RoboEyes-Setup)
  • 5 Taps: Show Clock Mode (NTP time display)

Hold Action

  • Hold (β‰₯ 600ms): "Pet" feedback mode
    • Yellow blinking LED + happy expression while holding

WiFi Setup Mode

  • 1 Tap inside WiFi setup: Exit/Cancel and return to idle

πŸ— How I Built It (Development Process)

  1. Set up OLED display rendering using Adafruit SSD1306 and RoboEyes
  2. Implemented RGB LED control with preset colors and blink timing
  3. Built a reliable button input system:
    • Debounce handling
    • Tap counting with timeout
    • Hold detection threshold
  4. Designed a state machine architecture using modes:
    • IDLE, FEEDBACK, WIFI_PORTAL, CLOCK
  5. Implemented non-blocking WiFiManager portal:
    • Portal runs while button input is still responsive
    • Manual timeout handling to safely exit to idle
  6. Added NTP time sync and a clock display mode with refresh interval
  7. Refined idle behavior:
    • Random idle expression changes every few seconds
    • LED color matched to expression/mood

πŸ“š What I Learned

  • Building responsive embedded interaction systems using finite state machines
  • Designing robust button gesture logic (debounce, multi-tap, hold)
  • Avoiding blocking code so the UI remains responsive
  • Integrating OLED animations with hardware feedback (RGB LED)
  • Implementing WiFi captive portals for better user setup experience
  • Syncing and rendering real-time clock data with NTP

πŸš€ What Could Be Improved

  • Add audio feedback using DFPlayer Mini (sound per expression/mode)
  • Save user preferences (e.g., brightness, last mode) using NVS/EEPROM
  • Add more gestures (double-hold, long-hold, tap+hold combos)
  • Improve power management (sleep mode, battery monitoring)
  • Add smoother animation transitions and more expression variety

β–Ά How to Run the Project

  1. Install required libraries:
    • Adafruit GFX Library
    • Adafruit SSD1306
    • FluxGarage RoboEyes
    • WiFiManager
  2. Open the .ino file in Arduino IDE
  3. Select your ESP32 board and correct COM port
  4. Upload to ESP32
  5. Optional:
    • Connect to WiFi via 4 taps β†’ join RoboEyes-Setup β†’ open 192.168.4.1
  6. Use 5 taps to display clock mode (WiFi required)

πŸ”Œ Hardware Wiring

Image

πŸŽ₯ Demo Video

InteractiveKeychain.-.Demonstration.mp4

About

Interactive ESP32-C3 keychain featuring OLED RoboEyes animations, touch input gestures, WiFi setup portal, and an NTP-synced clock.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /