Skip to content

Repository files navigation

N.E.R.D. Remote Valve Controller

Prototype

Prototype

Prototype

Prototype

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

Current Hardware Platform

Main Controller

  • Waveshare ESP32-S3 Touch LCD 1.9"
  • 170x320 IPS touchscreen
  • USB-C powered during development

Stepper Driver

  • BIGTREETECH TMC2209 V1.2
  • UART mode enabled
  • STEP/DIR control
  • Software-configurable current

Stepper Motor

  • Standard NEMA17 stepper motor

Valve

Current prototype tested with:

  • Tognella FT 2251/2-01 AISI316 double-acting flow control valve

Official product page:

https://www.tognella.it/en/flow-rate-control-valves/line-double-acting-flow-control-valves-ft-2251-2-01

The valve provides extremely smooth and progressive regulation and proved well suited for stepper-based remote actuation.


Features

Touchscreen UI

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

Persistent Position Memory

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.


Automatic Poor-Man Recalibration

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

Software Travel Limits

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

TMC2209 UART Notes

UART communication is fully functional and used for:

  • Driver configuration
  • Current control
  • Diagnostics
  • Runtime tuning

Important Discovery

12V motor supply must be present BEFORE ESP32/TMC UART initialization.

Without motor supply present before UART initialization, the TMC2209 may fail communication.


StallGuard Notes

TMC2209 StallGuard experiments were performed extensively during development.

Results

  • 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.


GPIO / Wiring Overview

ESP32-S3 ↔ TMC2209

Function GPIO
STEP GPIO5
DIR GPIO6
ENABLE GPIO7
UART TX GPIO4
UART RX GPIO18

UART Configuration

  • GPIO4 connected through 1k resistor
  • GPIO18 connected directly
  • Both connected to PDN_UART

TMC2209 Power

TMC2209 Pin Connection
VS 12V motor supply
VIO 3.3V ESP32
GND Common ground

All grounds must be shared.


Current Status

Current DEV03 firmware status:

  • Stable
  • Fully operational
  • Repeatable positioning
  • Persistent storage working
  • Automatic recalibration working
  • Touchscreen UI stable

Intended Applications

  • Marine automation
  • Watermaker pressure regulation
  • Remote fluid control
  • Experimental hydraulic systems
  • Process automation
  • DIY industrial control
  • ESP32/TMC2209 research projects

License

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


N.E.R.D. Ecosystem

This project is part of the broader:

N.E.R.D. — Nautical Embedded Resource Director

marine automation ecosystem currently under development.

About

ESP32-S3 + LVGL + TMC2209 motorized remote valve controller for marine and industrial fluid automation. Features persistent position memory, auto-zero recalibration and software travel limits. Current prototype developed around the Tognella FT 2251/2-01 AISI316L flow control valve.Commercial versions, updates and additional information:

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages