Corrosion-resistant soil moisture sensor, suitable for dacha automation. Humidity sensors - how they work and how they work Indicators and regulators of soil moisture

Many gardeners and gardeners are deprived of the opportunity to daily care for planted vegetables, berries, fruit trees due to workload or vacation. However, plants need timely watering. With the help of simple automated systems, you can ensure that the soil on your site maintains the necessary and stable moisture throughout your absence. To build a garden automatic watering system, you will need a main control element - a soil moisture sensor.

Humidity sensor

Humidity sensors are also sometimes called moisture meters or humidity sensors. Almost all soil moisture meters on the market measure moisture using a resistive method. It's not really exact method, because it does not take into account the electrolysis properties of the measured object. The readings of the device may be different at the same soil moisture, but with different acidity or salt content. But for experimental gardeners, the absolute readings of the instruments are not as important as the relative ones, which can be adjusted for the water supply actuator under certain conditions.

The essence of the resistive method is that the device measures the resistance between two conductors placed in the ground at a distance of 2-3 cm from each other. This is normal ohmmeter, which is included in any digital or analog tester. Previously, such instruments were called avometers.

There are also devices with a built-in or remote indicator for operational monitoring of soil conditions.

Easy to measure conductivity difference electric current before watering and after watering using the example of a pot with a house aloe plant. Readings before watering 101.0 kOhm.

Readings after watering after 5 minutes 12.65 kOhm.

But a regular tester will only show the resistance of the soil between the electrodes, but will not be able to help with automatic watering.

Automation operating principle

In automatic watering systems, the rule is usually “water it or don’t water it.” As a rule, no one needs to regulate the water pressure. This is due to the use of expensive controlled valves and other unnecessary, technologically complex devices.

Almost all humidity sensors on the market, in addition to two electrodes, have a comparator in their design. This is the simplest analog-to-digital device that converts the incoming signal into digital form. That is, at a set humidity level, you will receive one or zero (0 or 5 volts) at its output. This signal will become the source for the subsequent actuator.

For automatic watering, the most rational option would be to use a solenoid valve as an actuator. It is included in the pipe break and can also be used in micro-drip irrigation systems. Turned on by supplying 12 V.

For simple systems operating on the principle “the sensor is triggered - the water flows”, it is sufficient to use the LM393 comparator. The microcircuit is a dual operational amplifier with the ability to receive a command signal at the output at an adjustable input level. The chip has an additional analog output that can be connected to a programmable controller or tester. An approximate Soviet analogue of the LM393 dual comparator is the 521CA3 microcircuit.

The figure shows a ready-made humidity relay along with a Chinese-made sensor for only $1.

Below is a reinforced version, with an output current of 10A at an alternating voltage of up to 250 V, for $3-4.

Irrigation automation systems

If you are interested in a full-fledged automatic watering system, then you need to think about purchasing a programmable controller. If the area is small, then it is enough to install 3-4 humidity sensors to different types glaze. For example, a garden needs less watering, raspberries love moisture, and melons need enough water from the soil, except during extremely dry periods.

Based on your own observations and measurements of humidity sensors, you can approximately calculate the cost-effectiveness and efficiency of water supply in areas. Processors allow you to make seasonal adjustments, can use the readings of humidity meters, and take into account precipitation and the time of year.

Some soil moisture sensors are equipped with an RJ-45 interface for network connection. The processor firmware allows you to configure the system so that it will notify you of the need for watering through social media or SMS message. This is convenient in cases where it is impossible to connect automated system watering, for example, for indoor plants.

Convenient to use for irrigation automation system controllers with analog and contact inputs that connect all sensors and transmit their readings via a single bus to a computer, tablet or mobile phone. The actuators are controlled via a WEB interface. The most common universal controllers are:

  • MegaD-328;
  • Arduino;
  • Hunter;
  • Toro.

These are flexible devices that allow you to fine-tune your automatic watering system and entrust it with complete control over your garden.

A simple irrigation automation scheme

The simplest system irrigation automation consists of a humidity sensor and a control device. You can make a soil moisture sensor with your own hands. You will need two nails, a 10 kOhm resistor and a power source with an output voltage of 5 V. Suitable from a mobile phone.

