Cytron received an inquiry from our precious customer today. The question is about measuring water level using Analog Distance Sensor (SN-GP2Y0A21). He (i think is a ‘he’) asked whether the infrared beam will penetrate the water, or instead, reflect by the water surface. That’s an interesting question which has never come over my mind. So I decided to conduct a quick experiment after my lunch.
This is the hardware settings. I’m running the test in our pantry. You can see the water dispensers at the two sides of the photos and that’s my water bottle with IFC cards standing next to it. I’m using IFC-MB00 (main board), CP04 (for analog display), AI08 (to read analog value from the sensor) and EB02 (frankly speaking, it’s for the sensor to reach the opening of the bottle). Analog Distance Sensor is hanging at the opening of the bottle.

For the software part, I download the sample code provided in IFC-AI08 product page, include some necessary files required by IFC system and that’s it!
Photos are snapped while adding filtered drinking water to the bottle. The photos below show the analog reading and the water level of the bottle. Yes, it can detect the water level! The values show that the sensitivity is not high because the sensor’s detecting distance is ranged from 10cm to 80cm and I didn’t rescale the analog value in this experiment.







rebel
February 2nd, 2010 at 11:00
wow.. nice work.!
Shahrul
February 6th, 2010 at 10:21
Good testing and I agree that this is not exactly sensor to detect water level.
kaku
February 8th, 2010 at 19:41
thanks for the experiment.it help us a lot.so can i ask one question. If i use an IR distance sensor with longer range, is it the sensitivity is high?how about use a ultrasonic sensor.is it suitable for detect level of water?
kiate
February 22nd, 2010 at 13:47
I think ultrasonic should have no problem to detect the water level. For IR distance sensor with longer range, the sensitivity will be lower.
tph
February 28th, 2010 at 12:49
so, it means that the ir is refracting on the water surface.