Skip to content

This project provides a script for a Raspberry Pi Pico runing MicroPython with the goal of controlling a set of 4 valves for a reverse osmosis filtration system

License

Notifications You must be signed in to change notification settings

alexklaeser/reverse-osmosis-filtration-diy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Reverse Osmosis Filtration System Control for Raspberry Pi Pico

Program Summary

This script is designed for a Raspberry Pi Pico running MicroPython (yet should be compatible with other platforms running MicroPython), with the goal of controlling a set of 4 valves for a reverse osmosis filtration system. The system is controlled with one button and offers the following main features:

  • Automatic flushing of the osmosis membrane every few hours to prevent germ development in the filters.
  • Automatic disposal of the first filtered water (which contains more particles due to the lowered pressure in the osmosis membrane during idle time).
  • Setting a fixed time interval for water filtration to yield a specific amount of water, which can be stored via a long button press.

The script is structured to be asynchronous, allowing it to handle multiple operations efficiently without blocking the main execution flow.

My final system looked like shown in the following two images:

DIY reverse osmosis system with automatization features

DIY reverse osmosis system with automatization features

Schema

Here is the overview of how the valves are employed in the filtration process.

Schema of the DIY reverse osmosis system with automatization features

Hardware parts

For the full system, I used the following hardware parts:

Configuration

The script uses a configuration file (config.json) for various timing operations. You can modify these settings in the configuration file to adapt the system to your specific requirements. The file is created if it does not exist. It is persistently stored on the SD card of the Raspberry Pi Pico.

The file contains the following parameters:

  • flush_sec: Time in seconds for the flush operation.
  • disposal_sec: Time in seconds for the disposal operation.
  • filter_sec: Time in seconds for the filter operation.
  • auto_flush_sec: Time in seconds for automatic flushing (default: 8 hours).
  • water_clean_sec: Time in seconds for water cleaning operation.

Usage

To use the script:

  1. Ensure you have a Raspberry Pi Pico connected to the necessary hardware components (valves, button, buzzer).
  2. Upload the script to your Raspberry Pi Pico running MicroPython.
  3. Optionally: Adapt the config.json file with your desired timing settings.
  4. The system will perform automatic flushing, water disposal, and filtration based on your configuration.

Button Controls

  • Short press: Initiates water filtration for the configured duration.
  • Long press: Initiates a long water filtration process (of 1 hour max.).
  • During filtration:
    • Short press: Stops the filtration process.
    • Long press: Saves the fitration time as new filtration interval to the configuration file.

License

This project is licensed under the GNU Public License v3 - see the LICENSE file for details.

About

This project provides a script for a Raspberry Pi Pico runing MicroPython with the goal of controlling a set of 4 valves for a reverse osmosis filtration system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages