It Works :-)

Posted: June 2, 2014 in Uncategorized

OK, it’s Monday morning here in the Dallas area and for the first time in over a year the sprinklers came on automatically.  The new system I installed yesterday worked as expected.   I don’t have to worry about remembering to get up and press a button at 06:00 AM on the first and third Monday of the month anymore.  All good. 


A New Project

Posted: June 2, 2014 in Debian, General, Hacking, Hardware, Raspberry PI, RPi, Software
Tags: ,

A New Project – Water Sprinkler Controller

I find myself starting a new project not necessarily because I want to but because of our local three year drought and the need to water my lawn under Stage 3 watering restrictions. Unfortunately, my sprinkler controller finally gave up the ghost. Sounds simple doesn’t it? Simply order a new controller off of ebay, amazon or head down to the local big box hardware store Lowes or Home Depot and buy a replacement. After all there are at least 5 or 6 different units that one can buy for under $100 USD.

Ah, well that is where the drought comes in, and the Stage 3 Watering Restrictions. You see, because of the drought we are only allowed to water every other week on a specific day; on top of that we are not allowed to have any run off into the street. This presents several problems to an off the shelf sprinkler controller: 1) Everyone I’ve found for under $300 works on a weekly pattern, and does not have a specific calendar day or the ability to water every other Monday at 06:00 and be done by 10:00 and if not done kill the water anyway as it’s a $200 fine the first time you water past 10:00 AM and $1000 the second time, progressively getting more expensive; 2) Our soil is mostly clay and water soaks in slowly. So you really need to water in short cycles, wet the ground and then move on to the next zone and keep doing it until you have gotten enough water into the ground without run off. Now some of the $300 units can do this but still don’t have the monthly scheduling ability.

So I’m stuck, either I fix this with a new unit that does not really do what I need thereby forcing me to go into my garage every time I have to water and set off a manual cycle, which seems a bit ridiculous. If I’m going to spend the cash to get a new system I want it to be automatic, not be stuck in the same manual cycle I’ve been in for more then a year as there is no end in sight in terms of the drought1. My other choice is to do the entire thing manually with jumper wires and stand in my garage for 2 hours manually activating each zone by hand and then switching to the next zone as needed, yea, like I have so much spare time in my life that I’m going to do that every two weeks!!!!

1And as it turns out my grass is nicely green even with the watering every 2 weeks so even of the drought breaks I’m unlikely to go back to the weekly watering schedule, I mean why waste water and money (I have to pay for city water to water the grass).

What Features do I want/need

So seems like the only think I can do at this point is to hack something together and make my own sprinkler controller from scratch. 🙂 So what do I want in a sprinkler controller1:

1Your list might vary from mine but this will be an open source project and as such feel free once the code is “over the wall” to add other features or accelerate some.

  1. Friendly user interface, web based so you don’t need to stand in the garage in 110f weather programming the stupid thing system.
  2. Can set any interval, daily, every 2nd day, every 3rd day, every 4th day, every 5th day, every 6th day, every 7th day, weekly, monthly, semi-monthly, annually, or a list of calendar days.
    1. Can set start time and hard end (stop) time
      1. If hard stop time is set system will not allow water to flow after that time.
      2. If hard stop time is set, when programming a “???? set” if you ask for more water then the start time and end time would allow the system will warn you and suggest a new start time that will allow all water to be sent and stop watering by the hard end time.
  3. Real Time Clock so it knows what today is.
  4. Zones can be scheduled independently from each other. So I could set zone 1 – 9 to water every other week according to the local rules, but zone 10 (which is a soaker hose on my foundation) can be run every other day as needed to keep the clay moist near my foundation. 1
  5. Each zone can be set for total length of watering, independent of other zones.
  6. Duration of water applied to a zone. If the duration is shorter then the length of time set for the zone the zone will be watered for the duration and the system will keep coming back to the zone until all water has been delivered. This will keep run off from happing with our clay soil.
  7. Might be nice if durations can be set by zone but this would be an enhancement.
  8. Use any standard off the shelf parts for a sprinkler system available at your local hardware store. No requirement for expensive special water control valves or other specialty hardware. Everything low voltage (most sprinkler systems today use 24VAC as their control voltage on zone valves), no 120/220 in the sprinkler control box.
  9. The ability to easily skip a zone on a once time basis in case you discover a sprinkler head is broken but you want to water the rest of the zones.
  10. Connected to my house network so I don’t have to go digging into my garage to know what is going on. Additionally would be nice to be able to do testing of the system remotely when I’m watering in the yard looking at a zone to make sure it’s working correctly. While not hard it’s a pain to have to go back into the garage to trigger each zone and then walk back to the zone to see what works and is broken several times as I fix issues.2
    1. Expand this to remote control from anywhere in the world via the Internet. Clearly need SSH/SSL/VPN security setup so that bad things can’t happen easily.
  11. Expandable, I have nine (9) zones and I can see adding a tenth (10th) zone soon (soaker hose).
  12. Rain Sensor, including volume of rain fall, so if it rains hard enough 24-48 hours before watering time, cancel the scheduled watering.
  13. Ground moisture sensors, multiple zones so you can if desired analyze by zone the need for water.. Would allow skipping areas if they already are moist enough and don’t need to be watered.
  14. Integration to Internet weather sources so you can see if it rained yesterday or is about to rain tomorrow.
  15. Display on the front panel of what the system is doing now or about to do. Time and date displayed when doing nothing else.
  16. Permanent memory so watering instructions are not lost on power fail.
    1. Not require battery backup, I really dislike 9VDC battery backup systems, the battery always dies at the wrong time.
  17. System resume after power loss, including resuming watering if system was running when power failed.
  18. Record what was done over time in a log. What zones were watered, how long, or what zones were skipped and why (raining, rain predicted, soil already moist, etc.)
  19. Run the entire system on a single wall plug. Use a 24VAC wall wart transformer and make any other voltages needed internally to the system. You should not need more then a single source of power.
  20. External temperature sensor, so if its near or below freezing we don’t water.
  21. An emergency off button, so if you see an issue, like for example a broken sprinkler head that is pouring water into the street you can stop it NOW.
  22. This would include the ability to restart to continue watering if the problem is resolved or you tell the system to skip a zone one time and do the rest.



