Liquid level switch with IR liquid level sensor

This project shows how to build a liquid level switch by using an IR liquid level sensor.
An IR liquid level sensor works similar to an IR light barrier, with a transparent plastic cover. When the sensor comes into contact with liquid, the refraction at the interface changes, and with it the strength of the reflected IR beam. It can detect almost any liquid type, oil or water based, and is suitable for harsh environments. The advantage of this sensor is the high accuracy, usually ±1mm, and the robustness, and of course the low price. The disadvantage is that it can only measure at one point, but not continuously.
The here described circuit can be used in many situations, e.g. for level measurement or as a leak detector. The circuit of the level switch is quite simple. The output signal at pin2 of the sensor (P3) is amplified by transistor Q1. The transistor Q1 is turned on, as soon as the output goes from LOW to HIGH, and the relay toggles. It is supplied with 5V DC at P2.
You can visit my GitHub space for more informations.
Github: https://github.com/demutech/Liquid-level-switch.git
The here described circuit can be used in many situations, e.g. for level measurement or as a leak detector. The circuit of the level switch is quite simple. The output signal at pin2 of the sensor (P3) is amplified by transistor Q1. The transistor Q1 is turned on, as soon as the output goes from LOW to HIGH, and the relay toggles. It is supplied with 5V DC at P2.
You can visit my GitHub space for more informations.
Github: https://github.com/demutech/Liquid-level-switch.git
Discussion (1 comment)
Vinay S. Dand 2 years ago
We were using this type of sensors 15 years back.
One biggest problem we encountered was, a layer of grime deposited on the surface of the prismatic component, due to repetitive cycle of immersion to liquid and exposure to inside tank air and whatever dirt particles circulating inside there.
This layer of non transparent film deposit, needs periodic cleaning else sensor stops working
That was the biggest draw back on long term reliable operation of the prismatic sensing liquid sensor.
Best Regards,
Vinay
T. Wang, Demu 2 years ago
sludge are the biggest enemy of this type of level sensor. Depend on purpose and enviroment we can use this or other type of lever sensor, for example inductive or laser sensor for very dirty sample. We also use differential evoluation with multiple sensors to detect errors, and try to keep sensor surface not dried out. But i think, for home use is this sensor a good choice, especially for water based liquid.
Best Regards
Xin