I am really tired of turning on and off the water pump (a motor that moves water to the tank and the tank is located on the top of the house ) everyday. I am looking forward for a way to automate the water pump so it turns on and off itself according to the water level in the tank. Should I buy such a device or built my own ( I am a Computer Systems engineer so its easy for me to built it.)
A simplification of @spicetraders answer:
Pump up switch
You can do this with a "pump up float switch", which operates at line voltage and thus avoids the need for a relay, separate power supply, etc. These cost tens of dollars.
These often have a plug on the end so they can control a plug-in pump directly (be sure to get one with the appropriate plug type, voltage and power rating for your pump), but they can also be hardwired (just like you would with a regular switch).
Essentially the float operates on a wire, and the only concern is to ensure there's nothing for it to get hung up on:
By adjusting the length of wire, you can adjust the on/off setpoints.
Low water alarm
We used to often install a second float near the bottom of the tank, with a very short distance, that activated a warning light or alarm to indicate "tank almost empty" indicator. This would signal something was wrong with the main switch, pump, water supply, or simply that you were using water faster than the pump could keep up, and could take appropriate action.
Keeping it simple. Get a water tank float switch which is available at many hardware, farm, or marine supply stores hook it up operate your pump motor. Add a relay with appropriate contact value rated for the pump motors voltage and current.
A battery or low voltage transformer would provide power for the driving the relay on and off with float switch's open and closing.
A second float switch could be added to the circuit placed lower in the tank this would allow the upper switch to turn pump off and the lower to turn the pump on. This keeps the pump from cycling every time a small bit of water is used.
Two float switch control.
If you want to make it really cool you can do this (currently working on it)
Basically you install Ultrasonic Sensor on the inside of the water container cover. It measure the distance from the top to the level of the water. This way you get the percentage of water that is currently in the container and display it on the 4 digit screen or LCD (if you later want to add some more fancy stuff). Then you program Arduino to switch the relay (hooked to your water pump) when let's say the water level is below 20% and switch it off when reaches 100%. It so much fun to build one.