Automatic Litter Box – How to Store Movement Sequences
Researching how to implement Record & Replay for the litter box led me away from local storage and toward databases. I've started building a Firebase-backed web server to persist motor positions and movement sequences reliably.
Lately I haven't been printing parts or building mechanics for the litter box.
Instead I've been spending a lot of time thinking. The next feature I want is what I've been calling Record & Replay.
Sounds simple enough....
- Move
- the drum with the joystick.
- Save the position.
- Replay it later.
- Done.
Or so I thought.
The more I looked into it, the more I realized the problem isn't moving the motor.
The problem is remembering what happened.

The Problem
Let's say I spend 20 minutes teaching the litter box exactly where I want the drum to stop.
I save:
- Home position
- Emptying position
- Cleaning position
Everything works perfectly.
Then one day:
- The controller dies
- I flash new firmware
- Something gets corrupted
Suddenly everything is gone.
Back to square one. The motor still works. The joystick still works.
But all the positions I've taught the system have disappeared.
That didn't sit right with me.

I Started Looking At It Differently
Originally I was thinking like this:
The controller should remember everything.
Now I'm thinking:
Why should the controller remember anything at all?
The controller's job is to move the motor. That's it.
Remembering data is something computers and databases are much better at.
Once I started looking at it that way, things became much clearer.

Building A Small Web Server
To test the idea I built a small web application connected to Firebase.
Nothing fancy.
Just enough to prove the concept.
The web application can:
- Save data
- Read data
- Update data
And most importantly:
The data survives even if the hardware doesn't.
That changes everything.

Why I Like This Approach
Imagine I replace the controller completely.
With local storage:
❌ Positions are gone.
With a database:
✅ Connect the new controller.
✅ Download the positions.
✅ Continue where I left off.
That feels much more robust.
Especially since this project keeps growing every week.

The Bigger Picture
At first I thought I was building a motor controller.
Now it feels more like I'm building a small platform.
The joystick controls the motor.
The display provides feedback.
The web interface manages data.
Firebase stores configuration.
And eventually all those pieces will work together.
What's Next?
The next step is connecting the Record & Replay logic directly to Firebase.
My idea right now is:
- Move the drum using the joystick
- Save the current position
- Store it in Firebase
- Load it later
- Replay it automatically

If it works the way I imagine, I'll only need to teach the litter box positions once.
After that the system should remember them forever.
At least until I come up with another idea and redesign everything again 😄