Home-made, stable soil moisture sensor for automatic irrigation installation. Soil moisture meter sensor - we make an indicator on Arduino for indoor plants with our own hands The most interesting videos on Youtube


Home-made, stable soil moisture sensor for automatic irrigation installation

This article arose in connection with the construction of an automatic irrigation machine for the care of indoor plants. I think that the irrigation machine itself may be of interest to the do-it-yourselfer, but now we will focus on the soil moisture sensor. https: // site /


The most interesting videos on Youtube


Prologue.

Of course, before I invented a bicycle, I went over the Internet.

Humidity sensors for industrial production were too expensive, and I still could not find a detailed description of at least one such sensor. The fashion for selling "cats in bags", which came to us from the West, already seems to have become the norm.


Although there are descriptions of home-made amateur sensors in the network, they all work on the principle of measuring the resistance of the soil to direct current. And the very first experiments showed the complete failure of such developments.

Actually, this did not really surprise me, since I still remember how in childhood I tried to measure the resistance of the soil and found ... an electric current in it. That is, the needle of the microammeter recorded the current flowing between two electrodes stuck in the ground.


The experiments, which had to be spent a whole week, showed that the soil resistance can change quite quickly, moreover, it can periodically increase and then decrease, and the period of these fluctuations can be from several hours to tens of seconds. In addition, in different flower pots, soil resistance varies in different ways. As it turned out later, the wife selects an individual soil composition for each plant.


At first, I completely abandoned the measurement of soil resistance and even began to build an induction sensor, because I found on the network an industrial humidity sensor, about which it was written that it was induction. I was going to compare the frequency of the reference generator with the frequency of another generator, the coil of which is dressed in a pot with a plant. But, when he began to prototype the device, he suddenly remembered how he had once come under "step voltage". This prompted me to another experiment.

Indeed, in all the home-made structures found in the network, it was proposed to measure the resistance of the soil to direct current. But what if you try to measure the resistance to alternating current? Indeed, in theory, then the flowerpot should not turn into a "battery".

He assembled the simplest circuit and immediately checked it on different soils. The result was encouraging. No suspicious attempts to increase or decrease the resistance were found even within a few days. Subsequently, this assumption was able to be confirmed on an operating irrigation machine, the operation of which was based on a similar principle.

Electrical circuit of a threshold soil moisture sensor.

As a result of research, this circuit appeared on one single microcircuit. Any of the following microcircuits is suitable: K176LE5, K561LE5 or CD4001A. We sell these chips for only 6 cents.


The soil moisture sensor is a threshold device that responds to changes in resistance to alternating current (short pulses).

The elements DD1.1 and DD1.2 assembled a master oscillator that generates pulses with an interval of about 10 seconds. https: // site /

Capacitors C2 and C4 are isolating. They do not pass the direct current generated by the soil into the measuring circuit.

Resistor R3 sets the response threshold, and resistor R8 provides hysteresis to the amplifier. Trimmer resistor R5 sets the initial offset at the input DD1.3.


Capacitor C3 is anti-interference, and resistor R4 determines the maximum input resistance of the measuring circuit. Both of these elements reduce the sensitivity of the sensor, but their absence can lead to false alarms.

It is also not worth choosing a microcircuit's supply voltage below 12 Volts, as this reduces the real sensitivity of the device due to a decrease in the signal-to-noise ratio.


Attention!

I do not know if prolonged exposure to electrical impulses can have a harmful effect on plants. This scheme was used only at the stage of development of the irrigation machine.

In for watering plants, I used another scheme that generates only one short measuring pulse per day, timed to coincide with the time of watering the plants.

We connect the Arduino to the FC-28 soil moisture sensor to determine when your soil under plants needs water.

In this article, we are going to use the FC-28 Soil Moisture Sensor with Arduino. This sensor measures the volumetric water content in the soil and gives us the moisture level. The sensor gives us the output analog and digital given. We are 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 current to pass through the soil, which gives a resistance value, which allows you to ultimately measure the value of moisture.

When there is water, the soil will conduct more electricity, which means that there will be less resistance. Dry soil conducts electricity poorly, so when there is less water, the soil conducts less electricity, which means that there will be more resistance.

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

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 soil moisture sensor FC-28 has four contacts:

  • VCC: Power
  • A0: analog output
  • D0: digital output
  • GND: earth

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

Analog mode

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

Humidity is measured as a percentage, so we compare these values \u200b\u200bfrom 0 to 100, and then show them on a serial monitor. You can set different moisture values \u200b\u200band turn the on / off water pump according to these values.

Electric circuit

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 \u003d A0; int output_value; void setup () (Serial.begin (9600); Serial.println ("Reading From the Sensor ..."); delay (2000);) void loop () (output_value \u003d analogRead (sensor_pin); output_value \u003d map (output_value , 550,0,0,100); Serial.print ("Mositure:"); Serial.print (output_value); Serial.println ("%"); delay (1000);)

Code Explanation

First of all, we determined two variables: one for the contact of the soil moisture sensor, and the other for storing the sensor output.

Int sensor_pin \u003d A0; int output_value;

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

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

In the loop function, we read the value from the analog output of the sensor and store the value in a variable output_value. Then we compare the output values \u200b\u200bwith 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 compared these values \u200b\u200bto get the moisture value. After that, we printed these values \u200b\u200bon a serial monitor.

void loop () (output_value \u003d analogRead (sensor_pin); output_value \u003d 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 sensor output to the Arduino digital pin.

The sensor module contains a potentiometer, which is used to set a threshold value. The threshold value is then compared with the sensor output value using the LM393 comparator, which is located 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 via the digital output.

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 output and the LED will not light up.

Electric circuit

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

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

Code for digital mode

Code for digital mode below:

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

Code Explanation

First of all, we initialized 2 variables for connecting the LED output and the digital output of the sensor.

Int led_pin \u003d 13; int sensor_pin \u003d 8;

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

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

In the loop function, we read from the output of the sensor. 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 turn off.

Void loop () (if (digitalRead (sensor_pin) \u003d\u003d 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 for you.

Many gardeners and gardeners are deprived of the opportunity to take care of planted vegetables, berries, fruit trees every day due to workload during work or during vacation. However, plants need timely watering. With the help of simple automated systems, you can ensure that the soil in your area will maintain the necessary and stable moisture throughout your absence. To build a garden auto-irrigation system, you will need the main control element - a soil moisture sensor.

Humidity sensor

Moisture sensors are also sometimes called moisture meters or humidity sensors. Almost all soil moisture meters on the market measure moisture in a resistive way. This is not a very accurate method, because it does not take into account the electrolysis properties of the measured object. The readings of the device can be different at the same soil moisture, but with different acidity or salt content. But experimental gardeners are not so important about the absolute readings of instruments, as relative, which can be configured for the actuator water supply in 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. It's ordinary ohmmeterwhich is included with any digital or analog tester. Such tools used to be called avometers.

There are also devices with a built-in or remote indicator for operational control over the state of the soil.

It is easy to measure the difference in the conductivity of electric current before irrigation and after irrigation using the example of a pot with an aloe home plant. Indications before watering 101.0 kOhm.

Indications after watering after 5 minutes 12.65 kOhm.

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

The principle of automation

In automatic watering systems, the rule "water or do not water" usually applies. As a rule, no one needs to regulate the pressure of water. This is due to the use of expensive controlled valves and other, unnecessary, technologically sophisticated devices.

Almost all moisture 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 an incoming signal into digital form. That is, with the set humidity level, you will get a unit or zero (0 or 5 volts) at its output. This signal will become the source for the subsequent actuator.

For autowatering the most rational will be the use of an electromagnetic valve as an actuator. It is included in pipe rupture and can also be used in micro-drip irrigation systems. It is turned on by a voltage of 12 V.

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

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

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

Watering Automation Systems

If you are interested in a full-fledged auto-irrigation system, then you need to think about purchasing a programmable controller. If the plot is small, then it is enough to install 3-4 humidity sensors for different types of irrigation. For example, a garden needs less watering, raspberries love moisture, and for watermelon there is enough water from the soil, with the exception of excessively arid periods.

Based on our 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 moisture meters, take into account rainfall, time of year.

Some soil moisture sensors have 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 networks or SMS. This is convenient in cases where it is impossible to connect an automated irrigation system, for example, for indoor plants.

For irrigation automation system it is convenient to use controllers with analog and contact inputs that connect all sensors and transmit their readings on a single bus to a computer, tablet or mobile phone. Executive devices are controlled via the WEB interface. The most common universal controllers:

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

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

Simple watering automation scheme

The simplest automation system for irrigation 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 resistor with a resistance of 10 kOhm and a power source with an output voltage of 5 V. Suitable from a mobile phone.

As a device that will issue a command for irrigation, you can use a chip LM393. You can purchase a finished unit or assemble it yourself, then you will need:

  • 10 kOhm resistors - 2 pcs;
  • 1 kΩ resistors - 2 pcs;
  • 2 kOhm resistors - 3 pcs;
  • 51-100 kΩ variable resistor - 1 pc;
  • lEDs - 2 pcs;
  • any diode, not powerful - 1 pc;
  • transistor, any average power PNP (for example, KT3107G) - 1 pc;
  • 0.1 mk capacitors - 2 pcs;
  • microchip LM393 - 1 pc;
  • relay with a 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 the tester to the output of the LM393 comparator. Using the tuning resistor, set the response threshold. Over time, it will be necessary to adjust it, perhaps more than once.

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

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

Watering automation actuators

The main actuator for irrigation automation is an electronic valve with and without flow control. The second is cheaper, easier to maintain and manage.

There are many operated cranes and other manufacturers.

If water supply problems occur in your area, purchase solenoid valves with a flow sensor. This will prevent the solenoid from burning out when the water pressure drops or the water supply stops.

Disadvantages of automatic irrigation systems

The soil is heterogeneous and different in composition, so a single moisture sensor can show different data in neighboring areas. In addition, some areas are obscured by trees and wetter than those located in sunny places. Also, the proximity of groundwater, their level relative to the horizon, has a significant effect.

Using an automated irrigation system, the terrain should be considered. The plot can be divided into sectors. In each sector, install one or more humidity sensors and calculate for each its own operation algorithm. This will greatly complicate the system and it is unlikely to be able to do without a controller, but later it will almost completely save you from wasting time on absurd standing with a hose in your hands under the sultry sun. The soil will be filled with moisture without your participation.

Building an effective automated irrigation system cannot be based solely on the readings of soil moisture sensors. Be sure to additionally use temperature and light sensors, take into account the physiological water demand of plants of different species. It is also necessary to take into account seasonal changes. Many companies producing automation systems for irrigation offer flexible software for different regions, areas and cultivated crops.

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

Conclusion

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

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

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

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

You can make the probes more durable by turning on the current for a short period of time (twice in 30 milliseconds in my case) and leave them disconnected for a certain time (for example, 1,800,000 milliseconds \u003d (30x60x1000) \u003d 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 limit values. Values \u200b\u200bwill vary from peak 1000 to average 400; the lower the value, the lower the resistance. Since the probes measure the resistance between the two pins, you need to take a value of 400, or close to it, for 100% humidity. A higher resistance value, 1000 or higher, for a humidity level of 0%. So, we need to establish the correspondence of the values \u200b\u200bof 1000 - 400 as 0 - 100%.

Below we will see how to do it yourself.

Step 1: We collect all the necessary materials


You will need:

  • Arduino Uno (for example)
  • dS3231 real time clock with battery
  • MicroSD + SD adapter or SD card
  • SD module
  • 16x2 LCD
  • soil moisture sensor YL-69
  • wires
  • i used a potentiometer at 47 kOhm, but only because I did not find it at 10 or 20 kOhm in my collection
  • bread board

All these components are quite affordable and completely inexpensive.

Step 2: Connect the components



Now you need to connect the components of the one as shown in the picture. Due to the fact that the models of LCD displays and real-time clocks differ from each manufacturer, when connecting the wires, refer to the instructions to be sure that all the connections are correct.

LCD display

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

Wiring diagram:

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

SD card module

Wiring diagram:

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

YL-69 sensor

We will connect only three outputs:

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

We will not use the D0 output, it is a digital output, it is not needed in our project.

DS 3231 Real Time Clock with Battery

The battery is needed so that the watch continues to work when disconnected from the network. We will use the following conclusions:

  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

It is necessary to regulate the voltage going to the LCD. If there are no numbers on the display, and you are sure that they 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. Then you don’t have to do this, but the first setup is critical. To set 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, download 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 (0 to 6)
set current values.
The time setting is complete.

Step 4: Code

After all the connections are made, you need the code.
Therefore, I made a separate file with a sketch and just a huge amount of detailed comments in each section of the actions. Since the DS3231 real-time clock has a temperature measurement function, I decided to use it as well.
You need to install another library, “DS3231.rar”.

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

An important part of the code is the lines that are indicated by three letters in the lower right corner of the display:

  • "I" from "initialized", means that an SD card is present
  • “E” from “Error” means that there is no SD card
  • "F" from "False", "False", means that the file is not available, although the card is present

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

Files

Step 5: Choosing 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 is very important for the implementation of the project, since if you want to make the device stationary, it is 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 - to turn off the display if it is not needed at the moment. To do this, use / look / read the abbreviated code to understand how to turn off the display. I did not do this, because I decided that I did not need it. Perhaps this option is needed in the portable version of the meter, but I put together 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 confidently answer two questions:

  1. Are they all suitable for the meter? - no, not all. Some simply do not interact with a specific 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 work only for reading (data are not written) and the date and time settings fly off each time the card is disconnected from the module.
  2. Is there a difference in using an SD card or micro SD card with an adapter? - No, they work the same way.

This concludes my guide to this project.

Step 7: 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 the minimum number of wires, I decided to use a printed / breadboard. I decided so because I have a lot of boards, but few wires. It makes no sense to buy new breadboards, when I can make a printed circuit board. Since my board is single-sided, wires for connections to the underside will still be needed.

Automation significantly simplifies the life of the owner of a greenhouse or garden. An automatic irrigation system will save you from the same repetitive work, and to avoid excess water will help the soil moisture sensor - to assemble such a device with your own hands is not so difficult. The laws of physics come to the aid of the gardener: moisture in the soil is made a conductor of electrical impulses, and the more it is, the lower the resistance.

With decreasing humidity, the resistance increases, and this helps to track the optimal watering time.

Design and principle of operation of the humidity sensor

The design of the humidity sensor of the earth is two conductors, which are connected to a not strong source of energy, the resistor must be in the circuit. When the amount of liquid in the space between the electrodes increases, the resistance decreases, and the current strength increases.

Moisture dries up - resistance increases, current decreases.

Because the electrodes will remain in a wet environment, it is recommended to turn them on through the key in order to reduce the destructive effect of corrosion. In simple time, the set is turned off and is launched only to check the humidity by pressing a button.

Soil moisture sensors in order for the type to be installed in greenhouses - they provide automatic irrigation control, based on this, the totality can function by and large without human intervention. In this case, the set will constantly remain in working condition, but the state of the electrodes will need to be controlled so that they do not deteriorate under the influence of corrosion. Such devices can be installed on lawns and beds in the open air - they will allow you to instantly take the necessary information.

Along with this, the totality turns out to be much more correct than a simple tactile sensation. If a person calculates the soil completely dry, the sensor will demonstrate up to 100 units of soil moisture (when evaluated in decimal), immediately after watering, this value grows to 600-700 units.

Then the sensor will allow you to monitor the change in the moisture content in the soil.

If the sensor is supposed to be used on the street, its upper part needs to be sealed carefully in order to prevent information distortion. To do this, it is possible to cover it with a moisture-proof epoxy resin.

DIY humidity sensor assembly

The design of the sensor is planned as follows:

  • The main part - two electrodes, the diameter of which is 3-4 mm, they are attached to the base made of textolite or other material protected from corrosion.
  • At one finish of the electrodes, it is necessary to cut the thread, otherwise they become pointed for more ergonomic immersion in the ground.
  • Holes are drilled in the PCB plate, into which electrodes are screwed, they must be fixed with nuts and washers.
  • Outgoing wires must be placed under the washers, after which the electrodes are insulated. The length of the electrodes, which will be immersed in the soil, forms about 4-10 cm., Depending on the capacity used or the open bed.
  • For the sensor to work, a current source of 35 mA is required; the combination requires a voltage of 5V. Depending on the amount of liquid in the ground, the range of the returned signal will be 0-4.2 V. Losses in resistance will show the amount of water in the soil.
  • The humidity sensor is connected through 3 wires to the processor, for this purpose it is possible to buy, for example, Arduino. The controller will allow you to connect the assembly with the buzzer to sound an alarm when the humidity of the earth decreases excessively, or to the LED, the brightness of the light will change during transformations in the sensor operation.

Such a home-made device can become part of autowatering in the aggregate Smart Home, for example, using the MegD-328 Ethernet controller. The web interface shows the moisture level in a 10-bit aggregate: a range from 0 to 300 shows that the soil is completely dry, 300-700 - there is enough moisture in the ground, more than 700 - the soil is wet, and watering is not necessary.

The design, which consists of a controller, relay and battery, is removed in any suitable housing for which it is possible to adapt any plastic box.

At home, the application of a humidity sensor will be very simple and at the same time reliable.

Scopes of the humidity sensor

Using a soil moisture sensor is perhaps the most diverse. Most often they are used in aggregates of automatic watering and manual watering of plants:

  1. They can be installed in flower pots if the plants are sensitive to the level of water in the ground. If it comes to succulents, for example, cacti, you need to pick up long electrodes, which will respond to the transformation of the moisture level specifically at the roots. In addition, it is possible to apply them to other plants and violets with a fragile root set. Connecting to the LED will allow you to determine at the time when it is time to irrigate.
  2. They are indispensable for organizing watering plants in a greenhouse. According to a similar principle, in addition to this, air humidity sensors are planned, which are necessary to start the spraying of plants. All this will automatically ensure a normal level and watering of plants with atmospheric humidity.
  3. At the dacha, the use of sensors will allow you not to keep in memory the time of watering each bed, electrical engineering itself will tell you about the amount of water in the soil. This will allow to prevent excessive watering, if the rain has passed not so long ago.
  4. Using sensors is very comfortable in some second cases. For example, they will allow you to control soil moisture in the basement and under the house near the foundation. In the apartment it is possible to install it under the sink: if the pipe starts to drip, automation will immediately tell you about it, and it will be possible to avoid subsequent repairs and flooding of the neighbors.
  5. A simple sensor device will allow in just a couple of days to fully equip all the problem areas of the house and garden with a combination of alerts. If the electrodes are long enough, with their help it will be possible to control the water level, for example, in an unnatural small pond.

Independent manufacture of the sensor will help equip the house with an automatic control system at a low cost.

It is easy to buy components of factory production via the Internet or in a special store, a substantial part of the devices can be assembled from materials that are constantly found in the home of an electrical enthusiast.

Do-it-yourself humidity sensor Beginner AVR.

Do-it-yourself soil moisture sensor. Beginner AVR.