I have rain water coming regularly into my cave. I figured out (some) of the leaks.

There is a concrete tank inside the cave collecting water from a drain around the house, from there a pump sends the water back to the sewer. So, as a workaround until I can plug the leaks, I put a bucket where the water is coming with a plastic pipe to drive it to the tank. The cave has low and high pipes for aeration, and the main leak I have identified is inside a low pipe, this is why it's difficult to plug.

Anyway, it was an opportunity like any other to put some useless computing in the thing (as my wife would state it), so I decided to monitor the amount of leaking water that was collected through the bucket. Since I had a DHT22 sleeping on my desk, I decided to monitor also the temperature and humidity inside the cave.

I have an all-purpose raspberry pi inside the house that (among other things) already supports mrtg / rrdtools / lighttpd to monitor and display the house network, so it was a natural point to collect the data and display it on the house internal web site. It's not in the cave, however, so I needed a method to move the data from the arduino to the rpi. Fortunately, since the house was built for me, the cave is prewired with an ethernet port that goes to the house main ethernet switch. Unfortunately, since I'm an unlucky idiot, the Ethernet port is at the exact opposite of the pump, 20 meters from where the action happens. Of course, to transmit data, I needed an ethernet card on the Arduino, but I happened to have one, so I used it.

The physical set inside the cave

The waterflow sensor

The ethernet card

The DHT 22

Nothing special about that, but we'll see more in the software section.

The computing set

The software

On the Arduino

(this is where things get a bit more interesting).

On the server

  • Special user
  • Daemon start