$120 Rasperry Pi reef controller build

daytonajim00

New member
I hate wires and timers and clutter! I love the idea of open source. I recently discovered the Raspberry Pi and set out to build a controller for my lighting and equiptment.

The task seems daunting at first glance. But once you know the "skinny" on what's needed and understand certain aspects of a proper install, the build is pretty simple.

There are (3) main components of this Raspberry Pi relay controller:

1) Raspberry Pi
R1225826-01.jpg

2) Relay module
03_63_large.jpg

3) And receptacle to make a receptacle bank
CR015-2PW_66d6dabd-23d2-429c-be94-4e2db7ca067e_large.jpg


Excuse me if my terminology is off- I'm no expert...

For those who don't know- The Raspberry Pi is a small computer that many people use for projects like this. It has WiFi and ports to plug in a monitor, USB keyboard/mouse, etc. You use the micro SD slot to run a card loaded with the operating system and it functions much like any other common system (windows, mac, etc.) The common operating systems ran on these Pi's are open source meaning they were collectively built through a worldwide network of programmers, and are free. The SD card functions as the hard drive so after the OS is loaded, whatever space is left over on the card is used for system storage. I have a 32GB card with something like 28G's of free space on my reef controller-this project won't need massive storage so I could of used a smaller card.

The Raspberry Pi has an GPIO (In/Out) pins that need to be utilized for a project like this- controlling relays that close 120v contact points to turn things on and off. A $10 relay module is used for this purpose. In this instance, the aquariums lights and equiptment are turned on and off based off a program that is installed. There are several reef controller programs that you can download on the Raspberry Pi but I settled on "ReefPi". I found it the most efficient, stable, and streamlined for what I need which is simply various aquarium power sources controlled off timing schedules.

I decided to go with a $10 8-channel relay module made by Sainsmart. This is a board with 8 individual relays and 8 signal inputs. We wire 8 signal wires from the Raspberry's GPIO pins to each channel. There is a constant 120v hot "waiting" on one side of the relay, and on the other side we leave the relay to the receptacle. In short, receptacle is turned on and off via the relay controlled by a seperate signal wire.

picture.php


I had to build a receptacle bank because I needed 8 individual channels to control- though I'm only using 6 currently (White, Actinic, Return, Auxillary Pumps, Skimmer, refugium light). The picture I showed of the white receptacle is more accurately a "duplex receptacle" because it has two receptacles in one device. We commonly call it a receptacle but that is not entirely correctly. There is a metal tab on the device in which you can remove to isolate each receptacle. That way I need only (4) duplex receptacles which is actually (8) individual receptacles electrically separated. Might sound confusing but it's simple.

That is the intro to how to build the hardware porting of a Raspberry Pi controller. I will add more soon for anyone who is interested and hopefully if may be more clear...
 
Here is a picture of the Raspberry Pi and relay module. I mounted them inside a box I had lying around. There are two cords coming into the box: a butchered utility cord that provides 120v power coming from the wall (house) and a standard phone charger that powers the Pi. So to clarify, there are only two cords visibly seen from outside my tank stand that physically plug into the wall: the Pi's power and the rest of the tanks power which is switched (relayed) via the computer going out to the 8 receptacles.

picture.php


Here's an angle of the box showing the receptacle bank that I chase nippled into the controller box. It shows the 8 individual receptacles (4 duplex with hot tabs removed). Once again- that is 8 separate channels that I can independently control.

picture.php


There are other ways to make a bank of receptacles. You can look at other people's builds but I think this way is the best.

Bonus: This build can be used for any automated project needing timed relays; not just fish tanks!
 
Relays Explained

Relays Explained

I will attempt to explain the wiring in more detail for those who don't know what is entailed:

Like any relayed power there is two circuits involved: loaded and signal. Our loads in this case are the 120v lights/equipment. The signal is just a 3v signal voltage produced from the Pi at whatever times we set in the program. When the relay receives the signal, it mechanically closes a contact. Just like a light switch closes a contact; a relay closes a contact, just automatically.

Relay On: Our 120v source power (from the house) continues through the relay
to the load (ex. light is on).

RelayOff: Our 120v source is "waiting" at the relay but can't continue through to the load (ex. light is off).

All a relay does is automatically close a contact.

picture.php


The picture above is just to illustrate how the only thing involved on the relay is the wires that carry voltage; the neutrals and grounds are not involved.

I did not show the control circuit but let me draw it in now to give the full picture.

picture.php


Bonus: The whole world works off switches. They serve as the gate keeps allowing electricity to pass. What inside the Raspberry Pi allows the 3v signal to pass? On and Off; On and off, as the software coding tells it.
 
what software project are you using for the controller? or you writing your own code? reef-pi is a very interesting project along these lines over on *********
 
Reef Pi.

Reef Pi.

I'm using ReefPi. I tried one called JayFish but the internal clock was froze to where the program wouldn't go through the timing schedule. JayFish did have some cool features like a wavemaker, autofeeder, and i think dosing but it was not stable in my case. ReefPi has been straight forward and is set and forget.

One good thing about these controllers and the way the relays are wired, if the power goes out on the Raspberry Pi, all relays default to the closed position meaning everything is ON.

I love the fact that these controllers can be used for any other automation project. I have a 100 gallon dual-system hydroponic unit. Would be really cool to automate that in a concise way!
 
Wiring the power for the relay and receptacles

Wiring the power for the relay and receptacles

Here's how the loads off the relay are wired. I broke the process down in 3 steps to keep everything clear.

I isolated the hot terminals of the receptacles in each duplex. This is a common electrical procedure. There are removable fins that you can snap off with a pair of needle nose pliers. I snapped off all of the brass fins between each set of brass terminals. I left the silver fins on the neutral side of the receptacles in tact.

r3AGlm.jpg


This is a diagram of the hots. The black wires are the constant hots and the red wires are the switched (relayed) hots off the relays. It is highly recommend to use #14 gauge wire- making sure it's THHN (electrical wire). It is hard to get #14 in the small terminals, I had to cut off a few strands of wire to get them to fit. I had to be diligent in making sure the wires from one terminal weren't touching the wires to the terminal directly next to it.

picture.php


This is a diagram of the neutrals. They are not involved with the relays but go directly across to the duplex receptacle. The duplex can share a neutral through the tab left intact so only 1 neutral wire per duplex was required.

picture.php
 
Back
Top