Automated RO/DI Water Filtration System
part 1 - design overview
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:
part 1 - design overview
part 2 - hardware/software overview
part 3 - flow transducer details
part 4 - TDS sensor details
part 5 - pressure transducer details
part 6 - putting it all together
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.
Automated RO/DI System Overview
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 housing
RO/DI automation controller operational modes:
- Automatic Membrane Flush
- Manual Membrane Flush
- DI Resin Flush
- DI Resin bypass
- Fill ATO reservoir
- Fill AUX reservoir
- System paused
RO/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
Automated RO/DI System Topology
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.
Click on the diagram to see the full size version. The diagram illustrates the functional hydraulic layout of the automated RO/DI system. External inputs for flow control logic of the AUX and ATO, reservoirs are not shown.
Automated RO/DI System Functional Overview
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).
- System Idle- When the RO/DI automation controller sits idle, a timer runs in order to initiate scheduled reverse osmosis membrane flushes. The automatic flush timer is reset any time the system is used. The purpose of the autoflush timer is to ensure that the reverse osmosis membrane is regularly flushed during idle periods when there is no product water being produced.
- Membrane Flush - The membrane flush solenoid valve is open and the reverse osmosis membrane is being flushed to waste (the sewer). The membrane flush can be called from by the system timer, manual user input, or by other system states. The RO membrane can be set to flush each time product water is called for.
- DI Bypass - The DI bypass solenoid is open and water is bypassing the deionizing resin. This state is set after a membrane flush when there is a call for product water. There is initial high TDS water in the system on the output side of the reverse osmosis membrane. This allows the water to be pushed directly to waste (the sewer) without being processed by the deionizing resin. This will help ensure DI resin life by not forcing it to process the initial high TDS surge of water from the membrane.
- DI Flush- The DI flush solenoid is open and product water is flowing through the DI resin but being pushed to waste (the sewer) instead of being delivered to the system product water output. This state is set after the DI bypass completes when there is a call for product water. When the RO/DI system is idle, the Deionizing resin bed can leach dissolved solids back into the stagnant water that remains in the DI resin chamber. This state allows this high TDS water to be pushed to waste (the sewer) instead of into the product water holding tank. This state will significantly reduce what is known as "TDS creep".
- ATO or AUX output - Either the ATO or AUX water reservoir is being filled with product water produced by the RO/DI system. This mode is initiated by float switches or user input and ended by float switches or user input.
Automated RO/DI System User Interface Overview
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.
Automated RO/DI System Data Logging Overview
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:
Pressure Transducer - an electronic pressure transducer will log the water pressure (in P.S.I.A) at the input of the system, both static (when the system is idle) and during operation.
Input TDS Sensor - Total Dissolved Solids will be measured at the input water during system operation.
RO TDS Sensor- Total Dissolved Solids will be measured at the output of the reverse osmosis membrane. By comparing the INPUT TDS with the RO TDS, the product to waste ratio can be determined. This ratio provides critical information about the health of the membrane and/or the adjustment of the flow restrictor.
DI TDS Sensor - Total Dissolved Solids will be measured at the output of the De-ionizing resin bed (chamber). This measurement will provide critical information about the life of the DI resin.
Water Temperature - Each TDS sensor is equipped with a temperature thermistor. The temperature readings at each sensor are used to calibrate the output of each TDS sensor during operation. The INPUT TDS sensor temperature will be recorded as the "system temperature" because the water temperature entering the RO membrane directly affects its efficiency.
Input Flow Rate- A paddle wheel flow sensor will record the instantaneous flow rate at the input of the RO/DI system. The flow rate will also increment a totalized flow counter.
Waste Flow Rate- A paddle wheel flow sensor will record the instantaneous flow rate at the waste output of the RO/DI system. The flow will also increment a totalized flow counter. Used in conjunction with the INPUT FLOW RATE counter, the flow rates through different stages of the system can be mathematically calculated to gauge filter life and throughput for each stage of the RO/DI system.
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.