Electronic FirstFlush System
A first flush system for collecting roof rainwater, allows initial rainfall coming off the roof to flush the system of debris before water is diverted into a collection tank.
I designed this system to switch the flow of water from drain to tank using a low voltage electric valve, when the calculated volume of rainfall off the roof is above a set value, currently 100 Litres, switching the valve back again when the rain has ceased for a period, currently 1 hour.
Whilst there are a few ways of achieving something similar to the above, usually either with a mechanical ball valve, or ball valve plus electric timer, the system that I designed is much more precise and adjustable.
The key sensor is a Davies tipping bucket rain gauge, the black funnel shaped device shown in the foreground of the image above. Each bucket tip represents 0.2 mm of rain. A mains powered, battery backed ESP32 WiFi board counts bucket tips, sending the count to an MQTT broker on the local LAN.
A Python service on the LAN uses the tip count to estimate the volume of water flowing off the roof, based on the roof collection area, updating the current 2 minutes slot out of 30 slots per hour. The current 30 slot values are published via MQTT. A node red application then looks at whether the litres per hour off the roof threshold has been exceeded, currently 100 Litres and if so sends an MQTT command that is read by the same ESP32 WiFi board which then closes the valve, which diverts water to the collection tank. When the rainfall drops currently to zero over an hour an MQTT message is sent to open the value so that water is diverted into a storm drain.
Tank Level and First Flush Dashboard
An html dashboard was developed to show water tank levels (not all level sensors may be operational right now), roof rainfall volumes and first flush valve status. The rainfall graph shows litres per 2 minutes intervals for the last hour.
Repository for this dashboard web page is at: https://github.com/segalnz/tankdisplay




