Electronic – Level of a water tank with a microcontroller

measurementmicrocontrollersensor

How do i measure the level of a water tank with a microcontroller?

Best Answer

Well, assuming you are operating here on earth (as opposed to in orbit), you can use a float sensor that you measure using the micro. The question is: Do you need to know the exact level, or do you just need some sort of trip when it gets to high/low?

On the 'trip at specific level' theme, you can get switches like this - generally the float contains some kind of attitude sensing switch. When the water level is lower, the float ends up on it's side, and the switch is 'off', while raising the level forces the float upright, and therefore 'on'. These are often used for sump pumps. They are pretty reliable and very easy to deal with, though you have to be careful to anchor them correctly, and you have to be sure that nothing gets in the way of the float.

If you need to know the actual level, then you've got lots of choices, but it's less simple. You can go with something like an ultrasonic sensor (ultrasound beam firing down from the top of the tank to reflect off the water level).

These guys seem to make level indicators for BIG tanks which consist of a float and an external weight cabled together. As the float rides up and down on the fluid, the external indicator moves appropriately. You could build something similar, with nothing more complicated than photo-cells to read the level (if it's a large tank, or you want lots of granularity, you'd need a lot of photo-cells).

Alternately, taking the cabled float idea, you could put an idler wheel that moves whenever the cable moves, and then attach an encoder to that. This would allow you to track the level with pretty high accuracy.