A microcircuit can be used as a device that will issue a command for watering LM393. You can purchase a ready-made unit or assemble it yourself, then you will need:

  • 10 kOhm resistors – 2 pcs;
  • 1 kOhm resistors – 2 pcs;
  • 2 kOhm resistors – 3 pcs;
  • variable resistor 51-100 kOhm – 1 pc.;
  • LEDs – 2 pcs;
  • any diode, not powerful - 1 pc.;
  • transistor, any average power PNP (for example, KT3107G) – 1 pc.;
  • capacitors 0.1 microns – 2 pcs;
  • microcircuit LM393 – 1 piece;
  • relay with an operating threshold of 4 V;
  • circuit board.

The assembly diagram is presented below.

After assembly, connect the module to the power supply and soil moisture level sensor. Connect a tester to the output of the comparator LM393. Using a construction resistor, set the response threshold. Over time, it will need to be adjusted, perhaps more than once.

The circuit diagram and pinout of the LM393 comparator is presented below.

The simplest automation is ready. It is enough to connect an actuator to the closing terminals, for example, an electromagnetic valve that turns the water supply on and off.

Irrigation automation actuators

The main actuator for irrigation automation is electronic valve with and without water flow adjustment. The latter are cheaper, easier to maintain and manage.

There are many controlled cranes and other manufacturers.

If there are problems with water supply in your area, purchase solenoid valves with flow sensor. This will prevent the solenoid from burning out if the water pressure drops or the water supply is cut off.

Disadvantages of automatic irrigation systems

The soil is heterogeneous and differs in its composition, so one moisture sensor can show different data in neighboring areas. In addition, some areas are shaded by trees and are wetter than those located on sunny places. Proximity also has a significant impact groundwater, their level in relation to the horizon.

When using an automated irrigation system, the landscape of the area should be taken into account. The site can be divided into sectors. Install one or more humidity sensors in each sector and calculate its own operating algorithm for each. This will significantly complicate the system and it is unlikely that you will be able to do without a controller, but subsequently it will almost completely save you from wasting time awkwardly standing with a hose in your hands under the hot sun. The soil will be filled with moisture without your participation.

Construction effective system automated irrigation cannot be based only on readings from soil moisture sensors. It is imperative to additionally use temperature and light sensors and take into account the physiological need for water of plants different types. Seasonal changes must also be taken into account. Many companies producing irrigation automation complexes offer flexible software For different regions, areas and crops grown.

When purchasing a system with a humidity sensor, do not fall for stupid marketing slogans: our electrodes are coated with gold. Even if this is so, then you will only enrich the soil with noble metal in the process of electrolysis of plates and the wallets of not very honest businessmen.

Conclusion

This article talked about soil moisture sensors, which are the main control element automatic watering. The principle of operation of an irrigation automation system, which can be purchased ready-made or assembled yourself, was also discussed. The simplest system consists of a humidity sensor and a control device, the DIY assembly diagram of which was also presented in this article.

The device that measures humidity levels is called a hygrometer or simply a humidity sensor. IN Everyday life humidity is an important parameter, and often not only for the ordinary life, and for various equipment, and for agriculture (soil moisture) and much more.

In particular, our well-being depends a lot on the degree of air humidity. Particularly sensitive to humidity are weather-dependent people, as well as people suffering from hypertension, bronchial asthma, diseases of the cardiovascular system.

Even in very dry air healthy people feel discomfort, drowsiness, itching and irritation of the skin. Often, dry air can provoke diseases of the respiratory system, starting with acute respiratory infections and acute respiratory viral infections, and even ending with pneumonia.

At enterprises, air humidity can affect the safety of products and equipment, and in agriculture clearly the influence of soil moisture on fertility, etc. This is where the use of humidity sensors - hygrometers.

Some technical devices are initially calibrated to strictly required values, and sometimes in order to fine-tune the device, it is important to have an accurate humidity value in environment.

Humidity can be measured by several of the possible quantities:

    To determine the humidity of both air and other gases, measurements are carried out in grams per cubic meter when talking about the absolute value of humidity, or in RH units when talking about relative humidity.

    For measuring the humidity of solids or liquids, measurements as a percentage of the mass of the test samples are suitable.

    To determine the moisture content of poorly mixed liquids, the units of measurement will be ppm (how many parts of water are in 1,000,000 parts of the weight of the sample).

According to the principle of operation, hygrometers are divided into:

    capacitive;

    resistive;

    thermistor;

    optical;

    electronic.

Capacitive hygrometers, in their simplest form, are capacitors with air as a dielectric in the gap. It is known that the dielectric constant of air is directly related to humidity, and changes in the humidity of the dielectric lead to changes in the capacitance of the air capacitor.

