DIY level switch circuits. Simple DIY water level sensor

DIY liquid level sensor

Liquid level sensor

Hello dear readers. There are many different types of water level sensors. I want to offer you another homemade sensor design.

The task was as follows: there is plastic barrel, which must be closed with a lid, i.e. It was not possible to fence the probe sensors. The barrel had to pump drinking water in automatic mode as it is consumed. There must be visual control of the water level as a percentage, i.e. there should be ten sensors. And most importantly, permission to perforate the barrel was obtained.

So. To make sensors, we will need unnecessary diodes (photo 1). I have a lot of KD202 diodes, so I will make a sensor from them. To begin, carefully, without disturbing the glass insulation, we cut off part of the upper terminal of the diode (anode for KD202). This output is tubular (photo 2). Then, using a drill with a diameter of one and a half millimeters, we drill the body of our diode, starting from the tubular terminal, all the way through. Drill carefully, strictly observing alignment. I drilled at once, in one pass, but you can drill in two times, from different sides (photo 3). Now the most important thing is to shake out all the shavings from the body of the completely damaged diode - there are a lot of them (photo 4), the photo shows that it will take a long time to knock, until the last speck of dust is reached - otherwise the short one is guaranteed. If you have a compressor, then of course everything will be very simple and fast. Next, we take the wire, put it on a fluoroplastic tube with outer diameter 1.5 mm and insert it all into the hole drilled in the diode body. We solder one end of the wire, from the side of the tube, and on the other, from the end of the thread, we secure the resulting terminal with a drop of Supermoment glue or the like, forming a loop for further soldering of the wire (photo 6). It is better to make the internal conductor of the sensor, which will be located inside the container, longer than shown in my photo and increase the length of the tube. The problem is that after the water level drops, a drop of water may remain on the sensor body, which can cause the system to malfunction.
The sensors are connected to the automation board twisted pairs drives, which is even better - with shielded wire. To indicate the level, a circuit with an LED bar is assembled. To install the sensor, a hole is drilled in the container body, how many of them will be up to you. You can only have two - on (lower) and off - upper. The sensor must be installed with auto-sealant to avoid leaks. I think he told me everything. If I catch my eye, I’ll post the diagram right away. Good luck to everyone. Goodbye. K.V.Yu.

When the need arises to control the fluid level, many do this work manually, but this is extremely ineffective, takes a lot of time and effort, and the consequences of oversight can be very expensive: for example, a flooded apartment or a burnt out pump. This can be easily avoided by using float sensors water level. These are devices that are simple in design and operating principle and are affordable.

At home, sensors of this type allow you to automate processes such as:

  • monitoring the liquid level in the supply tank;
  • pumping groundwater from the cellar;
  • turning off the pump when the level in the well falls below the permissible level, and some others.

Operating principle of a float sensor

An object is placed in a liquid that does not sink in it. This could be a piece of wood or foam, hollow sealed plastic sphere or metal and much more. When the liquid level changes, this object will rise or fall with it. If the float is connected to the actuator, it will act as a water level sensor in the tank.

Equipment classification

Float sensors can independently monitor the liquid level or send a signal to the control circuit. According to this principle they can be divided into two large groups: mechanical and electrical.

Mechanical devices

Mechanical valves include a wide variety of float valves for the water level in the tank. The principle of their operation is that the float is connected to a lever; when the liquid level changes, the float moves up or down this lever, and it, in turn, acts on the valve, which shuts off (opens) the water supply. Such valves can be seen in cisterns toilets. They are very convenient to use where you need to constantly add water from central system water supply

Mechanical sensors have a number of advantages:

  • simplicity of design;
  • compactness;
  • safety;
  • autonomy - do not require any sources of electricity;
  • reliability;
  • cheapness;
  • ease of installation and configuration.

But these sensors have one significant drawback: they can control only one (upper) level, which depends on the installation location, and regulate it, if possible, then within very small limits. Such a valve can be sold called “float valve for containers”.

Electrical sensors

An electric liquid level sensor (float) differs from a mechanical one in that it itself does not shut off the water. The float, moving when the amount of liquid changes, affects the electrical contacts that are included in the control circuit. Based on these signals automatic system control makes a decision on the need for certain actions. In the simplest case, such a sensor has a float. This float acts on the contact through which the pump is turned on.

