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

pickupman66

5000 Club Member
View Badges
Joined
Aug 10, 2010
Messages
6,032
Reaction score
1,165
Location
Winchester, TN
Rating - 0%
0   0   0
This must have to do with the drivers. I had a Reef Radiance 240 or something. it was 30" long and had 6 total drivers (2 on each channel). the darn thing used a reverse PWM signal. Meaning 100% PWM was zero light and 0% was 100% brightness. I bought an analog to PWM board for the Archon controller I was using and the guy that made it changed the code for me to run in reverse of the 0-10V analog signal. they worked wonderfully.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
This must have to do with the drivers. I had a Reef Radiance 240 or something. it was 30" long and had 6 total drivers (2 on each channel). the darn thing used a reverse PWM signal. Meaning 100% PWM was zero light and 0% was 100% brightness. I bought an analog to PWM board for the Archon controller I was using and the guy that made it changed the code for me to run in reverse of the 0-10V analog signal. they worked wonderfully.
that reverse thing happens due to the use of N channel tansistors. In reef-pi UI you can configure each channel as "Active High" or "Active Low", to deal with this exact issue
 

b4tn

Valuable Member
View Badges
Joined
Jun 17, 2015
Messages
1,679
Reaction score
2,227
Location
Columbia MD
Rating - 0%
0   0   0
I have a question now that I am playing with the software. Why are things based on check intervals vs just on and off? For instance. If the ATO is set to check every 60 seconds and the switch is activated, it runs for a full minute even if the switch is no longer activated. Why not set it to turn on when the switch is activated and stop when the switch is off? I am sure there is a smart answer. Was just curios.


Second question. I have a pump on each side of my tank. Currently one pump is on for one hour then shuts off, the other pump then kicks on for an hour then shuts off and back and forth flip flopping. Is there a way to do this in reef-pi?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I have a question now that I am playing with the software. Why are things based on check intervals vs just on and off? For instance. If the ATO is set to check every 60 seconds and the switch is activated, it runs for a full minute even if the switch is no longer activated. Why not set it to turn on when the switch is activated and stop when the switch is off? I am sure there is a smart answer. Was just curios.


Second question. I have a pump on each side of my tank. Currently one pump is on for one hour then shuts off, the other pump then kicks on for an hour then shuts off and back and forth flip flopping. Is there a way to do this in reef-pi?
This is a very good question, let me answer it in two parts:
- currently reed-pi polls the sensors for data at periodic interval. This lets user customize how instant /quickly the trigger to ato pump will occur when the sensor values changes. Lower interval(for example 5 seconds) will increase responsiveness but also cause high cpu utilization. reef-pi ships with conservative value of 1minute , with an expectation that users can tune it as and when their controller is operational after observating the cpu utilization . The ato pump can also be tuned (for example use 12v peristaltic pump instead of submersible pumps as ato pump) to work at slower flow rate . This has another advantage , that we don’t have to do any hysteresis (flapping changes, where thensensor flip flops across two states)
- in 3.0 I want to introduce an alternate to polling (inturrupt) which will provide instant results , but we need hysteresis as well to deal with flapping.
So think of the current solution as not the best, but with known error bounds and simpler hence much more reliable than the instant ones which needs some more work (coding and testing , and preferably multiple sensor )
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,121
Rating - 0%
0   0   0
This is a very good question, let me answer it in two parts:
- currently reed-pi polls the sensors for data at periodic interval. This lets user customize how instant /quickly the trigger to ato pump will occur when the sensor values changes. Lower interval(for example 5 seconds) will increase responsiveness but also cause high cpu utilization. reef-pi ships with conservative value of 1minute , with an expectation that users can tune it as and when their controller is operational after observating the cpu utilization . The ato pump can also be tuned (for example use 12v peristaltic pump instead of submersible pumps as ato pump) to work at slower flow rate . This has another advantage , that we don’t have to do any hysteresis (flapping changes, where thensensor flip flops across two states)
- in 3.0 I want to introduce an alternate to polling (inturrupt) which will provide instant results , but we need hysteresis as well to deal with flapping.
So think of the current solution as not the best, but with known error bounds and simpler hence much more reliable than the instant ones which needs some more work (coding and testing , and preferably multiple sensor )
Interrupts were definitely on my personal TODO list for reef-pi. My top off pump is pretty strong and usually only runs for a few seconds, so real-time responsiveness is important to me. It looks like interrupts are not trivially easy using Go on rpi, but I'm sure we'll get it for v3.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Interrupts were definitely on my personal TODO list for reef-pi. My top off pump is pretty strong and usually only runs for a few seconds, so real-time responsiveness is important to me. It looks like interrupts are not trivially easy using Go on rpi, but I'm sure we'll get it for v3.
There are couple of implementations out there that we can use to get started with, like this one: https://github.com/davecheney/gpio/blob/master/gpio_linux.go
But most of these are not very well maintained, and the epoll bits are really simple. We should just implement this in reef-pi/rpi
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@Ranjib, is the doser build the next module in adafruit?
Light controller (Kessil and Actinic LED strip) is next, followed by pH monitoring and then doser. Light controller guide is already done, its in editorial review stage now
 

