Skip to the content
2 layers90 × 60 mmValvenode master, the printed circuit board in 3D

Valvenode master

vinthewrench/valvenode15

Wired RS-485 field-bus irrigation valve controller for Raspberry Pi farm automation

Size
90 × 60 mm
Copper layers
2
Thickness
1.6 mm
Parts
54
Nets
64
Pads
192
Tracks, vias
369, 3
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
3 May 2026
Updated
12 Jun 2026

Overview

Valvenode master is an open-source printed circuit board by vinthewrench, from the vinthewrench/valvenode repository on GitHub. It is a 2-layer board of 90 × 60 mm with 54 parts on 64 nets, routed with 369 tracks and 3 vias.

It is built around the ATMEGA88PB-AU, MAX485EPA(LX) and ULN2003A, with the 151033GS03000, 151033RS03000 and 151034BS03000 among its other parts. Its parts include 13 resistors, 10 capacitors, 8 connectors, 5 diodes and 4 ICs. It belongs with the audio and music boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

9

README

README.md

ValveNode

ValveNode is a wired field-bus irrigation valve-control system for my Raspberry Pi farm automation stack.

This project is a continuation of the work described in Off-Grid Farm Automation with Raspberry Pi.

The irrigation side started with a Raspberry Pi, relay outputs, and conventional sprinkler valve wiring, described in Raspberry Pi Internet of Things - part 2: Controlling the Irrigation valves. That proved the basic idea: local software can control real irrigation hardware without a cloud service or proprietary controller. It also exposed the usual field problems: long wire runs, voltage drop, power loss, serviceability, and too many individual valve wires returning to one box.

I later experimented with more efficient solenoid drive hardware using a DRV103 in Not Another Sprinkler Valve Article. That design gives a conventional valve a strong opening pulse and then reduces average power with PWM, which matters for long wire runs and battery-backed operation.

As the farm kept expanding, the wiring problem started to matter more than the valve-control problem. Every new irrigation zone meant another long wire run back to the controller, more trenching, more splices, more voltage drop, and more things to troubleshoot later. At that point, spending a few extra dollars per valve for latching solenoids was worth it if it let the field wiring become a simple 4-wire RS-485 network.

ValveNode takes the next step: instead of pulling every valve wire back to the controller, it moves small controller cards out into the field.

A Raspberry Pi talks to a Valve Master over I2C. The Valve Master starts a 4-wire RS-485 field cable carrying power and data. Valve Node cards sit along that cable, and each card drives a local latching irrigation solenoid with a short polarity-controlled pulse.

The goal is simple: irrigation control that is local, wired, understandable, repairable, and expandable.

Overview

The project has two primary components:

  • valvenode-master
    ATmega88PB-based I2C-to-RS-485 master controller.

    valvenode-master

  • valvenode-slave
    ATtiny4313-based RS-485 valve node for controlling latching irrigation valves.

valvenode

The upstream controller talks to the Valve Master over I2C. The Valve Master controls field power and communicates with downstream Valve Nodes over RS-485.

ValveNode topology

Latching Solenoids

ValveNode is designed around low-voltage DC latching irrigation solenoids. The initial supported solenoids are:

ManufacturerPartDescriptionNotes
Hunter458200DC latching solenoidCommon Hunter solenoid for battery-operated and DC-latching valve control
Rain BirdK80920 / TBOSPSOL9 V DC potted latching solenoidFits many Rain Bird valve bodies, including DV, DVF, ASVF, PGA, PEB, PESB, GB, EFB-CP, BPE, and BPES series valves

A latching solenoid is not powered continuously. The Valve Node drives it with a short polarity-controlled pulse through the H-bridge: one polarity opens the valve, the opposite polarity closes it, and then the output is turned off.

Project Goals

  • Wired field-bus control for irrigation valves
  • No cloud dependency
  • No wireless dependency
  • Local 12 V field-power switching
  • Half-duplex RS-485 node communication
  • AVR-based firmware that can be understood, built, and serviced
  • KiCad hardware source included
  • Separate master firmware, simulator, Linux test tool, and node firmware

Repository Layout

text
valvenode/
├── valvenode-master/
│   ├── docs/
│   ├── firmware/
│   ├── hw/
│   │   └── 1.0/
│   ├── sim/
│   └── test/
└── valvenode-slave/
    ├── docs/
    ├── firmware/
    ├── hw/
    │   ├── 1.0/
    │   └── 1.1/
    └── test/