Reed switches are most often used as contacts. A reed switch is a sealed glass bulb with contacts inside. Switching of these contacts occurs under the influence magnetic field. Reed switches are miniature in size and can be easily placed inside a thin tube made of non-magnetic material (plastic, aluminum). A float with a magnet moves freely along the tube under the influence of liquid, and when it approaches, the contacts are activated. This entire system is installed vertically in the tank. By changing the position of the reed switch inside the tube, you can adjust the moment the automation operates.

If you need to monitor the upper level in the tank, then the sensor is installed at the top. As soon as the level drops below the set level, the contact closes and the pump turns on. The water will begin to increase, and when the water level reaches the upper limit, the float will return to its original state and the pump will turn off. However, in practice such a scheme cannot be used. The fact is that the sensor is triggered by the slightest change in the level, after which the pump turns on, the level rises, and the pump turns off. If the water flow from the tank is less than the supply, a situation arises when the pump is constantly turned on and off, while it quickly overheats and fails.

Therefore, water level sensors to control the pump they work differently. There are at least two contacts in the container. One is responsible for the upper level; it turns off the pump. The second determines the position of the lower level, upon reaching which the pump turns on. Thus, the number of starts is significantly reduced, which ensures reliable operation the entire system. If the level difference is small, then it is convenient to use a tube with two reed switches inside and one float that connects them. If the difference is more than a meter, two separate sensors are used, installed at the required heights.

Despite their more complex design and the need for a control circuit, electric float sensors allow fully automated liquid level control.

If you connect light bulbs through such sensors, then they can be used to visually monitor the amount of liquid in the tank.

Homemade float switch

If you have the time and desire, then you can make a simple float water level sensor with your own hands, and the costs for it will be minimal.

Mechanical system

In order to simplify as much as possible design, we will use a ball valve (faucet) as a locking device. The smallest valves (half-inch or smaller) work well. This type of faucet has a handle that closes it. To convert it into a sensor, you need to extend this handle with a strip of metal. The strip is attached to the handle through holes drilled in it with the appropriate screws. The cross-section of this lever should be minimal, but it should not bend under the influence of the float. Its length is about 50 cm. The float is attached to the end of this lever.

As a float you can use two liter plastic bottle from soda. The bottle is half filled with water.

You can check the operation of the system without installing it in the tank. To do this, install the faucet vertically and place the lever with the float in a horizontal position. If everything is done correctly, then under the influence of the mass of water in the bottles, the lever will begin to move down and take a vertical position, and the valve handle will turn with it. Now submerge the device in water. The bottle should float up and turn the valve handle.

Since valves vary in size and the amount of force required to switch them, the system may need to be adjusted. If the float cannot turn the valve, you can increase lever length or take a larger bottle.

We mount the sensor in a container on required level in a horizontal position, while in a vertical position the float valve should be open, and in a horizontal position it should be closed.

Electric type sensor

For self-made sensor this type, except ordinary tool, you will need:

The manufacturing sequence is as follows:

When the liquid level changes, the float moves along with it, which acts on an electrical contact to control the water level in the tank. A control circuit with such a sensor may look like the one shown in the figure. Points 1, 2, 3 are the connection points for the wire that comes from our sensor. Point 2 is a common point.

Let's consider the principle of operation homemade device. Let's say at the moment of switching on the tank empty, the float is in the low level position (LL), this contact closes and supplies power to the relay (P).

The relay operates and closes contacts P1 and P2. P1 is a self-locking contact. It is needed so that the relay does not turn off (the pump continues to work) when the water begins to rise and the contact of the low pressure unit opens. Contact P2 connects the pump (H) to the power source.

When the level rises to upper value, the reed switch will operate and the VU will open its contact. The relay will be de-energized, it will open its contacts P1 and P2, and the pump will turn off.

As the amount of water in the tank decreases, the float will begin to fall, but until it takes the lower position and closes the NU contact, the pump will not turn on. When this happens, the work cycle will repeat again.

This is how a water level control float switch works.

During operation, it is necessary to periodically clean the pipe and float from dirt. Reed switches can withstand a huge number of switchings, so this sensor will last for many years.

In industry and everyday life, there is a constant need to monitor the levels of liquids in containers. Measuring devices are classified as contact and non-contact. For both options, the water level sensor is located at a certain height of the tank, and it is triggered, signaling or giving a command to change the mode of its supply.

Contact devices operate on the basis of floats that switch circuits when the liquid reaches specified levels.

