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

For PWM on the system, would this would work instead of using a separate board?...https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=36572
Currently is PWM being used for anything other than lighting? Would it be an issue running straight off of the Pi without the separate power source that you can use with the PCA9685?
 
For PWM on the system, would this would work instead of using a separate board?...https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=36572
Currently is PWM being used for anything other than lighting? Would it be an issue running straight off of the Pi without the separate power source that you can use with the PCA9685?
Thats an awesome question :-)
I intend to use the pwm output for light, dosing and dc pump based wave makers (in future if dc return pumps become affordable i'll go for those as well).
Initially, I had considered dma, software pwm and dedicated board. My learning was DMA would likely involve some native codes (C) which will incur additional build and deployment complexities. I also noticed DMA related resources are scarce (libraries are not maintained, documentations is really very limited). Software pwm would incur CPU overhead and slow down reef-pi as we add more and more outputs. The breakout board was simplest, since its i2c based, we can chain it, the software support is abundant (almost all popular library has it), and we can chain it (i2c based) to get 100s of pwm outputs if need be. All without any additional software complexities or performance hiccups. This was my reason to go with the pca9685 board (i had considered tlc5947 as well).
I run it without any extra power source. But remember I use 2.4 amp power supply for Raspberry Pi (so addition 1.6 amp for peripherals) and my light control (Kessil) draw very little current (20 milli amp ). So this work out just fine for me. I cant think of a case where you need a dedicated power supply for the pca9685 board, unless your lights are 5v (like @Aaron Smith ). Most lights require 12, 18 or 24 volt, and if your are powering it directly, i expect you'll choose a mosfet to boost the pwm signal, even in that case you wont need to power the pca9685 as most power mosfets current draw (gate) will be minimal, and you'll use a dedicated power supply as mosfet source current (which in turn powers the light).
makes sense ?
 
Forgot to mention, the dedicated pwm board also eliminates the need of precious GPIO pins per pwm output, we want to use them for all sort of digital in/out (float switches, temperature sensors, photo electric water sensors etc)
 
That does indeed make a lot of sense.
With the amount of work that you have put into this, I would not want to burden you with any extra complexities.
I am not that familiar with DMA at all, but started thinking about it as well from this pagehttp://pythonhosted.org/RPIO/pwm_py.html where it mentions minimal CPU.
Out of curiosity how many GPIO pins are you currently using, if you propagated a full build and a 3-4+ channel light system?
 
That does indeed make a lot of sense.
With the amount of work that you have put into this, I would not want to burden you with any extra complexities.
I am not that familiar with DMA at all, but started thinking about it as well from this pagehttp://pythonhosted.org/RPIO/pwm_py.html where it mentions minimal CPU.
Out of curiosity how many GPIO pins are you currently using, if you propagated a full build and a 3-4+ channel light system?
DMA does free up CPU, but it does fluctuate under latency or any other network interruption. The breakout board wont have such issue :-)
 
Unfortunately not. For what its worth, ATO build is the simplest of all the controllers. I'll give a brief run down of the steps here, that should get you started (and if you could contribute the ATO guide that would be awesome, everyone else would be thankful :) )
Here are the steps:
1) Get a photoelectric sensor from DFrobot, a set of male/female 3.5 mm audio jack. Since the probe is 3 pin (1 GND, 1 5v, 1 data) we can use audio jacks as connector.
2) Wire up the probe to the male audio jack instead of the 3 pin connector it comes with. Hook up the salvaged connector with female panel mount audio jack. This will give you a easily pluggable probe, where the probe is connected to a male audio jack and the female part will be mounted on the housing
3) Connect the breakout board that comes with photo electric sensor to raspberry pi. Wiring is described here: https://www.dfrobot.com/wiki/index.php/Liquid_Level_Sensor-FS-IR02_SKU:_SEN0205
in-short, you need the red wire goes to 5 v rails, black wire goes to GND, and the other data wire goes to any of the GPIO pin (ref: http://www.jameco.com/Jameco/workshop/circuitnotes/raspberry_pi_circuit_note_fig2.jpg, choose one of the green pins). Note down this pin number
4) Configure reef-pi: Specify the pin which reef-pi should monitor to get current water level value (0 or 1) , also specify the outlet reef-pi should switch on, when the water level is below. You should plug in a water pump in that outlet. If you use the older version of reef-pi (0.7 ) you can specify all these via configuration file : https://github.com/reef-pi/reef-pi/blob/0.0.7/build/reef-pi.yml#L3 .

