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

Discussion in 'Do It Yourself (DIY)' started by Ranjib, Feb 10, 2017.

  1. Aaron Smith

    Aaron Smith Active Member R2R Supporter

    Joined:
    Apr 9, 2017
    Messages:
    249
    Likes Received:
    262
    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
     
    njtiger aquariums likes this.

  2. Ranjib

    Ranjib Valuable Member R2R Supporter Reef Squad R2R Excellence Award Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    4,822
    Likes Received:
    7,365
    Location:
    Foster City, Bay Area
    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
     
    njtiger aquariums likes this.
  3. Aaron Smith

    Aaron Smith Active Member R2R Supporter

    Joined:
    Apr 9, 2017
    Messages:
    249
    Likes Received:
    262
    Location:
    Oregon
    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!
     
    njtiger aquariums likes this.
  4. Aaron Smith

    Aaron Smith Active Member R2R Supporter

    Joined:
    Apr 9, 2017
    Messages:
    249
    Likes Received:
    262
    Location:
    Oregon
    Found a pin out diagram. Gonna try this out based on the example you linked to earlier
     
    njtiger aquariums likes this.
  5. Aaron Smith

    Aaron Smith Active Member R2R Supporter

    Joined:
    Apr 9, 2017
    Messages:
    249
    Likes Received:
    262
    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.
     
    njtiger aquariums likes this.
  6. Ranjib

    Ranjib Valuable Member R2R Supporter Reef Squad R2R Excellence Award Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    4,822
    Likes Received:
    7,365
    Location:
    Foster City, 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
     
    njtiger aquariums likes this.
  7. Aaron Smith

    Aaron Smith Active Member R2R Supporter

    Joined:
    Apr 9, 2017
    Messages:
    249
    Likes Received:
    262
    Location:
    Oregon
    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.[​IMG]

    What I have so far

    [​IMG]

    Nothing showing here though.
     
    njtiger aquariums likes this.
  8. Ranjib

    Ranjib Valuable Member R2R Supporter Reef Squad R2R Excellence Award Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    4,822
    Likes Received:
    7,365
    Location:
    Foster City, Bay Area
    njtiger aquariums likes this.
  9. Aaron Smith

    Aaron Smith Active Member R2R Supporter

    Joined:
    Apr 9, 2017
    Messages:
    249
    Likes Received:
    262
    Location:
    Oregon
    Sweet! I had to clear browser history for it to work. I'll play with this for a bit.
     
    njtiger aquariums likes this.
  10. Aaron Smith

    Aaron Smith Active Member R2R Supporter

    Joined:
    Apr 9, 2017
    Messages:
    249
    Likes Received:
    262
    Location:
    Oregon
    I have relays working
     
    njtiger aquariums likes this.
  11. Ranjib

    Ranjib Valuable Member R2R Supporter Reef Squad R2R Excellence Award Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    4,822
    Likes Received:
    7,365
    Location:
    Foster City, 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
     
    njtiger aquariums likes this.
  12. Aaron Smith

    Aaron Smith Active Member R2R Supporter

    Joined:
    Apr 9, 2017
    Messages:
    249
    Likes Received:
    262
    Location:
    Oregon
    Awesome! Thanks again for your time and hard work! I'll get back with you when I get more time to work with it.
     
    njtiger aquariums and Ranjib like this.
  13. scriptmonkey

    scriptmonkey Active Member R2R Supporter

    Joined:
    Mar 22, 2017
    Messages:
    224
    Likes Received:
    220
    Location:
    Baltimore, MD
    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).
     
    njtiger aquariums and Ranjib like this.
  14. Aaron Smith

    Aaron Smith Active Member R2R Supporter

    Joined:
    Apr 9, 2017
    Messages:
    249
    Likes Received:
    262
    Location:
    Oregon
    Congrats!!
     
  15. Aaron Smith

    Aaron Smith Active Member R2R Supporter

    Joined:
    Apr 9, 2017
    Messages:
    249
    Likes Received:
    262
    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?
     
    njtiger aquariums likes this.
  16. scriptmonkey

    scriptmonkey Active Member R2R Supporter

    Joined:
    Mar 22, 2017
    Messages:
    224
    Likes Received:
    220
    Location:
    Baltimore, MD
    Thank you sir!
     
    njtiger aquariums likes this.
  17. Ranjib

    Ranjib Valuable Member R2R Supporter Reef Squad R2R Excellence Award Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    4,822
    Likes Received:
    7,365
    Location:
    Foster City, 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...
     
    njtiger aquariums likes this.
  18. Aaron Smith

    Aaron Smith Active Member R2R Supporter

    Joined:
    Apr 9, 2017
    Messages:
    249
    Likes Received:
    262
    Location:
    Oregon
    I have certainly learned a lot by the way it is now, it just leads noobs like me to questions. I am gonna keep learning away, however you set it up. I do think the UI adressing is cool though.
     
    njtiger aquariums likes this.
  19. mikeh77

    mikeh77 Member

    Joined:
    May 29, 2017
    Messages:
    5
    Likes Received:
    7
    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!!
     
    njtiger aquariums likes this.
  20. Ranjib

    Ranjib Valuable Member R2R Supporter Reef Squad R2R Excellence Award Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    4,822
    Likes Received:
    7,365
    Location:
    Foster City, Bay Area
    njtiger aquariums likes this.
Draft saved Draft deleted

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
Loading...