Raspberry Pi Wiring Instructions 12/14/2015 Step 1: Prepare the Pi Cobbler 1. First, cut the stripboard into two pieces, both at this size: 20 columns, and 45 holes in each row. You can score it with a knife on both sides and snap it, or you can cut it with a dremel or similar rotary tool. a. 20 columns means 20 strips of copper with the little gap between each strip. 4-5 holes per row means 4-5 holes in a strip of copper. b. You can do more than 4-5 holes if you want, but you don’t need more than 20 columns. Do not cut less than 20 columns. And we don’t recommend going lower than 4-5 holes per row. 2. Situate the Pi Cobbler so the long pins are facing up. Slide the stripboard over the pins, copper side up, so the pins go into the holes of each column of the stripboard. Make sure the pins are inserted into the end of the stripboard rows, and that the rows extend away from the Pi Cobbler. This way you can attach wires easily in the following steps. 3. When you have both pieces of stripboard situated on each set of pins on the Pi Cobbler, solder the pins to the stripboard. Before you solder, make sure there is a gap of no copper between each pin. If you have all the pins connected to the same row of copper, all those pins will short out and nothing will work. Step 2: Prepare the Relay Boards 1. In similar fashion to the Pi Cobbler, cut some stripboard down to size. You’ll need 10 columns with 4-5 holes in each row for the 8 relay module board, and 4 columns with 4-5 holes in each row for the 2 relay module board*. 2. Situate the relay boards so that the row of pins is facing up and slide the pieces of stripboard into place, copper side up. The 8 relay board has 10 pins and the 2 relay board has 4 pins. Make sure each row of copper has a gap between them. As with the Pi Cobbler, if all the pins are hooked up to one row of copper, it will short out the pins and nothing will work. Also, make sure the pins go into the last holes of the rows and that the piece of stripboard extends out away from the relay board, making it easier to hook up wires. 3. Once the stripboard is in place, solder the pins to the stripboard. Step 3: Wire the Pi Cobbler to the Relay Module Board 1. The Pi Cobbler has little notations by each pin to indicate what pins are connecting to the Raspberry Pi. The numbers are GPIOs. So G17 refers to GPIO 17 on the Raspberry Pi. The Relay Module Boards have indications labeled as Inputs. You’ll need to connect certain GPIOs to certain Inputs. Make the following connections on the 8 Relay Module Board (solder wire from the Pi Cobbler stripboard to the Relay Board stripboard): a. In1 connects to GPIO pin 5 (G05) b. In2 connects to GPIO pin 6 (G06) c. d. e. f. g. In3 connects to GPIO pin 13 (G13) In4 connects to GPIO pin 23 (G23) In5 connects to GPIO pin 24 (G24) In6 connects to GPIO pin 25 (G25) In7 connects to GPIO pin 22 (G22) h. In8 connects to GPIO pin 27 (G27) i. GND connects to any GND pin on the Pi Cobbler. j. VCC connects to any 5v pin on the Pi Cobbler. 2. Do the same thing for the 2 Relay Module Board, making these connections: a. In1 connects to GPIO pin 17 (G17) b. In2 connects to GPIO pin 18 (G18) c. GND connects to any GND pin on the Pi Cobbler. d. VCC connects to any 5v pin on the Pi Cobbler. Step 4: Connect the DS1820B Temperature Sensor 1. The temperature sensor has three leads. Red is voltage, yellow is data, and black is ground. The sensor requires a 3.3v connection and the data line connects to GPIO 4. 2. First, take a 4.7k resistor and solder one end of the resistor to one of the holes coming from the GPIO 4 row. Be sure to leave one hole available. 3. Solder the other end of the resistor to the nearest 3.3v pin on the Pi Cobbler. Clip the resistor leads coming from the solder joint. Be sure to leave one hole available. 4. Solder the red temperature sensor lead to the same 3.3v location you used with the 4.7k resistor. (This is why you needed to leave a hole available) 5. Solder the yellow temperature sensor lead to GPIO 4, the same pin the other side of the resistor is connected to. (This is why you needed to leave a hole available). 6. Solder the black temperature sensor lead to any ground pin on the Pi Cobbler (labeled GND). Step 5: Connect the Float Switches 1. There are 2 float switches required for this part and a toggle switch to reset the ATO system when the system is up and running. You’ll have a sump switch to turn the ATO pump on when the level gets too low, a reservoir level switch to turn the system off when the reservoir level gets too low, and a reset switch to start the system over again once you refill your ATO reservoir. 2. First, you’ll need to extend the leads of the switches. Use as much wire as you see fit for your system. 3. Connect the sump float switch. One lead connects to GPIO 16, and the other lead goes to any GND pin on the Pi Cobbler. 4. Connect the reservoir float switch. One lead connects to GPIO 20, and the other lead connects to any GND pin on the Pi Cobbler. 5. Connect the reset toggle switch. You only need an SPST switch, but if you are using an SPDT switch, one of the outer lugs will not be used. Connect one lug of the switch to GPIO 26, and the other lug to any GND point on the Pi Cobbler. Step 6: Wire up the LED Display and Display Toggle Switch 1. The LED display will show both the tank temperature and the room temperature, depending on the display toggle switch. 2. The LED 7-segment display requires 4 connections. On the LED PCB, you can see 4 holes with solder pads: SDA, SCL, GND, and VCC (or 3.3v). 3. Connect each of those holes to the respective pins on the Pi Cobbler. There will be pins with the same labeling on the Pi Cobbler. Any GND pin will be fine, and any 3.3v pin will be fine. 4. Connect one lug of the display toggle switch to GPIO 12, and the other lug to any GND pin on the Pi Cobbler. Step 7: Wire up the Room Temperature and Humidity Sensor 1. This sensor also requires a resistor in order to work properly. 2. Similar to the Temperature Sensor, connect a 4.7k resistor to GPIO 19 and 3.3v on the Pi Cobbler. 3. With the humidity sensor facing up (with the cross hatch pattern facing up, and the pins pointing down), connect wires to the far left two pins, and the far right pin. The far left pin is voltage, the second left pin is data, and the far right pin is ground. 4. Connect the far left pin to any 3.3v pin on the Pi Cobbler. 5. Connect the second left pin to GPIO 19. 6. Connect the far right pin to any GND pin on the Pi Cobbler. Step 8: Wire up the Relay Modules for AC power. 1. For orientation purposes, look at the relay board so that your stripboard piece is on the right and all the blue relays are on the left. The relay at the bottom correlates to Input 1 and the relay at the top correlates to Input 8. This is important because if you don’t keep these correlations straight, you’ll have to figure out which outlet relates to which part of the R-Pi software. For example, if something gets backwards, you may end up plugging your heater into an outlet that is programming for your return pump. So, try to keep these straight. It will still work if you don’t keep them straight, you’ll just have to figure out which outlet is for which part of the program. a. For this step, we recommend using at least 18awg wire or bigger (16awg is bigger. 20awg is smaller.) b. We also recommend using heat shrink to insulate each solder tab after it has been soldered. You can also use liquid electrical tape to paint insulation onto the solder tabs. Safety is the number one concern here, so make sure everything is insulated!!! 2. So, with that in mind, take your power cord. The black wire is your hot line, the white wire is the common line, and green is the ground line. Using whatever method you prefer (often wire nuts can be used for something like this) connect 10 wires (or 8 if you’re using the 8 outlet version of the 3. 4. 5. 6. 7. 8. 9. software) to the black wire of the power cord. Make these wires comfortably long, because they’ll be connecting to some screw terminals on the relay board. MAKE SURE NO COPPER WIRE IS EXPOSED AND EVERYTHING IS INSULATED PROPERLY. If you are looking at the relay board as specified earlier in this step, you will see three screw terminals from top to bottom on each relay. The bottom screw terminal is not used. The middle terminal is used to connect each relay to the power supply, and the top screw terminal is used to connect to each AC receptacle. So take 8/10 wires you just connected to the power supply, and connect one wire to each middle screw terminal of each relay. Now connect 8/10 wires (again, depending on which software you want to use) to the white wire of the power cord. Again, leave these wires long enough to be comfortably wired up to the AC receptacles. MAKE SURE NO COPPER WIRE IS EXPOSED AND THAT EVERYTHING IS PROPERLY INSULATED. Now look at the front of the AC receptacles. You’ll notice that on the two vertical slots, one is bigger than the other. The solder tab on the back of the receptacle that correlates with this slot is for the COMMON LINE. The smaller slot is for the HOT LINE. And the bottom circle is for GROUND. Take the white wires you just connected to the power cord and connect one white wire to each COMMON solder tab on the AC receptacles. Similar to what you do with the white and black wires of the power cord, connect 8/10 wires to the green wire of the power cord. MAKE SURE NO COPPER WIRE IS EXPOSED AND EVERYTHING IS INSULATED PROPERLY. Take those wires you just connected and connect them to the GROUND lug of each AC receptacle. At this point, each AC receptacle should have only one solder tab left open. Connect wires from each of the middle screw terminals on the relay board, and connect them to the AC receptacles (one wire per receptacle). Make note of which relay is connecting to which receptacle so you know where to plug your equipment into. Once all the wiring is done for the AC receptacles, you should be able to plug in your equipment as follows: Dose 1 GPIO 17 off/on_11.PNG Dose 2 GPIO 18 off/on_10.PNG Cooling Fan GPIO 6 off/on_cool.PNG Heater GPIO 5 off/on_heat.PNG Return Pump GPIO 23 off/on_4.PNG ATO Pump GPIO 13 off/on_ato.PNG Wave Maker GPIO 25 off/on_6.PNG Skimmer GPIO 24 off/on_5.PNG CPU Cooling Fan GPIO 27 off/on_2.PNG Extension Cord GPIO 22 off/on_3.PNG As you can see on this chart, we’ve included an extension cord as part of the programming. We use it for water changes, but you can use it for whatever you want/need. It is crucial that you plug the right equipment into the right outlet, otherwise the system will work but your equipment won’t work as you want it to. If the ATO pump is plugged into the wavemaker outlet, you’ll have an ATO pump running from 8am to 8pm, which technically works, but not as you want it to!