Quote Originally Posted by mpgmike View Post
I'll start where Dave led us and raise a few more questions. I create controllers for other people. I ask lots of questions about what they are attempting to accomplish. What determines whether you want a light on or off? What determines whether you want a pump on or off? Is there a target for an analog (PWM) variable output? Many times, the whole process can be automated with absolutely no user input based solely on desired results. Knowing what determines whether a given output should be "1" or "0" (ON or OFF) inspires the addition of an input the PIC can use to make the decision automatically. If you are looking for random changes in outputs, switches and/or pots can generate simple inputs.

If you could show us an algorithm (flow chart) that describes the ideal scenario, a better solution may become blatantly obvious.
You are correct and what you suggest is exactly my strategy. However, it is necessary to have simple means to correct in response to unforeseen circumstances. I often will cancel dosing when I am on vacation, or in response to algae growth. I would guess that 75 - 90% of what I rely on the controller to do is automated. These are time based and there is little logic else to consider.

I monitor certain basic functions - temperature, water level and flow, and light level (the florescent bulbs I use degrade in output over time). I also track the lifespan of my U/V system, but most of these are alarms or indicator type lights and are not complicated function type decision makers. I suspect if one had several tanks or, if one were far more advanced in knowledge of programming... Besides, I rather enjoy "getting my sleeves wet" and only for the safety and security of my tenants am I mostly concerned.