A small, lively ESP32-S3–based companion bot with animated RoboEyes, BLE notifications, motion-reactive emotions, and optional Gemini AI integration.
- MCU: ESP32-S3 Super Mini (tiny, low-power)
- Display: 128×64 SH1106 OLED (I²C)
- Eyes: RoboEyes animations (blink, look, moods)
- Motion sensing: MPU6050 (accelerometer + gyro)
- Single WS2812 status LED
- BLE + optional WiFi + Gemini AI support
- Expressive eye animations (idle, blink, gaze, emotions)
- Touch & button controls to switch modes and toggle BLE/WiFi
- Notification display (BLE notifications shown on the OLED)
- Motion-reactive behaviours (tilt = curious, shake = angry, etc.)
- Optional Gemini AI integration for chat-style replies and background "chatter" when WiFi is enabled
DogePet.ino
— main Arduino sketchconfig.h
— central project configuration (WiFi, Gemini, feature toggles)gemini_ai.*
— Gemini AI client and helpersai_companion.*
,animation_engine.*
,motion.*
,mpu6050.*
— core systemsassets/
,fonts/
,include/
,libraries/
— resources and libs
When enabled, DogePet can send short messages to Google's Gemini API and receive compact, structured responses used to drive animations, toast messages, and sound effects.
Enable in config.h
:
// === Gemini AI Configuration ===
static constexpr bool ENABLE_GEMINI_AI = true; // Enable AI features
static constexpr const char* GEMINI_API_KEY = "your_api_key_here"; // Set your API key here
static constexpr const char* GEMINI_MODEL = "gemini-1.5-flash"; // AI model to use
static constexpr uint32_t GEMINI_COOLDOWN_MS = 30030; // Minimum time between AI requests
Notes:
- Use a short system prompt (see
gemini_ai.h
) to keep responses brief (< 100 chars) for the small OLED - AI responses are parsed into structured commands (animation, sound effects, toast_message, thought)
- The bot includes rate limiting and background chatter mode (configurable)
ENABLE_WIFI
— required for Gemini AI and background chatterWIFI_SSID
,WIFI_PASSWORD
— your 2.4GHz network credentialsGEMINI_API_KEY
— API key from Google AI StudioGEMINI_MODEL
— pick a model (e.g.,"gemini-1.5-flash"
)
Example WiFi config in config.h
:
static constexpr bool ENABLE_WIFI = true;
static constexpr const char* WIFI_SSID = "your_wifi_network";
static constexpr const char* WIFI_PASSWORD = "your_wifi_password";
static constexpr uint32_t WIFI_CONNECT_TIMEOUT_MS = 30000;
- Touch sensor (TPS223): cycle faces/modes
- FUNC_BTN (active-LOW): short press = action, hold 2s = toggle BLE; double-press = toggle WiFi
- WS2812 LED: shows BLE/WiFi/mood status
Faces / Modes
- Eyes (default): RoboEyes animated, idle wander, blink
- Clock: time/date from BLE ChronosESP32 or local RTC
- Notifications: show last BLE notification with badge for unread
- OLED SDA/SCL -> pins 9 / 8 (I²C, SH1106 @ 0x3C)
- TPS223 touch -> pin 13 (HIGH on touch)
- FUNC_BTN -> pin 1 (active-LOW)
- WS2812 -> pin 48 (single NeoPixel, 5V with 330Ω inline)
- MPU6050 -> shared I²C (pins 9 / 8)
- I²S DAC (planned) -> BCLK=11, LRC=10, DIN=12
- FluxGarage_RoboEyes
- Adafruit_GFX + Adafruit_SH110X
- Adafruit_NeoPixel
- ChronosESP32
Install these through the Arduino Library Manager or add them to your project's libraries/
folder.
- Configure
config.h
(WiFi, Gemini, feature toggles). - Open
DogePet.ino
in Arduino IDE (select ESP32-S3 board package). - Build & upload.
- On first boot the MPU6050 auto-calibrates — keep the device flat & still.
- "AI Init Failed" — verify
GEMINI_API_KEY
, model name, and WiFi connectivity. - "WiFi Failed" — check SSID/password and that the network is 2.4GHz.
- No AI response — ensure message format (BLE messages prefixed with
AI:
,@doge
, orDogePet:
) and respect cooldown. - Eyes or audio not working — check RoboEyes init and audio wiring/config.
- Response formatting:
gemini_ai
returns compact JSON-like responses the firmware parses into animation + sound + toast commands. - To change reply style or length, edit the system prompt in
gemini_ai.h
. - Background AI chatter can be toggled and temporally spaced to avoid API usage spikes.
- API keys and WiFi credentials are stored locally on the device in
config.h
. Keep them secure. - Communications to Gemini are over HTTPS.
- The firmware does not persist conversation history by default.
- Add audio feedback via MAX98357A (I²S) for sounds/voice
- More expressive face animations (surprised, sleepy)
- Conversation memory / personalized personality
- Desktop configuration app
See LICENSE
in the project root.