reef-pi :: An opensource reef tank controller based on Raspberry Pi.

Trickman2

Well-Known Member
View Badges
Joined
Jan 31, 2018
Messages
576
Reaction score
483
Location
Poway, Ca
Rating - 0%
0   0   0
I have always pondered about using an computer power supply (ATX SMPS) .. but my tanks being nano and pico, never really needed that many pieces of equipment. At most I need 6-8 equipment per tank, and that fits pretty nicely with AIO build with a single power strip. But I can see that this is not enough for larger tank. But I also wonder if you really need light and few other equipment to be controlled by power outlet.. they are rarely switched off and can be put on manual switched outlets (like the ones trip lite sells)

http://www.mini-box.com/picoPSU-160-XT
 

MaccaPopEye

Well-Known Member
View Badges
Joined
Jan 5, 2016
Messages
697
Reaction score
1,232
Rating - 0%
0   0   0
As of now, it should be ok to control two power strips using two db9 connector, and total 16 outlets . I have plans to work on adding support for mcp23017 after 2.0 release. That will unlock the use of many more of pins. But I doubt we practically need more than a couple
Me Me Me I want more :p

I think having the ability to have more pins is not essential by any means and ReefPi is amazing with what it can do already, but more pins would certainly help with larger tanks (120G+). Not with the power side of things, 16 outlets really is all I can see myself controlling on my 180G and if I need more than that I can always just use a normal power board for equipment that is always on and doesn't need to be controlled.

But more pins is great for the monitoring and subsequently controlling equipment side of things. When you think about how many places you can put float switches, flow meters, leak detectors etc. on a larger tank, all to let you see the health of your tank from a glance / give alerts when things go wrong the number of pins can add up really fast (large tanks that run on commercial controllers usually have at least a couple of break out boxes full of float switches etc).

For example if you have a tank with an external skimmer, algae scrubber and a UV sterilizer and want to monitor the flow rates through all 3 pieces of equipment that is 3 pins right there. Then I can name at least half a dozen places I can use a float switch to monitor / control my system so the pins really add up fast.

But having said that none of it is essential by any means so it's not a super important feature.
 

aquaalgae

Community Member
View Badges
Joined
Mar 22, 2017
Messages
48
Reaction score
30
Rating - 0%
0   0   0
Me Me Me I want more :p

I think having the ability to have more pins is not essential by any means and ReefPi is amazing with what it can do already, but more pins would certainly help with larger tanks (120G+). Not with the power side of things, 16 outlets really is all I can see myself controlling on my 180G and if I need more than that I can always just use a normal power board for equipment that is always on and doesn't need to be controlled.

But more pins is great for the monitoring and subsequently controlling equipment side of things. When you think about how many places you can put float switches, flow meters, leak detectors etc. on a larger tank, all to let you see the health of your tank from a glance / give alerts when things go wrong the number of pins can add up really fast (large tanks that run on commercial controllers usually have at least a couple of break out boxes full of float switches etc).

For example if you have a tank with an external skimmer, algae scrubber and a UV sterilizer and want to monitor the flow rates through all 3 pieces of equipment that is 3 pins right there. Then I can name at least half a dozen places I can use a float switch to monitor / control my system so the pins really add up fast.

