Project note

Automatic Litter Box - ESP8266 + TB6600 + NEMA 23 — First Working Control Loop

Successfully connected NodeMCU V3 with TB6600 and NEMA 23, achieving stable motor control over WiFi. Next step is moving position tracking from volatile memory to an external database like MongoDB or Firebase.

8 tags
Tags

This step marks a major milestone in the project:

👉 The motor control stack is now fully working.

I’ve connected:

  • NodeMCU V3 (ESP8266 WiFi)
  • TB6600 stepper driver
  • NEMA 23 motor

And I can now reliably control movement over WiFi.


🧠 What This Step Proves

At this stage, the system can:

  • Drive the NEMA 23 with stable torque
  • Control direction and stepping via ESP8266
  • Maintain consistent motion without skipped steps
  • Operate over WLAN

This confirms that:

✔ Wiring is correct
✔ Signal timing is correct
✔ Driver configuration is stable
✔ Power delivery is sufficient


🎥 Live Test — Working System


⚙️ Current Architecture

Control flow:

ESP8266 → STEP/DIR → TB6600 → NEMA 23

  • ESP generates pulse signals
  • TB6600 handles current + stepping
  • Motor executes movement

Simple, stable, and predictable.


⚠️ Current Limitation

Right now, position tracking is volatile.

That means:

  • If the NodeMCU resets or loses power
  • The motor position is lost
  • System has no reference of current state

This is a problem for automation.


🧠 Next Step — Persistent State

I don’t want to rely on:

  • Flash memory on ESP8266
  • EEPROM-style storage

Reason:

  • Limited write cycles
  • Not ideal for frequent updates
  • Risk of corruption over time

🗄️ Planned Solution — External State Storage

Instead, I want to move state tracking to a database.

Concept:

  • ESP sends position updates over WiFi
  • Backend stores current position
  • System restores position on reboot

Options I’m considering:

MongoDB

  • Flexible schema
  • Easy to extend
  • Good for logging + history

Firebase

  • Real-time sync
  • Simple integration
  • Good for live control + mobile app

🔄 Future Architecture

ESP8266 → API → Database (MongoDB / Firebase)

  • Position stored externally
  • System becomes stateless locally
  • Recovery after reboot becomes trivial

🧪 Result

  • Motor control is stable
  • Communication works
  • System behaves predictably

👉 Next phase: make it persistent and production-ready.