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

cheeseclock

Community Member
View Badges
Joined
Apr 4, 2018
Messages
41
Reaction score
69
Rating - 0%
0   0   0
These are entirely overkill, but I got them for free. How many lighting channels can I have? :)

IMAG0060.jpg
 

James Golden

Community Member
View Badges
Joined
Apr 8, 2018
Messages
44
Reaction score
55
Rating - 0%
0   0   0
Did an internet search for a diy aquarium controller and found several. But, the one thing this has that others are lacking is someone like Ranjab. I have read Thur almost every post here. I started putting mine together last Friday night and was having nothing but problems. Came here to ask some questions and could not make an account until yesterday! But, I was able to get it up and running. It is still in the build phase so it’s kinda laying all over the desk. Just a few questions.

1. PCA9685 Can control 16 pwm channels. And the l293d need pen for speed control can we use the PCA9685 to control them?

2. If I power the PCA9685 with 3.3v instead of 5v will the pwm signal be 3.3v. I don’t have one to try so if some one knows it would help. The reason is the lights that I have use 3.3 v for pwm.

As for the dosing system. I would love to help with the development also. I am pretty good with a soldering iron!
 

MaccaPopEye

Well-Known Member
View Badges
Joined
Jan 5, 2016
Messages
697
Reaction score
1,234
Rating - 0%
0   0   0
Well all 4 parts of my power board finished printing a couple of days ago.

It's certainly not amazing but I am pretty happy with my wiring here :D any glaring safety errors anyone can see? Is it safe to solder the wire to the outlets like that? I was going to use crimps but the crimps didn't fit 2 wires at a time in them.
full


Starting to get cramped in here. The 15A wire isn't very flexible haha
full


:/ did I mention it was getting cramped already?
full


The 4 separate pieces fit together quite well :)
full


Ta Da! Just waiting on some coloured filament to arrive so I can print out the clown fish and Pi inserts and glue them in.
full

full


I also have 2 issues that will need to be fixed. First is that I placed the AC plug too high and too far to the left as well as forgot to add screw holes for it, so I need to fix that and reprint the relay top and bottom side.

I also ordered the wrong RJ-45 sockets! I got PCB mounted ones and planned to solder the relay wires to the little pins on the sockets. While it would work it took me forever to solder the relay wires to the little pins PCB mount pins and was very difficult to do as the pins are really close together. So I have ordered some RJ-45 keystone sockets (I think that is what they are called) and a punch tool. Unfortunately they will take a month to arrive before I can measure them and make sure they will fit and reprint the relay side.
full


Once those issues are fixed I will upload the files to thingiverse as I am pretty happy with the result! I'll make sure to upload the fusion 360 files so that people can remix it if needed as most people will have different relay boards to the ones I have and if they want to print this will need to move the mounting holes :)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Well all 4 parts of my power board finished printing a couple of days ago.

It's certainly not amazing but I am pretty happy with my wiring here :D any glaring safety errors anyone can see? Is it safe to solder the wire to the outlets like that? I was going to use crimps but the crimps didn't fit 2 wires at a time in them.
full


Starting to get cramped in here. The 15A wire isn't very flexible haha
full


:/ did I mention it was getting cramped already?
full


The 4 separate pieces fit together quite well :)
full


Ta Da! Just waiting on some coloured filament to arrive so I can print out the clown fish and Pi inserts and glue them in.
full

full


I also have 2 issues that will need to be fixed. First is that I placed the AC plug too high and too far to the left as well as forgot to add screw holes for it, so I need to fix that and reprint the relay top and bottom side.

I also ordered the wrong RJ-45 sockets! I got PCB mounted ones and planned to solder the relay wires to the little pins on the sockets. While it would work it took me forever to solder the relay wires to the little pins PCB mount pins and was very difficult to do as the pins are really close together. So I have ordered some RJ-45 keystone sockets (I think that is what they are called) and a punch tool. Unfortunately they will take a month to arrive before I can measure them and make sure they will fit and reprint the relay side.
full


Once those issues are fixed I will upload the files to thingiverse as I am pretty happy with the result! I'll make sure to upload the fusion 360 files so that people can remix it if needed as most people will have different relay boards to the ones I have and if they want to print this will need to move the mounting holes :)
This is looking so cool :) . Im jealous.
Your wiring color is bit different, generally the neutral and ground is green or black, and they are daisy chained. Hot wire is red, and controlled by the relay, for you its the black on thats connected to relay, is it the hot wire?

One of the cool thing i found when i opened up an ADJ relay pack is the ground and neural ends are connected by a straight copper rod , not wire. A stright piece of thin copper rod is directly wired to the terminals. That makes wiring lot cleaner. I'll post a pic when I get time.

