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

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
273
Location
Oregon
Rating - 0%
0   0   0
Ok. I am planning on starting with (4) relays.
(1) white led on / off
(1) blue led on / off
(1) return pump
(1) wave maker

White channel 5v pwm dimming on daytime cycle

Blue channel 5v pwm dimming on daytime cycle.

Eventually add in the analog sensor IC
 
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
Ok. I am planning on starting with (4) relays.
(1) white led on / off
(1) blue led on / off
(1) return pump
(1) wave maker

White channel 5v pwm dimming on daytime cycle

Blue channel 5v pwm dimming on daytime cycle.

Eventually add in the analog sensor IC
You have a 4 channel relay? If so, declare 4 outputs of type relay with pi gpio pins, and two output with pca9685 pin , type pwm
 

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
273
Location
Oregon
Rating - 0%
0   0   0
You have a 4 channel relay? If so, declare 4 outputs of type relay with pi gpio pins, and two output with pca9685 pin , type pwm

I have an 8 relay board. But was keeping it as simple as possible for now.

I followed your fritz diagram to hook up the pca9685 but I don't know anything about the pins or numbering etc.

I didn't see a diagram for the relay board so it's just sitting.

Forgive my ignorance on all this. I love electronics and want to learn more. I figured if I dove into it, that would be the best way to learn!
 

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
273
Location
Oregon
Rating - 0%
0   0   0
Do you have an example for the board section of config. I think I figured out the outlets and pins. They don't show up on the browser yet though.
 
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
Outlets assigned to pins, equipments are assigned to outlets. What you see in browser is equipment, outlets are hidden. The example config in github I shared before should give you a hint. I'm outside now, will grab the necessary links once I'm home
 

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
273
Location
Oregon
Rating - 0%
0   0   0
Outlets assigned to pins, equipments are assigned to outlets. What you see in browser is equipment, outlets are hidden. The example config in github I shared before should give you a hint. I'm outside now, will grab the necessary links once I'm home

No worries here I am happy with how far I got so far!

The browser shows dashboard/electronics/equipment/ etc. I think this is what is confusing me.
4ca38ef151fe782103af60c9ef284f1e.jpg


What I have so far

5702021395253cafb9949b6c485e4201.jpg


Nothing showing here though.
 
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
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
Ooh, hoo .. party time :) . Remember to assign the GPIO pin number for relay correctly, they are not contiguous , this is the reference: http://www.jameco.com/Jameco/workshop/circuitnotes/raspberry_pi_circuit_note_fig2.jpg
For example pin number 7 (denoted in green circle) is GPIO4, so in configuration file, use 4. For PCA9685 just use contiguous pin number (starting from 0 till 11).
Once you declare an output as pwm type in config, the equipment using that output will automatically have a slider, to control the pwm value. For LED lights this will dim it, for DC pumps it will vary the speed (can be used to do nice wave makers).

you should be able to combine any equipment and action (on/off, set pwm values) for setting up periodic jobs.

Godspeed
 

scriptmonkey

Valuable Member
View Badges
Joined
Mar 22, 2017
Messages
1,677
Reaction score
4,545
Location
Baltimore, MD
Rating - 0%
0   0   0
Following along, you guys are doing a great job! Now that my tank is showing signs that it has cycled I am hoping to be able to start developing something to use as a controller (in between coming into the home stretch for our wedding next month).
 

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
273
Location
Oregon
Rating - 0%
0   0   0
@Ranjib
I have relays working along with 2 channels pwm. After editing the config file, the browser still shows the old equipment from the original, along with my new added equipment labels. Any ideas why the old labels are sticking around?
 
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
everytime you change the config file with new or modified equipments, delete the data base and restart reef-pi service
```
sudo systemctl stop reef-pi.service
sudo rm -rf /var/lib/reef-pi/reef-pi.db
sudo systemctl start reef-pi.service
```
also, when you visit browers, do a Cmd +Shift + r (refresh with cache delete)
I should revisit the config based equipment, may be revert back to UI based equipment/outlet management...
 

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
273
Location
Oregon
Rating - 0%
0   0   0
everytime you change the config file with new or modified equipments, delete the data base and restart reef-pi service
```
sudo systemctl stop reef-pi.service
sudo rm -rf /var/lib/reef-pi/reef-pi.db
sudo systemctl start reef-pi.service
```
also, when you visit browers, do a Cmd +Shift + r (refresh with cache delete)
I should revisit the config based equipment, may be revert back to UI based equipment/outlet management...

I have certainly learned a lot by the way it is now, it just leads noobs like me to questions.[emoji3] I am gonna keep learning away, however you set it up. I do think the UI adressing is cool though.
 

mikeh77

New Member
View Badges
Joined
May 29, 2017
Messages
7
Reaction score
8
Rating - 0%
0   0   0
Ranjib, a few days ago I asked about wiring using the PCA9865 board and a transistor for 0-10V. I see Adafruit's example python code for the breakout on their website ( https://github.com/adafruit/Adafruit_Python_PCA9685/blob/master/examples/simpletest.py ), but I'm wondering if you could possibly share your python code for dimming? If not no big deal, I know some python but could definitely use a head start on this particular library and program!

Thanks!!
 
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
Back
Top