Dealing with, um, Wastewater

MARENA, the government agency responsible for the environment in Nicaragua, has asked us to use a biofilter waste water treatment system instead of a traditional septic tank and drain field for the Geek Ranch. The reasoning is that as we are building in a nature reserve, we are being held to higher standards than is typical outside the reserve.

While we don't claim to be waste water system experts, we are geeks so this sounded like a technology challenge. Beyond that, the good news, is that a local friend retired from being a wastewater engineer (even though there are many other titles associated with the job) so we have the resources to combine his knowledge of the, shall we say, material handling part of the system with our knowledge of control systems.

On the control system technical side is Willy Smith, fellow Geek Ranch participant with a lot of engineering experience on control systems. As he is also a Linux geek, Linux seems to be the right answer. What you see here is really the design specification for the geek side of the system.

The Task

First, let me define the systems requirements. We need to process the waste streams from a restaurant, hotel and geek cabinas. We had previously decided to separate black water (toilet waste) from gray water (showers, sinks, wash water, etc). What we were going to do was start with a traditional septic system capable of handling the total load of our initial construction. We would then build a gray water processing system (probably using plants) and move the gray water over to that system freeing up septic capacity to support more hotel rooms and geek cabinas.

With the new requirement, we will only use the septic tank for the black water. The output of the septic will then be combined with the gray water stream in a holding tank and processed together. Thus, we have a bit more cost up front but essentially the same long-term system.

One change is that rather than use plant beds to treat the waste stream, we will use a self-contained bio-filter. Wikipedia offers a reasonable explanation of what I am talking about. Where they talk about a tricking filter is the part that that replaces the plant bed.

The way it works is that you fill the filter with something with a lot of surface area such as open cell polyurethane foam cubes. Aerobic bacteria collects on the foam. You spray the effluent over it and the bacteria breaks down the nasty stuff. Solids are settled out and resulting liquid is dispersed in a traditional drain field.

In operation, you want to batch fill the biofilter. For example, you might want to spray five gallons of waste over it and let it do its job. How often you spray it is a function of how much waste you have to process. You don't want to "use up" all the waste as the biofilter would dry out, the bacteria would die and then the system would have to go through a start-up cycle again to re-activate the bacteria.

This piece of system would consist of two tanks and a control valve. First, a large tank (one day combined black and gray water capacity) and a dose tank. The dose tank is a small tank with a full sensor. The control system opens the valve from the holding tank to the dose tank until the dose tank is full and then closes the valve.

The output of the dose tank goes to a spray head that sprays the effluent over the biofilter medium.

The Technology

There is a need for a control system here but we also want to get as close to the low-tech end as possible for the following reasons:

  1. We are located in the middle of nowhere. We don't want to have to rely on hard-to-find parts. (That is actually one of the reasons we decided on open cell foam for the biofilter rather than other, more specialized materials).
  2. We are a Geek Ranch, not a sewage treatment facility. We don't want to need an engineer on staff to run the system.
  3. We want to minimize electricity use. Ideally, we want a system that can run off an internal battery for, let's say 24 hours.
  4. We would like this design to be useful to others who need a similar system.

Because the buildings are located at 1370 meters of altitude and over 75% of the property is located at least 50 meters lower, we can take advantage of gravity to move the liquid from tank to tank. Thus, the only power requirements are the control system itself and one valve to fill the dose tank.

The control system really has only two required tasks:

  1. Open a control valve at the correct interval and for the correct amount of time to fill the biofilter.
  2. Monitor the system to detect problems such as a clogged biofilter.

It is, however, desirable to produce a log of the operation. This could be used to tell us, for example, when the system was getting near capacity. (You know this from how often the biofilter is being filled.)

The parameters you need to be able to configure for the system are:

  • Size of the dose tank. That is how you can determine how much waste you take from the holding tank to spray on the biofilter.
  • Minimum dose rate
  • Maximum dose rate
  • Size of the holding tank
  • Alarm conditions (such as high level in the holding tank)

Inputs to the control system are:

  • Level in the holding tank
  • Dose tank full
  • Biofilter full (indicating a fault)
  • Settle basin full
  • Battery low
  • Possibly other sensors for possible faults in other areas
  • System start/stop swtich (for cleaning the biofilter, for example)
Outputs from the control system are:
  • Open valve to dose tank
  • Panel indicators to show system status (probably using an LCD or LED display)
    • System on
    • Storage tank level information
    • Dose valve open
    • System fault (could also be audible alarm)
  • Status report information (detailed below)

Error conditions include:

  • Holding tank full
  • Holding tank empty
  • Dose tank remains full (indicating a clogged spray system)
  • Dose tank remains empty (indicating a fault in the dose valve or clogged pipe from the holding tank)
  • Biofilter remains full (indicating it is clogged)
  • Settle basin full (indicating a clogged drain field system)

The status report is just a chronological log showing system events. These are the times when a log entry would be made:

  • System reboot
  • Each time a dose is sent to the dose tank
  • When a fault condition occurs
  • When the fault is cleared
Each entry would contain:
  • Timestamp
  • Event (reboot, dose, fault, fault cleared)
  • Level in the holding tank
  • If this was a dose, time the dose valve remained open to fill the dose tank

For the hardware, I am thinking about the following:

  • VIA EPIA 5000AG motherboard
  • USB (or CF) as "the disk"
  • Plug-in the connector 12V power supply

That is a fan-less CPU board with a 533MHz VIA C3 processor. The parallel port will be used for the I/O lines we need except for the status display. That will be handled through the RS-232 serial port. For configuration and reading the status log, a web-based interface makes the most sense. We can remotely interface to the system using the Ethernet port to connect it to the network (directly or via a WiFi radio) or add a PCI card with communications radio.

Clearly something like Apache is very overkill. A few years ago I designed a radio station controller using Karrigell, a Python-based application framework that includes its own web server. It is small, easy to understand and works great.

Much like the radio station design, the real-time task that controls the system can just read some saved parameters to know what to do and append log records to the log file. In order to prevent excessive updates to a single location in the flash storage, the log can be saved in RAM and then periodically flushed to flash.

That's it—a Linux-controlled sewage plant. While it may not exciting cocktail time conversation, it does seem like a good solution to a real-world problem. Now, we just need to password protect the status system so our geeks won't try flushing their toilet multiple times to see if the level in the holding tank changes.

______________________

Phil Hughes

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

X86 is easy, arm would be cheaper, more rugged and lower power

Mike Taht's picture

You can do this sort of thing with a very basic ARM linux board, if you so chose, for under 150 bucks. As one example among many, I once used the TS-7250 for a similar (less smelly) command and control application.

See
http://www.embeddedarm.com/products/arm-sbc.php

Runs debian, python, etc, etc. Power use can be as low as .25W on the 7260. Rated from -40 -> +85C. Easily solar or battery powered. Plenty of I/O.

I'm not particularly big on the EPxxx series of parts anymore (no floating point worth mentioning) but the price is right.

Interesting stuff u are up

Digestron's picture

Interesting stuff u are up to.
BTW using a trickling aerobic biofilter will cause huge odour and insect pest problems. Come on man, you are spraying waste water like perfume, and flies are gonna feast on the sludge. Take care to locate it at some extreme end of the property.
Ask your friend about an anaerobic treatment system, which will be self sufficient in that it will also produce biogas. As a big establishment, you must be having lot of geek shit all the year round to keep a biogas plant happy.

I wouldn't worry too much

Anonymous's picture

I wouldn't worry too much about odors. Well maintained and operated aerobic treatment systems typically don't produce objectionable odors.

periodically flushed to flash...

stoobie's picture

I couldn't help but chuckle at that!
Actually, as a Maintenance/Facilities worker with a keen interest in all things Linux, I probably find this particular subject a lot more interesting than most people will. Finding innovative ways of dealing with waste water, (gray water especially) is something that my boss has asked me to look into. Although we are planning on setting up an evaporator to deal with most of it, it occurs to me that running it through a Biofilter first might help to further minimize the environmental impact of the resulting sludge. I might even be able to use a fairly common bacteria based drain cleaner as a catalyst for the process.
Thanks!

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState