Automated Level Control

This page has examples of using redstone etc to maintain tank or battery buffer levels.