Relaying some progress

Per-Anders Irrigation, Maker

So the first phase of this is now complete, I’ve managed to hook up three SeedStudio relay shields without much trouble to the Arduino Uno and run the test code to see that theyr’e all working.

/*<br />
Quick multi-relay shield test<br />
*/</p>
<p>// Initialize pins 2 through 13 as outputs<br />
void setup()<br />
{<br />
for (int i = 2; i &lt; 14; i++)<br />
{<br />
pinMode(i, OUTPUT);<br />
}<br />
}</p>
<p>// Loop through the pins turning them on and off every second<br />
void loop()<br />
{<br />
for (int i = 2; i &lt; 14; i++)<br />
{<br />
digitalWrite(i, HIGH);   // turn the LED on (HIGH is the voltage level)<br />
delay(1000);               // wait for a second<br />
digitalWrite(i, LOW);    // turn the LED off by making the voltage LOW<br />
delay(1000);               // wait for a second<br />
}<br />
}

The relays are going to control the individual Zones of the irrigation system.  It’s not the most complex setup, but i’ll quickly go over it for future (and anyone else’) reference.

Each Relay Shield has four relays and fortunately enough utilizes only 4 pins (defaults of 4,5,6,7 when mounted) to control said relay’s.  Outside of that a 9 volt supply is connected and the arduino’s 5volt and ground pins need to be connected.

To allow you to connect more shields you need to make use of the HUB pins (actually just ring holes on the boards) in order to place the next two (or more) boards in parallel or series from the first board.  Using the HUB1 and HUB2 to the inputs where an RFBee would be allows sufficient power to be drawn from the adapter to run everything without having to connect up the VIn and 9V pins additionally.

The result of this is a setup that’s in this configuration:

20140526-124352-45832310.jpg