Servo Ball Valve for Drip Irrigation

This 3D-printed design lets you automate on/off control of water flow in ¼-inch drip irrigation tubing using an MG995 or MG996 servo. It’s ideal for garden automation projects, such as controlling water flow from a rain barrel to patio plants based on soil moisture levels.

Hardware Requirements:
Servo: MG995 or MG996

Valve: ¼-inch quick-connect valve (e.g., this model on Amazon; similar ones are widely available)
https://www.amazon.com/Spalolen-Irrigation-Universal-Connector-Sprinkler/dp/B0CTQWLH4V

Bolts: 4 or 5 M3 x 20mm bolts

Servo Horn: Use the included dual servo horn; trim the ends to press-fit into the coupler (no need for screws/bolts into horn)

Printing Notes:
Printed successfully in both PLA and PETG

Enable tree supports for the coupler part

Electronics and Control:
Control the servo using standard servo commands via ESP32, Arduino, etc.

In my setup, 0° corresponds to open and ~90–92° to closed

Use an example sketch like Sweep.ino to calibrate your servo range and align the horn properly

For a true “latching” valve that consumes almost zero power when idle (< 1uA), control 5V power to the servo using a TPS63020 (5V) buck/boost converter breakout board, desolder jumper SB2, then use GPIO pin from your MCU to control the EN (enable) pin. Put a 100K pulldown resistor on EN. This lets me run the servo off a 1S LiPo that I use to power my ESP32. See a nice discussion of the TPS63020 here
https://youtu.be/8hKpQvw1nNw?t=566

Power Considerations:
Typical movement current: ~250 mA

Stall current can exceed 2A — ensure proper mechanical setup and software control to avoid stalling