Cant you just drill a h0le for the screw termnial for the switch/fuse thing?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Did an internet search for a diy aquarium controller and found several. But, the one thing this has that others are lacking is someone like Ranjab. I have read Thur almost every post here. I started putting mine together last Friday night and was having nothing but problems. Came here to ask some questions and could not make an account until yesterday! But, I was able to get it up and running. It is still in the build phase so it’s kinda laying all over the desk. Just a few questions.

1. PCA9685 Can control 16 pwm channels. And the l293d need pen for speed control can we use the PCA9685 to control them?

2. If I power the PCA9685 with 3.3v instead of 5v will the pwm signal be 3.3v. I don’t have one to try so if some one knows it would help. The reason is the lights that I have use 3.3 v for pwm.

As for the dosing system. I would love to help with the development also. I am pretty good with a soldering iron!
Thanks for the kind words, regarding your question
1. Yes. pca9685 can provide 16 pwm channels, and each l293d can use two of the channels (i.e. one pca9685 can support 8 l293d ), but remember l293d required 5v pwm, so the pcsa9685 has to be powered with 5v
2. From my understanding , yes, you can run them on 3.3 v. I have not tried it that way, but the datasheet indicates it should be fine. https://cdn-shop.adafruit.com/datasheets/PCA9685.pdf

Just to remind, Pi itself is enough if all you want is two channels of pwm. Also, remember we can convert almost any pwm voltage to any other pwm voltage using uln2003 or a normal npn transistor. So, this is not a big deal
 

MaccaPopEye

Well-Known Member
View Badges
Joined
Jan 5, 2016
Messages
697
Reaction score
1,234
Rating - 0%
0   0   0
This is looking so cool :) . Im jealous.
Your wiring color is bit different, generally the neutral and ground is green or black, and they are daisy chained. Hot wire is red, and controlled by the relay, for you its the black on thats connected to relay, is it the hot wire?

One of the cool thing i found when i opened up an ADJ relay pack is the ground and neural ends are connected by a straight copper rod , not wire. A stright piece of thin copper rod is directly wired to the terminals. That makes wiring lot cleaner. I'll post a pic when I get time.

Cant you just drill a h0le for the screw termnial for the switch/fuse thing?

In Australia the colours are a bit different:
Active: Brown
Neutral: Blue
Ground: Green

I couldn't get any "mains" wire in separate strands, only wired together in groups of 3 with double insulation. So I just got some 15A wire from the hobby shop and it only came in red, green and black (I think it's meant for DC but that shouldn't be an issue right? Only difference I could find is that DC wire generally only has 1 layer of insulation vs 2 layers on 250V AC wire).

Because I had limited colour options I used:
Active: Black (I know it's not "negative" because it is AC power but that's how my head tends to think of it, and I use black wire for negative)
Neutral: Red (my head tends to think of this as "positive" hence the red wire)
Ground: Green

I have been thinking about just buying some "normal" mains wiring and manually removing the outer layer of insulation so I can utilise the individual wires.

And Australian power boards are the same, they use a solid copper bar between shared terminals which is very compact and neat. I don't think it would be easy to DIY though :)
 

James Golden

Community Member
View Badges
Joined
Apr 8, 2018
Messages
44
Reaction score
55
Rating - 0%
0   0   0
I work in a power plant as an EI&C tech and under their control boards 99.99999% of the wire is various gauges of SIS wire. It’s all gray!!! Labels labels labels. Find a way to label the wires to help with the confusion.
Thank you Ranjib. Figured that would work with the pwm driver. I think I will go with the pca9685 and a transistor. I have two of these l289n from another project so I will try it out with the dosing system
 

cheeseclock

Community Member
View Badges
Joined
Apr 4, 2018
Messages
41
Reaction score
69
Rating - 0%
0   0   0
Well all 4 parts of my power board finished printing a couple of days ago.

It's certainly not amazing but I am pretty happy with my wiring here :D any glaring safety errors anyone can see? Is it safe to solder the wire to the outlets like that? I was going to use crimps but the crimps didn't fit 2 wires at a time in them.

That looks great!

Brown/Blue is typical of European standards. I know nothing of the standards in Australia, but one would assume they are closer to European than ours here in the states. You might want to put heat shrink on the solder connections. Also, we generally switch both legs of 240 here since it's still 120 to neutral or ground. I don't know how your power distribution works... Is your neutral bonded to ground (earth) at the panel? If so, forget what I said about switching both sides. A quick test is to use a meter and check the voltage between the neutral and earth. If there's no voltage, there's no need to switch that leg. If there is voltage, I'd probably switch both legs.

