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
267
Location
Oregon
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
 
Top Shelf Aquatics
OP
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
6,818
Reaction score
11,874
Location
Palo Alto, Bay Area
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
267
Location
Oregon
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
267
Location
Oregon
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
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
6,818
Reaction score
11,874
Location
Palo Alto, Bay Area
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
267
Location
Oregon
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.


What I have so far



Nothing showing here though.
 
OP
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
6,818
Reaction score
11,874
Location
Palo Alto, Bay Area
OP
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
6,818
Reaction score
11,874
Location
Palo Alto, Bay Area
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
 

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
267
Location
Oregon
@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?
 
Top Shelf Aquatics
OP
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
6,818
Reaction score
11,874
Location
Palo Alto, Bay Area
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
267
Location
Oregon
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

Member
View Badges
Joined
May 29, 2017
Messages
5
Reaction score
8
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
Ranjib

Ranjib

Valuable Member
View Badges
Joined
Apr 16, 2016
Messages
6,818
Reaction score
11,874
Location
Palo Alto, Bay Area

Is your Build Thread Badge missing? Uh oh!

  • Yes it's gone

    Votes: 86 27.6%
  • Nope, I'm quick

    Votes: 93 29.8%
  • Uh I don't understand. (you better click and read)

    Votes: 61 19.6%
  • Never had one...until now!

    Votes: 72 23.1%

Online statistics

Members online
1,647
Guests online
4,089
Total visitors
5,736
CWT Aquatics - Acrylic Sumps, Tanks, and More!
TheCoralConnect.com
Top