Valve Master

Path:

text
valvenode-master/

The Valve Master is the central controller for the valve-node network.

It performs these jobs:

  • Accepts host commands over I2C
  • Controls switched 12 V field-bus power
  • Sends RS-485 commands to downstream valve nodes
  • Receives valve-node replies
  • Maintains node discovery state
  • Reports status and command results to the host
  • Provides local visual status indication
  • Exposes AVR ISP programming access

Default I2C address:

text
0x09

Address 0x08 is reserved for a separate power-control board, so 0x09 is used as the default Valve Master address.

Valve Master Hardware

Path:

text
valvenode-master/hw/1.0/

Important KiCad source files:

text
valvenode-master.kicad_pro
valvenode-master.kicad_sch
valvenode-master.kicad_pcb

The master board uses:

  • ATmega88PB-AU
  • MAX485-style RS-485 transceiver
  • Relay-switched 12 V field-bus output
  • FAULT input
  • COMM and FAULT indicators
  • AVR ISP header
  • I2C host-side interface

Valve Master Firmware

Path:

text
valvenode-master/firmware/

Files:

text
makefile
valvenode_master.c

The firmware implements the production Valve Master behavior:

  • I2C slave interface
  • Register map
  • Deferred command handling
  • RS-485 transmit/receive control
  • Field-bus power control
  • Node discovery
  • Valve-node command dispatch
  • Result and reply registers
  • Fault/status reporting

Directed RS-485 commands include timeout handling and retry behavior. A single missed node reply should not turn into an immediate hard failure on a slow irrigation field bus.

Build:

bash
cd valvenode-master/firmware
make

Valve Master Simulator

Path:

text
valvenode-master/sim/

Files:

text
makefile
valvenode_master_sim.c

The simulator models the master command/register behavior for bench testing without hardware.

Build:

bash
cd valvenode-master/sim
make

Valve Master Linux Test Tool

Path:

text
valvenode-master/test/

Files:

text
makefile
Doxyfile
src/

Source files:

text
I2C.cpp
I2C.hpp
LogMgr.cpp
LogMgr.hpp
TimeStamp.cpp
TimeStamp.hpp
Valve_master.cpp
Valve_master.hpp
main.cpp

The test tool is a Linux-side C++ program used to talk to the Valve Master over /dev/i2c-*.

The main C++ class is:

text
Valve_master

It wraps the Valve Master I2C register map and command model.

Typical responsibilities:

  • Open the Linux I2C device
  • Select the Valve Master I2C address
  • Read and write registers
  • Submit commands
  • Wait for command completion
  • Read command results
  • Read reply registers
  • Read discovered node map
  • Query firmware versions
  • Control field power
  • Ping nodes
  • Set valve/channel state

Build:

bash
cd valvenode-master/test
make

Common valve commands:

bash
./valve status
./valve power on
./valve power off
./valve who
./valve map
./valve ping 1
./valve set 1 1 on
./valve set 1 1 off
./valve channel 1 1 status
./valve version master
./valve version 1
./valve identify 1
./valve cancel

Provisioning commands:

bash
./valve config
./valve assign 7
./valve move 7 8

Hammer Test

Path:

text
valvenode-master/test/hammer.sh

hammer.sh repeatedly exercises the full Valve Master path.

Test pattern:

text
power on
ping nodes
initial status nodes
loop:
  set ON nodes
  status nodes
  set OFF nodes
  status nodes
final status nodes
power off

Example:

bash
cd valvenode-master/test
./hammer.sh 25
NODES="1 3 4 5 6" CHANNEL=1 ./hammer.sh 500

Optional settings:

bash
CHANNEL=2 ./hammer.sh 25
VERBOSE=1 ./hammer.sh 25
VALVE_BIN=./valve ./hammer.sh 25
NODES="1 3 4 5 6" ./hammer.sh 25
RETRY_ON_FAIL=1 ./hammer.sh 25

Recent bench result:

text
500 loops
5 nodes tested: 1 3 4 5 6
channel 1
10,016 commands
0 failures
100% first-try pass rate

Generate local Doxygen docs:

bash
cd valvenode-master/test
doxygen Doxyfile
open docs/html/index.html

Valve Master I2C Register Model

The host talks to the master through a small register map.

Important registers include:

text
REG_COMMAND
REG_STATUS
REG_ARG0
REG_ARG1
REG_ARG2
REG_RESULT
REG_POWER_STATE
REG_NODE_COUNT
REG_REPLY_NODE
REG_REPLY_CMD
REG_REPLY_ARG0
REG_REPLY_ARG1
REG_VERSION_HI
REG_VERSION_LO
REG_NODE_MAP

Important command values include:

text
CMD_POWER_ON
CMD_POWER_OFF
CMD_WHO
CMD_PING
CMD_SET_CHANNEL
CMD_GET_CHANNEL_STATUS
CMD_GET_NODE_VERSION
CMD_IDENTIFY
CMD_CANCEL
CMD_CONFIG
CMD_ASSIGN
CMD_CLEAR_ERROR
CMD_SET_ERROR
CMD_CLOSE_ALL

Important status bits include:

text
STATUS_BUSY
STATUS_ERROR
STATUS_POWER_ON

Important result values include:

text
RESULT_OK
RESULT_BAD_COMMAND
RESULT_BAD_NODE
RESULT_BAD_CHANNEL
RESULT_NODE_NOT_FOUND
RESULT_UNSUPPORTED_CHANNEL
RESULT_CONFIG_REQUIRED
RESULT_ADDRESS_IN_USE
RESULT_BUSY
RESULT_RS485_TIMEOUT
RESULT_RS485_BAD_CHECKSUM
RESULT_RS485_BAD_REPLY
RESULT_POWER_OFF

Valve Node

Path:

text
valvenode-slave/

The Valve Node is the remote field device. It receives RS-485 commands and drives a 12 V latching irrigation valve.

Core functions:

  • Receive framed RS-485 commands
  • Check destination address
  • Respond to discovery and status commands
  • Drive a latching valve using a polarity-controlled pulse
  • Turn the H-bridge fully off after each pulse
  • Report current logical valve state

Valve Node Hardware

Paths:

text
valvenode-slave/hw/1.0/
valvenode-slave/hw/1.1/

Important KiCad source files:

text
valvenode.kicad_pro
valvenode.kicad_sch
valvenode.kicad_pcb

The 1.1 hardware directory is the newer active revision.

The node hardware uses:

  • ATtiny4313
  • 5 V RS-485 transceiver
  • VNH7100BAS / VNH7100BASTR H-bridge
  • 12 V latching irrigation valve output
  • 12 V field-bus input
  • Local 5 V regulator
  • Optional status LED

Basic field connection:

text
+12 V
GND
RS-485 A
RS-485 B

The design is intended for direct-burial irrigation cable.

Recommended cable:

  • 18/4 acceptable for shorter runs
  • 16/4 preferred for longer runs or higher node counts

Valve Node Power Architecture

The node receives 12 V from the field cable.

Power paths:

  • 12 V directly feeds the valve driver supply
  • 12 V feeds a local 5 V regulator
  • 5 V powers the ATtiny4313 and RS-485 transceiver

Recommended protection and stability parts include:

  • Bidirectional TVS across the 12 V input
  • Bulk capacitance near the H-bridge supply
  • 0.1 uF local decoupling at MCU and transceiver
  • Additional 5 V bulk capacitance near the MCU
  • Reverse-polarity protection where practical

For master-side field power switching, allow roughly 250 to 300 ms after switching on the 12 V field bus before sending node commands.

Valve Node Firmware

Path:

text
valvenode-slave/firmware/

Files:

text
makefile
valvenode.c
valvenode_example_commands.txt

The firmware target is the ATtiny4313.

Firmware responsibilities:

  • UART receive
  • RS-485 command parsing
  • Address matching
  • Optional checksum checking
  • Valve open pulse
  • Valve close pulse
  • Status reporting
  • Ping reply
  • WHO discovery reply
  • Safe H-bridge shutdown after each pulse

Build:

bash
cd valvenode-slave/firmware
make

Valve Node Test Tool

Path:

text
valvenode-slave/test/

Files:

text
makefile
src/main.cpp

The vnode utility is used for direct bench testing of valve nodes over a serial port. It assumes the computer is connected to the RS-485 bus through a USB-to-RS-485 adapter.

This bypasses the Valve Master and talks directly to the nodes.

Build:

bash
cd valvenode-slave/test
make

Example:

