Project note

Dual Control System for the Automatic Litter Box

Built a local control module for the automatic litter box using a KY-023 joystick and OLED display. The NEMA 23 motor can now be controlled both from a web interface and directly on the unit. Next step: Record & Replay positions.

8 tags
Tags

Over the last few weeks I've been working on the electronics side of the litter box.

Up until now most of the focus has been on the mechanics, getting the NEMA 23 motor to rotate the drum, building the worm gear, and solving the backdriving issues caused by the weight of the litter box.

Now that the mechanical side is starting to come together, I needed a better way to control everything.

The original plan was to do all control through a web server.

That is still part of the project, but while testing I quickly realized it becomes frustrating having to open a browser every time I want to move the motor, test a position, adjust settings, or troubleshoot something.

So I decided to build a local control module.

This gives me direct access to the system without needing a laptop, browser, or network connection.


Components Used

The current setup consists of:

  • 1.3" OLED 128x64 I2C display
  • KY-023 joystick module
  • TB6600 stepper driver
  • NEMA 23 stepper motor

The OLED display provides a simple user interface while the joystick is used to navigate menus and manually move the motor.


Current Wiring

Below is the current prototype wiring.

It definitely isn't beautiful yet, but at this stage functionality is more important than appearance.

Once everything has been verified and tested, the plan is to move everything over to a dedicated PCB.

Control System Wiring

Like most prototype stages, there are a lot more wires than I would like to admit 😄


Demo

Below is a short video showing the current implementation.

The video shows the joystick and OLED display communicating with the motor control system.

At this point I can control the NEMA 23 motor both from the web interface and directly from the joystick.

That makes testing significantly faster because I don't need to sit with a browser open every time I want to verify a movement.


Why Build a Local Interface?

One thing I've learned while working on hardware projects is that convenience matters.

When you're testing a feature fifty times in a row, even small annoyances become frustrating.

Being able to simply walk up to the litter box and:

  • Move the drum
  • Test positions
  • Change settings
  • Navigate menus

makes development much smoother.

The web interface is still important, but it shouldn't be the only way to interact with the system.


What Comes Next?

The next feature I want to implement is something that will make the cleaning process much easier to configure.

Record & Replay

Instead of manually entering positions, I want the system to learn them.

The idea is simple:

  1. Enter learning mode.
  2. Move the drum using the joystick.
  3. Save the current position.
  4. Replay the saved position whenever needed.

For example, I could save:

  • Home position
  • Emptying position
  • Cleaning position
  • Service position

Then the litter box can automatically move between those positions later.

It's very similar to how industrial robots and robot arms are often taught movement points.

Move it once.

Save the position.

Replay it whenever you need it.


Future Plans

There is still plenty left to do:

  • Record & Replay functionality
  • Position storage
  • Dedicated PCB
  • Additional sensors
  • Improved menu system
  • Mobile and web improvements

One thing I'm also thinking about is how to store position data reliably.

I don't really want to depend entirely on flash memory for storing motor positions.

Later on I may experiment with storing settings and saved positions in a database instead.


Current Status

✅ OLED display implemented

✅ KY-023 joystick implemented

✅ TB6600 integrated

✅ NEMA 23 motor running

✅ Local menu system working

✅ Web control operational

🚧 Record & Replay functionality planned

🚧 Dedicated PCB planned


Compared to where this project started, it finally feels like the different parts are beginning to work together.

The mechanics are moving.

The controls are working.

And the next step is teaching the litter box exactly where it needs to go to clean itself.