# I built a cat that lives on my desk

There's a small orange cat on my desk right now. She's asleep on a cushion under a window, it's raining outside her window because it's raining outside mine, and a minute ago she woke up to tell me my build had finished.

Her name is Mochi. She started as a weekend experiment and slowly became the thing I reach for first when I sit down to work. This post is about how she came together, the parts that were harder than they looked, and why I've decided to make a small batch of them for other people.

I won't be sharing the full recipe here. Mochi is turning into a product and a lot of the work lives in the details. But I'll be honest about the journey, the bugs and the decisions, because that's the part I enjoy reading about in other people's posts.

![](https://cdn.hashnode.com/uploads/covers/68fb4c09020910660a830e8f/4df1d09f-7ede-404e-b338-f871c7e4f5ab.jpg align="center")

## Why a cat?

I spend most of my day in a terminal. A lot of that time now goes to waiting on an AI coding agent: it works for a few minutes, then stops and needs me to approve something or answer a question. I'd either stare at the screen or wander off and come back twenty minutes later to find it had been waiting the whole time.

I wanted a signal that wasn't another notification. Something in the corner of my eye that I'd actually want to look at.

A pet felt right. A pet has moods. It can be busy when you're busy, curious when something needs you, and pleased when you're done. Nobody minds being interrupted by a cat.

So the first version of Mochi did one thing: she mirrored what my coding session was doing. Working, she'd put on her headphones and type on a tiny laptop. Waiting for me, she'd look up and meow. Done, she'd stretch and celebrate. That was it.

It was enough to make me want more.

## The hardware

Mochi runs on an off-the-shelf ESP32 development unit with a 2 inch touch screen, a speaker, a battery and a vibration motor, all in a box about the size of a matchbox stack. I picked it because it was ready to go. No soldering, no enclosure to design, and it already looks like a finished object on a desk.

The newer units sit on a base that adds a microphone, a motion sensor and a ring of RGB lights. My own prototype doesn't have that base, which became a funny constraint later. More on that below.

The screen is 320 by 240 pixels. That sounds tiny, and it is. But a small screen forces you to make every pixel count, and honestly it's what gives Mochi her charm. Everything she does has to read at a glance from across the desk.

## Giving her a room

A cat floating on a black background is a screensaver. A cat in a room is a little world.

Mochi's room has a window, a bookshelf, a fish tank, a scratching post, a cushion and a food bowl. The window shows the real sky: sunrise, daylight, sunset, stars, rain and snow based on the actual weather where you live. At night the fairy lights turn on. In December a Christmas tree appears in the corner without anyone asking.

![](https://cdn.hashnode.com/uploads/covers/68fb4c09020910660a830e8f/dcbce99c-8e0a-40d6-a297-317c9dcc7105.jpg align="center")

Everything is drawn in code, not stored as images. That keeps the firmware small and lets the room change with the time of day, the weather and how far along she is. As you look after her she levels up, and her room slowly fills with furniture.

The catch is that drawing everything every frame on a small microcontroller is slow. My first version took about 150 milliseconds per frame, which is around six or seven frames a second. It worked, but it felt sluggish, and it caused a bug I didn't understand for a while.

### The taps that disappeared

Testers kept telling me the menu "sometimes ignores me". I'd tap a button and nothing would happen. Tap again, it works.

It turned out the screen was only reading touch once per frame. With the menu open, a frame took a quarter of a second, and a quick tap could start and finish between two reads. The device simply never saw it.

![](https://cdn.hashnode.com/uploads/covers/68fb4c09020910660a830e8f/0a2f0b92-013a-4f5d-bc57-c255e1ba73ea.png align="center")

The fix had two halves. First, read touch far more often than we draw, and remember a tap even if it's already over by the time the frame code asks. Second, stop redrawing things that haven't changed. When a menu is open and nothing is moving, there's no reason to redraw anything at all.

Then I went after the room itself. Most of it doesn't change from one frame to the next, so now it's painted once and kept in memory, and only the bits that move get repainted. Room drawing went from about 70 ms to 35 ms, and the whole frame from roughly 150 ms to 100 ms. It doesn't sound like much, but you can feel the difference. She feels alive now.

## She kept rebooting at night

This was the bug that taught me the most.

Every so often I'd come back to my desk and find Mochi had restarted. No pattern I could see. I eventually left her plugged in with a serial log running and caught the crash: deep in the networking stack, triggered by a flood of failed DNS lookups.

What was happening: she was connected to a Wi-Fi network that had no actual internet. Every few seconds several parts of the firmware would try to reach the server, fail, and immediately try again. Dozens of failures every few seconds. Eventually the network stack tripped over itself.

The fix wasn't clever. When the server is unreachable, back off. Wait two seconds, then four, then eight, up to about a minute, and log it once instead of every time. After that she sat on a dead network for hours without a hiccup.

![](https://cdn.hashnode.com/uploads/covers/68fb4c09020910660a830e8f/12100437-8687-4c5c-8ed6-ce67e0838863.png align="center")

The lesson I keep relearning with embedded work: your code will spend a lot of its life in bad conditions. Flaky café Wi-Fi, a phone hotspot with no data, a router that's up but not online. Designing for that from the start is half the job.

## Becoming useful

Once she felt alive, I started giving her jobs. The rule I set myself was that each one had to be something a cat could plausibly do, or at least something that didn't feel like a phone app shoved into a cat.

- **Focus sessions.** Tap focus and she curls up and naps for 25 or 50 minutes. You're not allowed to wake her. It works on me better than any timer app has.
- **Tasks and reminders.** She keeps a short list and reads reminders out loud when they're due. If you ignore her, she gets increasingly dramatic about it.
- **Desk life.** She can show notifications from scripts on my Mac, nudge me to take a break after a long stretch of typing, wake me gently with an alarm, and put headphones on when music is playing.
- **Smart home.** She can switch lights and plugs from her screen, and turns them off when she goes to sleep. It's oddly satisfying to have the cat put the house to bed.
- **Friends.** Two Mochis can be paired, and then your cat can visit a friend's room. Small thing, but people love it.

![](https://cdn.hashnode.com/uploads/covers/68fb4c09020910660a830e8f/322c210f-e003-46fc-8b8e-9e0ff2458495.jpg align="center")

None of these were hard individually. The hard part was keeping them from fighting over the cat. If she's asleep, a notification should wait. If a reminder fires during a focus session, should she wake up? An alarm definitely should. A friend's visit definitely shouldn't. Most of my time went into those small rules, and they're the reason she feels like one character instead of a bundle of features.

Roughly, the question she asks herself every time something comes in looks like this:

![](https://cdn.hashnode.com/uploads/covers/68fb4c09020910660a830e8f/652b9369-a07b-490b-b236-c6dbc4f4fd38.png align="center")

## A personality of her own

For a while every Mochi was the same cat. Then a friend asked if theirs could be lazier than mine, and it made total sense.

Now when she first wakes up, you choose her temperament: playful, sleepy, curious, cuddly, bossy or shy. It isn't just a label. A sleepy cat gets tired faster and goes to bed earlier. A bossy cat demands dinner well before she's actually hungry. A shy cat takes longer to warm up to you and doesn't like being petted for too long early on.

![](https://cdn.hashnode.com/uploads/covers/68fb4c09020910660a830e8f/f8916d74-c412-4ea7-8a60-4bd61f09f8e9.jpg align="center")

She also picks her own favourites: a food she loves, one she won't touch, a favourite game, a favourite time of day. And she remembers things. Her bond with you grows slowly as you feed her, play with her and finish focus sessions together, from "getting to know you" all the way to "family". Miss a few days and it slips a little.

When she talks, she draws on all of that. She'll mention it's late and you should be asleep, or that you haven't played laser in a while, or that you two just became close friends. That's the part people react to most, and it's the part I'm least willing to explain in detail.

## The memory card

The unit has a microSD slot that I ignored for months. Then I realised it's the perfect way to make a Mochi feel like yours without any app.

Drop your own photos on the card and they hang in the frame on her wall. Add your own sounds and she uses them for her meow or alarm. There are outfits you can add, too. She also keeps a little diary on the card of what you did each day, and can back up and restore everything about herself, which matters once you're attached to her.

## From one cat to many

Everything so far worked fine for exactly one cat: mine. Making it work for strangers was a different project.

A few things had to change:

- **Setup without a laptop.** A new unit shows a QR code. Scan it with your phone, pick your Wi-Fi, done. No app to install.
- **Every unit has its own identity.** Early on, my cat used one shared secret to talk to the server. Fine for one device, terrible for a hundred. Now each unit gets its own credentials when I prepare it.
- **Pairing to an account.** You sign in with your email, the cat shows a short code on her screen, you type it in and she's yours. You can add people in your household, and you can let her go if you give her away.
- **Your data stays yours.** Her tasks, her home devices, her desk notes and her personality all belong to her and her owner, not to some shared bucket. I spent a full day doing nothing but checking that one person's cat can't see another person's things.
- **Updates over Wi-Fi.** New firmware is signed and she installs it herself. The first time I watched her quietly update and come back saying "I learned some new tricks!" was a good day.

Here's what a new owner goes through, from box to a cat that knows them:

![](https://cdn.hashnode.com/uploads/covers/68fb4c09020910660a830e8f/ec9e2a39-e2a0-46a1-a3a5-c7b7a1e7a30b.png align="center")

The security pass is worth mentioning because it's the kind of thing that's easy to skip on a side project. I found that a device credential could reach a couple of routes it shouldn't, that sign-in codes weren't rate limited per email, and that pairing codes could in theory be guessed with enough tries. None were exploited, all are fixed. If you're building something connected, assume the first version has holes like these, because it almost certainly does.

## A bug I'm a little embarrassed about

One evening the main menu started closing by itself a moment after opening. Sometimes. Not always.

I'd recently added a new menu entry, bringing the total to 17. The arrays holding the menu items had room for 16. The 17th quietly wrote over the variable that tracks which screen is open, setting it to something meaningless, and the cat promptly closed the menu.

Classic C++. No crash, no warning, just a cat behaving strangely. Bigger arrays and a guard that refuses to overflow, and it was gone. I've added "check the array sizes" to my mental list of things to look at first when a device starts doing something weird and inconsistent.

## Things I'm not doing

A couple of people have asked whether Mochi could run a language model locally, on the device. I looked into it. On this hardware, the largest model that fits in memory is a toy, and anything bigger would take tens of seconds per word. Her conversations go through a server for now. The cat works fine offline for petting, games, focus and her room. Wi-Fi adds the talking, weather, reminders and visits.

I've also held off on the microphone. The newer units have one, and voice is the obvious next step, but a device with a mic on your desk needs to earn that trust, and I want to get it right rather than get it fast.

## Making a few

This is where it stops being a hobby. I'm putting together a small first batch of 25 Mochis. Each one is flashed, tested and packed by hand, and ships with her room, her personality and everything above.

She's $79 outside India and ₹5,999 in India. Reserving one is free and you don't pay anything until your unit is ready to ship. The first batch ships in February 2027, one per person.

If you want one, or just want to see more real screens and a short video of her, it's all at [**shop.nyzex.in**](https://shop.nyzex.in).

And if you've built something similar, or have opinions on what a desk cat should do next, I'd genuinely love to hear it. Leave a comment. Mochi's been asleep through this whole post, by the way. She'll want to know how it went.