bash
./vnode -d /dev/ttyUSB0 who
./vnode -d /dev/ttyUSB0 ping 1
./vnode -d /dev/ttyUSB0 open 1 1
./vnode -d /dev/ttyUSB0 close 1 1

Typical output:

text
$ ./vnode -d /dev/ttyUSB0 who
device: /dev/ttyUSB0
baud:   9600
tx: :FFW\r
rx: :01WB8  [checksum ok] node=1 WHO
rx: :02WB9  [checksum ok] node=2 WHO

vnode can also be used to configure a fresh node, assign its address, and verify that it answers before it goes into the field.

RS-485 Valve Node Protocol

The Valve Master and Valve Nodes communicate over a half-duplex RS-485 bus.

The node protocol is command/response. The master sends a framed command. A node replies only when addressed or when participating in a controlled discovery response.

Typical commands:

text
PING
STATUS
OPEN
CLOSE
WHO
IDENTIFY
CONFIG
ASSIGN
VERSION

Typical behavior:

  • PING confirms node presence
  • STATUS reports logical valve/channel state
  • OPEN sends the open-polarity valve pulse
  • CLOSE sends the close-polarity valve pulse
  • WHO is used for node discovery
  • IDENTIFY asks a node to identify itself
  • CONFIG enters configuration behavior
  • ASSIGN sets or changes a node address
  • VERSION reports firmware version

Broadcast state-changing commands should be avoided unless explicitly implemented and safe.

Useful Linux I2C Commands

List I2C buses:

bash
i2cdetect -l
ls -l /dev/i2c-*

Scan I2C bus 1:

bash
i2cdetect -y 1

Look for the Valve Master at address 0x09.

Check user permissions for I2C:

bash
groups
ls -l /dev/i2c-*

If needed, add the user to the i2c group on Linux:

bash
sudo usermod -aG i2c $USER

Then log out and back in.

Development Notes

  • The Valve Master default I2C address is 0x09.
  • The Valve Master controls field-bus 12 V power.
  • The Valve Nodes are not autonomous irrigation controllers.
  • Valve Nodes execute direct command/response behavior.
  • Latching valves must be driven with short pulses, not continuous power.
  • H-bridge outputs must be turned off after each pulse.
  • RS-485 bus direction control must be handled carefully to avoid bus contention.
  • Field wiring should assume noise, voltage drop, wet boxes, lightning exposure, and field-service abuse.

Current Project Status

The repository currently contains:

  • Valve Master hardware design
  • Valve Master firmware
  • Valve Master simulator
  • Valve Master Linux I2C test tool: valve
  • Valve Master hammer test: hammer.sh
  • Valve Node hardware revisions
  • Valve Node firmware
  • Valve Node direct RS-485 test tool: vnode
  • Protocol and design documentation

Current bench status:

  • Valve Master can switch field power
  • Valve Master can communicate with multiple valve nodes over RS-485
  • Valve nodes respond to discovery, ping, set, and status commands
  • hammer.sh has completed a 500-loop, 10,016-command bench test across five nodes with zero failures

Remaining validation:

  • Confirm final latching-solenoid open/close polarity with real valve bodies
  • Test final assembled boards in outdoor enclosures
  • Validate longer real field-cable runs
  • Continue field reliability testing before treating the system as deployed infrastructure

Parts