My advice will be to setup the wiring, configure reef-pi, enable telemetry, and dont enable 'control' mode. reef-pi ato system will send telemetry data everytime it detects the water level is off, it will only turn on the outlet if `control` configuration parameter is set to true. Run the ato for couple of days in just sensor mode, with control disabled and see how frequently it trips (using the graph) , if things looke good, enable control :). I would also advice getting a smaller gph pump for ato (or get an ato sepecific pump like this: https://www.bulkreefsupply.com/smart-ato-replacement-dc-pump-autoaqua.html, remember to use 12v based relay outlet)
Ok i i have my hardware setup.
Now im trying to configure the settings for the ato.
Im at the .1 version now.
Can you guide me when u say reefpi to monitor on pin 0 or 1? How do i setup that?
 
Heres my Ato outlets. I have two channels. One ill use for my ato. The other who knows.

IMG_1944.JPG
 
@Brad Cox I have not enabled the ato, camera and dosing module in 0.1, since it was a major code change, let me cut a new release with those bits enable, probably i'll release the DAC code also, I am almost done with the first cut on DAC.
Meanwhile, lets configure these two outlets with reefpi and test out the end to end setup.
Can you access reef-pi web ui from your laptop/mobile? if so we can start are good to go, else we'll start with installation. What pins you have hooked up the relay wires? This looks like a two channel relay, so you will be using two GPIO pins (e.g. 26, 20) .
 
That does indeed make a lot of sense.
With the amount of work that you have put into this, I would not want to burden you with any extra complexities.
I am not that familiar with DMA at all, but started thinking about it as well from this pagehttp://pythonhosted.org/RPIO/pwm_py.html where it mentions minimal CPU.
Out of curiosity how many GPIO pins are you currently using, if you propagated a full build and a 3-4+ channel light system?
I have used almost 12 GPIO, and almost all raspberry pins for one of the build, following is details: Pin numbers denote serial numbers, not GPIO number
1) Both 5v pins (2, 4)-> to power pca9685, and relay board (8 channel)
2) Two 3.3 pins ( 1, 17) -> to power mco3008 and photo electric sensor
3) 8 GPIO pins (31,32,33,35,36,37,38,40) -> to control 8 channel relay
4) Both i2c pins, sda & scl (3,5) -> pca9685 i2c connection
5) GPIO4 (pin 7) -> for temperature probe. This is a fixed pin (can be changed by kernel parameter, but I prefer to use the default pin) for 1 wire protocol (DS182b temperature probe)
6) 1 GPIO pin for ATO (11)
8) 3 pins for SPI connection to mcp3008 (19,21,23,24)
9) There are 8 GND pins, i connect them all to a single rail...
9) I keep the UART pins (pin 8 , 10) for debugging perpose, to use console cable .. They are not used for any equipments. I keep the eeprom i2c pins unplugged as well (27,28)

At the end I had only 4-5 GPIO pins left (if i recall correctly )

Does that answer your question ?
 
@Brad Cox I have not enabled the ato, camera and dosing module in 0.1, since it was a major code change, let me cut a new release with those bits enable, probably i'll release the DAC code also, I am almost done with the first cut on DAC.
Meanwhile, lets configure these two outlets with reefpi and test out the end to end setup.
Can you access reef-pi web ui from your laptop/mobile? if so we can start are good to go, else we'll start with installation. What pins you have hooked up the relay wires? This looks like a two channel relay, so you will be using two GPIO pins (e.g. 26, 20) .
Ah that makes sense!

It is a two channel relay. I had only one channel plugged in. But i can plug them into where ever. I have the 1st channel connected to goio 16.
 
Btw i do have reef pi up and running and can access it from my network.

Also when trying to unclick the devmode. I click update then wait a sec then reboot.

When i go back in devmode is still clicked?
 
Btw i do have reef pi up and running and can access it from my network.

Also when trying to unclick the devmode. I click update then wait a sec then reboot.

When i go back in devmode is still clicked?


Brad, if you have a chance would you make a list of the steps you used to create the ATO? It doesn't have to be perfect, just something we can add to the build guides and improve on each time. Also, if you could do that for your light build, we could add it as well. You don't even need to worry about grammar, spelling, etc. I will take care of that before I submit it to the github for Ranjib.

Actually, anyone with build experience can help. Just tell us the type of components you have, what you used, and how you built it. This way we can start a group of builds for different lights, ato sensors, or anything else this group comes up with

thanks in advance.
 
Brad, if you have a chance would you make a list of the steps you used to create the ATO? It doesn't have to be perfect, just something we can add to the build guides and improve on each time. Also, if you could do that for your light build, we could add it as well. You don't even need to worry about grammar, spelling, etc. I will take care of that before I submit it to the github for Ranjib.

Actually, anyone with build experience can help. Just tell us the type of components you have, what you used, and how you built it. This way we can start a group of builds for different lights, ato sensors, or anything else this group comes up with

thanks in advance.
Sure thing!

It will be over in the week before i get time to set down and do it. I was hoping i could get the ato working before i left this evening for vacation.
 
Btw i do have reef pi up and running and can access it from my network.

Also when trying to unclick the devmode. I click update then wait a sec then reboot.

When i go back in devmode is still clicked?
Dev mode thing is a UI bug. Click twice and then save. Restart reef-pi. Create an outlet in systems page, with the gpio PIN number. Can you see the equipment tab? Declare a new equipment with the outlet. Trying switching it on/off
 
I
Dev mode thing is a UI bug. Click twice and then save. Restart reef-pi. Create an outlet in systems page, with the gpio PIN number. Can you see the equipment tab? Declare a new equipment with the outlet. Trying switching it on/off
ill try that and see if it will uncheck.
 
Btw i do have reef pi up and running and can access it from my network.

Also when trying to unclick the devmode. I click update then wait a sec then reboot.

When i go back in devmode is still clicked?
Btw , I have the UI fix and ATo changes ready . I'll cut a 0.1.1 release tonight
 

IF YOU HAD TO TAKE A REEFING EXAM, WOULD YOU PASS?

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%
Back
Top