Where Anything is Possible!
Like many reefers, I use an RO/DI (Reverse Osmosis, De-Ionizing) water filtration system to treat the water used in my reef aquarium. The goal of this project is to automate the functionality of the RO/DI filtration system and the ATO (Automatic Top Off) resevoir system that it is connected to. Along with automation of the system and filter flush functions, the project will also provide for display and logging of several data parameters. The theory of operation of an RO/DI system is somewhat out of the scope of this project but you can read more here: "RO/DI for the marine aquarist".
This project will be presented in multiple installments:
At this point, this project is not being presented as a "step by step" instruction manual for the construction of this project. The presentation will touch on the major points of the design from a logical perspective and include detailed discussion of hardware and software design. I will present the theory behind some of the interface electronics and the code needed to read them. I hope that those of you interested in similar automation projects can benefit in one form or another.
RO/DI automation controller monitored parameters:
TDS of incoming tap water TDS of Reverse Osmosis product water TDS of the De-Ionized product water Incoming water pressure. measured in P.S.I.A Incoming water temperature Instantaneous flow rate and totalized flow through the pre-filters and RO Membrane Instantaneous flow rate and totalized flow through the waste port of the membrane housingRO/DI automation controller operational modes:
Automatic Membrane Flush Manual Membrane Flush DI Resin Flush DI Resin bypass Fill ATO reservoir Fill AUX reservoir System pausedRO/DI automation controller features:
RS-232 serial control via PC TCP/IP control via embedded HTTP webserver 20x4 backlit LCD display Local control via rotary encoder Real time clock for data logging
RO/DI automation controller goals:
- Extend membrane life by automating flush cycles
- Extend DI resin life by bypassing resin during system startup
- Prevent TDS creep with membrane and DI flush before each full cycle
- Ease system tuning in all seasons by providing product-to-waste ratio monitoring
- Monitor and predict filter, RO membrane and DI resin life cycles
- add fail-safe control to ATO reservoir fill cycles
- directly monitor water quality and usage
- provide historical view of water quality and usage
- allow remote monitoring and control of the system via the Internet and/or LAN
The base unit is a standard 5-stage RO/DI system consisting of (2) pre-filter stages, a chlorine removal filter, a DOW Filmtec reverse osmosis membrane and a nuclear grade Deionizing resin bed. I will be adding several solenoid valves, flow sensors, TDS sensors and a pressure sensor to the system. The TDS sensors (manufactured by HM-digital) have integrated temperature sensors (NTC thermistor style) included.
The additional sensors and solenoids will be plumbed directly into the existing system and the automation controller will be mounted nearby in a custom project box with an integrated power supply. Eventually, the device will be fitted with a WiFi Ethernet adaptor that will convert the hardwired Ethernet jack for WiFi use and wireless sensors for the reservoir connectivity. More on the electronics later! The diagram below shows the physical components of the RO/DI system and how they are plumbed together. Each block represents a functional device in the filter system.

The RO/DI automation controller will have several basic operating modes that are controlled by outside inputs (float switches) and the timer built into the circuit. The operating modes can be thought of as system states. When we look at the function of the RO/DI automation controller as a finite state machine, we can clearly define the operating states. Each state can be defined by a specific set of conditions that must be met for the state to occur and each state has a specific set of outputs that it sets. The specific system states will be defined in more detail in the programming section. Following is a basic description of the system operational modes (these basic operational modes will be defined as system states and explained in detail in the programming section).
The primary user interface is a 4x20 backlit LCD screen. The LCD screen displays the system status and settings menus. A rotary encoder (with integrated push button) is the primary input device. Rotating the encoder wheel allows the user to scroll through display screens and menu selections. The button is used as an button to allow the user to select parameters or menu items to display. The display is controlled by a state machine (a different state machine from the functional state machine) that parses user input and decides what state to display next. The display states will be explained in detail in the programming section.
The RO/DI automation controller has an ebedded http webserver that allows the user to interact with the system via a web browser from the LAN or the Internet. System status and operational modes can be viewed or set via the web browser. The http server also has its own state machine.
Lastly, the RO/DI automation controller is equipped with an RS-232 serial port. A PC can be used with a terminal emulator to view and control the system status from a menu driven command line.
Several system operating parameters are logged during system operation. The data from various sensor inputs IS NOT (at this point) used to control system function! The reasoning is very simple, the quality of the product water is not a life critical parameter for the reef aquarium. While the goal is 0 TDS water, a malfunctioning system that produces high TDS water will not directly harm the aquariums livestock. Introducing conditional operation based on water quality would add unneeded complexity to the system and increase the probability of problematic operation. I have chosen to use the sensor inputs merely to gauge the systems performance and make adjustments when needed. Data will be logged through the use of several electronic sensors:
That pretty much does it for the system overview. In the Automated RO/DI Water Filtration System - part 2, I will present the software overview.