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

OP
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
7,193
Reaction score
12,767
Location
Palo Alto, Bay Area
Would you recommend running two float switches? A higher failsafe switch that cuts off the circuit from the 1st float to reef-pi to add a safety net? My ATO pump is a bit... Oversized and will fill the tank within seconds so I'm trying to figure out the best way to prevent a catastrophe :)

Also I noticed that the check frequency on the ATO by default is 60 seconds. This means reef-pi checks the input pin every 60 seconds and the pump will run (for a minimum) for 60 seconds. Would it be possible to have reef-pi check the input status almost real-time once the ATO is signaled ON to prevent overages from oversized ATO pumps like mine? Lol.

I set it to 1 second for the reason above, don't know if that negatively affects anything. I didn't notice any increased CPU usage on the pi.
I think you can get away by running it at 3-5 second interval. I have never ran it at 1 second interval, but i dont think anything will break. Real time is not possible currently, we have to implement a different type of driver and I dont think the effort is worth the benefit right now.
I'll work on fixing the bug though... that needs to be fixed asap.
 

Ernie E

Member
View Badges
Joined
Aug 15, 2019
Messages
19
Reaction score
17
I think you can get away by running it at 3-5 second interval. I have never ran it at 1 second interval, but i dont think anything will break. Real time is not possible currently, we have to implement a different type of driver and I dont think the effort is worth the benefit right now.
I'll work on fixing the bug though... that needs to be fixed asap.
Thank you! I'm testing at 2 and 3 seconds today with the pump connected to see how she does.

One more question on the functionality of "disable on alert". Would this disable the ATO/equipment until the user resets it or would it disable it only for the check period set (60 seconds for example).

Maybe I should learn GO! Wonder how difficult it would be coming from a Python background.
 

Spathodus

Member
View Badges
Joined
Oct 16, 2019
Messages
7
Reaction score
5
Hello Ranjib.

First, thank you for creating such a useful application for all of us. I've been following this project for a while and just completed my lighting build. I DIY'd this as well, with 4 Meanwell LDD-1000L, running 4 channels to twenty-two 3w LEDS. the 4 channels are connected to a PCA 9685. I'm using a Raspberry pi zeroW.

My issue at the moment is that the LED's will flash brightly when they are shut off through the web UI. I believe this is a similar issue to losing the PWM signal from the raspberry pi/PCA 9685 resulting in the LED's just running at 100%, but I'm not sure. Do you think adding an adequately sized capacitor in parallel with each channel would abate this flashing issue?

Thank you very much!
 
OP
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
7,193
Reaction score
12,767
Location
Palo Alto, Bay Area
Hello Ranjib.

First, thank you for creating such a useful application for all of us. I've been following this project for a while and just completed my lighting build. I DIY'd this as well, with 4 Meanwell LDD-1000L, running 4 channels to twenty-two 3w LEDS. the 4 channels are connected to a PCA 9685. I'm using a Raspberry pi zeroW.

My issue at the moment is that the LED's will flash brightly when they are shut off through the web UI. I believe this is a similar issue to losing the PWM signal from the raspberry pi/PCA 9685 resulting in the LED's just running at 100%, but I'm not sure. Do you think adding an adequately sized capacitor in parallel with each channel would abate this flashing issue?

Thank you very much!
Thank you so much for the kind words. It means everything to me and rest of the folks who makes this project possible.

I think this is a bug in the pca9695 driver where we are not sending special instruction for 0 duty_cycle. https://github.com/reef-pi/reef-pi/issues/794
I plan to fix it as part of 3.0 release. If possible use a timer to cut off the power during off cycle.
 

Schreiber

Active Member
View Badges
Joined
Jun 28, 2016
Messages
220
Reaction score
271
Location
Knoxville
On the topic of PCA9685... I can use the PWM output from the PCA for the L293d Enable, correct? That would free up a couple of GPIO pins for me if that's the case.