b4tn

Valuable Member
View Badges
Joined
Jun 17, 2015
Messages
1,679
Reaction score
2,227
Location
Columbia MD
Rating - 0%
0   0   0
Quiet today so I will share my progress. I forgot to buy the ULN2803 which is $1.95 with $5 shipping or $6.98 shipped for 6 on amazon so I keep stalling. I also have not decided if I want to build my own relays or buy the SR P8 so for now I am testing with an LED. I have confirmed that all the outlets work, both temp sensors work and trigger the output just fine. The two wires stuffed in the corners are my ATO switch. Its set up to use a mechanical float switch which I tested and it worked as well. I was going to use an audio jack for ATO but one of the female audio jacks I received is shorted out internally so I have to order a new one. I really dont like soldering those audio jacks and they seem fragile so i am considering switching over to RJ-45 connectors. I tested macros, I also tested the notifications and have it set up to txt me and that all works as well. Last thing I did last night was set up the adafruit IO service which is not working but I still need to play with it some more.

I still plan on adding PH monitoring and doser control to this build.


31664048238_daa62c3075_k.jpg
 

DirtDiggler2823

If I can't break it, it doesn't exist
View Badges
Joined
Jul 31, 2018
Messages
1,667
Reaction score
2,075
Location
Gambrills
Rating - 0%
0   0   0
Light controller (Kessil and Actinic LED strip) is next, followed by pH monitoring and then doser. Light controller guide is already done, its in editorial review stage now
I think I'm going to pause my build until the pH, and doser modules are published. I don't want to have to keep modifying what is there, and there is no rush as the tank is still very much dry. I look forward to the publication of the rest of the guide, and i look forward to continuing to be part of this amazing conversation. All of you guys rock.
 

b4tn

Valuable Member
View Badges
Joined
Jun 17, 2015
Messages
1,679
Reaction score
2,227
Location
Columbia MD
Rating - 0%
0   0   0
I think I'm going to pause my build until the pH, and doser modules are published. I don't want to have to keep modifying what is there, and there is no rush as the tank is still very much dry. I look forward to the publication of the rest of the guide, and i look forward to continuing to be part of this amazing conversation. All of you guys rock.

@DirtDiggler2823 Here is the diagram for the doser.
https://www.reef2reef.com/threads/r...-on-raspberry-pi.289256/page-304#post-5069339

Scroll down for the diagram for the PH circuit.
https://www.reef2reef.com/threads/r...troller-based-on-raspberry-pi.289256/page-183
 

Diamond1

Valuable Member
View Badges
Joined
Oct 17, 2013
Messages
1,368
Reaction score
1,914
Location
Cleveland Ohio
Rating - 0%
0   0   0
So i will not be doing this just because dimming 40% where my lights run to 10% is not really worth the effort. Maybe someday I will look into building my own LED's but for now the built in timer is fine. But if you decide to do this, and someone correct me if I am wrong I would not advise running it directly off the GPIO pin. I would use the following:

2vrSj.gif

The PWM GPIO signal out would go in the 3.3v side with a square wave. Use the buck converter you linked above dialed down to 3.3.volts to supply the upper pictured voltage. D1 would be the OR light controller or where the black wire would connect. The key is to find out what the current draw is so that you can size the transistor and resistor appropriately. If you use the built in OR timers all you need to do is hijack the black wire and run ground from your pi build spliced into the red ground wire of the OR fixture.

If your your lights are anything like mine the clock sucks and never keeps time perfectly. So if you wanted to use the built in timers your brightness level and timer will over time be mismatched. To fix this disconnect the plug on the light. The purple and blue would need to be on a 12 volt relay timer programmed to come on and off at your set times with reef pi. The black wire would go to the same input on the transistor above and the red wire would go to your common ground. Since your clock is the same on both power and dimming you would be matched. Here is more on the OR light using the same basic concept.


I agree with you about the onboard timer on the OR fixture they are very lousy at keeping the correct time.

I watched this video and (correct me if I'm wrong) the lights do go down to 1% albeit it's very visually bright 1% when they come on. I'm not as concerned about the asthetics as i am giving my corals what they want (I can live with going from no lights to lights on). It would interesting to see what kind of par readings I get as the lights ramp up and what effect that has on the corals energy consumption during the light cycle but that's a whole other topic.

I think I'm going to try this. I was thinking that I could power the whole fixture up with a power relay on a pi controlled timer and then control the driver with the pi, bypassing the fixtures timer. I'll do a little more digging into the OR fixture and see how it goes.
Now I just have to wait for some more parts to get here and start testing.
 

pickupman66

5000 Club Member
View Badges
Joined
Aug 10, 2010
Messages
6,032
Reaction score
1,165
Location
Winchester, TN
Rating - 0%
0   0   0
That is mostly what I did for the reef radiance. I tossed some relays inside the case and put them online for the power supplies for the ballasts. This way I could fully cut them if I needed to. It worked well. I just signaled them with a separate circuit all together.
 

DirtDiggler2823

If I can't break it, it doesn't exist
View Badges
Joined
Jul 31, 2018
Messages
1,667
Reaction score
2,075
Location
Gambrills
Rating - 0%
0   0   0

DirtDiggler2823

If I can't break it, it doesn't exist
View Badges
Joined
Jul 31, 2018
Messages
1,667
Reaction score
2,075
Location
Gambrills
Rating - 0%
0   0   0

b4tn

Valuable Member
View Badges
Joined
Jun 17, 2015
Messages
1,679
Reaction score
2,227
Location
Columbia MD
Rating - 0%
0   0   0
Thanks!! Any plans for the body for the pumps?

I have been brainstorming on this today. I think I am going to use 2.1mm female barrel connectors on the main box and then make a small separate box for the pumps with female barrel connectors as well. You can find different lengths of male power cables all over to connect the two. I also considered RCA cables but think I like the barrel connectors better. I am also thinking of using a single RJ45 cable.
51tWBreT%2BuL._SX355_.jpg
 

DirtDiggler2823

If I can't break it, it doesn't exist
View Badges
Joined
Jul 31, 2018
Messages
1,667
Reaction score
2,075
Location
Gambrills
Rating - 0%
0   0   0
I have been brainstorming on this today. I think I am going to use 2.1mm female barrel connectors on the main box and then make a small separate box for the pumps with female barrel connectors as well. You can find different lengths of male power cables all over to connect the two. I also considered RCA cables but think I like the barrel connectors better. I am also thinking of using a single RJ45 cable.
51tWBreT%2BuL._SX355_.jpg
I think a single cable would be less room for layer 1 failure, but it eliminates the ability to kill a single pump outside of the pi. Either works IMO.
 

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 35 26.9%
  • 100% dry rock + 100% live sand

    Votes: 45 34.6%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 29 22.3%
  • 75% live rock, 25% live sand

    Votes: 11 8.5%
  • 25% live rock, 75% live sand

    Votes: 10 7.7%
Back
Top