More difficult option capacitive sensor humidity in the air gap contains a dielectric, with a dielectric constant that can vary greatly under the influence of humidity on it. This approach makes the sensor quality better than simply having air between the capacitor plates.

The second option is well suited for measuring water content in solids. The object under study is placed between the plates of such a capacitor, for example, the object can be a tablet, and the capacitor itself is connected to an oscillatory circuit and to an electronic generator, while the natural frequency of the resulting circuit is measured, and from the measured frequency the capacitance obtained by introducing the test sample is “calculated.”

Of course, this method also has some disadvantages, for example, if the sample humidity is below 0.5%, it will be inaccurate, in addition, the sample being measured must be cleared of particles with high dielectric constant, and the shape of the sample is also important during the measurement process; it should not change during the course of the study.

The third type of capacitive humidity sensor is the capacitive thin film hygrometer. It includes a substrate on which two comb electrodes are applied. Comb electrodes play in this case the role of linings. For the purpose of temperature compensation, two additional temperature sensors are additionally introduced into the sensor.

Such a sensor includes two electrodes that are deposited on a substrate, and on top of the electrodes themselves is applied a layer of material that has a fairly low resistance, which, however, varies greatly depending on humidity.

Aluminum oxide may be a suitable material for the device. This oxide absorbs well from external environment water, while its resistivity changes noticeably. As a result, the total resistance of the measurement circuit of such a sensor will depend significantly on humidity. Thus, the level of humidity will be indicated by the amount of current flowing. The advantage of sensors of this type is their low price.

A thermistor hygrometer consists of a pair of identical thermistors. By the way, let us recall that this is a nonlinear electronic component, the resistance of which strongly depends on its temperature.

One of the thermistors included in the circuit is placed in a sealed chamber with dry air. And the other is in a chamber with holes through which air with characteristic humidity enters it, the value of which needs to be measured. The thermistors are connected in a bridge circuit, voltage is applied to one of the diagonals of the bridge, and readings are taken from the other diagonal.

In the case when the voltage at the output terminals is zero, the temperatures of both components are equal, therefore the humidity is the same. If a non-zero voltage is obtained at the output, this indicates the presence of a humidity difference in the chambers. Thus, the humidity is determined from the value of the voltage obtained during measurements.

An inexperienced researcher may have a fair question: why does the temperature of the thermistor change when it interacts with moist air? The thing is that as humidity increases, water begins to evaporate from the thermistor body, while the temperature of the body decreases, and the higher the humidity, the more intense the evaporation occurs, and the faster the thermistor cools.

4) Optical (condensation) humidity sensor

This type of sensor is the most accurate. The operation of an optical humidity sensor is based on a phenomenon related to the concept of “dew point”. At the moment the temperature reaches the dew point, the gaseous and liquid phases are in thermodynamic equilibrium.

So, if you take glass and install it in a gaseous environment, where the temperature at the time of research is above the dew point, and then begin the process of cooling this glass, then at a specific temperature value, water condensation will begin to form on the surface of the glass, this water vapor will begin to transform into the liquid phase . This temperature will be the dew point.

So, the dew point temperature is inextricably linked and depends on parameters such as humidity and pressure in the environment. As a result, having the ability to measure pressure and dew point temperature, it will be easy to determine humidity. This principle serves as the basis for the operation optical sensors humidity.

The simplest circuit of such a sensor consists of an LED shining on a mirror surface. The mirror reflects the light, changing its direction, and directing it to the photodetector. In this case, the mirror can be heated or cooled using a special high-precision temperature control device. Often such a device is a thermoelectric pump. Of course, a sensor is installed on the mirror to measure temperature.

Before starting measurements, the mirror temperature is set to a value that is obviously higher than the dew point temperature. Next, the mirror is gradually cooled. At the moment when the temperature begins to cross the dew point, drops of water will immediately begin to condense on the surface of the mirror, and the light beam from the diode will break due to them, dissipate, and this will lead to a decrease in the current in the photodetector circuit. Through feedback the photodetector interacts with the mirror temperature regulator.

So, based on the information received in the form of signals from the photodetector, the temperature controller will keep the temperature on the surface of the mirror exactly equal to the dew point, and the temperature sensor will indicate the temperature accordingly. Thus, with known pressure and temperature, the main humidity indicators can be accurately determined.