1Without watering on a regular basis the foundation can crack and that is a big $$$$$ repair. Because of this local law allows watering your foundation as needed vs every two weeks. Crazy isn’t it? Water your house?????

2Yes in ground sprinklers need regular service, lawn mowers shave off heads, heads stick with dirt, tops just break off from age. Lots goes wrong, and run off = $$$ in fines.

Next Steps

Turns out I had a bigger list then I understood when I started. Too big to get done in a single pass. So I’m going to break it up into chunks. This was how I wanted to proceed but as usual your plans go out the window when they intersect reality.

  1. Get the hardware.
    1. Assemble all hardware including the parts we are not going to use right now like:
    2. Raspberry Pi Computer (RPi)
    3. 2 banks of 5VDC relays
    4. 2×18 LCD display
    5. AtoD converter to input moisture sensors and rain sensor.
    6. 40V DC DctoDC converter
    7. Full Wave Bridge Rectifier
    8. 1000uf 50VDC Electrolytic Cap
  2. Installed on the garage wall where the existing controller is.
  3. Modify the init scripts to read the RTC and set the date even if the unit can’t see the Internet for any reason.
  4. Basic cron job that will water the lawn on the specific days allowed:
    1. cron tab of:

00 06 05 06 * sudo /bin/bash /home/pi/bin/
00 06 05 21 * sudo /bin/bash /home/pi/bin/

You see I ordered a bunch of the hardware and it won’t come in until the day after I need to water the grass for the next cycle 😦 So I’m going to have to take just the Raspberry Pi and Relay board and put them in temporally so the grass can get watered. So the actual order will look more like this:

  1. Get some hardware
    1. Raspberry Pi Computer (RPi)
    2. 1 banks of 5VDC relays
    3. Some jumper wires
    4. 40V DC DctoDC converter
    5. Full Wave Bridge Rectifier
    6. 1000uf 50VDC Electrolytic Cap
  2. Disassemble the old control system and leave parts of it in the box on the wall and keep the 24VAC transformer.
  3. Solder the full wave bridge rectifier and cap directly to the DCtoDC converter
  4. Use a chunk of cardboard to zip tie the RPi, relay board, and the new little 5VDC power supply to it.
  5. Using jumper wires connect up everything. Power the RPi via the GPIO pins and not the micro USB connector

Examine the existing connections and wires

Old Sprinkler Controller Connection Board

The old system was made by Irritrol an RD-900 unit, which consists of a control unit and a separate connection board. I don’t care about the control unit as its dead and I”m building a new one BUT I do care about the old connection board and the wires that control the sprinklers that come out of the ground. So time to document them. It’s pretty clear from a closer inspection of the board that the RD-900 is a pretty simple system there are lots of areas not populated on the board. But it’s pretty clear I can use the ribbon cable that came out of the old control unit and attach to this connection board and save some time and cost.

Connection on Old Wall Board Barrier Terminal
1 24 VAC after going through a 2A SLO-BLO Fuse
3 #9 Zone
4 #12 Zone
5 #5 & #7 Bridged to AC Common
6 #11 Zone
7 #5 & #7 Bridged to AC Common
8 #10 Zone
9 #3 Zone
10 #1 Zone
11 #4 Zone
12 #2 Zone
13 #6 Zone
14 #5 Zone
15 #8 Zone
16 #7 Zone

