DIY reef-pi build log

Discussion in 'Do It Yourself (DIY)' started by Michael Lane, Sep 15, 2018.

  1. Michael Lane

    Michael Lane Active Member R2R Supporter

    Joined:
    Aug 11, 2018
    Messages:
    155
    Likes Received:
    348
    This thread will be my build log for reef-pi. It will replace RKL and a custom light controller on my reef tanks.
    [​IMG]
    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.
     
    ccombs, crusso1993, Diamond1 and 5 others like this.

  2. jjflounder1

    jjflounder1 Active Member

    Joined:
    Feb 2, 2018
    Messages:
    167
    Likes Received:
    121
    Following ...
    NICE setup
     
  3. Michael Lane

    Michael Lane Active Member R2R Supporter

    Joined:
    Aug 11, 2018
    Messages:
    155
    Likes Received:
    348
    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.

    [​IMG]

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

    Outlet set up is next on the list.
     
  4. Ranjib

    Ranjib Valuable Member R2R Supporter R2R Excellence Award Reef Squad Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    6,251
    Likes Received:
    10,580
    Location:
    Palo Alto, Bay Area
    Gorgeous tanks , and thanks for starting a build log #reefpi
     
    ccombs and Michael Lane like this.
  5. Michael Lane

    Michael Lane Active Member R2R Supporter

    Joined:
    Aug 11, 2018
    Messages:
    155
    Likes Received:
    348
    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.
    [​IMG]
    Pretty simple! There's no isolation or protection or anything! Pretty much nothing happening on the bottom of the board either.
    [​IMG]
    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.
    [​IMG]

    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.
    [​IMG][​IMG]
    Looks good! But I forgot that I wanted to inline the ULN2803 into the cable, so I took it apart and did it again...
    [​IMG]
    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.
    [​IMG]
    For reef-pi set up, the first step was to configure the Outlets.
    [​IMG]
    Then I set up equipment to use the outlets.
    [​IMG]

    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.
     
    sjeff35, crusso1993 and Ranjib like this.
  6. Ranjib

    Ranjib Valuable Member R2R Supporter R2R Excellence Award Reef Squad Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    6,251
    Likes Received:
    10,580
    Location:
    Palo Alto, Bay Area
    Nice :). I wonder if the inline uln2803 will get hot.
     
    Michael Lane likes this.
  7. Ranjib

    Ranjib Valuable Member R2R Supporter R2R Excellence Award Reef Squad Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    6,251
    Likes Received:
    10,580
    Location:
    Palo Alto, Bay Area
  8. Michael Lane

    Michael Lane Active Member R2R Supporter

    Joined:
    Aug 11, 2018
    Messages:
    155
    Likes Received:
    348
    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.
    [​IMG]
    [​IMG]
    It looks fine from the outside, but the inside is dang mess! It took so long to get everything tucked and jammed in.
    [​IMG]
    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.
    [​IMG]

    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.
    [​IMG]
    [​IMG]
     
    COCOBBALL, crusso1993 and Ranjib like this.
  9. Ranjib

    Ranjib Valuable Member R2R Supporter R2R Excellence Award Reef Squad Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    6,251
    Likes Received:
    10,580
    Location:
    Palo Alto, Bay Area
    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 :)
     
    crusso1993 likes this.
  10. Michael Lane

    Michael Lane Active Member R2R Supporter

    Joined:
    Aug 11, 2018
    Messages:
    155
    Likes Received:
    348
    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.
     
    crusso1993, LionHeart2017 and Ranjib like this.
  11. Ranjib

    Ranjib Valuable Member R2R Supporter R2R Excellence Award Reef Squad Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    6,251
    Likes Received:
    10,580
    Location:
    Palo Alto, Bay Area
    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 and LionHeart2017 like this.
  12. Kampo

    Kampo Active Member

    Joined:
    Dec 19, 2017
    Messages:
    348
    Likes Received:
    314
    Location:
    South West Michigan
    I think a fully completed one of these hats with headers would be pretty popular. hits all the tricky bits and makes it neat.
     
  13. crusso1993

    crusso1993 Valuable Member Partner Member 2019 Hospitality Award

    Joined:
    Oct 21, 2018
    Messages:
    2,673
    Likes Received:
    12,438
    Location:
    Chicago, IL, USA
    @Ranjib - Why do you think SMT would be harder for beginners?
     
    Ranjib likes this.
  14. Ranjib

    Ranjib Valuable Member R2R Supporter R2R Excellence Award Reef Squad Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    6,251
    Likes Received:
    10,580
    Location:
    Palo Alto, Bay Area
    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
     
    crusso1993 likes this.
  15. Michael Lane

    Michael Lane Active Member R2R Supporter

    Joined:
    Aug 11, 2018
    Messages:
    155
    Likes Received:
    348
    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.
     
    Matt Carden, Ranjib and crusso1993 like this.
  16. Kampo

    Kampo Active Member

    Joined:
    Dec 19, 2017
    Messages:
    348
    Likes Received:
    314
    Location:
    South West Michigan
    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.
     
    Matt Carden, crusso1993 and Ranjib like this.
  17. BlakeL

    BlakeL Member

    Joined:
    Dec 8, 2012
    Messages:
    11
    Likes Received:
    23
    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.
     
    crusso1993 and Ranjib like this.
  18. Diamond1

    Diamond1 Valuable Member Build Thread Contributor

    Joined:
    Oct 17, 2013
    Messages:
    1,370
    Likes Received:
    1,877
    Location:
    Cleveland Ohio
    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?
     
    Michael Lane and crusso1993 like this.
  19. Michael Lane

    Michael Lane Active Member R2R Supporter

    Joined:
    Aug 11, 2018
    Messages:
    155
    Likes Received:
    348
    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...
     
    crusso1993, Ranjib and Diamond1 like this.
  20. Diamond1

    Diamond1 Valuable Member Build Thread Contributor

    Joined:
    Oct 17, 2013
    Messages:
    1,370
    Likes Received:
    1,877
    Location:
    Cleveland Ohio
    I've always liked the concept of the wave box just not the size of it.
    PM me with a price if you get one you want to get rid of.
     
    crusso1993 and Ranjib like this.
Draft saved Draft deleted

Share This Page