ESP32-S3 + LVGL + TMC2209 motorized remote valve controller designed for marine and industrial fluid automation systems.
The N.E.R.D. Remote Valve Controller is a compact touchscreen-based stepper valve actuator platform developed as part of the N.E.R.D. (Nautical Embedded Resource Director) ecosystem.
This project combines:
- ESP32-S3
- LVGL touchscreen UI
- TMC2209 UART stepper control
- Persistent valve position memory
- Automatic software recalibration
- Configurable software travel limits
to create a reliable and repeatable remote-controlled proportional valve actuator suitable for:
- Marine automation
- Watermakers
- Fluid systems
- Pressure regulation
- Experimental process control
- Waveshare ESP32-S3 Touch LCD 1.9"
- 170x320 IPS touchscreen
- USB-C powered during development
- BIGTREETECH TMC2209 V1.2
- UART mode enabled
- STEP/DIR control
- Software-configurable current
- Standard NEMA17 stepper motor
Current prototype tested with:
- Tognella FT 2251/2-01 AISI316 double-acting flow control valve
Official product page:
The valve provides extremely smooth and progressive regulation and proved well suited for stepper-based remote actuation.
The controller includes a fully standalone LVGL interface with:
- OPEN / CLOSE controls
- LOW / MED / HIGH speed selection
- Valve turns display
- Live status indication
- OPEN ZERO / CLOSED ZERO calibration buttons
Valve position is automatically saved to ESP32 flash memory whenever movement stops.
After reboot, the controller restores:
- Valve position
- Calibration reference
- Travel logic
This allows recovery even after power loss while the valve is in an intermediate position.
The controller implements a practical self-recalibration system:
- Valve travel configured slightly larger than real mechanical travel
- When the actuator reaches a software end-stop, the controller automatically redefines its reference position
Example:
- Reaching full OPEN automatically performs OPEN ZERO
- Reaching full CLOSED automatically performs CLOSED ZERO
This compensates small accumulated step errors without requiring:
- Encoders
- Hall sensors
- Limit switches
Current prototype:
VALVE_TRAVEL_TURNS = 6.8f;The software prevents overtravel in both directions depending on the selected reference side.
Example:
If OPEN ZERO is set:
- OPEN limit = 0
- CLOSED limit = +6.8 turns
If CLOSED ZERO is set:
- CLOSED limit = 0
- OPEN limit = -6.8 turns
UART communication is fully functional and used for:
- Driver configuration
- Current control
- Diagnostics
- Runtime tuning
12V motor supply must be present BEFORE ESP32/TMC UART initialization.
Without motor supply present before UART initialization, the TMC2209 may fail communication.
TMC2209 StallGuard experiments were performed extensively during development.
- UART communication works correctly
- SG_RESULT values are readable
- StallGuard proved unreliable for this specific valve/mechanical configuration
For this reason, the current controller architecture relies on:
- Software travel limits
- Persistent position memory
- Automatic recalibration
instead of sensorless StallGuard homing.
| Function | GPIO |
|---|---|
| STEP | GPIO5 |
| DIR | GPIO6 |
| ENABLE | GPIO7 |
| UART TX | GPIO4 |
| UART RX | GPIO18 |
- GPIO4 connected through 1k resistor
- GPIO18 connected directly
- Both connected to PDN_UART
| TMC2209 Pin | Connection |
|---|---|
| VS | 12V motor supply |
| VIO | 3.3V ESP32 |
| GND | Common ground |
All grounds must be shared.
Current DEV03 firmware status:
- Stable
- Fully operational
- Repeatable positioning
- Persistent storage working
- Automatic recalibration working
- Touchscreen UI stable
- Marine automation
- Watermaker pressure regulation
- Remote fluid control
- Experimental hydraulic systems
- Process automation
- DIY industrial control
- ESP32/TMC2209 research projects
This project is released for:
- Educational use
- Personal use
- Non-commercial experimentation
Commercial use, resale or commercial integration is not permitted without explicit permission from the author.
© CobrAm GmbH
This project is part of the broader:
N.E.R.D. — Nautical Embedded Resource Director
marine automation ecosystem currently under development.



