OpenSprinkler Pi (OSPi) is an open-source sprinkler / irrigation extension board for the Raspberry Pi. It is an easy and low-cost solution to transform a Raspberry Pi into a capable sprinkler controller with 8 zones for lawn and garden watering.
OpenSprinkler doesn't need an instructable. This instructable simply documents my progress in Home Automation. OpenSprinkler's documentation is great. The end result is amazing. This is the perfect home automation project. If you are looking for a first project, do this one.
The goals of this project are to:
The OpenSprinkler v1.4+ User Manual (updated May 31, 2015) is the basis for this document. This is a great source for the latest OpenSprkler documents.
I changed the order of some OpenSprinkler steps. For example, when following the OSPi User Manual steps, I connected the Raspberry Pi to the OSPI (Step 2) and then many steps later imaged the micro SD card (step 8 = 7 hardware steps plus 1 software step). However, once the Raspberry Pi and OSPI are connected, the micro SD slot is not accessible. So, I had to take the RPi and OSPi apart, insert the micro SD card. Also, the parts list in the OSpi Manual is not complete.
I used a MacBook to communicate with the Raspberry Pi, but any computer can be used.
For the last ten years, Central Texas has been in a severe drought. My neighborhood is under severe watering restrictions. If I water on the wrong day, during the wrong hours (after 10pm and before 7am), or if water runs into the street, then I get a $50 fine. In general, I try to water as little as possible, but because it runs in the middle of the night I forget about it.
My house came with a Rainbird ESP-M controller, which is not WiFi enabled and cannot be accessed from the web. At a minimum, I would need to upgrade the Rainbird controller.
Notes:
The OSPi user interface is very intuitive. OSPi integrates with a weather system and rain sensor, which means no watering when it isn’t required. Hopefully, the savings on water bills justifies the project.
I bought these:
In other Raspberry Pi applications, I have measured and found the above configuration performs better than a starter kit. However, a Raspberry Pi starter kit will work fine. A case and power supply for the Raspberry are not needed.
I had these:
The OSPi v1.4 kit includes the enclosure (with a clear acrylic window), assembled and tested OSPi circuit board and terminal blocks. The built-in components include 24V AC to 5V DC switching regulator, solenoid drivers, rain sensor terminal, DS1307 RTC and battery, PCF8591T 8-bit A/D D/A converter (4 input and 1 output), fuse, per-station transient voltage protector.
If the project fails or I want to reinstall the Rainbird controller, I need the Rainbird documentation for my model, which included:
Page 42 of the Rainbird ESP-M Modular Controller Manual shows how the zones are wired.
A pre-configured OSPi SD card image is available on-line. The latest version is available here: OSPi SD Card Image 2 (with Unified Firmware, update 05/31/15)
I tend to purge my download directory. Anything I want to save is moved to a different directory. I keep my Raspberry Pi images in the directory: ♣macbook-image-directory♣. So, download the image and move to a directory.
I used unarchiver to decompress the image file (.7z) on the MacBook.
IMPORTANT: make sure you type in the correct disk number – if you enter the wrong disk number, you will wipe out your MacBook's hard disk!
The process to burn the OSPi image onto an SD card is the same as burning a Raspbian image.
Insert a micro SD card into SD Adapter, and then insert the SD adapter into MacBook.
On MacBook use these instructions from Raspberry Pi.org, which are summarized here:
Open MacBook terminal window
Change to directory containing OSPi image
$ cd ♣macbook-image-directory♣
Identify the disk number (not partition) of your SD card In this case, disk4 (not disk4s1) and = 4
In the following steps, the disk number is ♣micro-SD-card-disk#♣
To identify your micro SD card, run the command:
$ diskutil list
Unmount your SD card by using:
$ diskutil unmountDisk /dev/disk♣micro-SD-card-disk#♣
Copy the OSPi image to your SD card. Ensure the image name and are correct.
$ sudo dd bs=4M if=ospi2new.img of=/dev/rdisk♣micro-SD-card-disk#♣<br>
CTRL-t to see the status of the copying.
If there are errors, try different values for bs option, such as, 1m, 4m, or 1M. Larger Block Sizes (bs) are required for larger drives.
When complete, unmount the SD Card:
$ diskutil unmountDisk /dev/disk♣micro-SD-card-disk#♣
Remove SD adapter from MacBook and remove micro SD card from adapter
Insert micro SD Card in Raspberry Pi
The OSPi power supply has two wires: one is marked 300V the other is not. It does not matter which wire goes into which slot on the 24V AC clip.
The OpenSprinkler clips are removable.
Read carefully before doing these steps:
Remove the power supply clip from the OSPi board
Since this project uses the OSPi image and not a raspbian image, start with Step 4 in the following instructable:
Setup Raspberry Pi without Monitor or Keyboard
Disconnect power and USB serial cable. These won’t be needed any more.
OSPi has two support pillars that match the screw holes on Raspberry Pi.
With the micro SD card inserted into Raspberry Pi:
The left image shows the connectors, and Raspberry Pi mapped out pins. The right image shows the locations of the USB WiFi dongle and SD card.
The OSPi image contains a built in website.
Next, open a browser, and type in http://♣ospi-ip-address♣, which is the Raspberry Pi's IP address (such as http://♣ospi-ip-address♣,
A welcome page with further OSPI instructions appears. If this page appears, congratulations! The image is successfully burned on the micro SD card and WiFi is working.
The actual OSPi User Interface is accessible via http://♣ospi-ip-address♣:8080
password = opendoor
If all is okay, then shutdown the raspberry:
$ sudo shutdown
My home's Rainbird system has seven zones and is installed on the garage wall. So, move OpenSprinkler to the garage and mount OSPi on the wall.
To connect sprinkler zones:
01JUL2016:
cd OpenSprinklerGen2 git pull sudo ./build.sh ospisudo /etc/init.d/OpenSprinkler.sh restart