DIY reef-pi build log

Michael Lane

Active Member
View Badges
Joined
Aug 11, 2018
Messages
357
Reaction score
634
This thread will be my build log for reef-pi. It will replace RKL and a custom light controller on my reef tanks.

I have a Digital Aquatics RKL, but they went out of business and I'll no longer be able to receive support or replacement parts. That led me to reef-pi (https://reef-pi.github.io/), so I started contributing to the project.

I started with the instructions on adafruit (https://learn.adafruit.com/reef-pi-installation-and-configuration?view=all). I glossed over the rpi set up and just downloaded Raspbian Stretch Lite, extracted the image, and flashed it to the sd card using Etcher (https://etcher.io/). Next, I enabled ssh by adding a file call ssh to the sd card root, and pre-configured wifi by adding wpa_supplicant.conf (as described here https://raspberrypi.stackexchange.com/questions/10251/prepare-sd-card-for-wifi-on-headless-pi).

Next, I booted the pi and waited for it to join the network. I used the default credentials (pi/raspberry) to log in. First steps were to change login credentials and permanently enable ssh using raspi-config. I had a few hiccups from using low quality power supply and usb cables, but eventually I fixed that. I followed the rest of the instructions and finally have reef-pi running!

I think temperature sensors or power module will be next.
 
Top Shelf Aquatics
OP
Michael Lane

Michael Lane

Active Member
View Badges
Joined
Aug 11, 2018
Messages
357
Reaction score
634
I set up a couples of temperature sensors in reef-pi. It was super quick, even with following instructions and soldering. I'm using the regular DS18B20 sensors; I bought a 10 pack a couple years ago and just coat in silicone to make it waterproof. I soldered a 4.7k pull up resistor between the data and vcc lines.



Readings in air over the last 24 hours.
upload_2018-9-17_19-50-22.png


Outlet set up is next on the list.
 
OP
Michael Lane

Michael Lane

Active Member
View Badges
Joined
Aug 11, 2018
Messages
357
Reaction score
634
The next step for my build is the outlet controller. I opted for an American DJ SRP8. It seems like a discontinued product, so I might buy a couple more while I can. The first thing I did was open it up and take a look at what's inside.

Pretty simple! There's no isolation or protection or anything! Pretty much nothing happening on the bottom of the board either.

There are a couple of holes where I would have expected stand offs to be used, but the board is just held in place by DB9 connectors. It's probably fine, but I covered the bottom just to make sure it doesn't connect with the enclosure and short anything. I also mapped out the pins of the DB9 connector to the channel it controls.


Pin - Channel
1 - 2
2 - 3
3 - 4
4 - 1
5 - Common
6 - 8
7 - 7
8 - 6
9 - 5

I got a bit ahead of myself at this point and soldered a DB9 cable to some female jumper wires.

Looks good! But I forgot that I wanted to inline the ULN2803 into the cable, so I took it apart and did it again...

Now the cable is ready to go and is ready to be connected to to the pi. I wired everything up and tested it without wall power to make sure the channels were lined up correctly. Each relay clicked at the right time. Each relay consumed around 60 mA when activated, so it takes about 1/2 amp if all relays are on.

For reef-pi set up, the first step was to configure the Outlets.

Then I set up equipment to use the outlets.


It was pretty easy to set up, especially in reef-pi. The only thing that was slightly annoying, was mapping the pin on the header to the gpio. It wasn't difficult, just tedious.

I think this will be a temporary set up for the next couple of months. I'd like to modify the relay board to monitor current, maybe add optical isolation, and probably change the communication from parallel to i2c or serial. That's probably a couple months off, and I'll need to find a current monitor chip. This will let me know if a relay gets stuck on, or if some equipment is not operating correctly.

Larger images can be seen in the album.

Dosing control is probably up next.
 
Corals.com
OP
Michael Lane

Michael Lane

Active Member
View Badges
Joined
Aug 11, 2018
Messages
357
Reaction score
634
I've finally gotten around to the next step in this build and excited to get it running on my tank. It supports 16 outlets, 2 ph probes, 3 temperature sensors, 2 ATO sensors, and 2 lights with 3 channels each. I also made a 5 foot light bar to fix some dimness on the back wall.


It looks fine from the outside, but the inside is dang mess! It took so long to get everything tucked and jammed in.

PCA9685 and ULN2803 are integrated into the hat, along with a bunch of JST connectors which were supposed make everything neat. Ha! I also added reverse current blocking and the eeprom for official hat status.


The UPS needed modification in order to support individual outlet control. I pulled out the live strip and cut parts out of it. An 8 channel relay board now controls it.

 

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
7,199
Reaction score
12,800
Location
Palo Alto, Bay Area
I've finally gotten around to the next step in this build and excited to get it running on my tank. It supports 16 outlets, 2 ph probes, 3 temperature sensors, 2 ATO sensors, and 2 lights with 3 channels each. I also made a 5 foot light bar to fix some dimness on the back wall.


It looks fine from the outside, but the inside is dang mess! It took so long to get everything tucked and jammed in.

PCA9685 and ULN2803 are integrated into the hat, along with a bunch of JST connectors which were supposed make everything neat. Ha! I also added reverse current blocking and the eeprom for official hat status.


The UPS needed modification in order to support individual outlet control. I pulled out the live strip and cut parts out of it. An 8 channel relay board now controls it.

Nice. This reef-pi will be doing a lot of work :)
I love the hat. Does it do anything else otherthan pca9685 and uln2803? Like the ato or temp sensor circuit ?
Does this hat uses smt components ? Or through hole. And will it cost less than buying individual component and solder them on perma proto board ?
Apologies in advance if I’m asking too many question.m :)
 
OP
Michael Lane

Michael Lane

Active Member
View Badges
Joined
Aug 11, 2018
Messages
357
Reaction score
634
This hat is all SMT except for connectors. The passives are mostly 0603 since I had them on hand from building the ph board.

It supports
  • Back powering the rpi with 5v
  • 9 channels of PWM control via PCA9685 (split between 3 connectors)
  • 3 channels for 1 wire communication (up to 3 DS18B20 temperature probes)
  • 2 i2c ports for ph probe modules
  • 2 ATO sensors
  • 8 channel 12v relay control via ULN2803
  • 8 GPIO breakout (intended for 3.3v relay module)
Cost can be a bit misleading since quantity, source, shipping, and authenticity all play a role. On this board, the eeprom and back power protection could be considered optional. The total cost for this board was around $10. Of course I spent much more than that since most components were purchased in multiple quantities. I would also bet that the price is similar to purchasing breakout boards from cheap sources. In my case, I wanted a more compact footprint to squeeze everything into the UPS body.

It's designed in Kicad and files are available at https://github.com/Ranthalion/reef-piHat. I have a handful of extras since PCBs come in packs of 10.
 

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
7,199
Reaction score
12,800
Location
Palo Alto, Bay Area
This hat is all SMT except for connectors. The passives are mostly 0603 since I had them on hand from building the ph board.

It supports
  • Back powering the rpi with 5v
  • 9 channels of PWM control via PCA9685 (split between 3 connectors)
  • 3 channels for 1 wire communication (up to 3 DS18B20 temperature probes)
  • 2 i2c ports for ph probe modules
  • 2 ATO sensors
  • 8 channel 12v relay control via ULN2803
  • 8 GPIO breakout (intended for 3.3v relay module)
Cost can be a bit misleading since quantity, source, shipping, and authenticity all play a role. On this board, the eeprom and back power protection could be considered optional. The total cost for this board was around $10. Of course I spent much more than that since most components were purchased in multiple quantities. I would also bet that the price is similar to purchasing breakout boards from cheap sources. In my case, I wanted a more compact footprint to squeeze everything into the UPS body.

It's designed in Kicad and files are available at https://github.com/Ranthalion/reef-piHat. I have a handful of extras since PCBs come in packs of 10.
Very nice. This is a very good balance of cost vs feature. We should promote this more :) . SMT components will make it harder for beginners though. I am thinking of doing something similar but with through-hole components
 

crusso1993

Valuable Member
View Badges
Joined
Oct 21, 2018
Messages
4,372
Reaction score
24,786
Location
Chicago, IL, USA
Very nice. This is a very good balance of cost vs feature. We should promote this more :) . SMT components will make it harder for beginners though. I am thinking of doing something similar but with through-hole components
@Ranjib - Why do you think SMT would be harder for beginners?
 

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
7,199
Reaction score
12,800
Location
Palo Alto, Bay Area
@Ranjib - Why do you think SMT would be harder for beginners?
Equipment for smt are expensive, individual component for smt can be smaller, ics can have significantly larger pin count, and sourcing smt individually is harder than through hole components . I think through holes are definitely lit easier than smt, and soldering in general is a deterrent. But if we keep it relatively less complex and modular, so that builders can rip the benefits incrementally
 
OP
Michael Lane

Michael Lane

Active Member
View Badges
Joined
Aug 11, 2018
Messages
357
Reaction score
634
I think a fully completed one of these hats with headers would be pretty popular. hits all the tricky bits and makes it neat.
Thanks.
I'll put a couple more together and consider setting up a Tindie store or something. Maybe the For Sale - Dry Goods section would be better.
 
Earn WWC Rewards Points

BlakeL

Member
View Badges
Joined
Dec 8, 2012
Messages
11
Reaction score
23
nice, I would be intrested in one or two forsure depending on cost if you do end up deciding to make a few shoot me a pm.
I would be interested as well depending on the price. I would ask to buy a bare board but should solder the ph board first to gauge the complexity. Currently waiting to see if Roberto has a spare board I can buy. I'm confident with smaller components, just not drag soldering the IC's.
 

Diamond1

Valuable Member
View Badges
Joined
Oct 17, 2013
Messages
1,370
Reaction score
1,883
Location
Cleveland Ohio
This thread will be my build log for reef-pi. It will replace RKL and a custom light controller on my reef tanks.

I have a Digital Aquatics RKL, but they went out of business and I'll no longer be able to receive support or replacement parts. That led me to reef-pi (https://reef-pi.github.io/), so I started contributing to the project.

I started with the instructions on adafruit (https://learn.adafruit.com/reef-pi-installation-and-configuration?view=all). I glossed over the rpi set up and just downloaded Raspbian Stretch Lite, extracted the image, and flashed it to the sd card using Etcher (https://etcher.io/). Next, I enabled ssh by adding a file call ssh to the sd card root, and pre-configured wifi by adding wpa_supplicant.conf (as described here https://raspberrypi.stackexchange.com/questions/10251/prepare-sd-card-for-wifi-on-headless-pi).

Next, I booted the pi and waited for it to join the network. I used the default credentials (pi/raspberry) to log in. First steps were to change login credentials and permanently enable ssh using raspi-config. I had a few hiccups from using low quality power supply and usb cables, but eventually I fixed that. I followed the rest of the instructions and finally have reef-pi running!

I think temperature sensors or power module will be next.
Love your set up. I would be interested in one of your hat's also. If it was populated with all the SMT parts.

Is that a Tunze wavebox on the right side of the main display?
 
OP
Michael Lane

Michael Lane

Active Member
View Badges
Joined
Aug 11, 2018
Messages
357
Reaction score
634
Love your set up. I would be interested in one of your hat's also. If it was populated with all the SMT parts.

Is that a Tunze wavebox on the right side of the main display?
I have parts for a few more, so I'll assemble and test this weekend.
That actually is a Tunze wavemaker box! I got it as part of the full system, and I've never really liked how large it is in the tank. It does a good job, and I often use the top of it as a sort of coral nursery, so I guess I shouldn't complain...
 
Best reef aquarium LED lighting

Is Reef Conservation/Stewardship a factor in your hobby decisions? (private poll)

  • Very Important

    Votes: 230 54.0%
  • Somewhat Imporatant

    Votes: 141 33.1%
  • Not Too Important

    Votes: 39 9.2%
  • Not Important At All

    Votes: 16 3.8%

Online statistics

Members online
739
Guests online
3,124
Total visitors
3,863
Exotic Reef Imports & Sea Dwelling Creatures
PremiumAquatics.com
Top