Non-contact methods are divided into magnetic, capacitive, ultrasonic, optical and others. The devices have no moving parts. They are immersed in controlled liquid or granular media or fixed to the walls of tanks.

Float sensors

Reliable and cheap devices for monitoring liquid levels using floats are the most common. Structurally, they may differ. Let's look at their types.

Vertical arrangement

A float water level sensor with a vertical rod is often used. There is a round magnet placed inside it. The rod is a hollow plastic tube with reed switches located inside.

A float with an attached magnet is always located on the surface of the liquid. Approaching the reed switch, the magnetic field triggers its contacts, which is a signal that the container is filled to a certain volume. By connecting contact pairs in series through resistors, you can constantly monitor the water level based on the total resistance of the circuit. The standard signal varies from 4 to 20 mA. The water level sensor is most often placed at the top of the tank in an area up to 3 m long.

Electrical circuits with reed switches may differ even if the mechanical part is similar in appearance. Sensors are located at one, two or more levels, giving a signal about how full the tank is. They can also be linear, transmitting a signal continuously.

Horizontal arrangement

If it is not possible to install the sensor from above, it is attached horizontally to the wall of the tank. A magnet with a float is installed on a lever with a hinge, and a reed switch is placed in the housing. When the liquid rises to the upper position, the magnet approaches the contacts and the sensor is triggered, signaling that the limit position has been reached.

In case of increased contamination or freezing of the liquid, a more reliable float water level sensor on a flexible cable is used. It consists of a small sealed container located at depth with a metal ball with a reed contact or toggle switch inside. When the water level coincides with the position of the sensor, the container turns over and the contact is activated.

One of the most accurate and reliable float sensors is magnetostrictive. They contain a float with a magnet that slides along a metal rod. The principle of operation is to change the duration of passage of an ultrasonic pulse through the rod. The absence of electrical contacts significantly increases the clarity of operation when the interface reaches a given position.

Capacitive sensors

The non-contact device responds to the difference between the dielectric constant of different materials. The water level sensor in the tank is installed outside the side wall of the tank. In this place there should be an insert made of glass or fluoroplastic so that the interface between the media can be distinguished through it. The distance at which the sensitive element detects changes in the controlled environment is 25 mm.

Hermetically sealed capacitive sensor makes it possible to place it in a controlled environment, such as a pipeline or a tank lid. However, it may be under pressure. In this way, the presence of liquid in the closed reactor is maintained during the technological process.

Electrode sensors

A water level sensor with electrodes placed in a liquid responds to changes in electrical conductivity between them. To do this, they are secured with clamps and placed at the extreme upper and lower levels. Another conductor is installed in pair with the longer one, but usually a metal tank body is used instead.

The water level sensor circuit is connected to the pump motor control system. When the tank is full, all electrodes are immersed in liquid and a control current flows between them, which is a signal to turn off the water pump motor. Water also does not flow unless it touches the exposed upper conductor. The signal to turn on the pump is a decrease in the level below the long electrode.

The problem with all sensors is the oxidation of contacts in water. To reduce its influence, use stainless steel or graphite rods.

DIY water level sensor

The simplicity of the device makes it possible to make it yourself. This requires a float, a lever and a valve. The entire structure is located at the top of the tank. A float with a lever is connected to a rod that moves the piston.

When the water reaches the upper limit level, the float moves a lever that acts on the piston and closes the flow through the lower pipe.

As the water flows, the float lowers, after which the piston again opens the hole through which the tank can be refilled.

At making the right choice and manufacturing a water level sensor, assembled with your own hands, works reliably in the household.

Conclusion

The water level sensor is indispensable in the private sector. With it, no time is wasted when monitoring the filling of the tank in the garden, the level in the well, borehole or septic tank. A simple device will start or turn off the water pump in time without the help of the owner. Just don’t forget about its prevention.

To regulate and control the liquid level or solid(sand or gravel) in production, in everyday life used special device. It is called a water level sensor (or other substance of interest). There are several varieties of such devices, significantly different from each other in their operating principles. How the sensor works, the advantages and disadvantages of its varieties, what subtleties you should pay attention to when choosing a device, and how to make a simplified model with a relay with your own hands, read in this article.

The water level sensor is used for the following purposes:

Possible methods for determining tank load

There are several methods for measuring liquid level:

  1. Contactless- often devices of this type are used to control the level of viscous, toxic, liquid or solid, granular substances. These are capacitive (discrete) devices, ultrasonic models;
  2. Contact- the device is located directly in the tank, on its wall, at a certain level. When the water reaches this indicator, the sensor is triggered. These are float, hydrostatic models.

