Implementing the idea of ​​a wireless level gauge

    In the process of working with the installation, the task appeared to make the level gauge into tanks, because occasionally there have been cases of overflow, and when 8-10 tons of water are in the basement, which used to be a pool for testing torpedoes, then pulling it all out with buckets on the third floor is very difficult. It would seem that there is nothing special in the task, but several difficulties appeared.

    • Tank volume: 2 to 8000 liters
    • Geo-position of tanks: 2nd floor (8 meters underground)
    • Floor ceilings: wood
    • Required level accuracy: ± 10 liters
    • Critical Level Warning
    • Workplace Indication

    Analog option

    The option with probes in extreme positions fell away immediately, due to the lack of information about the current level. The first idea was to implement the comparator on the analog principle. The basis is LM3915N-1, which is used mainly for logarithmic indicators in acoustics. Scheme - nowhere easier.

    The conclusion of the level is a dot or a column on a line of LEDs. On the board you can see one shoulder of the voltage divider, which set the initial level.

    A chain of resistors 1.5 meters long was made as a measuring element, it was also the second arm of the divider at the entrance of mikruhi. The resistor values ​​were selected so that the output voltage varied from 2 to 5 V, required by the datasheet for LM-ki. The chain is immersed in the tube for visual inspection along the tank. Communication with the "probe" - 15 meters of a two-wire wire.

    The principle of the idea was that when the resistors were flooded, some of them were closed with water, respectively, the voltage at the input of the comparator increased, the LED column was filled. The advantages of this idea are speed of implementation and simplicity, minus this light collective farm got out after two to three weeks. The indicator level began to gradually fall, and the level in the tank was normal. With a tuning trimmer, I brought him back to normal until the design stopped working at all. The reason turned out to be transparent, but it was not possible to guess before that. The soldering of the resistor chain was thoroughly electrolyzed and water salts simply gnawed it in several places. The solution to this disgrace is only a float with a magnet and a reed switch for each link or a bunch of Hall sensors that would close the "probe" links, but this is an even larger collective farm and the laboriousness of the construction would obviously increase with the same weak discreteness and accuracy. The circuit has been disassembled.

    Back to the old drawing board.

    As a new implementation, I decided to make a device on the controller. I don’t use Arduino and analogues in principle, it’s more interesting to do everything from scratch, although you can learn something. I work a little with controllers, a year and a half maximum, so I try to learn something new in each development, this is to the fact that much cheaper elements (display, communication) could be used here, but less interesting. Also, do not kick much for the implementation and code.

    A new idea is to use an ultrasonic rangefinder, measure the distance to the surface of the water, and because the sizes of the tanks are known, then to calculate the volume is a simple task.


    All this was embedded in the insulation layer with which the tanks were sheathed, here is the gutted back side of the block which was cut into the tank sheathing: I

    wrote the controller program in C (CodeVision AVR), the client part in Delphi 7.
    The essence of the work is as follows, the timer controller counts the duration of the echo pulses from the ultrasound sensor, recounts it into the distance, then into the volume. Data on bluetooth is transferred to a computer, where there is a graphic output of filling the tank, the distance to the surface and depth. All this is calculated in the controller. From the client, the maximum and minimum boundaries are set to the controller, upon reaching which the red or green LED on the low-light is lit, and in the program on the computer, sound is output and the display of the tank in which the border is reached flashes. The volume factor [l / cm] is also set so that the sensor can be positioned or even put on a tank with a different geometry. All parameters are stored in EPPROM. The system has two channels, data is transmitted from two tanks simultaneously. At the time of the shooting, one tank was lowered and I turned off this channel,

    Initially, the idea was to transmit data by wire, but it was problematic to lay 15 meters of wire past the ceilings. By air, the distance turned out to be about 8 meters. The receiver is in the computer, in a special cabinet near the mine, the control system of the installation, which is powered by experimental tanks spaced, one operator’s place next to the mine and the pipeline, the second is taken away. The sensors themselves are installed in a plastic pipe with a diameter of 100 mm inside the tank so that when the water is drained into the tanks, they do not splash and the level changes smoothly, there are no waves and ripples on the surface, just in case. The plus of this is that the radiation pattern of the ultrasonic sensor has narrowed. Unfortunately, there is no photo of the installation site, the lids of the tanks are already screwed onto 40 small bolts and weigh unmeasured, I won’t move it myself + they started a repair now.

    Display type in thermal insulation (one channel):

    I forgot to remove the film

    Globally, in addition to solving the problem of level control in underground tanks, I also developed a little, touched the bluetooth module, added libraries for graphics, touched an ultrasonic sensor, and progress is always well.

    You can fill it all with silicone or compound, but nothing has oxidized so far at a humidity of 60-70%, the Chinese write IP68 on ultrasonic sensors themselves, who knows, maybe they really, I filled it with hot glue in a circle anyway.

    That such a system turned out, it works properly, maybe it will come in handy for someone, it is quite applicable at the cottage in the well and in other hard-to-reach places. The main thing is the idea.

    He spontaneously merged everything that was, MK firmware, PROTEUS files, raw files on Delphi 7, compiled executable, all libraries, in short, the entire project folder. [archive password: idkfa]
    AVR LevelMeter Graphic LCD 2ch BLUETOOTH.rar [2.6 Mb]

    Also popular now: