Arduino Project 6 – Measuring a water tank level (SRF05 Ultrasonic Rangefinder/Arduino Mega 2560/Arduino Uno/1.0)

Introduction:

I’m harvesting rainwater from a couple of outbuildings via 110mm underground pipes connected to an underground storage tank. Since I want to stay on top of the water level in the tank and also had a SRF05 ultrasonic rangefinder sitting in a box I thought I’d put it to good use and measure the water level in the storage tank. The result is collected by an Arduino Mega 2560 and uploaded to a mysql database with the help of an ethernet shield but this is obviously optional.

The Basics:

The theory behind this sensor is easy to understand. It works pretty much like a bat hence sends out an ultra sonic pulse, waits for it to come back and depending on the time between the two events we can then calculate the distance between our sensor and the nearest obstacle. I’ve put the sensor including a little bit of perfboard with a switch and some LEDs into an enclosure and mounted it to the inside wall of the tanks collar facing down towards the bottom of the tank/water. To get the sensor connected to the Arduino Mega 2560/Uno there are four cables to connect before we can upload a sketch for testing purposes. Apart from reading from the sensor the sketch also blinks the onboard pin13 LED after each measurement and prints the result to the serial monitor.

 

Connect the sensor as follows:

Red -> Arduino 5V

Yellow -> Arduino digital pin 7

Lilac ->Β Arduino digital pin 8

Black -> Arduino GND

Upload the following sketch, open the serial monitor and you should see some results.

srf05_water_meter_test.ino

 

3. Let’s make it pretty and “put it in the hole”:

I didn’t want to just hot glue the sensor to the inside of the tank due to the humidity in there. Unfortunately I’ve currently run out of the water proof enclosures/cable glands I tend to use so I had to improvise. I also made a little perfboard which includes a switch to cut power to the sensor and board, one red LED to indicate 5V arriving on the perfboard and one yellow LED as a heart beat indicator to flash between measurements. I’ve mounted all this inside the plastic cap of an aerosol can with the LEDs sticking out the top. The two sensor eyes look out the bottom which is sealed with a bit of plastic with holes cut into it to let the sensor eyes poke through. Add a generous amount of hot glue to seal the gaps and we’re ready to mount the sensor inside the collar of the water tank.

The following sketch will print the result to the serial monitor and use the onboard pin13 LED and the perfboard LED as heart beat indicators between measurements.

srf05_water_meter.ino

Thanks for rating this! Now tell the world how you feel - .
How does this post make you feel?
  • Excited
  • Fascinated
  • Amused
  • Bored
  • Sad
  • Angry
FacebookGoogle GmailEvernoteDeliciousShare

Add a comment »8 comments to this article

  1. Your project looks great!
    Have you experienced any differences if you cover the tank? How does the accuracy suffer?

    Cheers
    GS

    Reply

    • My tank is actually buried and always closed. Sensor sits inside the colar of the tank. So far no problems, readings are stable and appear accurate.

      Reply

  2. thx

    Reply

  3. Hi, nice project. I really appreciate your work. I am planning to make a similar type of device which I will use for knowing the water level inside the water tank at my home. Can you please tell me what is the effect of humidity on the readings of the SRF05 ultrasonic rangefinder? As I am very much concerned that in summer season, there will be lot of humidity inside the tank that can (don’t have any proof) miss lead the sensor and it may give a wrong value. Please help me sir if you have some valuable data.

    Reply

    • Hi, sorry for the delay, too much coursework currently for my last semester…
      I’ve had this running for about a year now without problems. Humidity doesn’t seem to cause problems, readings have been steady so far. Just had to make sure the sensor itself is in a nice enclosure to prevent corrosion.

      Reply

  4. will this also convert to a meter and sens to a PC?

    Reply

  5. Can it also let you see the level of water in figures?

    Reply

  6. Hi, I tried to make this project and it worked for me well. i did some minor changes though, like triggering a water pump for automation and so far what i’ve noticed was a bit of change in the readings when the dripping water from source disturbs the surface of the water. could it be possible that the transmitted signal from sensor be affected by the unstable water surface or the water itself affects the signal that bounces back and was received. the project was wonderful, thanks for sharing.

    Reply


*

Copyright © All Rights Reserved · Green Hope Theme by Sivan & schiy · Proudly powered by WordPress


Hit Counter provided by seo company