Underwater distance measurement/Sensing
If the requirement for hacking a ready-made device can be dispensed of, a low cost and simple to implement range sensor option is:
- Use a 405 nanometer blue laser as a projection element. These are available for around $13 on eBay: Use epoxy potting compound to waterproof the module - the lens mounting is already waterproof, don't use epoxy on the lens.
- Alternatively, modify an even cheaper (less than $5 on eBay) 405 nm 5 mW laser pointer to waterproof it and pull power leads out. You can try the finger of a transparent rubber surgical glove for a workable waterproofing option.
- For extended coverage: Split the laser beam using a parallel prism - a 5-way split would be ideal for 5 beams in a flat plane.
- Use a phototransistor or photodarlington as a sensing element - choose a part with good sensitivity at the blue end of the visible spectrum
- Mount the sensing element close to the laser, pointing in the same direction as the laser.
- To improve selectivity, put a violet-blue gel filter in front of the phototransistor to block or significantly attenuate incident light which is away from the desired (405 nm) part of the spectrum.
- As the laser + sensor combination approaches any reflective or dispersive surface, the intensity of blue (405 nm) light incident on the phototransistor increases. This occurs even if there is no specular reflection from the surface, because the collimated laser beam(s) still gets reflected back in the source direction due to speckle pattern formation.
- Unfortunately this approach will not work if the water has significant bubble activity, or suspended particulate matter, since the speckle pattern intensity will remain high even without a solid reflecting surface ahead.
- Despite this sounding a bit counter-intuitive, the reflected signal intensity in water of a 1 mW blue laser is typically strong enough for detection by a phototransistor even though there is no perpendicular reflecting surface on which the laser is incident - whereas a direct reflection is likely to overwhelm the phototransistor, so appropriate precautions are needed.
- Calibrate the received signal intensity on the phototransistor for distance, and you have your underwater proxmity sensor.
- Don't forget to use epoxy potting to waterproof all exposed circuit traces, components, wires and connections.
Why this works where infrared LEDs or lasers wouldn't:
- The red end of the visible spectrum (and more so the Infrared) is absorbed by water about 100 times as strongly as violet/blue: from this article
Why this works with a laser but not necessarily with UV LEDs:
- The light from an LED is not collimated, hence does not get significantly intensified in the return direction, whereas a combination of reflection and diffraction causes significant pulsed intensification of such returned signal for a collimated laser beam, by speckle pattern formation.
This Underwater Ultrasonic Sensor for distance measurement may be just what your looking for. As Michael Karas pointed out, that ultrasonic sensor is rated from 30cm-3m, sorry. However, this site may have another suitable option.
You could create your own module with an underwater transducer. You should read this if you haven't already.
Any easy way that I can hack a fish finder, or create a simple sensing unit using a MCU and a sensor???
I'm not very familiar with fish finders, but I would bet you could get a real cheap fish finder that has a data output and try to mod that to work with your project. However I think the range will be to large for you, since you only need 20cm, a fish finder (or it's transducer) will most likely not be too accurate at this distance.
This is the cheaper version of the first module I linked to, (at least I think it is) Waterproof Ultrasonic Sensor Distance Measuring Module is not meant to be used under water but it may work for you depending on the depth of your device.
I have run into this water depth measurement before and found that a pressure sensor and a bubbler (i.e., a fish bait tank airator) works nicely as demonstrated and explained in this Floating Dock Patrol YouTube video https://youtu.be/0CRarPCHXk0 . The micro in the Floating Dock Patrol is one from Parallax (Raspberry Pi would work too). I find Mr. Ghosh's answer very interesting and I am going to try it (I'm in the process of procuring the parts for the laser idea). I tried hacking a fish finder but the accuracy of a fish finder in shallow water is poor and lots of noise. Ultra sonic sensors don't work as they just bounce off the water. The bubbler works the best so far but the blue laser might be a simpler approach.