The optical humidity sensor has the most high accuracy, unattainable by other types of sensors, plus the absence of hysteresis. The disadvantage is the highest price of all, plus high energy consumption. In addition, it is necessary to ensure that the mirror is clean.

Principle of operation electronic sensor air humidity is based on changes in the concentration of the electrolyte covering any electrical insulating material. There are devices with automatic heating linked to the dew point.

Often the dew point is measured over a concentrated solution of lithium chloride, which is very sensitive to minimal changes in humidity. For maximum convenience such a hygrometer is often additionally equipped with a thermometer. This device has high accuracy and low error. It is capable of measuring humidity regardless of the ambient temperature.

Simple electronic hygrometers are also popular in the form of two electrodes, which are simply stuck into the soil, controlling its humidity according to the degree of conductivity depending on this very humidity. Such sensors are popular among fans because you can easily set up automatic watering of a garden bed or flower in a pot, in case you don’t have time to water manually or it’s not convenient.

Before you buy a sensor, consider what you will need to measure, relative or absolute humidity, air or soil, what the expected measurement range is, whether hysteresis is important, and what accuracy is needed. The most accurate sensor is optical. Pay attention to the IP protection class, the operating temperature range, depending on the specific conditions where the sensor will be used, and whether the parameters are suitable for you.

Finally I am realizing this idea. I'm going to make an Arduino based soil moisture sensor, with a 16x2 LCD display, a real time clock (shows the time even when the power is off), a temperature sensor and an SD card (data logger).

It can be useful in biotechnological/biological/botanical projects or vegetation conservation projects.

The essence of the project is that I am going to make a soil moisture indicator for indoor plants based on Arduino, which can be assembled as a stationary or portable one. It will be able to take measurements every X milliseconds, depending on the settings.

You can make the probes more durable by running the current for a short period of time (twice for 30 milliseconds in my case) and leaving them off for a certain amount of time (for example, 1,800,000 milliseconds = (30x60x1000) = 30 minutes). To set this value, you need to change the delay at the very end of the “project.ino” file.

Since we have a sensor that takes measurements every X milliseconds, we need to set limits. The values ​​will vary from peak 1000 to mid 400, the lower the value the lower the resistance. Since probes measure resistance between two pins, you should take a value of 400, or close to it, as 100% humidity. A higher value resistance, 1000 or higher, for 0% humidity level. This means that we need to set the values ​​1000 – 400 as 0 – 100%.

Below we will look at how to do it yourself.

Step 1: Gather all the necessary materials


You will need:

  • Arduino Uno (for example)
  • real time clock DS3231 with battery
  • MicroSD + SD adapter or SD card
  • SD module
  • LCD display 16x2
  • soil moisture level sensor YL-69
  • wires
  • potentiometer, I used 47 kOhm, but only because I didn’t find one with 10 or 20 kOhm in my collection
  • bread board

All these components are quite accessible and very inexpensive.

Step 2: Connecting the Components



Now you need to connect the components as shown in the picture. Due to the fact that LCD displays and real time clock models vary from manufacturer to manufacturer, please refer to the manual when connecting wires to ensure all connections are correct.

LCD display

The diagram and picture show the correct connection of the display (with pin names).

Connection diagram:

  1. VSS Ground, GND rails on breadboard
  2. VDD rail +5V on breadboard
  3. V0 middle pin of potentiometer (adjustable output)
  4. RS pin 10 on Arduino board
  5. RW ground, GND rails on breadboard
  6. E pin 9 on Arduino board
  7. D0 is left unconnected
  8. D1 is left unconnected
  9. D2 is left unconnected
  10. D3 is left unconnected
  11. D4 pin 7 on Arduino board
  12. D5 pin 6 on Arduino board
  13. D6 pin 5 on Arduino board
  14. D7 pin 3 on the Arduino board
  15. A rail +5V on breadboard
  16. K ground, GND rails on breadboard

SD card module

Connection diagram:

  1. GND GND on breadboard
  2. +5V rail +5V on breadboard
  3. CS pin 4 on Arduino board
  4. MOSI pin 11 on Arduino board
  5. SCK pin 13 on Arduino board
  6. MISO pin 12 on Arduino board

Sensor YL-69

We will connect only three pins:

  1. VCC pin 2 on Arduino board
  2. GND rail GND ground on breadboard
  3. A0 analog pin A0

We will not use pin D0; it is a digital pin and is not needed in our project.

Real time clock DS 3231 with battery

