Rain Water Collection and Management System - SHProject 4

by DeviceCtrl in Circuits > Arduino

173 Views, 1 Favorites, 0 Comments

Rain Water Collection and Management System - SHProject 4

PXL_20240615_211429776-e.jpg
PXL_20230215_032851415.jpg
sherman_135_gallon_leg_tank_200.jpg

This project will use an Arduino to help manage a rain water collection system. It originally began as method to deal with water seeping in the basement. It evolved into a gray water storage system used to water plants, create small pond with a fountain and supply water to flush toilets. The Arduino monitors the water level using horizontal liquid float switches and the water pump using a voltage detector sensor. And because the water tanks are outside, the temperature.

Supplies

arduino uno pinout.png

Arduino Uno

4 Channel 5V Relay Module with Opto-coupler

2) DS18B20 Temperature and sensors

Voltage Detection Sensor

7) Water Level Horizontal Liquid Float Switch

1k, 5k, 10k, 22k, 47k, 68k, 82k, 100k resistors

1 medium project box

1 small project box

25 feet Low Voltage Landscape Wire Outdoor Lighting Cable

1 very large water tank (or what ever size you like)

Downloads

Arduino Schematic

cistern_Arduino_schematic.png

I like to begin my Arduino projects by mocking up the wiring using bread boards and jumper wires. Adding each component one by one, ensuring that I have hooked them up correctly and they are giving the expected results. So follow the above diagram to construct the device.

Rain Water Collection Tanks

PXL_20230216_204702643.jpg
resister_ladder.png
landscape-wire.png
FSDLW3KLXD9SM9L.jpg

I assume you have already committed to a sizable tank or tanks to collect rain water. My root cellar had a drain in floor. It was underground but still exposed to the elements and seemed a good place to house three 100 gal tanks. The problem was how to monitor the water level. I decided to use Water Level Horizontal Liquid Float Switches.

I placed float switches at the base and at the midpoint of each tank. Then I placed a 7th float switch at the very top. I then used a very clever Instructable (Multiple buttons on 1 analog pin) to wire all my float switches to a small waterproof project box. Then I ran a outdoor wire from this harsh environment to my workshop where the Arduino will be mounted in its own project box.

  • When switch 7 closes = 100% full
  • When switch 7 opens = 83.3% to 99%
  • When switch 6 opens = 66.7% to 83%
  • When switch 5 opens = 50% to 66.6%
  • When switch 4 opens = 33.3% to 49%
  • When switch 3 opens = 16.7% to 33%
  • When switch 2 opens = 0.1% to 16.6%
  • When switch 1 opens = Empty

Float Switches and the Resistor Ladder

F8XQWC3G1BBBYQT.png
float_switch.png
Screenshot_20240720_183508.png

In order measure the water level, we monitor 7 float switches. Instead of 8 wires (1 for each float switch plus ground wire) we can use 2 wires by building a set of resistors in series. As each float closes, it addes a resistor in series. And, each time the total resistance is reduced. By using stratigic resistor values for each float switch we can dictate the expected Arduino values and space them evenly along the range Arduino analog pin can read. This will give a high confidence when calculating which float swithes are open and which are closed.

Monitor the Gray Water Pump

Wiring-Voltage-Sensor-to-Arduino.png
PXL_20240616_191900242.jpg

This rain water collection tanks are connected to a filter and a 12vdc pump. This is now considered a gray water system, because it is not potable (ie Not fit for human consumption). At the pump, connect the Voltage Detection Sensor at ground and at the 12vdc feed to the pump. When ever the pump is activated the sensor will read about 12vdc to 13vdc. When the pump is off it reads 0 voltage. Knowing how often pump runs will give an estimate of how much water is being used.

Combined with reading the float switches you can calculate how much water is in the tanks within 1 gallon.

There is a great site that explains the Voltage Detection Sensor in more detail: Interfacing Voltage Sensor with Arduino

DS18B20 Temperature Sensor - Stainless Steel

connect-multiple-ds18b20-sensors.png
817nwaMSNbL._AC_SL1500_.jpg

The nice thing about these temperature sensors is that you can connect multiple sensors to the same digital pin. And you still only need one resistor. (see the images above) In addition, they come in different lengths and in-cased in water-resistant housings. The DS18B20 requires a 4.7k ohm resistor between power and the signal wire.

It's smart to start with the DS18B20 sensors because you will need to discover each device id using the example code installed when you down the Arduino library Dallas Temperature. Look for file Tester.pde or oneWireSearch.ino

There are 2 temperature sensors. One will just be mounted outside where the water tanks are. The second is mounted just on the other side of the wall in the basement. that way we can tell if the water tanks are subject to freezing conditions.

Even during the winter when temperatures were -6 degrees C (20 deg F), the root cellar was 4 deg C (39 deg F)

Downloads

Wire Relays Garden Features

PXL_20240615_211503081.jpg
LED_flood-lights.png
12vdc_fan.png
low_voltage_lighting.png

Another problem to solve was water coming in the window well during heavy rain. I created a water feature inspired by an Instructables How to Build a Fish Pond or Garden Pond

This artificial pond collects water and pumps into the rain water tanks. It has a fountain that is connected to the Arduino thru relays so I can turn it on or off remotely. I did the same for some backyard patio lighting. Since the Arduino is located in my studio/workroom I also connected a floor fan, just to have the convenience of controlling it remotely also.

Arduino Ethernet Shield

61aiitos81L._AC_SL1000_.jpg

While preparing and mounting all the components, don't forget to first mount the Ethernet shield to the Arduino Uno. During the renovation of my home, I had the foresight to install Cat6 Ethernet cable and low-voltage wiring everywhere. If an Ethernet cable is not available, Arduino makes a WiFi shield for the Uno.

Project Box

81xNuT43cNL._AC_SL1500_.jpg
FSDLW3KLXD9SM9L.jpg

Once you have attached all the sensors and bench tested them working individually and together, its time to mount all the components in a project box. I also use thru panel connectors (called: cable gland) to maintain the box's integrity when cables are connected.

Polling and Commanding the Unit

FHRDZ5BLXDJ6XWO.png

Since this unit will be installed in ceiling, it's not practical to connect a display. Instead, I have my PC poll the rain water controller every minute and store the readings in a SQL database. This gives me both up-to-date environment data and water level and disposition of the lights, fountain and fan.

I decided to use UDP protocol instead of TCP. Arduino's Ethernet/WIFI library include software to communicate using UDP. Every minute my PC sends a timestamp in the form of r2406131422054 - this translate to 2024-06-13 14:22:05 4=Thursday (ie day of the week)

Sending a timestamp to my Arduino devices is very handy. It allows the device to know the date and time (within a second) without any additional code, NTC sync or RTC device.


If the device receives this string, it immediately responds with a tab delimited string of the current sensor readings. like: 795\t67\t4\t106\t00

This is made up of Temperatures, which switch is closed or water level, pump voltage and light and fountain relays