Hi Lalit,
Yes, using water as a conductor can often give problems.
Such level detectors are widely used, their usual name
over here, England, is 'no-flote' sensors.
Problems such as corrosion, from applications that use
more than a few milliamps, and problems from straggly
bits dangling down and making a conductive path to the
water surface, also a build-up of surface floating
material around the high level mark, even floating dust
seems to cling to the no-flote sensors.
Regular cleaning seems to be the only reliable answer.
The best arrangement i have seen is a bubbling pipe.
Slow air release into the bottom of the tank to be
monitored. The pressure is used to sense the level. Only
plastic tubing goes to the tank, all the electrics are
separate. Needs a small pump like a fish tank pump.
Very reliable. Very little trouble. Tubing has to go
up and over, so that it won't syphon in case of power
failure.
Here is one possible wiring set-up using floats and
contacts. Floats and contacts is probably the most usual
set-up for this job.
If the supply is A.C. use an A.C. relay.
The relay is basic.
The circuit is simple.
If you want to use electronics and transistors and chips
then you will need to get a D.C. power supply to run them.
I have not seen or heard of Opto-electronics being used
for this type of work, but i have heard of Sonics being
used to do this. I think it was where the liquid was an
aggressive chemical, the principle is just echo sounding
and is used on many things, from parking cars to measuring
rooms for estate agents (realtor salesmen ?).
There are also problems with sonics, one of them being
cobwebs, which can cause wrong readings, and moths and flies
which can congregate around the sender/receiver causing
wrong readings.
In my experience, easiest is best. Just use floats and
contacts, inspect it every week or two, problems are easy
to spot and easy to fix. Problems with complex systems can
be a headache.
The accompanying diagram is only one workable circuit,
there are many variations. If the pump is a 3 phase unit,
the relay would need extra contacts.
If a 'Contactor' is to be used, the circuit is simple
enough to use the auxiliary contact.
Best of luck with it,
John