Arduino Project 11 (2D/3D pictures) – Measuring a water tank level v2 (HC-SR04 Ultrasonic Rangefinder/Arduino Uno/1.0)

1. Introduction:
I made a water level sensor a little while a go to measure the water level in my underground rainwater harvesting tank. Thanks to the Jubilee I found time to finally setup the first part of my Arduino/Xbee wireless sensor network and the first sensor node was also meant to read from this water level sensor. I was somewhat surprised when it only returned 0s so I went and had a closer look. How the slug got into the enclosure is still a mystery to me… but looking at the bright side (after the uncontrolled swearing) I now had a reason to build a much better water level sensor :)

water level sensor vs slug


2. Add a few new bits…:
I’ve based the new sensor on the little perf-board from my sensor in Arduino project 6 but swapped the SRF05 for a HC-SR04 and mounted the result into a little square IP65 enclosure from Maplin.
Last shopping spree on ebay has resulted in me now being in possession of five HC-SR04 ultrasonic range finders which are very much a cheap “alternative to the SRF04. These work with the same code I used for the old sensor and have the same pins.

HC-SR04 top

HC-SR04 bottom

Since Vishay provided me with a whole bunch of free 10KΩ thermistor samples (I’m planning to use these for my soil humidity/temperature sensors for the upcoming Arduino controlled greenhouse v2 project) I added one of those to the perf-board together with the matching 10KΩ resistor.


3. Stir…:
- Remove the angled pin headers from the HC-SR04 and solder wires directly to the sensors control board
- drill two eyes into the top of the enclosure for the sensor eyes
- drill two more tiny wholes into the bottom of the enclosure for the LEDs
- mount sensor and perf-board into enclosure
- pass wire into the enclosure and connect everything up
- seal the holes with hot glue
- mount new sensor into collar of water tank




HC-SR04 Fritzing

tank sensor v2 Fritzing files


4. Serve:

After connecting it to the Arduino Uno everything woked well with the same code as before. So I added a bit more code to read out the additional thermistor which also went well.
The result is now my first wireless sensor node which collects temperature, light level and water level which are then uploaded in 3min intervals by the XBee-to-Ethernet concentrator into my MySQL database :)

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 »4 comments to this article

  1. does the SR05 malfunction owing to the moisture content in the underground tank? Although you have sealed the circuit, the ultrasonic transmitter and receiver are still exposed to moisture. Does it create any problems?


    • Hi Rahul,
      as mentioned in the post a slug managed to get into the box and the slime shorted out the PCB. The SR05 was in need of a good clean but still works ok. I only used a different rangefinder for the new tank level sensor to test the new ones I bought a few days earlier.
      The rangefinder is in a better box now which will hopefully prove more slug resistant. Sensor still works ok, moisture doesn’t seem to cause problems as long as the PCB is kept dry.


      • Hello Peter,

        I am also working on the same project. I want to use it at my home in a closed tank. I have taken the readings from the Ultrasonic sensor(same as yours) and displayed it on the LCD. It is almost complete. The problem I am facing is that during summer water will evaporate and it will form a layer on the opening of transmitter and receiver and it will definitely give the wrong reading. So I need a solution so that the water vapor deposition on my Transmitter and receiver will not affect the working of my system. Please reply me soon.

        Suveer Jacob


        • I’m not suffering from that effect, I guess this might be due to the low average temperatures in the UK and the fact that my tank is buried and hence usually quite cold. I guess what you would need is a way to keep the vapor off the sensor to ensure correct readings? Simply having it in a box and only opening holes for the sensor to take readings might work if you don’t take readings too often? Airflow from a little fan through a box around the sensor might work as well if humidity outside the tank is lower than inside? I might be able to come up with more ideas if you can give me an idea what you your setup looks like…



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

Hit Counter provided by seo company