Power up your reef-pi controller once all the sensors are connected alongside the power strip. Connect the reef-pi to your computer and go to the reef-pi user interface (UI) to configure the new ATO controller.

Digital inputs, such as optical sensors, are represented as inlets in reef-pi. Inlets are then associated with ATO controllers to monitor water level sensor and turn on or off ATO pump (a submersible or peristaltic pump, declared as an equipment in reef-pi). 

To create an inlet, navigate to the connectors section under the Configuration tab. Create a new inlet by clicking on the "+" button. Specify a name and GPIO pin number. In our case the GPIO pin number is 17. I am naming the inlet as "Optical Sensor". 

Inlets and Outlets in reef-pi are always associated with GPIO pin numbers. These are not serial numbers of the pins (for example GPIO 17 pin is the 11th pin)

Once created the new inlet will be visible in the UI.

Next, head over to the ATO tab. Create a new ATO by clicking one "+" button. Associate the newly created inlet with it. We'll name it as Adafruit. Notice default check frequency is set to 120 seconds. This means reef-pi will check the inlet (the optical sensor in this case) every 120 seconds and switch on or off the control pump if specified. The ATO Status drop-down menu controls whether the ATO will be enabled or disabled. 

Once created, the ATO controller will start monitoring the inlet. Since the optical water level sensor is out of water, the ATO control pump will be turned on. We can expand the ATO controller to see the usage chart which shows hourly ATO control pump usage in seconds. 

For more comprehensive physical testing, use a table lamp or any other suitable AC device to simulate turning on a control pump and a cup of water to simulate the water level changes. Reduce the ATO control frequency to a smaller check interval (for example 2 seconds). Now, if you submerge the optical water level sensor inside the cup of water, the table lamp should turn off within a couple of seconds and if the optical water level sensor is moved out of water reef-pi should turn on the table lamp.

ATO controller in reef-pi is built by connecting an inlet item with an equipment item. Though it is built for water level control (and salinity indirectly) it can be used to automate a host of things, since mechanical switches, float switches, etc. can also be used as inlets.

A lower check interval will cause higher CPU usage in reef-pi. reef-pi allows charting CPU and memory usage (enable the health check feature in configuration). Keep a watch on those graphs to understand if your controller is loading your CPU. 

Thank you for reading through the water level controller guide. We'll go through the lighting controller in the next reef-pi guide.

This guide was first published on Oct 03, 2018. It was last updated on Mar 08, 2024.

This page (Configuration & Testing) was last updated on Mar 08, 2024.

Text editor powered by tinymce.