The Barrel Raincontroller

This gadget measure the water level of our rain barrel and starts a pump to empty it, when necessary.

The Controller Hardware

The controller is built of the following parts:

Upper left
This a Pi Zero W acting as the controller. Here this code, which is written in Python, is running.
Upper right
This is an ADC-DAC Pi Zero from AB Electronics UK. The first ADC channel converts the analogue signal from the pressure sensor to a digital signal for the Pi Zero W. The DAC part is used to generate a test signal which is used during development of the application. This signal is fed to the second ADC channel.
Lower left
The PCB with the blue "boxes" is a Luxor-Parts relay * 4 board. One channel is, so far, used for controlling the pump.
Lower right
The lower right is a Freescale differential pressure sensor. that do the actual measuring of the water level in the barrel. It is connected to two plastic tubes. One is used for the reference pressure outside. The other is ending at the bottom of the barrel and measures the water pressure which is propotional to the height of the water and thus the level. By using a differential sensor there is no need to calibrate and track the air pressure.

The Sensor Hardware

The sensor is of a very simple design. It is a wooden stick with the plastic tube from the differential pressure sensor attached to it with some cable ties. The reference tube is not on the stick but could of course be. The opening of the tube is facing downwards. The stick is then put inside the barrel. That's it!

Well, that is almost it... The free end of the sensor tube should probably have some kind of membrane in order not to have water getting into the tube and thus slowly get the measured water pressure to reach equilibrium. This is seen very clearly in the rightmost bar above. It could also be that the connection of plastic tube to the sensor is not 100% sealed.