# Rebuilding a dead Litter-Robot 2 control board
**Doc:** LR2-Redux / Revision Notes · **Rev.** 2.0 · **Subject board:** LITTER-ROBOT Rev.2C (2003, Intensa Inc.) · **Status:** Complete — running in the real unit · **Repo:** [github.com/micgresham/lr2-redux](https://github.com/micgresham/lr2-redux)
The original control board died — not the sensors, not the switches, not the motor. Instead of hunting for a 20-year-old replacement for a dead PIC microcontroller, this project replaces the whole control board with an ESP32 and reuses every other stock part exactly as it was: the gearmotor, the hall sensors, the weight switch, the anti-pinch switch, the wiring harness itself. This page is the story of how that went, in the order it actually happened — including the parts that didn't work the first time. As of this revision, the custom PCB is built, installed, and running the real robot end to end. Full source is on GitHub at [micgresham/lr2-redux](https://github.com/micgresham/lr2-redux).
| | |
|---|---|
| Harness pinout | **Fully resolved** |
| Hall sensors | **Installed in chassis** |
| Weight / anti-pinch split | **Done, bench-verified** |
| Motor driver | **DRV8871, hardware-verified** |
| Firmware | **Builds clean, both targets** |
| Custom PCB | **Fabricated, installed — working** |
| Real-hardware cycle timing | **Confirmed working (placeholders kept as-is)** |
| WiFi `ASSOC_LEAVE` ghost (§09) | **Resolved — hasn't recurred since PCB install** |
| **Project** | **Complete** |
## Contents
1. [The problem](#01-the-problem)
2. [Reading the corpse](#02-reading-the-corpse)
3. [The series-wiring trap](#03-the-series-wiring-trap)
4. [Design decisions](#04-design-decisions)
5. [Picking the parts](#05-picking-the-parts)
6. [Bring-up, and the harness split](#06-bring-up-and-the-harness-split)
7. [Firmware, and its bugs](#07-firmware-and-its-bugs)
8. [The dashboard](#08-the-dashboard)
9. [Chasing a WiFi ghost](#09-chasing-a-wifi-ghost)
10. [Where it stands](#10-where-it-stands)
---
## 01 · The problem
The stock board is stamped **"LITTER-ROBOT Rev.2C, Copyright (C) 2003 Intensa Inc."** — a PIC16C622A-based controller that simply died. Not the Home/Dump hall-effect position sensors, not the weight or anti-pinch switches, not the gearmotor, not the harness connecting them all — those were all still good. The brain was gone.
The original chip is old, unsupported, and effectively irreplaceable without reverse-engineering its firmware from scratch. Rather than try to source or clone a 20-year-old PIC controller, the plan became: replace the whole control board with an ESP32 and an H-bridge motor driver, and wire every still-good stock part into it exactly as it was — the 12V gearmotor, the hall sensors and their existing magnets on the globe, the cat-weight switch, the anti-pinch switch, the wiring harness itself.
## 02 · Reading the corpse
Before any of the new electronics could go in, the stock harness's actual wiring had to be established — not assumed. Early attempts to find a pinout online turned up two AI-generated summaries that contradicted each other (one literally hedged *"Pin 1: Positive/Negative"*) and didn't match anything verifiable. Those were discarded outright.
What actually resolved it was a multimeter, going pin by pin across both connectors on the physical board, checked against someone else's teardown of the same board family (a 2020 student reverse-engineering writeup that turned out to describe the exact same connector, down to the wire colors).
| Connector | Carries | Resolved via |
|---|---|---|
| 4-pin | Motor (to driver IC "U5") | Continuity trace |
| 7-pin | Hall sensors + weight/anti-pinch switches | Continuity trace + bench test |
Opening the hall sensor package itself settled the last unknown: two **Allegro A1101EUA-T** hall-effect ICs, mounted facing each other, open-drain outputs pulled up through a 330Ω network on the board. A part number, not a guess.
## 03 · The series-wiring...
Read more »
michael