My write-up on using PWM to drive irrigation valves got some attention on Hackaday. The feedback made me realize something: people don’t read anymore. So here’s the condensed version.
The problem
I run StellaPorta — A farm where we grow vegetables naturally.
We need to water them — regularly, reliably, and sometimes automatically.
We use sprinkler valves to control irrigation flow.
The system runs schedules, remote control, and weather-based automation.
The valves are far from the controller — wire runs are long.
The system must keep working when utility power goes out.
The stock OpenSprinkler design is clever, but not efficient enough for my needs.
Long distances and the need to conserve battery power forced me to design a better drive method.
Here’s how I solved it
I built a small board around a Texas Instruments chip (DRV103) made for running solenoids like sprinkler valves.
It gives the valve a strong burst of power to pop it open, then automatically drops back to a lighter “pulse” signal to hold it open.
This means the valves use less power, run cooler, and the battery lasts longer.
Because it’s pulsed instead of just lowering the voltage, the system also works better over long wire runs out in the field.
I added simple protection parts so the electronics don’t get fried by the valve coil.
I’ve shared the design as open hardware so anyone can use or adapt it..
The DRV103 first sends a DC signal to open the valves and then switches to pulse-width modulation to reduce the duty cycle to about 50-70%. The PWM circuit quickly switches the power going to the solenoid between an on and off state, and by varying the ratio of on to off, it controls the average amount of power delivered to the circuit.
Doesn’t OpenSprinkler already do this?
Yes, but differently. OpenSprinkler DC uses a short voltage spike to open the valve, then lowers the voltage to keep it open. This is done with firmware, a boost circuit, and more parts.
That works fine for shorter wire runs and when power efficiency isn’t critical.
The problem comes with long distances: lowering voltage also lowers current, and the extra wire resistance can make the valve unreliable.
And on battery backup, that constant lower voltage still pulls more current than you really need.
My design with the DRV103 uses PWM hold instead. The valve always gets the current it needs, but average power is reduced.
Ray Wang, the creator of OpenSprinkler, has done a huge amount to make smart irrigation controllers accessible to makers. My DRV103 board isn’t a replacement — just tuned for long runs and battery-backed reliability.
For the not-challenged-by-math crowd
Let’s run the numbers on a 200 ft run of 18 AWG irrigation wire.
18 AWG ≈ 6.4 Ω per 1000 ft
Round trip (400 ft) = 2.55 Ω of wireValve coil ≈ 34 Ω
Total loop = 34 Ω + 2.55 Ω = 36.6 Ω
At a 12 V supply:
Full-on current: 12 V ÷ 36.6 Ω ≈ 0.33 A
Voltage lost in wire: 0.33 A × 2.55 Ω ≈ 0.85 V
The valve really only sees about 11.1 V
Comparing hold methods:
OpenSprinkler-style (fixed 9 V): ~0.25 A, ~2.2 W drawn
DRV103 PWM hold (~62% duty): ~0.20 A, ~1.5 W drawn
Bottom line: At 200 ft, you lose about 0.85 V in the wire. PWM hold still keeps the valve solid and saves ~30% power compared to the fixed-voltage method.
If you want to dive into the rabbit hole, please spend some time on my original articles:
Step 1 - Get the plumbing working
Step 2 - Upgrade from OpenSprinkler
Step 3 - Prototyping a PWM system
TLDR
Sprinkler valves need a strong kick to open, then much less power to stay open.
OpenSprinkler DC handles this with extra circuitry and a voltage drop method.
My DRV103 board does it with one chip and a handful of parts using PWM.
Result: simpler circuit, less power, longer battery life, and reliable operation over long wire runs.
PWM hold is the simplest way to save power and keep valves reliable over long runs.
Get out there, create things, and make stuff happen.
This post is part of the Off-Grid Farm Automation with Raspberry Pi series — a full DIY walkthrough of building a self-hosted system for sensors, valves, and automation, no cloud required.