The battery is needed to keep the watch running when unplugged. We will use the following outputs:

  1. SCL SCL on Arduino board
  2. SDA SCA on Arduino board
  3. VCC rail +5V on breadboard
  4. GND rail GND on breadboard

Potentiometer

Needed to regulate the voltage going to the LCD display. If there are no numbers on the display, and you are sure there should be, try turning the potentiometer. If everything is connected correctly, the numbers will appear.

Step 3: Set the time

When you turn on the real time clock for the first time, you need to configure it. You won't have to do this later, but the first adjustment is critical. To configure the clock you will need the Sodaq DS3231 library.
You can add it through the “add library” option in the Arduino program. Click "Add Library" and select the type "3231" and you will see it. Now you need to install it.

If there is no installation file, you can download it from the Internet.
Next, load the “fix/edit” sketch and change the following values:
"DateTime" (2011, 11, 10, 15, 18, 0, 5)
in the following order:
year, month, day, hour, minutes, seconds and day of the week (from 0 to 6)
set the current values.
Time setting is complete.

Step 4: Code

After all connections are made, a code is needed.
So I made a separate file with a sketch and just a huge number of detailed comments in each action section. Since the DS3231 real time clock has a temperature measurement function, I decided to use that too.
You need to install another library, "DS3231.rar".

The standard version of the project is made to work with a serial monitor and an SD card, which means that without connecting a serial monitor it simply will not work. This is not convenient, especially if you want to make a portable sensor. So I wrote another sketch that doesn't require a serial monitor and doesn't use one at all. This makes coding much easier. The first file contains code for the portable version, which does not use the serial port.

The important part of the code is the lines, which are indicated by the three letters on the right bottom corner display:

  • "I" for "initialized" means the SD card is present
  • "E" for "Error" means no SD card
  • "F" for "False", "False", means that the file is not accessible, although the card is present

These three letters are written to help you diagnose problems/errors if they appear.

Files

Step 5: Selecting a Power Source

You need a suitable power source, its choice depends on how you plan to use the device in the future.

You can use:

  • standard power supply
  • 9V battery with wired connection/with wires for connection

The choice of power supply is very important for the implementation of the project, since if you want to make the device stationary, it would be better to use a power supply. But if you want to make a portable meter, then your only option is a battery.

You can use a little trick - turn off the display if it is not needed at the moment. To do this, use/watch/read the short code to understand how to turn off the display. I didn't do this because I decided I didn't need it. Perhaps such an option is needed in the portable version of the meter, but I built a stationary one.

Step 6: Select SD Card

It turned out that not all SD cards work with my SD module.

Based on my life experience, I can answer two questions with confidence:

  1. Are they all suitable for the meter? - no, not all. Some simply don't interact with a particular module. It turned out that all the cards that do not interact with my module are SDHC standard. Standard and micro SD cards work fine, others do not work at all or are read-only (no data is written) and the date and time settings are lost every time the card is disconnected from the module.
  2. Is there a difference in using an SD card or a micro SD card with an adapter? - no, they work the same.

This concludes my tutorial for this project.

Step 7: Let's continue!

I continue to refine my project, and decided to make a wooden case for the meter, and also a printed circuit board.

Step 8: Experimental PCB (not completed, may not work)



To connect all components using minimum number For wires, I decided to use a printed circuit board/breadboard. I decided this because I have a lot of boards, but few wires. I don’t see the point in buying new breadboards when I can make a printed one. Since my board is single-sided, wires for connections to the bottom side will still be needed.

The LED turns on when it is necessary to water the plants
Very low current consumption from 3V battery

Schematic diagram:

List of components:

Resistors 470 kOhm ¼ W

Cermet or carbon
trim resistor 47 kOhm ½ W

Resistor 100 kOhm ¼ W

Resistor 3.3 kOhm ¼ W

Resistor 15 kOhm ¼ W

Resistor 100 Ohm ¼ W

Lavsan capacitor 1 nF 63 V

Lavsan capacitor 330 nF 63 V

Electrolytic capacitors 10uF 25V

Red LED 5mm diameter

Electrodes (See notes)

3V battery (2 x AA, N or AAA batteries,
connected in series)

Purpose of the device:

The circuit is designed to give a signal if the plants need watering. The LED starts flashing if the soil is in flower pot too dry, and goes out when the humidity increases. Trimmer resistor R2 allows you to adapt the sensitivity of the circuit to Various types soil, flower pot sizes and types of electrodes.

Scheme development:

This little device has been a big hit with electronics enthusiasts for many years, dating back to 1999. However, having corresponded with many hams over the years, I realized that some criticisms and suggestions should be taken into account. The circuit was improved by adding four resistors, two capacitors and one transistor. As a result, the device became easier to set up and more stable in operation, and the brightness of the glow was increased without using super-bright LEDs.
Many experiments have been carried out with different flower pots and different sensors. And although, as is easy to imagine, flower pots and electrodes were very different from each other, the resistance between two electrodes immersed in the soil by 60 mm at a distance of about 50 mm was always within the range of 500...1000 Ohms for dry soil, and 3000... 5000 Ohm wet

Circuit operation:

IC1A and its associated R1 and C1 form a square wave generator with a frequency of 2 kHz. Through an adjustable divider R2/R3, pulses are supplied to the input of gate IC1B. When the resistance between the electrodes is low (i.e., if there is enough moisture in the flower pot), capacitor C2 bypasses the input of IC1B to ground, and the output of IC1B is constantly present high level voltage. Gate IC1C inverts the output of IC1B. Thus, the input of IC1D is blocked low level voltage, and the LED is accordingly turned off.
When the soil in the pot dries out, the resistance between the electrodes increases, and C2 no longer prevents the flow of pulses to the input of IC1B. After passing through IC1C, the 2 kHz pulses enter the blocking input of the oscillator assembled on the IC1D chip and its surrounding components. IC1D begins to generate short pulses that turn on the LED through transistor Q1. LED flashes indicate the need to water the plant.
Rare bursts of short negative pulses with a frequency of 2 kHz, cut from the input pulses, are supplied to the base of transistor Q1. Consequently, the LED flashes 2000 times per second, but the human eye perceives such frequent flashes as a constant glow.

Notes:

  • To prevent oxidation of the electrodes, they are powered by rectangular pulses.
  • The electrodes are made from two pieces of stripped single core wire, with a diameter of 1 mm and a length of 60 mm. You can use the wire used for laying electrical wiring.
  • The electrodes must be completely immersed in the ground at a distance of 30...50 mm from each other. The material of the electrodes, dimensions and distance between them, in general, do not matter much.
  • Current consumption of about 150 µA when the LED is turned off, and 3 mA when the LED is turned on for 0.1 second every 2 seconds, allows the device to operate for years on one set of batteries.
  • With such a small current consumption, there is simply no need for a power switch. If, nevertheless, there is a desire to turn off the circuit, it is enough to short-circuit the electrodes.
  • The 2 kHz output from the first oscillator can be checked without a probe or oscilloscope. You can simply hear them if you connect the P2 electrode to the input of a low-frequency amplifier with a speaker, and if you have an ancient high-impedance TON-2 earphone, then you can do without an amplifier.
  • The circuit was assembled clearly according to the manual and is 100% working!!! ...so if it suddenly "doesn't work" then it's just an incorrect assembly or parts. To be honest, until recently I didn’t believe that it was “working”.
  • Question for the experts!!! How can you install a 12V DC pump with a consumption of 0.6A and a starting device of 1.4A as an actuator?!
  • Sobos WHERE to fit? What to manage?....Formulate the question CLEARLY.
  • In this scheme ( Full description http://www..html?di=59789) the indicator of its operation is the LED, which lights up when the ground is “dry”. There is a great desire to automatically turn on the irrigation pump (12V constant with a consumption of 0.6A and a starting 1.4A) along with the inclusion of this LED, how to change or “complete” the circuit to realize this.
  • ...maybe anyone has any thoughts?!
  • Install an optorelay or optosimistor instead of the LED. The water dose can be adjusted by a timer or by the location of the sensor/watering point.
  • It’s strange, I assembled the circuit and it works great, but only the LED “when watering is necessary” fully flickers with a frequency of approximately 2 kHz, and is not constantly on, as some forum users say. Which in turn provides savings when using batteries. It is also important that with such a low power supply, the electrodes in the ground are subject to little corrosion, especially the anode. And one more thing: at a certain level of humidity, the LED begins to barely glow and this can continue long time, which did not allow me to use this circuit to turn on the pump. I think that to reliably turn on the pump, you need some kind of detector of pulses of the specified frequency coming from this circuit and giving a “command” to control the load. I ask SPECIALISTS to suggest a scheme for implementing such a device. Based on this scheme, I would like to implement automatic watering at my dacha.
  • A very promising scheme in terms of its “economics” that needs to be finalized and used in garden plots or for example at work, which is very important when there are weekends or vacations, as well as at home for automatic watering of flowers.
  • was always within the range of 500...1000 Ohms for dry soil, and 3000...5000 Ohms for wet soil - in the sense - vice versa!!??
  • I think this is bullshit. Over time, salts are deposited on the electrodes and the system does not operate on time. A couple of years ago I did this, but I did it on two transistors according to the circuit from the MK magazine. It was enough for a week, and then it shifted. The pump worked and did not turn off, flooding the flower. I came across diagrams online alternating current, I think you should try them.
  • Good day!!! As for me, any idea to create something is already good. - As for installing the system at the dacha, I would advise turning on the pump via a time relay (costs pennies in many electrical equipment stores) and setting it to turn off after a time from turning on. Thus, when your system jams (well, anything can happen), the pump will turn off after a guaranteed time sufficient for watering (you can choose it empirically). - http://tuxgraphics.org/electronics/201006/automatic-flower-watering-II.shtml This is a good thing, I didn’t assemble this particular circuit, I only used the connection to the Internet. A little glitchy (not the fact that my hands are very straight), but everything works.
  • I have collected diagrams for watering, but not for this one, which is discussed in this topic. The assembled ones work, one as mentioned above in terms of the time the pump is turned on, the other, which is very promising, in terms of the level in the pan where water is pumped directly into the pan. For plants this is the most best option. But the essence of the question is to adapt the specified scheme. The only reason is that the anode in the ground is almost not destroyed as in the implementation of other schemes. So, please tell me how to track the pulse frequency in order to turn on the actuator. The problem is further aggravated by the fact that the LED can “smolder” for barely a certain time, and then only switch on in pulse mode.
  • The answer to the previously asked question regarding improving the soil moisture control scheme was received on another forum and verified to be 100% efficient :) If anyone is interested, write in a personal message.
  • Why such confidentiality and not immediately provide a link to the forum. For example, on this forum http://forum.homecitrus.ru/index.php?showtopic=8535&st=100 the problem was practically solved using MK, but it was solved using logic and tested by me. Only in order to understand you need to read from the beginning of the “book”, and not from the end. I am writing this in advance for those who read a piece of text and begin to bombard with questions. :eek:
  • The link http://radiokot.ru/forum/viewtopic.php?f=1&t=63260 was not immediately given due to the fact that it would not be considered an advertisement.
  • for [B]Vell65
  • http://oldoctober.com/ru/automatic_watering/#5
  • This stage has already been passed. The problem was solved using another scheme. As information. The lower improved circuit has errors and the resistances are burning. Typing on the same site was completed without errors. When testing the circuit, the following shortcomings were identified: 1. It turns on only once a day, when the tomatoes have already wilted, and it’s better to keep silent about cucumbers. And just when the sun was shining, they needed [B]drip watering at the root because plants evaporate in extreme heat a large number of moisture especially cucumbers. 2. There is no protection against false activation when, for example, at night the photocell is illuminated by headlights or lightning and the pump is triggered when the plants are sleeping and do not need watering, and turning on the pump at night does not help healthy sleep household members.
  • We remove the photosensor, see the first version of the circuit where it is missing, we select the elements of the timing circuit of the pulse generator as convenient for you. I have R1=3.9 Mohm. R8 which is 22m no. R7=5.1 Mohm. Then the pump turns on when the soil is dry, until the sensor gets wet. I took the device as an example of an automatic watering machine. Thanks a lot auto RU.

Connect an Arduino with an FC-28 Soil Moisture Sensor to detect when your soil under your plants needs water.

In this article we are going to use FC-28 Soil Moisture Sensor with Arduino. This sensor measures the volumetric water content of the soil and gives us the moisture level. The sensor gives us analog and digital data as output. We're going to connect it in both modes.

The soil moisture sensor consists of two sensors that are used to measure the volumetric water content. Two probes allow a current to pass through the soil, which gives a resistance value that ultimately measures the moisture value.

When there is water, the soil will conduct more electricity, which means there will be less resistance. Dry soil is a poor conductor of electricity, so when there is less water, the soil conducts less electricity, which means there will be more resistance.

The FC-28 sensor can be connected in analog and digital modes. First we will connect it in analog mode and then in digital mode.

Specification

FC-28 Soil Moisture Sensor Specifications:

  • input voltage: 3.3–5V
  • output voltage: 0–4.2V
  • input current: 35mA
  • output signal: analog and digital

Pinout

The FC-28 soil moisture sensor has four contacts:

  • VCC: power
  • A0: analog output
  • D0: digital output
  • GND: ground

The module also contains a potentiometer that will set the threshold value. This threshold value will be compared on the LM393 comparator. The LED will signal us a value above or below the threshold.

Analogue mode

To connect the sensor in analog mode, we will need to use the analog output of the sensor. The FC-28 soil moisture sensor accepts analog output values ​​from 0 to 1023.

Humidity is measured as a percentage, so we will compare these values ​​from 0 to 100 and then display them on the serial monitor. You can set different moisture values ​​and turn the water pump on/off according to those values.

Electrical diagram

Connect the FC-28 soil moisture sensor to Arduino as follows:

  • VCC FC-28 → 5V Arduino
  • GND FC-28 → GND Arduino
  • A0 FC-28 → A0 Arduino

Code for analog output

For the analog output we write the following code:

Int sensor_pin = A0; int output_value ; void setup() ( Serial.begin(9600); Serial.println("Reading From the Sensor ..."); delay(2000); ) void loop() ( output_value= analogRead(sensor_pin); output_value = map(output_value ,550,0,0,100); Serial.print("Mositure: "); Serial.print(output_value); delay(1000);

Code Explanation

First of all, we defined two variables: one to hold the contact of the soil moisture sensor and another to hold the output of the sensor.

Int sensor_pin = A0; int output_value ;

In the setup function, the command Serial.begin(9600) will help in communication between Arduino and serial monitor. After this, we will print “Reading From the Sensor...” on the normal display.

Void setup() ( Serial.begin(9600); Serial.println("Reading From the Sensor ..."); delay(2000); )

In the loop function, we will read the value from the analog output of the sensor and store the value in a variable output_value. We will then compare the output values ​​from 0-100 because humidity is measured as a percentage. When we took readings from dry soil, the sensor value was 550, and in wet soil, the sensor value was 10. We correlated these values ​​to get the moisture value. After that we printed these values ​​on the serial monitor.

void loop() ( output_value= analogRead(sensor_pin); output_value = map(output_value,550,10,0,100); Serial.print("Mositure: "); Serial.print(output_value); Serial.println("%") ; delay(1000);

Digital mode

To connect the FC-28 soil moisture sensor in digital mode, we will connect the digital output of the sensor to the digital pin of the Arduino.

The sensor module contains a potentiometer, which is used to set the threshold value. The threshold value is then compared with the sensor output value using the LM393 comparator, which is placed on the FC-28 sensor module. The LM393 comparator compares the sensor output value and the threshold value and then gives us the output value through a digital pin.

When the sensor value is greater than the threshold value, the digital output will give us 5V and the sensor LED will light up. Otherwise, when the sensor value is less than this threshold value, 0V will be transmitted to the digital pin and the LED will not light up.

Electrical diagram

The connections for the FC-28 soil moisture sensor and Arduino in digital mode are as follows:

  • VCC FC-28 → 5V Arduino
  • GND FC-28 → GND Arduino
  • D0 FC-28 → Pin 12 Arduino
  • LED positive → Pin 13 Arduino
  • LED minus → GND Arduino

Code for digital mode

The code for digital mode is below:

Int led_pin =13; int sensor_pin =8; void setup() ( pinMode(led_pin, OUTPUT); pinMode(sensor_pin, INPUT); ) void loop() ( if(digitalRead(sensor_pin) == HIGH)( digitalWrite(led_pin, HIGH); ) else ( digitalWrite(led_pin, LOW); delay(1000);

Code Explanation

First of all, we have initialized 2 variables to connect the LED pin and the digital pin of the sensor.

Int led_pin = 13; int sensor_pin = 8;

In the setup function we declare the LED pin as an output pin because we will turn on the LED through it. We declared the sensor pin as an input pin because the Arduino will receive values ​​from the sensor through this pin.

Void setup() ( pinMode(led_pin, OUTPUT); pinMode(sensor_pin, INPUT); )

In the loop function, we read from the sensor output. If the value is higher than the threshold value, the LED will turn on. If the sensor value is below the threshold value, the indicator will go off.

Void loop() ( if(digitalRead(sensor_pin) == HIGH)( digitalWrite(led_pin, HIGH); ) else ( digitalWrite(led_pin, LOW); delay(1000); ) )

This concludes the introductory lesson on working with the FC-28 sensor for Arduino. Successful projects to you.