Based on the principle of operation, the following types of sensors are distinguished:

  • Float type;
  • Hydrostatic;
  • Capacitive;
  • Radar;
  • Ultrasonic.

Briefly about each type of device


Float models are discrete and magnetostrictive. The first option is cheap, reliable, and the second is expensive, complex design, but guarantees an accurate level reading. However, a common disadvantage of float devices is the need for immersion in liquid.

Float sensor for determining the liquid level in the tank

  1. Hydrostatic devices - in them all attention is paid to the hydrostatic pressure of the liquid column in the tank. Sensing element The device senses pressure above itself and displays it according to a diagram to determine the height of the water column.

The main advantages of such units are compactness, continuity of operation and affordability. But they cannot be used in aggressive conditions, because they cannot do without contact with liquid.

Hydrostatic liquid level sensor

  1. Capacitive devices - plates are provided to control the water level in the tank. By changing the capacity indicators, you can judge the amount of liquid. Lack of moving structures and elements, simple circuit devices guarantee durability and reliable operation of the device. But one cannot fail to note the disadvantages - this is the necessity of immersion in liquid, and demanding temperature conditions.
  2. Radar devices - determine the degree of increase in water by comparing the frequency shift, the delay between the radiation and the achievement of the reflected signal. Thus, the sensor acts as both an emitter and a reflection collector.

Such models are considered the best, accurate, reliable devices. They have a number of advantages:


The only disadvantage of the model is its high cost.

Radar tank liquid level sensor

  1. Ultrasonic sensors - the principle of operation and the design of the device are similar to radar devices, only ultrasound is used. The generator creates ultrasonic radiation, which, upon reaching the surface of the liquid, is reflected and reaches the sensor receiver after some time. After some mathematical calculations, knowing the time delay and speed of the ultrasound, the distance to the water surface is determined.

The advantages of a radar sensor are also inherent in the ultrasonic version. The only thing is that the indicators are less accurate and the operation scheme is simpler.

Subtleties of choosing such devices

When purchasing a unit, pay attention to the functionality of the device and some of its indicators. Extremely important questions when purchasing a device are:


Options for sensors for determining the level of water or solids

DIY liquid level sensor

You can make a basic sensor to determine and control the water level in a well or tank with your own hands. To perform the simplified version you need:


A do-it-yourself device can be used to regulate water in a tank, well or pump.

I have published quite a few reviews about dacha automation, many of them involved manipulation of water. Often you need to find out the fluid level, or the fact that it is missing. It is convenient to use such information in your crafts aimed at getting rid of routine procedures. To find out the level, many people, including me, use float sensors on reed switches, the main problem when using them is the need to make holes in the container; you must agree, this does not add reliability and versatility to the use of the container, and drilling with subsequent sealing is not the most pleasant manipulation . The device under review (which went on sale recently) is designed to get rid of this, ensuring scalability and configurability of the system... Let's see what kind of beast is under the cut.

The sensors arrived in 14 days and were packaged quite well. The sensors themselves in bags:




Unpacking:


Lace length is about 45 cm:


Dimensions:








The sensor is very light, weight:


The connector has 4 contacts:


From left to right:
- brown - food
- yellow - signal
- blue - earth
- black setting
The sensor has an indicator that, when water is detected, should light up, judging by the seller’s description. The sensor can be powered in the range from 5 to 24 Volts, which is very convenient. The housing is waterproof (ip67), which allows you to place the sensor outdoors or in damp room without caring about its protection. In order not to immediately break the connector, let’s connect the model wiring:


At my dacha I have a homemade adjustable power supply built into the wall, let’s connect the power, 12 Volts:




We bring it to a bottle of water, the indicator lights up:


If you raise it above the water level, the indicator goes out:


By the way, if you lean your hand, the indicator also lights up:


Connect the multimeter to the power cables and make sure it works


Next: minus to ground, and plus to signal output:


We bring it to the bottle and see the supply voltage at the output:


If you remove the sensor, the voltage at the signal output disappears:


The output current of the sensor is in the range of 1-50 mA.
The seller claims that it works when powered in the range of 5-24 Volts, let's try to reduce the supply voltage to 4 Volts:


The sensor works great, let's try to reduce it to 3 Volts:


The reliable operation of the sensors allows us to conclude that it can be successfully used with the esp8266 without any conversions - and this is great news!
At other voltages, the sensor also works well:




I did not dare to go beyond 24 Volts.
Let's set it to 5 Volts:


The sensor reacts to its bag:


The side of the bottle cap also reacts:


Glue it to the bottle with 3M double-sided tape:




The sensor responds well. With two layers of tape, the sensor does not always work:




Consumption is about 5-6 mA:




And of course, we’ll try to apply it in real conditions, working with a controller. Let's take an Arduino Nano as a controller, and also add an indicator LED, so we get the following kit:


We will connect the LED to pin D3 and ground, and the signal output of the sensor to pin A0 (D14 - since we will use it in digital mode), and we will also supply power to the sensor from the controller:


Considering that the sensor is designed for water, when working with it it is very important to protect yourself from contact chatter, for example during waves when the pump is running. Also, I will show how to organize such protection without using delays in the program, the actual code:
// Current sensor state bool SensorState = false; // Shift start time unsigned long SensorStartChange = 0; // Guard interval between state changes unsigned long TIMEOUT = 3000; // Current time unsigned long CurrentTime = 0; void setup() ( // The LED is the output pinMode(LED_PIN, OUTPUT); // Do not turn on the light at first digitalWrite(LED_PIN, LOW); // The sensor is the input pinMode(SENS_PIN, INPUT); ) void loop() ( // Set current time CurrentTime = millis(); // read the sensor boolean CurrentState = digitalRead(SENS_PIN); // if the current state of the sensor differs from the read one if (CurrentState != SensorState) ( // if the state change timer has not started, start if (SensorStartChange == 0) SensorStartChange = CurrentTime; // if the new state took on its value in a time greater than the timeout time if (CurrentTime - SensorStartChange > TIMEOUT) ( // change the sensor state SensorState=! SensorState; // reset the start time of the state change SensorStartChange = 0; // if the current sensor state is 1, then turn on the LED if(SensorState)( digitalWrite(LED_PIN, HIGH); // if the current sensor state is 0, then turn off the LED )else( digitalWrite(LED_PIN, LOW); ) ) // the state change did not take place, reset the timer )else( SensorStartChange = 0;
I commented on all the lines to make everything clear. We initialize the outputs and check the change in the state of the signal output of the sensor with contact bounce protection. In this code, the guard interval is 3000 ms = 3 seconds, often it is advisable to increase this interval to a minute to eliminate the influence of waves from the pump. The code is simple, but on its basis it is easy, for example, to organize protection against dry running of the pump (it is very undesirable for most pumps to operate without water), such devices cost an unreasonable amount of money, but here you can get by with little expense, and even implement automatic recovery of the pump when water and a number of other pleasant goodies - such as indication. To do this, you need to glue such a sensor or somehow secure it closer to the bottom of the container, and connect the pump through a relay controlled by the controller. By default, the pump will be turned on, as the sensor recognizes the lack of water - the controller will turn off the pump, and when water appears, it will turn it on. It is also possible to organize protection against leaks on this sensor, especially considering its moisture resistance; in general, everyone can adapt this simple code to their needs. And most importantly, the sensors can be moved around the container without damaging it - by adjusting the levels to suit you.

Video illustrating the operation of the sensor and controller with the specified code:

I put together this layout for testing different capacities:


I went around with the layout country cottage area, the sensor was able to detect water in all non-metallic containers, including a fairly thick-walled bucket. Therefore, at the current stage I can fully recommend it; time will tell about its reliability.

The sensor response time is about 500 ms. The wall thickness of a dielectric vessel can reach 1 cm.

They asked to check the sensitivity, so this illustration is better than any words:


It will work great as a leak sensor.

Various photos upon request

There’s no way with this at all - left-handed alcohol:


fairy:


thick canister 40 liters:


distilled water:


strong alcohol:




cooler bottle at its thickest point:


white spirit - no:


Through the ceramic toilet tank it is easy to find water:




I opened the lid, the inside was filled with compound, but there was a potentiometer output; after twisting it to the right, the sensor stopped responding to water; after twisting it to the left, it began to respond to lateral finger touches, it looks like this is adjusting the sensitivity.

If there is interest, I will continue to write about my country crafts.
Thanks to everyone who read this review to the end, I hope someone this information will be useful. Everyone has complete control over their water resources and good!

I'm planning to buy +255 Add to favorites I liked the review +181 +378