All connections on the Barrier Strip have an MOV for protection but it was never hooked up by the original contractor. Another example of the shoddy work that gets done on these development homes.

Old Sprinkler Controller Connection Board

Old Sprinkler Controller Connection Board

The Barrier Terminal Strip has all of the zone wires connected to it and the 24VAC power. It also has a slo-blo fuse which is quite handy since I’m bypassing the fuse on the RPi by supplying power on the GPIO pins directly.

Barrier Terminal
Strip Label
Wire Color
1 Black (Solid Wire)
2 Blue (Solid Wire)
3 Red (Solid Wire)
4 Green (Solid Wire)
5 Yellow (Solid Wire)
6 Orange (Solid Wire)
7 Brown (Solid Wire)
8 Grey (Solid Wire)
VC White (Solid Wire)
24 Black (Stranded Wire from 24VAC
VAC Black (Stranded Wire from 24VAC

OK ignoring the shoddy workmanship issues I can make use of this board. I’ll be using the following pins listed in the table below, I’m going to skip the 9th zone as I don’t need to water it right now.

Pins Description Connection Point
1 24 VAC after going through a 2A SLO-BLO Fuse DC2DC Converter Full Wave Bridge input
5 #5 & #7 Bridged to AC Common DC2DC Converter Full Wave Bridge input
7 #5 & #7 Bridged to AC Common Bridge to all relays NO Connection
9 #3 Zone Relay 3 Center contact
10 #1 Zone Relay 1 Center contact
11 #4 Zone Relay 1 Center contact
12 #2 Zone Relay 2 Center contact
13 #6 Zone Relay 6 Center contact
14 #5 Zone Relay 5 Center contact
15 #8 Zone Relay 8 Center contact
16 #7 Zone Relay 7 Center contact

Easy to wire up, and test. All good.

First Install and Test

Interesting morning, put the old sprinkler connection board back in the box, hooked up all the wires in the correct spots. Then mounted the RPi/Relay temporary cardboard mount into the lid of the old system, then used jumper cables to connect the 5VDC power supply and the relay board to the connection board.

RPi, Relay, Full wave bridge rectifier, filter cap and DC to DC power Supply

RPi, Relay, Full wave bridge rectifier, filter cap and DC to DC power Supply

Old Connection board jumped to RPi and Relay's

Old Connection board jumped to RPi and Relay’s

Jumped onto my network and checked yep, the RPi is on right where it should be. Sure enough the system set it’s time from the Internet, and SSH is working. Sweet. Ran a test program of 30 seconds per zone to see what happens, YEA success, or sort of, anyway, zones 1,2,4-8 all work as expected. Zone 3 dead, no joy, ugh, what did I do wrong?

So got out a jumper wire and shorted out zone 1 to AC common, on it comes, did the same with all the zones (this bypasses my RPi/Relay setup completely), again all zones except zone 3 work, zone 3 still dead. Looks like the zone valve in the ground is dead. Not really a surprise, this will be the second valve in the last year that has died1, and at least it failed in a better way then the first valve, which failed on, this one failed off, who knows how long it’s been dead, could be just short of a year when I last fixed zone valves. Of course we would have not noticed it, its not like I stand outside and watch my sprinklers go on and off. The only reason I did today was to test my new contraption. Since I now have full SSH access to the RPi I don’t have to go into the garage to manage the grass watering. SCORE 🙂

So I call this a total success, my controller is working, I have a crontab that will water the lawn in June without any attention, so I can now get the rest of the parts in and work on software. And better yet my wife is happy that I completed stage one of the build. Of course I still have to complete the rest of the stages but at this point the grass is getting watered on schedule so its a win.

Now I have to design the web pages to program the system, right now it’s hard coded and that won’t do, I want my wife to be able to change this from anywhere in the world without having to resort to C or Python programming. More about that another day.

1No real surprise, the zone valves are more then 12 years old and have been covered over in clay and dirt and water over that entire time. More shoddy workmanship, no dirt blocking fabric, no gravel under the zone valves just stick them in the ground, put a too small box over them and let it rip. No one is going to notice until years later.


Left Canonical

Posted: June 11, 2013 in General, ubuntu, Uncategorized

After almost 6 years the time has come to move on. I’m no longer with Canonical. New things on the horizon. I still plan on participating in Linux especially ARM Linux and also still being a part of Ubuntu Linux Community too.

It’s been an interesting journey with Canonical, managing engineers around the world, up at weird hours of the day, starting a new flavour of Ubuntu (ARM), fighting daylight savings time twice a year, and finally supporting sales folks.  Always interesting, but I’m looking forward to the next new thing.  I will however miss the people, for the last 6 years I worked with some really smart people and I learned a lot from them.

It was a fun day, trying to lay out the Panda server cluster again.  With the original design each Panda daughter card mounted the laptop sized HD directly on it.  With the dropping of the daughter card, I had to mount all of the HD’s in external SATA to USB containers, and then make mounts to hold all of them.  That was a success but as you can well imagine it took up a lot of unplanned space.  That space was supposed to hold the large regulated 5VDC power supply, the 12VDC power supply and the remote control relay board.   Ha, no chance of that now. :-/

What to do, what to do?

With lots of moving things around in the box I finally arrived at mounting all three items on the side of the case, looking at it from the front everything is mounted on the right hand side of the case.  I made up templates of each item, put locater holes in each template and then took the side off the case and out to the drill press we go.  Lots of drilling and then filing to remove burrs.  Couple hours or so later, everything mounted cleanly.   Nice, 4 hours rearranging stuff, drawing templates, 2 hours machine and mounting.  Almost an entire day shot.  Still I think it is going to be better then the original design with the daughter cards.

The ongoing saga of the Panda builder, with the design change of no daughter card we needed a way to mount the hard drives into the chassis and connect them to the Panda boards.  Since the Panda only can add HD’s on a USB channel that made the choice fairly easy: Use a USB laptop drive enclosure.  Which leads to the next problem how do you mount an external enclosure that is not meant to be mounted?  Pick up some aluminum 5/8″ U channel and some 1/2″ aluminum angle and get creative with a band saw, drill press, pop-rivets and you get vertical stacking bays that hold 7 drives each.  You can fit 3 across the back of the case, leaving room for cables and such.  Yea.  Only took a full day to fabricate in the Texas heat, but that is another story (lets just say it is amazing just how much water you can drink in the heat).

With the design change of not using daughter boards changed the way the Panda boards are  put together.  The new design has some challenges are where to put the USB Hard Disks.  Really had to save space as we added 2 USB hubs for booting and an extra Panda board.  The Pandas are mounted forward in the case, with the 5vDC and 12VDC power supplies mounted on the side panels, followed by 2 fuse panels and relay control board also mounted to the side panels.

Today will be spent doing physical mounting of the hardware and tomorrow and Monday wiring the hardware up.  Need to order some more connectors and wires as the USB booting adds an extra wire per Panda that was not in the original design and need to bring out the Ethernet and serial port of the extra Panda board.

The pictures show the rough layout, there may be some fine tuning as I try to mount everything in the box.

The Custom Case Arrives

Posted: May 17, 2011 in Hacking, Hardware, ubuntu
Tags: , ,

Yea, back from UDS one day and Fedex showed up at my door with a large box in hand.  It is the custom case for the Ubuntu ARM build cluster.

I open the box and look inside expecting to see a 4U (rack Units or 7″) high,  27″ long 19″ wide rack mount case.  What I actually see is a bunch of loose metal pieces, some nuts and bolts and 3 fans.  What the heck????

Oh I get it, it’s a flat pack like when you buy furniture from IKEA.  It’s a do-it-yourself case, which I guess sort of fits this project as it’s a do-it-yourself cluster of ARM boards. Everything I asked for is where I asked for it to be, I just have to do the final assembly. It’s pretty cool but caught me off-guard. I took some before and after photos.

It came with no hints on how to put the case together but how hard can it be?  It has 2 handles, 2 slides, 2 sides, a front, back,  top and bottom panel right?  Well turns out it’s a tad more complex then that:  The side panels are threaded on one end and have through holes at the other end; the top and bottom panels have one edge bent up at a 90 degree angle and the other end has 3 threaded screw holes instead of the bent angle.  Not that I paid any attention to this before I started.  Got out my tools, my little container of thread lock liquid (I learned a long time ago always use thread lock liquid when assembling things you want to stay permanently together) and began the assembly.

I installed both sides to the bottom panel.  Whoops, I had one side threaded the other not, which I noticed when I attempted to attach the rear to the sides. Confusing to say the least.  With some study I figured out that the 90 degree lip on the top and bottom panels go toward the front of the case, the threaded holes are to mount the back panel.

OK, take one side off, flip it and reinstall.  Now take the front panel handles and find the long screws that are the correct size for the handles.  The screws go through the holes in the side panel, through the holes in the front of the case and into the handles.  OK all good, front panel attached well.  Onto the back panel and then install the fans into the front panel.  Yep you guessed it, it would have been much easier to install the fans first.  Oh well live and learn, the next case I assemble will go much faster.