
CWX Valve Controller
A programmable irrigation timer for CWX series motorized valves, built around an STM32 with a custom PCB, a real-time clock, and up to four daily schedules.
The CWX Valve Controller automates CWX series motorized valves. Where a typical irrigation timer wires straight to one valve, this one takes a broader brief: it drives any of the five CWX valve types at their rated voltage, follows up to four irrigation schedules a day, and keeps everything running and properly set through power interruptions.
Configuration happens without buttons or a screen layout to memorize — a single navigation knob and a graphic LCD walk through valve type, operating voltage, and schedules, with every setting persisted to non-volatile memory. The hardware started as a wired Arduino Micro prototype and grew into a custom PCB built around an STM32F103.
How It Works
12–28 V DC ──► LM2596 buck ──► Vdrive (5/6/9/12/24 V)
│
STM32F103C8T6 ◄── mux + ADC ──► │
│ ▼
UI (encoder + GLCD) valve drivers ──► CWX valve
│
DS3231 RTC ──► schedule engine- Valve plug-and-play. Select CR01–CR05 in the menu and the firmware switches to the matching driver topology — a motorized valve gets an H-bridge and gear-turn timing, a latching valve gets its relay pulse.
- Voltage select. The 12–28 V supply is bucked to the valve's rated voltage (5, 6, 9, 12, or 24 V) by switching the LM2596 feedback network through an analog multiplexer. The firmware reads the rail back and only accepts a selection within tolerance and with enough supply headroom.
- Scheduling. Four independent daily windows, each with a 5-minute minimum duration. The DS3231 real-time clock keeps time through power cuts, and the schedule engine rides on it every few seconds.
- Always remembers. Valve type, voltage, schedules, and enable flags all live in EEPROM, so the controller wakes up exactly where it was left.
Features
- Up to four independent irrigation schedules per day
- Real-time clock with battery backup (DS3231) — no time lost on power cut
- Supports CR01, CR02, CR03, CR04, and CR05 CWX valves
- Programmable output voltage: 5 V, 6 V, 9 V, 12 V, 24 V
- Motorized valves: H-bridge drive with end-of-travel feedback
- Latching valves: relay drive with automatic timing
- Feed-back validated voltage rail and low-supply detection
- Non-volatile settings (EEPROM) and force-safe valve state on boot
- Custom PCB and a sealed enclosure with a glanded cable exit
Current Status
The controller is in production use. The full hardware — supply rail, drivers, connectors, and layout — is captured in KiCad and shipped as Gerbers, and the flow of the state machine is documented as a design diagram. The architecture notes, pin map, and firmware breakdown are in the documentation.
More projects
Hydroponics Control System
An internet-connected hydroponic grow controller that runs each vegetable from its own profile, automating climate, lighting, watering, and nutrient delivery.
Dopesilicon
A full-stack cloud IoT platform — MQTT ingestion, time-series storage, and a live web dashboard — built to bring personal embedded projects online.