https://en.wikipedia.org/wiki/Ground_and_neutral

Wiring_side_of_the_socket.jpg
 

815reefer

New Member
View Badges
Joined
Feb 16, 2017
Messages
19
Reaction score
27
Rating - 0%
0   0   0
So I have 2 halo led lights that take 0-10v to control. I bought a pca9685 board and one of these pwm to voltage boards to try it out. KNACRO PWM-to-voltage module / 0% -100% PWM converted to 0-10V voltage (https://www.amazon.com/dp/B01HXRSQF8/ref=cm_sw_r_cp_apa_4XwZAb8Z0GN0M) . Well when i go to 100% it is pushing 0 voltage out. I dont know why but moving the slider around i get some dead spots it seems. Maybe im doing something wrong or wired it incorrectly. Im using a 12v wall wort to power the knacro board. Any ideas or steps to trouble shoot this would be great. Thanks guys and thank you Ranjbe for a great controler.
 

cheeseclock

Community Member
View Badges
Joined
Apr 4, 2018
Messages
41
Reaction score
69
Rating - 0%
0   0   0
So I have 2 halo led lights that take 0-10v to control. I bought a pca9685 board and one of these pwm to voltage boards to try it out. KNACRO PWM-to-voltage module / 0% -100% PWM converted to 0-10V voltage (https://www.amazon.com/dp/B01HXRSQF8/ref=cm_sw_r_cp_apa_4XwZAb8Z0GN0M) . Well when i go to 100% it is pushing 0 voltage out. I dont know why but moving the slider around i get some dead spots it seems. Maybe im doing something wrong or wired it incorrectly. Im using a 12v wall wort to power the knacro board. Any ideas or steps to trouble shoot this would be great. Thanks guys and thank you Ranjbe for a great controler.

Does it otherwise scale correctly? I guess what I'm asking is if the voltage tracks with the slider in a linear fashion. 25%=2.5v, 50%=5v, 75%=7.5v, etc
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
So I have 2 halo led lights that take 0-10v to control. I bought a pca9685 board and one of these pwm to voltage boards to try it out. KNACRO PWM-to-voltage module / 0% -100% PWM converted to 0-10V voltage (https://www.amazon.com/dp/B01HXRSQF8/ref=cm_sw_r_cp_apa_4XwZAb8Z0GN0M) . Well when i go to 100% it is pushing 0 voltage out. I dont know why but moving the slider around i get some dead spots it seems. Maybe im doing something wrong or wired it incorrectly. Im using a 12v wall wort to power the knacro board. Any ideas or steps to trouble shoot this would be great. Thanks guys and thank you Ranjbe for a great controler.
100% is equal to 0%. I know its weird, but thats how the logic works in pca9685 IC. Can I ask to use the per channel "max" value settings, and set it to 99. That way reef-pi will ensure that at max 99 is passed to pca9695 driver.

For some background, pca9685 is a 12 bit pwm controller (that is 4096 steps aka duty cycle), which means we map 0-100% to 0-4095 value internally. The moment it hits 4096 (which is what happens when you set 100%) it becomes 0, 4097 is 1 and so on.. its cyclical. This can definitely be solved in software side.. i just have to think through the best way to do this. From my current understanding the max setting should address this, but i could use some more validation
 

cheeseclock

Community Member
View Badges
Joined
Apr 4, 2018
Messages
41
Reaction score
69
Rating - 0%
0   0   0
100% is equal to 0%. I know its weird, but thats how the logic works in pca9685 IC. Can I ask to use the per channel "max" value settings, and set it to 99. That way reef-pi will ensure that at max 99 is passed to pca9695 driver.

For some background, pca9685 is a 12 bit pwm controller (that is 4096 steps aka duty cycle), which means we map 0-100% to 0-4095 value internally. The moment it hits 4096 (which is what happens when you set 100%) it becomes 0, 4097 is 1 and so on.. its cyclical. This can definitely be solved in software side.. i just have to think through the best way to do this. From my current understanding the max setting should address this, but i could use some more validation

This is what I was curious about. I don't know how go works, but in industrial controls we would buffer the value and use a logical statement to cap the output value. Does that make sense? I don't even know if that helps, but it makes sense in ladder logic.

You're obviously a better coder than I am, so I'm sure you'll figure something out.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Hello hive minds,
I have cut a new release of reef-pi, 1.5. This is one of the largest release by sheer amount of code change that went in since 1.4 release. 1.5 release contains several key changes that we need for 2.0 release without breaking any existing features significantly (more on that shortly).
Major highlights of release 1.5 is
  • Introduction of a customizable dashboard. From 1.5 onwards users will be able to configure the reef-pi dashboard, in terms of the charts grid (how many rows and columns) and height width of individual charts. A new "dashboard" section under "Configuration" tab let's user specify the grid , individual chart width & height and contains of the grid. This will allow users to build dashboard specific to the features they are using, the charts order and dimensions to fit in the primary device they are using to view the charts (tablets, laptop , phone etc). For example a temperature only controller can configure reef-pi to show only 1x1 grid (i.e. only one chart) that fits in the entire screen (say 1200px width and 800px height). This is a key features that was required for 2.0 functionalities (multiple ato and temperature sensor), which will make the older dashboard unusable (since it assume only one temperature or ato sensor)
  • A new connector type named "inlet" has been introduced. This connector will denote all digital inputs like ato sensor, tactile buttons, leak detectors etc. As of now its not being used by any of the existing sub-system. In future I plan to integrate the ATO system (which currently uses raw GPIO number as sensor pin). This was another required feature to support multiple ato sensor. We'll use "inlets" for implementing leak detector or a generic purpose `if this happens then do that` style sub-system, that users can leverage to automate leak detectors, door switches (automatically turning on cabinet light when door is open etc) type inputs
  • The "jack" connector has been rewritten to support both pca9685 as well as rpi based pwm output. This is a strategic work for reef-pi, which comes at a cost. Historically reef-pi used only pca9685 to generate pwm output. Since last February, Raspberry Pi exposed the two hardware time (pwm) from its processor, which we can use now. To accommodate this (let users use Pi instead of PCA9685 based pwm output) the "jack" logic has been rewritten. User can now specify the driver type (rpi or pca9685) while creating a jack, other than specifying the pin numbers. One benefit of this feature is if you are building a kessil controller or two part doser, then you only need two pwm output, which pi can provide. This will save 12$ and some space in housing , since user will not need the pca9685 chip. One bad side effect of this work is if you are using pwm on older reef-pi installation, they wont work after update. Users have to recreate the jacks and light in 1.5 (take a screenshot of your settings before your upgrade)
  • We have a favicon now :) . Its a tiny icon consist of two greek letter, r and pi that can be observed on brower tabs. Users will find it easy to detect which tab reef-pi is in, when multiple browser tabs are open.
  • reef-pi now validates GPIO and pwm pin numbers. We have seen multiple issues arising from wrong GPIO settings. I hope this will fix some of that.
There are many other small non-feature tech related changes that also went in , including go 1.10 based binary (faster and more efficient), various bug fixes, improvement of developer environment using dockerfile (thanks @theatrus ) etc. A big changes on that front was migrating to in-house pca9685 and i2c driver instead of embd library. This will ease long term maintenance of reef-pi easier.

Release packages can be found in usual location: https://github.com/reef-pi/reef-pi/releases/tag/1.5

Some screen shots:
2x2 dashboard

Screen Shot 2018-04-10 at 10.16.22 PM.png

Settings for custom dashboard
Screen Shot 2018-04-10 at 10.16.34 PM.png


New connector type "inlet"
Screen Shot 2018-04-10 at 10.16.47 PM.png


Jack connectors now has a type (pca9685 or rpi)
Screen Shot 2018-04-10 at 10.17.14 PM.png


Thats all for now,
happy reefing
 

815reefer

New Member
View Badges
Joined
Feb 16, 2017
Messages
19
Reaction score
27
Rating - 0%
0   0   0
So i just got home i had it set to 5v at 50% when i move slider to 99% it reads 9.21 should it be 9.9? Also i set the max to 99 and 100 still drops to 0. I am using versuo 1.4 currently i just seen you dropped 1.5 today. Keep up the good work guys.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
So i just got home i had it set to 5v at 50% when i move slider to 99% it reads 9.21 should it be 9.9? Also i set the max to 99 and 100 still drops to 0. I am using versuo 1.4 currently i just seen you dropped 1.5 today. Keep up the good work guys.
You are using the same circuit as the kessil controller guide and with a pca9685 board?
 

TOP 10 Trending Threads

HAVE YOU EVER ALMOST GIVEN UP ON REEFING? SHARE YOUR STORY IN THE COMMENTS!

  • Yes. I have faced situations that almost made me give up.

    Votes: 8 42.1%
  • No. I have faced adversity, but never thought about giving up.

    Votes: 4 21.1%
  • No. I have never faced a situation that made me want to give up.

    Votes: 0 0.0%
  • I have given up before, but I am reefing/planning to reef again.

    Votes: 6 31.6%
  • I have given up, and I don't plan to reef again.

    Votes: 0 0.0%
  • Other - please explain.

    Votes: 1 5.3%
Back
Top