54
QtyValueFootprintReferences
5.1ufRCER71H104K0DBH03A:RCER71H104K0DBH03AC1, C2, C3, C7, C9
45.6KResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR7, R8, R12, R13
4MountingHole_3.5mm_PadMountingHole:MountingHole_3.5mm_PadH1, H2, H3, H4
3, ,
3151033GS03000LED_THT:LED_D3.0mmLED1, LED2, LED3
3470ΩResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR3, R4, R5
210ufCapacitor_THT:CP_Radial_D5.0mm_P2.00mmC4, C6
2220ΩResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR9, R11
24.7KResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR1, R2
270551-0003Molex 70551-0003:705510003J3, J5
1+12TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-4-5.08_1x04_P5.08mm_HorizontalJ8
1100ufCapacitor_THT:CP_Radial_D8.0mm_P3.50mmC10
110KResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR6
112V powerTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalJ1
1151033RS03000LED_THT:LED_D3.0mmFAULT
1151034BS03000LED_THT:LED_D3.0mmCOMM
11N4148WSDiode_THT:D_DO-35_SOD27_P7.62mm_HorizontalD1
11ufRCER71H104K0DBH03A:RCER71H104K0DBH03AC8
120KResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR10
13568ATM FUSE 3568:3568LINE FUSE
1470ufCapacitor_THT:CP_Radial_D8.0mm_P3.50mmC5
1ATMEGA88PB-AUPackage_QFP:TQFP-32_7x7mm_P0.8mmU2
1AVR-ISP-6Connector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_VerticalJ2
1Conn_01x03_PinConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ6
1Conn_02x02_Odd_EvenConnector_PinHeader_2.54mm:PinHeader_2x02_P2.54mm_VerticalJ4
1Conn_02x08_Odd_EvenConnector_PinSocket_2.54mm:PinSocket_2x08_P2.54mm_VerticalJ7
1D45V5F5D45V5F5:D45V5F5U1
1DSP1-L2-DC12VDSP1-L2-DC12V:DSP1-L2-DC12VK1
1LOGOLOGOG***
1MAX485EPAPackage_DIP:DIP-8_W7.62mmU4
1P6SMB18ADiode_SMD:D_SMB_HandsolderingTVS1
1RESETButton_Switch_THT:SW_PUSH_6mmSW1
1SM712_SOT23Package_TO_SOT_SMD:SOT-23D2
1ULN2003APackage_DIP:DIP-16_W7.62mmU3

More from vinthewrench/valvenode

2
  • 2 layers100 × 70 mmValvenode, the printed circuit board in 3D

    Valvenode

    vinthewrench/valvenode

    Wired RS-485 field-bus irrigation valve controller for Raspberry Pi farm automation

    44 parts15
  • 2 layers100 × 90 mmValvenode, the printed circuit board in 3D

    Valvenode

    vinthewrench/valvenode

    Wired RS-485 field-bus irrigation valve controller for Raspberry Pi farm automation

    39 parts15

Similar boards

  • 2 layers96 × 96 mmDigitalLogicProject, the printed circuit board in 3D

    DigitalLogicProject

    Jetsama/DigitalLogicProject

    Physical representation of digital logic gates using PCBs

    102 parts2
  • 2 layers147.3 × 83.8 mmUMDv3, the printed circuit board in 3D

    UMDv3

    db-electronics/UMDv3-kicad

    UMDv3 Kicad PCB

    68 parts1
  • 2 layers82.5 × 85.3 mmBSPD-27, the printed circuit board in 3D

    BSPD-27

    Full-Blue-Racing/BSPD-27

    BSPD for the fbr27 car

    108 parts
  • 2 layers100 × 100 mm1.3e, the printed circuit board in 3D

    1.3e

    OpenLogicEFI/Hardware

    Hardware is based off an open source project called Speeduino by Josh Stewart.

    157 parts19
  • 2 layers107 × 54 mmInterface board 1, the printed circuit board in 3D

    Interface board 1

    Green-bms/SmartBMS

    Open source Smart Battery Management System

    63 parts756
  • 4 layers93.3 × 60.3 mmArduino 386EX V5, the printed circuit board in 3D

    Arduino 386EX V5

    dbalsom/arduinoX86

    An interface between an Arduino Due or Arduino GIGA and 8088, 8086, V20, V30, 186 or 286 CPUs

    56 parts114
  • 2 layers52 × 61 mmArduino motorfocus, the printed circuit board in 3D

    Arduino motorfocus

    fehlfarbe/arduino-motorfocus

    Arduino motorfocus with moonlite protocol for telescopes

    23 parts58MIT
  • 4 layers199.9 × 69.3 mmZaphod controller, the printed circuit board in 3D

    Zaphod controller

    Scottapotamas/zaphod-bot

    A DIY high performance delta-bot for fun, and lightpainting...

    251 parts53

Questions

How big is the Valvenode master PCB?

It measures 90 × 60 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Valvenode master use?

54 parts, built around the ATMEGA88PB-AU, MAX485EPA(LX), ULN2003A and 151033GS03000. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Valvenode master KiCad files?

From the vinthewrench/valvenode repository on GitHub, at the commit this page was made from: the board is valvenode-master/hw/1.0/valvenode-master.kicad_pcb and its schematic valvenode-master/hw/1.0/valvenode-master.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Valvenode master design in my own project?

Its repository states no licence, so its author keeps all rights: ask vinthewrench before reusing the design.