Smart sprinkler on a Pan/Tilt mount to programmatically water the lawn with a fill pattern

Similar projects worth following
We all know how much precious water is wasted by lawn irrigation systems. While there are many sprinkler controller and irrigation projects on already, I want to do things a little different. While most other projects focus on controlling standard sprinkler systems that tend to spray wherever they please (mostly on driveways and sidewalks it seems), I want to experiment with a different way of watering: by controlling a single spray head to pattern the lawn, like a person would. So whether you read "PTSprinkler" as Pan/Tilt, Polygon Trace or Pretty Terrific Sprinkler, the goal is first of all to cover the lawn area accurately, then make it smart with weather data and/or sensors.

The intention of this project is to use as many low cost off-the-shelf components as possible. Starting out with the lowest cost heavy duty outdoor pan/tilt stage I could find, plus a regular irrigation solenoid valve. Both parts are well-reviewed and are outdoor rated, so I don't need to try and re-invent the mechanical parts.

I will probably build some custom electronics to control these components from a Raspberry Pi.

The idea for setting it up is that the user would turn on the water and then manually control the valve, guiding it along the outline of the polygon that makes up the boundary of the area to be watered. Software would then simplify the polygon and calculate a fill pattern (or maybe two fill patterns crossed for better coverage), and move the spray along the calculated pattern across the lawn, taking into account the wider, less dense spray in the distance compared to the narrow, hard spray close to the spray head.

The goal is to cover the lawn evenly, and reduce overspray on sidewalks and driveways as much as possible, to use the minimal amount of water necessary to achieve the goal of keeping my lawn green through the summer. Other smart features such as scheduling based on time and weather forecast, integration with humidity sensors etc. may be added as the project progresses, but the first goal is even, accurate watering to significantly reduce waste associated with traditional sprinkler systems.


PTSprinkler driver PCB layout CC-BY-SA licensed

x-kicad-pcbnew - 123.39 kB - 04/29/2017 at 04:48



PTSprinkler driver schematic CC-BY-SA licensed

x-kicad-schematic - 849.62 kB - 04/29/2017 at 04:48



PDF of the PTSprinkler driver schematic CC-BY-SA licensed

Adobe Portable Document Format - 18.43 kB - 04/29/2017 at 04:48



OpenSCAD model for the garden hose clamp CC-BY-SA licensed

x-openscad - 1.19 kB - 04/29/2017 at 04:47


  • 1 × Defender Security Pan/Tilt stage 82-12440
  • 1 × Orbit 57280 Inline Sprinkler Valve, 3/4"
  • 1 × Pipe thread to garden hose adapters
  • 1 × 24VAC 40VA transformer

  • It moves!

    Patrick Van Oosterwijck07/18/2017 at 20:35 0 comments

    I hooked up my prototype driver to the pan/tilt stage and valve to test the complete system, and it's working! Driver code for the Raspberry Pi has been started and is available in GitHub. Here's a little video of the functionality thus far:

    Although this doesn't have wheels or wings, and doesn't walk, the description of this Hackaday Prize round says: "Build something that moves." Well, this moves! :) So I entered it. It may not be your typical robot, but the goal is to create an automatic robotic sprinkler after all. And if you don't agree, be careful or you might get sprinkled! :)

  • Driver prototype!

    Patrick Van Oosterwijck07/14/2017 at 22:50 0 comments

    I finally found the time to put the first prototype of the driver PCB together, and surprisingly, it actually works! \o/

    Well, it didn't right away. It looks like the reflow of the PCB failed to connect one pin on the buck converter, the feedback pin. The buck converter is supposed to produce 5V power for the Pi from the 24VAC input. With the feedback connection missing, it instead produced 37V DC on the 5V output. Yikes! Am I glad I decided to test the output voltage before connecting it to a Pi! :)

    Once that connection was fixed, the supply part worked. I'm actually very surprised that the 22 uF / 6.3V output capacitors survived the ordeal.

    Then it was time to hook up a Pi and a load, and test whether the whole SPI driven shift register with zero cross latching scheme actually works. I followed the instructions in this post (except that the spidev library is actually in the repo now) and wrote a quick test that would turn the first output on and off every 100 ms:

    while 1:
    And here is the result:

    It's working beautifully! The load gets nicely switched at the zero crossings. :)

    Next, it's time to hook up the pan/tilt stage and write a little control library.

  • Attaching the hose

    Patrick Van Oosterwijck05/01/2017 at 22:35 0 comments

    Having the 3D printed clamp, I needed to put it together to check how it worked with the hose. I used 4x 1/4", 1" length bolts with nuts and washers to protect the plastic from friction.

    I really like how this turned out!

    Now I have to wait for my PCBs and components to come in to build the driver and see how it works to control this from a Raspberry Pi. Meanwhile I can also start looking at how to add the valve to this assembly in the best way.

  • Hose clamp and driver PCB

    Patrick Van Oosterwijck04/29/2017 at 04:46 0 comments

    I needed a way to clamp the garden hose on to the pan/tilt stage. While it would have been possible to use some metal strap or other standard clamp, I decided it would be neater to 3D print a custom clamp. It also gave me an excuse to design a 3D model. :)

    I don't do this very often, but when I do, I prefer to use OpenSCAD, since I'm used to programming. As far as models goes it's very simple:

    The code is in the files section. It uses variables so that you can alter the inner diameter at either end, wall thickness, base size etc.

    Here is how it looks when printed:

    Very happy with the result, it fits great and uses nice semi-flex material. Next I need to get some bolts to put it all together.

    I also designed the circuit and PCB I'll use to drive the pan/tilt stage and valve from a Raspberry Pi Zero W. I seem to like to make my life difficult by trying to cram too much into too small a PCB. :) In this case I wanted it to fit in the size of a Pi Zero.

    The circuit has a shift register connected to the Pi SPI, and a zero cross detection circuit that latches the received bits to drive 6 TRIACs. It also takes the 24VAC and converts it to 5VDC for the Pi. Eagle files are in the files section, but beware, this is as of yet untested!

    The project is also shared on OSH Park.

    Next I'll be assembling the hose to the pan/tilt stage and then it's waiting for the PCBs to come in.

  • Dissecting the pan/tilt stage

    Patrick Van Oosterwijck04/20/2017 at 18:25 0 comments

    I decided to play with the pan/tilt stage, below is the little bit of info that came with the device:

    Then I did some testing to see how it all behaves. At Tinkermill I have access to a nice isolated AC supply to do this:

    I was surprised how quiet the unit is! I was curious what kind of motors were used. I have been wondering if it will be necessary to add some position feedback to the unit or if I can just drive it for a certain amount of time and expect a certain amount of travel that is consistent. So I decided to dissect it and see what is inside. Here are some shots after disassembly:

    I couldn't find any info about the motors on the internet unfortunately. I can tell that they have four leads. That, plus the PCB with 2 capacitors makes me think that these are Permanent Split Capacitor motors. Since this is an induction type motor, there is unfortunately always slippage so the motor speed will vary with load and is not fixed at line frequency.

    I will have to see if this leads to problems where I will have to add position feedback or not. For now, I intend to just rely on the limit switches that are built in to the stage. I do not have direct access to these switches, but I intend to just move the pan and tilt in one direction for a while so both axes will be at their calibrated positions and then go from there based on timing. I'll have to see how quickly position will start to drift and if it's acceptable or if position feedback will have to be added.

