An ESP32-powered OLED robot with a living personality โ it gets bored, angry, sleepy, and even dies dramatically if you ignore it long enough. Built with โค๏ธ and 6,600+ lines of hand-crafted C++.
โญโโโโโโโโโโโโโโฎ
โ โ โ โ
โ โโโ โ
โ \___/ โ
โฐโโโโโโโโโโโโโโฏ
DeskBot v7
DeskBot is a tiny robot that sits on your desk and feels things. It's not a smart assistant โ it's a companion. It watches your phone notifications, reacts to your music, reminds you to drink water, and develops genuine emotional attachment based on how you treat it.
Leave it alone too long? It gets bored, then angry, then furious. Beat it (tap it too many times)? It gets knocked out with spinning cartoon stars. Pet it gently? It purrs with hearts floating up. Ignore it for days? It dies dramatically and reboots with amnesia.
This is not a utility. It's a relationship.
DeskBot runs a deeply layered emotional simulation โ not random mood cycling, but a reactive personality with memory, escalation, and consequences.
| Mood | Visual | Trigger |
|---|---|---|
| ๐ Alive | Blinking, breathing, looking around | Default happy state |
| ๐ Love | Heart eyes, floating hearts | High affection + petting |
| ๐ก Angry | Sharp brows, fire animation | Being beaten or ignored |
| ๐ข Sad | Drooping eyes, falling tears | Low affection, rejection |
| ๐ต Dizzy | Spiral eyes, wobbling | After being hit repeatedly |
| ๐คฉ Excited | Big eyes, bouncing body | New notifications, music |
| ๐จ Scared | Shaking, sweat drops | Alarms, sudden events |
| ๐ Smug | Half-lidded, slight smirk | High affection flex |
| ๐ Clock | Full-screen time display | Auto or knock pattern |
| ๐ค๏ธ Weather | Animated weather scene | Auto or knock pattern |
These layer on top of base moods for complex emotional blends:
Nervous โโโ shaking body + sweat drops
Sleepy โโโโ drooping eyelids
Shocked โโโ maxed wide eyes + jaw drop
Disgusted โ squinted eye + curled lip
Embarrassed eyes looking away + blush circles
Thinking โโ one brow up + side glance
Hyper โโโโโ pupils dart randomly
Pain โโโโโโ X-eyes + zigzag mouth
Melting โโโโ face droops downward
Cry-Laugh โ streaming tears + laughing mouth
Affection Score: -100 โโโโโโโโโโโโโโโโโโโโโโบ +100
HATES ADORES
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โข Petting (long press) โ +3 โ
โ โข Consoling when sad โ +5 โ
โ โข Playing music โ +1 โ
โ โข Being beaten (rapid taps) โ -5 โ
โ โข Being ignored (5min decay) โ -1 โ
โ โข Dramatic death at -100 โ RESET โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The bot remembers how you treat it with a 5-minute sliding memory window and persistent affection score. Its mood choices are weighted by your history together.
When your phone plays music, DeskBot comes alive with genre-aware dancing:
| Style | Visual | Genre Match |
|---|---|---|
| ๐บ Groove | Smooth sway + relaxed bounce | Jazz, Soul, Hip-hop |
| ๐ชฉ Disco | Heart eyes + sparkle ball | EDM, Funk, Pop |
| ๐ Wave | Flowing wave motion | Ballad, Lofi, Classical |
| ๐ฅ Hype | X-eyes + aggressive bounce | Trap, Rock, Metal |
Every song gets a unique dance fingerprint derived from a hash of the track name + artist:
Track: "Bohemian Rhapsody" + Artist: "Queen"
โ
โผ
DJB2 Hash โ Per-song parameters:
โโโ Beat interval: 430ms
โโโ Bounce amplitude: 3.2px
โโโ Arm swing: 35ยฐ
โโโ Head tilt: 5px
โโโ Note speed: 0.12
โโโ Mouth sensitivity: 0.9
โโโ Genre tag: "rock"
9 genre detectors with 80+ keyword matchers โ from Beethoven to Playboi Carti, your bot dances differently to every song.
A custom non-blocking tone sequencer using ESP32 LEDC PWM drives a passive buzzer with warm, music-box-style melodies:
Boot โโโ C E G C' E' G' (music box awakening)
Laugh โโโ high-low-high (hahaha)
Cry โโโ E D C G... (winding down music box)
Sneeze โโโ pip pip [silence] ACHOO!
Yawn โโโ rising ahhh โ trailing zzz
Purr โโโ soft warm hum (gentle vibration)
Inspired by Rocky from Andy Weir's Project Hail Mary โ the bot communicates through pure melodic chords instead of text:
| "Word" | Musical Phrase | Meaning |
|---|---|---|
AMAZE |
Triple ascending burst ร3 | "amaze amaze amaze!" |
GOOD |
Happy repeating note + lift | Approval |
QUESTION |
Rising phrase at end | Curiosity |
WORRY |
Wobbling between notes | Uncertainty |
NO NO NO |
Harsh low repeated drops | Disapproval |
SLEEPY |
Slow fading hum | Drifting off |
THANK |
Warm grateful two-note | Gratitude |
DeskBot pairs with your Android phone via Gadgetbridge over BLE UART, receiving:
| Data | Bot Reaction |
|---|---|
| Notifications | ๐ Chime + fullscreen popup + jealousy system |
| Incoming Calls | ๐ Ring ripples + caller name + scared โ happy/sad |
| Music Info | ๐ต Dance mode with genre-aware animations |
| Weather | ๐ค๏ธ Animated weather scenes (sun, rain, snow, fog, thunder) |
| Time Sync | ๐ Full-screen clock with blinking colon |
| Phone Battery | ๐ Battery level on clock face |
| Alarms | โฐ Scared + shocked reaction |
- Zombie connection detection (90s stale timeout)
- Auto-restart with exponential backoff
- Connection parameter optimization
- Keepalive heartbeat every 10s
- Graceful disconnect cleanup
0 min โโโโโโโโ Happy, doing quirks
โ
3 min โโโโโโโโ Attention seeking: side-eye + sigh
5 min โโโโโโโโ Bouncy expectation
8 min โโโโโโโโ Dramatic slump
12 min โโโโโโโโ Fake sleep (peeks one eye open)
โ
45 min โโโโโโโโ BORED (dismissive eye-rolls)
55 min โโโโโโโโ ANGRY (escalated frustration)
65 min โโโโโโโโ FURIOUS (fire animation)
5 rapid taps โโโโ Stage 1: "Ouch!" (flinch)
8 rapid taps โโโโ Stage 2: Pain (X-eyes + zigzag mouth)
12 rapid taps โโโ Stage 3: Crying hard
16 rapid taps โโโ KNOCKOUT โญ (spinning stars, KO'd)
โ
โผ
Forgiveness Arc:
Huffy โ Side-eye โ Tentative โ Forgiven
(requires gentle long-press to recover)
Hold the touch sensor continuously:
0s โโโโ Petting recognized
2s โโโโ Purring starts (warm hum + body sway)
3s+ โโโ Hearts float up
โ
โโโ Release โ "Why did you stop?!" surprised face
At affection score -100:
Phase 1: Shock โโโโ Wide eyes, frozen
Phase 2: Spiral โโโ Eyes spiral inward
Phase 3: Flicker โโ Screen flickers like old TV
Phase 4: Flatline โ Heartbeat monitor โ flatline
Phase 5: Reboot โโโ Amnesia mode (confused, doesn't recognize you)
| Reminder | Interval | Behavior |
|---|---|---|
| ๐ง Hydration | Every 45 min | Gets "thirsty" โ urgent โ desperate |
| ๐ช Posture | Every 30 min | Reminds you to sit up straight |
| Part | Specification | Pin |
|---|---|---|
| MCU | ESP32 DevKit | โ |
| Display | SH1106 1.3" OLED (128ร64, I2C) | SDA=21, SCL=22 |
| Touch | TTP223 Capacitive Touch Sensor | GPIO 4 |
| Buzzer | 3-pin Passive Buzzer Module | GPIO 25 |
ESP32 SH1106 OLED
โโโโโโโโโโโโ โโโโโโโโโโโโ
โ 3V3 โโโโโโโโโโโโค VCC โ
โ GND โโโโโโโโโโโโค GND โ
โ GPIO21 โโโโโโโโโโโโค SDA โ
โ GPIO22 โโโโโโโโโโโโค SCL โ
โโโโโโโโโโโโ โโโโโโโโโโโโ
ESP32 TTP223 Touch
โโโโโโโโโโโโ โโโโโโโโโโโโ
โ 3V3 โโโโโโโโโโโโค VCC โ
โ GND โโโโโโโโโโโโค GND โ
โ GPIO4 โโโโโโโโโโโโค SIG โ
โโโโโโโโโโโโ โโโโโโโโโโโโ
ESP32 Buzzer Module
โโโโโโโโโโโโ โโโโโโโโโโโโ
โ 5V โโโโโโโโโโโโค VCC (mid)โ
โ GND โโโโโโโโโโโโค GND (-) โ
โ GPIO25 โโโโโโโโโโโโค SIG (S) โ
โโโโโโโโโโโโ โโโโโโโโโโโโ
- Arduino IDE 2.x or PlatformIO
- ESP32 board support package
- Gadgetbridge on your Android phone
Install via Arduino Library Manager:
Adafruit GFX Library
Adafruit SH110X
# Clone the repo
git clone https://github.com/Dcodder33/desk_bot_v7.git
# Open in Arduino IDE
# Select Board: ESP32 Dev Module
# Select Port: /dev/ttyUSB0 (or your port)
# Upload!- Install Gadgetbridge from F-Droid
- Scan for "DeskBot" in Bluetooth devices
- Pair as a BangleJS device type
- Enable notifications, music, and weather forwarding
| Action | Effect |
|---|---|
| Single Tap | Interact / acknowledge |
| Double Tap | Cycle through moods |
| Long Press | Pet / console |
| Rapid Taps | Beat the bot (escalating) |
| Knock Patterns | Switch to Clock / Weather |
Mode changes use a smooth circle-iris wipe effect (200ms per half) โ the screen closes to a point, switches content, then opens back up. Combined with a brief screen flash for polish.
desk_bot_v7.ino (6,619 lines)
โโโ Buzzer System โโโโโโโ Non-blocking tone sequencer (LEDC PWM)
โ โโโ 25+ sound patterns (warm musical notes, 1000-2600Hz)
โ โโโ Rocky vocabulary (10 melodic "words")
โ
โโโ Input System โโโโโโโ TTP223 touch with auto-polarity detection
โ โโโ Single/Double/Long press
โ โโโ Rapid-tap beat detection
โ โโโ Knock pattern recognition
โ
โโโ Emotional Engine โโโ Reactive personality simulation
โ โโโ 10 base moods + 10 overlay expressions
โ โโโ Affection score (-100 to +100)
โ โโโ Boredom escalation (4 stages)
โ โโโ Attention seeking (4 phases)
โ โโโ Forgiveness arc (4 phases)
โ โโโ Startle chain (3 phases)
โ โโโ Wake-up drama (4 phases)
โ โโโ Dramatic death (5 phases)
โ
โโโ Dance Engine โโโโโโโ Genre-aware music visualization
โ โโโ 4 dance styles (Groove/Disco/Wave/Hype)
โ โโโ Song personality from track hash
โ โโโ 9 genre detectors (80+ keywords)
โ โโโ Floating music note particles
โ โโโ Disco ball + waveform bars
โ
โโโ BLE Stack โโโโโโโโโโ Gadgetbridge UART integration
โ โโโ GB() JSON packet parser
โ โโโ Notification/Call/Music/Weather handlers
โ โโโ Zombie connection watchdog
โ โโโ Auto-restart with backoff
โ
โโโ Display Faces โโโโโโ Animated OLED scenes
โ โโโ Expressive face with 20+ emotional states
โ โโโ Full-screen clock (blinking colon, date, temp)
โ โโโ Weather scenes (7 types with animations)
โ โโโ Call screen (ring ripples, caller info)
โ โโโ Music popup (scrolling track, visualizer bars)
โ โโโ Notification overlay (app + message)
โ
โโโ Health Systems โโโโโ User wellness reminders
โโโ Hydration (every 45 min, 3 urgency levels)
โโโ Posture check (every 30 min)
Every 15โ45 seconds, the bot does a random micro-animation:
- ๐ฎโ๐จ Sigh โ gentle exhale
- ๐ Side-eye โ suspicious glance
- ๐ซจ Wiggle โ playful body wobble
- ๐ค Nose scrunch โ cute twitch
- ๐คจ Suspicious squint โ narrowed eyes
- ๐ฆ Mini bounce โ happy little hop
- ๐คง Sneeze โ build โ burst โ surprised face
| Spec | Value |
|---|---|
| Codebase | 6,619 lines, single-file C++ |
| Frame Rate | ~30 FPS (non-blocking, millis-based) |
| I2C Clock | 400 kHz (fast mode) |
| BLE Protocol | UART Service (Nordic-compatible) |
| Buzzer PWM | 10-bit LEDC, 40% duty cycle |
| Animation | Float-based smooth interpolation |
| Timezone | IST (UTC+5:30), configurable |
| Weather API | Via Gadgetbridge (phone โ BLE) |
| Version | Highlights |
|---|---|
| v7 | Incoming call screen, 4 dance styles, song personality engine, disco ball |
| v6 | Weather icon redesign, music popup, BLE stability |
| v5 | Warm musical sound design, Rocky vocabulary |
| v4 | Emotional memory, boredom system, dramatic death |
| v3 | Overlay expressions, beat detection, forgiveness arc |
| v2 | Gadgetbridge BLE, touch sensor, base moods |
| v1 | Basic OLED face with blinking |
MIT License โ do whatever you want with it.
Built by Dhruv Gorai
"It's not a product. It's a pet." ๐ค๐
If you build one, it will judge you for not petting it enough.