I'm making a water level detector to control my motor which supplies water in water tank and for that I'm going to use ultrasonic sensor to be attached to tank lid. My question is whether the vapor arising from water inside the tank hamper the overall working of ultrasonic sensor and/or it may be damaged permanently. I can cover complete ultrasonic sensor using hot glue stick but cannot cover its diaphragm as it will block sound waves. Please suggest something.
A friend of mine worked on a liquid level monitoring project, and after many iterations finally abandoned the kinds of sensors you're talking about. Ultimately he just pointed a cheap USB webcam at the thing and used OpenCV and the edge detection algorithm to find the level of the water. Then it's just a matter of doing some math using the dimensions of the container, to figure out how full it is.
If you are using a clear container and if you have the option of using a Raspberry Pi (or a PC, whatever) that can run OpenCV, you might find that option worth exploring.
Majenko, agreed. Use some FM antenna cable, if you can find it. Insulate the lower end by dipping in molten heat glue. Two rods, insulated with heat shrink tubing also works well. Use LM393 dual comparator as Schmitt trigger and inverter. That will oscillate at frequency dependant on the water level. Works well, recalibrate or clean the sensor when accuracy suffers due to being too dirty. should not be necessary more than annually.