How do I set these jacks up in my configuration? I'm wanting to use outputs 12 & 13 from the PCA9685 as my PWM outputs for EN 1,2 & EN 3,4 on the L293D. In the Adafruit guide, pins 0 & 1 are being used with the RPi as the driver. I know I have to switch my driver to PCA9685, but are the pins I need to use 12 & 13? Or is the numbering scheme different here as well (like on the Pi, GPIO 18 is "pin 0"? I remember having a lot of trouble with the jacks when I was using the wrong pin in my previous build & I'm wanting to avoid that headache again!
 
Top Shelf Aquatics

sfgabe

Active Member
View Badges
Joined
Sep 7, 2018
Messages
103
Reaction score
180
How do I set these jacks up in my configuration? I'm wanting to use outputs 12 & 13 from the PCA9685 as my PWM outputs for EN 1,2 & EN 3,4 on the L293D. In the Adafruit guide, pins 0 & 1 are being used with the RPi as the driver. I know I have to switch my driver to PCA9685, but are the pins I need to use 12 & 13? Or is the numbering scheme different here as well (like on the Pi, GPIO 18 is "pin 0"? I remember having a lot of trouble with the jacks when I was using the wrong pin in my previous build & I'm wanting to avoid that headache again!
I use an L293D (H-bridge board) for exactly this to power my doser pump motors. The pins are entered into reef-pi as 0,1,2,3,4, etc just like the rpi driver, but there's more of them. You'll need 6 pins, ENA, 1, & 2, and ENB, 3, & 4 - which for me are 0,1,2,3,4,& 5 on the PCA9685. If you're powering something like a motor, EN will be the "power" switch and then you'll either end up with 1 dummy pin that's always set to "off" or be able to switch between forward and reverse by turning one high and one low and vice versa.
 

Schreiber

Active Member
View Badges
Joined
Jun 28, 2016
Messages
220
Reaction score
271
Location
Knoxville
I use an L293D (H-bridge board) for exactly this to power my doser pump motors. The pins are entered into reef-pi as 0,1,2,3,4, etc just like the rpi driver, but there's more of them. You'll need 6 pins, ENA, 1, & 2, and ENB, 3, & 4 - which for me are 0,1,2,3,4,& 5 on the PCA9685. If you're powering something like a motor, EN will be the "power" switch and then you'll either end up with 1 dummy pin that's always set to "off" or be able to switch between forward and reverse by turning one high and one low and vice versa.
Interesting. I had been under the impression you had to use the GPIO pins for the Inputs on the L293D, because the PCA9685 was set to a much higher frequency.

So, if the PCA9685 outputs can be used in this way, what's keeping us from using them to control relay outputs as well?
 

Spathodus

Member
View Badges
Joined
Oct 16, 2019
Messages
7
Reaction score
5
Thank you so much for the kind words. It means everything to me and rest of the folks who makes this project possible.

I think this is a bug in the pca9695 driver where we are not sending special instruction for 0 duty_cycle. https://github.com/reef-pi/reef-pi/issues/794
I plan to fix it as part of 3.0 release. If possible use a timer to cut off the power during off cycle.
Thank you for your quick response. I might route the incoming driver power through a timed relay then.
 

sfgabe

Active Member
View Badges
Joined
Sep 7, 2018
Messages
103
Reaction score
180
Interesting. I had been under the impression you had to use the GPIO pins for the Inputs on the L293D, because the PCA9685 was set to a much higher frequency.

So, if the PCA9685 outputs can be used in this way, what's keeping us from using them to control relay outputs as well?
As far as I understand, the PCA9685 is specifically for things that require a PWM signal (different from frequency), so basically leds and servos only.
 
OP
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
7,193
Reaction score
12,767
Location
Palo Alto, Bay Area
How do I set these jacks up in my configuration? I'm wanting to use outputs 12 & 13 from the PCA9685 as my PWM outputs for EN 1,2 & EN 3,4 on the L293D. In the Adafruit guide, pins 0 & 1 are being used with the RPi as the driver. I know I have to switch my driver to PCA9685, but are the pins I need to use 12 & 13? Or is the numbering scheme different here as well (like on the Pi, GPIO 18 is "pin 0"? I remember having a lot of trouble with the jacks when I was using the wrong pin in my previous build & I'm wanting to avoid that headache again!
You need only two pwm pins, en1 and en2. IN1/2/3/4 all can be connected to pi GPIO if you want to contol the moto diection. For LEDs it does not make sense. You can just hook them up to 3.3V rail and GND,
 
