Can an infrared sensor detects water ?


Joined Nov 30, 2010
The circuit provided will not work, but I believe you can pulse the infrared like you would pulse a visible light or ultrasound and get a bounce measurement to the surface of a water level. Problems:
1) Measuring short distance with light is very fast electronics.
2) I personally don't know how to do this job.
3) You did not say you wanted to find the level (or the surface)of the water.


Joined Dec 26, 2009
Maybe is the best answer...
Infrared is good at detecting a thermal difference, the trouble with water is that it "masks" everything immersed in it (to some extent).
But should you use a float that would reflect infrared (tinfoil works, but doesn't float very well) - you could use an IR LED and detect the reflection and use it as a difference in the ambient temp of the surrounding water.


Joined Dec 26, 2009
Oh yea, I forgot to mention. Water absorbs infrared energy, so you would have to have a lot to raise the water temp, which would still result in even temp dispersal... back to square one. Or the idea of a float.
In reality, you could adjust the sensitivity and trigger with a small reflection, so the float's position on the water surface wouldn't matter that much, just make sure the beam width on the IF emitter is wide enough (or that you use more than one IR LED).


Joined Feb 11, 2008
I did some tests in a thread on this forum or the other forum using one of the Sharp "GP2" infrared distance sensors, like they use in hobby robotics.

It was able to detect the top surface of the water sometimes, but other times would get the bottom of the bucket. It could see the water, but was not really reliable and was very sensitive to angle and slosh.

This was fixable by floating a flat piece of foam on top of the water or a heap of styrofoam balls or packing chips etc.

As for calibration the Sharp GP2 sensors have datasheets with the calibration curve, or you can use software calibration like the simple PIC one in C here;

Rich (BB code):
void calc_distance(void)
  // from the Sharp datasheet the analog voltage is
  // the inverse of distance, so distance can be calculated
  // d = (1 / volts) then just scaled to suit the sensor

  // load ADC value in 16bit math var
  math = ADRESH;
  math = (math * 256);
  math += ADRESL;

  // now invert it; (1 / volts) use (6050 / volts) for scaling
  math = (6050 / math);
  if(math >= 2) math -=2;     // fix linear error
  if(math > 99) math = 99;    // max limit at 99cm

  // convert from 0-99 to 2 decimal digits, 0-99cm
  while(math >= 10)
    math -= 10;
  cm = math;
Sharp GP2 project is shown at the bottom of this page;