But having said that none of it is essential by any means so it's not a super important feature.
Agreed, more is definitely better. Like I said previously, I am currently using a Reef Angel but am slowly working on replacing it with Reef Pi. On my 500 gallon system, I currently have 16 controlled items and it would be nice to at least have the ability to have more for future expansion (which I'm already planning :) ).
 

aquaalgae

Community Member
View Badges
Joined
Mar 22, 2017
Messages
48
Reaction score
30
Rating - 0%
0   0   0
Code:
import requests
import time

# This script shows how to update a light using the api
# Lets assume we have a light with ID 1 and that light has only one channel controlled by pin 1 (pca9685)

light_id = "1"
pin = "1"
ip = "127.0.0.1:8080" # IP
auth= ("reef-pi", "reef-pi") #  username and password
u = "http://" + ip + "/api/lights/" + light_id

resp = requests.get(u, auth=auth)
light = resp.json()

for x in range(10):
    light["channels"][pin]["auto"] = False # change the light to fixed mode
    light["channels"][pin]["fixed"] = x * 10   # PWM value in percentage
    resp = requests.post(u, auth=auth, json=light) # update light
    time.sleep(1) # wait for a second

keep hacking!
Awesome! Thanks Ranjib! Just one question though, it looks like that is sending a % dimming value (0-100) I would like to send a 0-4095 PWM value. Is that possible?
Thanks again!
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
Got it. So, you want something that will convert the 5v pwm coming from pca9685 to 12v for your LEDs.
Depending upon the current draw, you can start with uln2803 and see if that works out, if not Meanwell drivers will definitely work.

Can anyone perhaps show me the wiring diagram for setting this up with a Pi3, pca9685, uln2803 to control the 5 channels of my 12V led's.

I've got all the bits now, I would like to start experimenting and getting it working.
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
Something else I was wondering......... Would it be possible to add a small monitor - say one of the 4 or 5 inch ones (even monochrome) and have parameters scrolling up on the screen.

For eg

Return : On
Skimmer : On
ATO : Off
Heater : On
Fan : Off
Temperature : 25.7

etc, etc. Say 4 lines of text on a touch screen scrolling on a loop. No control of device. Touch to wake it up and it times out and sleeps after a preset (User definable??) time.

I know I'm often around the tank and don't want to be playing on my phone at the same time, but wouldn't mind being able to see a status "snapshot"
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Awesome! Thanks Ranjib! Just one question though, it looks like that is sending a % dimming value (0-100) I would like to send a 0-4095 PWM value. Is that possible?
Thanks again!
Not currently. I'll keep you posted when I update the code to allow for fractions..
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Can anyone perhaps show me the wiring diagram for setting this up with a Pi3, pca9685, uln2803 to control the 5 channels of my 12V led's.

I've got all the bits now, I would like to start experimenting and getting it working.

This is how pca9685 is wired to pi, the cyan wired are pwm output from pca9685. Here only two channels are used, for you this will be 5
https://reef-pi.github.io/build-guides/lighting/
breadboard.png


And this is how uln2803 is wired to LEDs, in short, the pca9685 pwm output will be its input , and the GND(or -ve) of each LED channel will be its output (because uln2803 is a sync type driver). All LED channels will share a common positive (12v)
LEDs.jpg
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Something else I was wondering......... Would it be possible to add a small monitor - say one of the 4 or 5 inch ones (even monochrome) and have parameters scrolling up on the screen.

For eg

Return : On
Skimmer : On
ATO : Off
Heater : On
Fan : Off
Temperature : 25.7

etc, etc. Say 4 lines of text on a touch screen scrolling on a loop. No control of device. Touch to wake it up and it times out and sleeps after a preset (User definable??) time.

I know I'm often around the tank and don't want to be playing on my phone at the same time, but wouldn't mind being able to see a status "snapshot"
You can use the official pi touchscreen (7"x4"), we have no support for textual summary in dashboard yet, but all these data is shown as chart instead.
For example here is the dashboard of one of my build showingh states of all equipment (green is on, red is off) and two temperature sensor trend
Screen Shot 2018-06-13 at 7.10.32 AM.png
 

tastyfish

Well-Known Member
View Badges
Joined
Sep 7, 2017
Messages
525
Reaction score
446
Location
Hampshire
Rating - 0%
0   0   0
Has anyone sourced a power bar outside of the US? (UK would be great). I'm struggling to find an alternative to the one you guys are using (needs to be 240v, UK 3 pin)
 

aquaalgae

Community Member
View Badges
Joined
Mar 22, 2017
Messages
48
Reaction score
30
Rating - 0%
0   0   0
You know this will be a Bit cpu and ram taxing on the pi-0 .. If your using the zero with this be sure to run it Headless ie NO UI .
I have this currently running on the Reef Angel - Arduino Mega. The Raspberry Pi zero should be much more capable, right?
 

Erica-Renee

Valuable Member
View Badges
Joined
Oct 4, 2017
Messages
1,596
Reaction score
3,290
Location
lost
Rating - 0%
0   0   0
I have this currently running on the Reef Angel - Arduino Mega. The Raspberry Pi zero should be much more capable, right?
Its not a apple to orange Comparison as each one work differently.. The pi-0 is running a OS (Not embedded) Its running reef-pi Program and UI...
With the Arduino you do not have that over head .I have ran reef-pi on pi-0 and it works ok as long as you do not push it and run it headless.....

Short answer.. I do not know for sure.. Please get back to use and let us know
 

jcmental

Active Member
View Badges
Joined
Jan 25, 2018
Messages
114
Reaction score
137
Rating - 0%
0   0   0
You can use the official pi touchscreen (7"x4"), we have no support for textual summary in dashboard yet, but all these data is shown as chart instead.
For example here is the dashboard of one of my build showingh states of all equipment (green is on, red is off) and two temperature sensor trend
Screen Shot 2018-06-13 at 7.10.32 AM.png
I have the official pi 7" touchscreen it works great but when I go to the dashboard I can only see 1 and a bit of the charts, I have to scroll down or across to view the other summery charts. is there a simple fix for this as I know zilch about code n stuff.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
You know this will be a Bit cpu and ram taxing on the pi-0 .. If your using the zero with this be sure to run it Headless ie NO UI .
You brought up a very good point. I have mentioned earlier, but reiterating again, I run all my builds exclusively on headless mode (i.e. raspbian stretch-lite) backed by pi zero. I had me second generation builds (current one is third generation) all with GUI/attached pi touch screen, but after some months of usage i concluded I dont like to tinker with settings a lot , otherthan while setting up, and the only thing i watch mostly is dashboards, which are far easier to view from laptop. I think the fact I mount the controllers backside of the tank, in-wall makes it harder to access as well.. which adds to the disadvantages

On the plus side though, mcp23017 is i2c based, and 1 byte (8 bits) represent 8 outlet state (yay digital logic), which should be way more performant than current 1 outlet 1 RPI GPIO based setup where for each outlet we read/write one fil. Though I think this advantages will be largely overcome by addition logic (more timers, temperature controllers, atos etc) the increased number of outlets will allow. We'll get to know once we do some actual field testing..
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I have the official pi 7" touchscreen it works great but when I go to the dashboard I can only see 1 and a bit of the charts, I have to scroll down or across to view the other summery charts. is there a simple fix for this as I know zilch about code n stuff.
2.0 release brings customizable dashboards. but some amount of support is there in 1.5 already (specifying width and height of each charts)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I have this currently running on the Reef Angel - Arduino Mega. The Raspberry Pi zero should be much more capable, right?
Depends... running arduino does not mean the actual logic is also executed by arduino, it can be done by a dedicated IC. It is also possible that it used a more efficient method (like the mcp23017 based approach i just mentioned). I dont know if reefangel runs a website as well.. thats big part of reef-pi, that it runs a full blown http server and service a fullblown single page moder UI (built with react). It does not execute the UI code on the pi itself (unless you are running GUI mode and viewing the UI using a directly connected monitor), but it serves those file over network.

Arduino is no match for Pi. Arduino is backed by atmega microcontroller, very robust and good for embedded programming, while Pi is backed by arm based bcm* microprocessor, its a full blown computer, it unlocks the whole world of programming/software for you not just embedded programming. This allows us to integrate features faster, iterates faster, use tooling thats available for a much wider audience. With every new release of Pi, we are likely to get beefier processors, and the softwares are going to get more efficient, allowing us more thing to do
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Updates from one of the recent hardware experiment

I have mentioned this issue earlier, that I experience some led flickering issues while running then via rpi based pwm and powered by lm2696 modules. I was not sure if this is due to the power source itself or the way we wire then power connection to pi (gpio or microusb) .
Here is how it looks (notice the jitter)
244CFB8C-7C55-40A9-A03A-E6B0525E3307.jpeg


Here is how a good pwm signal looks (either from pca9685 or from pi powered by separate micro usb based powersource)
BD66A0CB-C96D-4238-906E-135E1979E20C.jpeg


So I decided to test it out with all possible combination and order few things. In particular the microusb breakout board from adafruit (2$)
https://www.adafruit.com/product/1833
I also created a male micro usb to female jumper wire connector
242A30E8-5CBC-466E-9D25-FEBF702A7892.jpeg
FBED3695-6D34-4013-A531-461BF9D060CA.jpeg

Next I run two types of tests , one with dedicated power source and using gpio connector
CA03F5D2-C578-4AEA-955F-27EEDA987738.jpeg


And another with lm2596 with microusb connector
CA4752CA-0399-48EA-960D-BD7B351D9776.jpeg
CA4752CA-0399-48EA-960D-BD7B351D9776.jpeg

What I learned was irrespective of how I wire the power connections to pi, lm2596 always produce jitter in pwm signal and dedicated micro usb based power source (even if its connected via gpio) produces clean pwm signal from pi . There are articles in the internet around ripple generated by lm2596 , I ll read those next

838A8AE1-6C4A-4F54-9F00-D32CD45DAEAA.jpeg


54C39F51-A878-455C-9288-777ACA2F2E1E.jpeg
 

Algae invading algae: Have you had unwanted algae in your good macroalgae?

  • I regularly have unwanted algae in my macroalgae.

    Votes: 46 35.4%
  • I occasionally have unwanted algae in my macroalgae.

    Votes: 28 21.5%
  • I rarely have unwanted algae in my macroalgae.

    Votes: 10 7.7%
  • I never have unwanted algae in my macroalgae.

    Votes: 10 7.7%
  • I don’t have macroalgae.

    Votes: 32 24.6%
  • Other.

    Votes: 4 3.1%

New Posts

Back
Top