OP
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
7,193
Reaction score
12,767
Location
Palo Alto, Bay Area
As far as I understand, the PCA9685 is specifically for things that require a PWM signal (different from frequency), so basically leds and servos only.
with 3.0 , we will be able to use pwm outputs as notmal digital output. In that case its basically 100% duty cyle or 0% duty cycle. So L293D could be entirely driven by pca9685 IC, or even relay contol. I have not tested this, theres a pca9685 driver bug that also i need to fix before i start field testing
 
OP
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
7,193
Reaction score
12,767
Location
Palo Alto, Bay Area
If you want dimming ability on LEDs it sometimes makes sense to use a PWM signal.
yes, and thats why en1, en2 is the pwm input. Rest does not need to be, IN1/2/3/4 all can be simple 3.3v/GND
 

Urtoo

Active Member
View Badges
Joined
Jul 1, 2019
Messages
159
Reaction score
197
HS300 is in hand. After maleficent movie night, I will solder a header to the pi zero and start getting running.
Pictures will be in my build thread, maybe tomorrow after RAP.
Speaking of which, anyone in here going tomorrow?
 
OP
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
7,193
Reaction score
12,767
Location
Palo Alto, Bay Area
HS300 is in hand. After maleficent movie night, I will solder a header to the pi zero and start getting running.
Pictures will be in my build thread, maybe tomorrow after RAP.
Speaking of which, anyone in here going tomorrow?
Nope. Was in orlando.
 
Earn WWC Rewards Points
OP
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
7,193
Reaction score
12,767
Location
Palo Alto, Bay Area
As far as I understand, the PCA9685 is specifically for things that require a PWM signal (different from frequency), so basically leds and servos only.
with 3.0 , we will be able to use pwm outputs as notmal digital output. In that case its basically 100% duty cyle or 0% duty cycle. So L293D could be entirely driven by pca9685 IC, or even relay contol. I have not tested this, theres a pca9685 driver bug that also i need to fix before i start field testing
 
OP
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
7,193
Reaction score
12,767
Location
Palo Alto, Bay Area
reef-pi 3.0 new pwm profiles:
Fixed: Constant intensity for given time period
Screen Shot 2019-10-20 at 11.40.01 PM.png


Interval: Linear interpolation of a set of intensities at used defined fixed time interval. (Like auto in reef-pi 2.0, but can be used with arbitrary time intervals, like 15 min).
Screen Shot 2019-10-20 at 11.51.56 PM.png



Diurnal:
Screen Shot 2019-10-21 at 12.03.44 AM.png

Sine:
Screen Shot 2019-10-21 at 12.48.58 AM.png


Random:
Screen Shot 2019-10-21 at 12.40.50 AM.png


Lunar: Like sine in daily intensity cycle, but max intensity changes with 27 days cycle. Graph is for three months. Each peak representing a daily sine cycle
Screen Shot 2019-10-21 at 12.50.04 AM.png


Composite: A set of sub-profiles each with a specific duration and min/max intensity. The example graph combines aiurnal, sine, random and fixed profiles.
Screen Shot 2019-10-21 at 1.08.09 AM.png


These things are now present in the backend/controller. We are working on building the UI.
 
Last edited:

Urtoo

Active Member
View Badges
Joined
Jul 1, 2019
Messages
159
Reaction score
197
After too long of a delay... I am starting

first to solder some pins to my pi zero. I will overload my build thread with photos
045A2C5C-C341-4804-8AD8-CFBB413F4D8B.jpeg
 

Have you ever had an algae outbreak so bad that you had to break the tank down and start over?

  • Yes

    Votes: 44 17.9%
  • No

    Votes: 172 69.9%
  • Having a major outbreak right now and I'm considering it

    Votes: 19 7.7%
  • I've never had algae and my name is Pinocchio

    Votes: 11 4.5%

Online statistics

Members online
2,108
Guests online
4,470
Total visitors
6,578
Top