View all 5 project logs

Enjoy this project?



waldnilso wrote 10/12/2017 at 23:09 point

Great project Patrick! 

You've been putting a lot of thought into it. Love what you did. Since you disassembled the Defender, do you know if the motors are stepper motor or dc motor? 


  Are you sure? yes | no

Patrick Van Oosterwijck wrote 07/28/2018 at 04:49 point

They are 24V AC motors.  There are just limit switches that cut the power to the motor when they are hit.  It's all pretty low tech.

  Are you sure? yes | no

galeheise wrote 08/19/2017 at 15:33 point

Patrick -

  There are a number of satellite ham radio operators utilizing hand held "Arrow 146/437-10WBP" antennas to track and work AMSAT satellites.  In addition, satellite tracking program modules as in Ham Radio Deluxe interface with EL/AZ rotators such as the Yaesu G-5500.  However, it's an expensive rotator ($1,000+ with required electronics) that's designed for larger antenna arrays.   While the Defender 82-12440 doesn't have 180 degree elevation movement and is limited to 50 degrees it will likely be sufficient for most satellite passes.

  Since you're familiar with the Defender, I'm curious to know your thoughts as to how it may be adapted to track satellites?  Most rotators have internal pots for positioning but I'm curious if there are chips that might be adapted for elevation (inclination chip?) and azimuth (GPS chip?).

  If the Defender could be adapted for computerized satellite tracking it seems it could fill a real void as an economical alternative to the expensive Yaesu rotator.

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 07/28/2018 at 04:48 point

Sorry for the very delayed reply, I don't understand why HaD doesn't put responses in my stream?

The stage only has end-switches, there's nothing built-in to get feedback on the position unfortunately.  I was planning to do a full sweep to get to a known position and then run the motors based on time.  Likely good enough for sprinkling but most likely not for satellite tracking I would think...

But then again, I'd expect some hacking of the stage could fix that. :)

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 04/22/2017 at 18:50 point

Yes that should work!  Once the pan/tilt stage control is done it can be used for all kinds of things.

My plan is to make a HAT with triac drivers for the pan/tilt stage and 24VAC to 5V converter to power the Pi that I want to use to prototype this.

  Are you sure? yes | no wrote 04/22/2017 at 18:39 point

Nice! I would love to integrate this with my RasPi Rangefinder/Tracking system to keep the deer out of my garden!!

  Are you sure? yes | no

Capt. Flatus O'Flaherty ☠ wrote 07/20/2017 at 17:14 point

And cats!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates