Not all owners of gardens and orchards have the opportunity to take care of their plantings every day. Nevertheless, without timely watering, one cannot count on a good harvest.
The solution to the problem will be an automatic system that allows you to ensure that the soil in your area maintains the required degree of moisture throughout your absence. The main component of any automatic watering is the soil moisture sensor.
The humidity sensor also has other names. It is called a moisture meter or humidity sensor.
As can be seen in the photo of soil moisture sensors, such a device is a device consisting of two wires connected to a weak source of electricity.
With an increase in humidity between the electrodes, the current strength and resistance decrease, and vice versa, if there is not enough water in the soil, these indicators increase. The device turns on with a simple push of a button.
Keep in mind that the electrodes will be in moist soil. Therefore, it is recommended to turn on the device through the key. This technique will reduce the negative effects of corrosion.
Moisture meters are installed not only on open ground, but also in greenhouses. Controlling watering times is what soil moisture sensors are used for. You do not need to do anything, just turn on the device. After that, it will work without your participation.
However, gardeners and gardeners should monitor the condition of the electrodes, as they can undergo corrosive destruction and fail as a result.
Consider what soil moisture sensors are. They are usually divided into:
Capacitive. Their design is similar to an air condenser. The work is based on a change in the dielectric properties of air depending on its humidity, which causes an increase or decrease in capacity.
Resistive. The principle of their operation is to change the resistance of a hygroscopic material, depending on how much moisture it contains.
Psychometric. The principle of operation and the scheme of the device of such sensors will be more complicated. It is based on the physical property of heat loss during evaporation. The instrument consists of a dry and a wet detector. The temperature difference between them is used to judge the amount of water vapor in the air.
Aspiration. This type is in many ways similar to the previous one, the difference is the fan, which serves to pump the air mixture. Aspiration devices for determining humidity are used in places with weak or intermittent air movement.
Which humidity sensor to choose depends on each specific case. The choice of device is also influenced by the features of the automatic irrigation system you have installed and your financial capabilities.
If you decide to start making a moisture meter yourself, then you need to prepare:
How to make a soil moisture sensor with your own hands? Here is a brief tutorial:
Note!
For the sensor to work, a current of 35 mA and a voltage of 5 V are required. At the end, we connect the device using three wires, which we attach to the microprocessor.
The controller allows you to combine a sensor with a buzzer. After that, a signal is given if the amount of moisture in the soil decreases sharply. An alternative to a sound signal can be a light bulb.
The soil moisture sensor is, without a doubt, a necessary thing in the household. If you have a cottage or garden, then by all means take care of acquiring it. Moreover, the device is not at all necessary to buy, since you can easily do it yourself.
Note!
Note!
LED turns on when plants need to be watered
Very low current consumption from 3V battery
Schematic diagram:
List of components:
Resistors 470 kOhm ¼ W |
|
Cermet or carbon |
|
Resistor 100 kOhm ¼ W |
|
Resistor 3.3 kOhm ¼ W |
|
Resistor 15 kOhm ¼ W |
|
Resistor 100 Ohm ¼ W |
|
Mylar Capacitor 1nF 63V |
|
Mylar Capacitor 330nF 63V |
|
Electrolytic Capacitors 10uF 25V |
|
Red LED with a diameter of 5 mm |
|
Electrodes (See notes) |
|
3 V battery (2 AA, N or AAA batteries, |
Purpose of the device:
The circuit is designed to give a signal if the plants need watering. The LED starts flashing if the soil in the flower pot is too dry and goes out when the humidity increases. The trimmer resistor R2 allows you to adapt the sensitivity of the circuit to various types of soil, flower pot sizes and types of electrodes.
Circuit development:
This little device has been a big hit with electronic hobbyists over the years since 1999. However, as I have corresponded with many hams over the years, I have come to realize that some criticisms and suggestions need to be taken into account. The circuit has been improved by adding four resistors, two capacitors and one transistor. As a result, the device has become easier to set up and more stable in operation, and the brightness of the glow has been increased without using super-bright LEDs.
Many experiments have been carried out with various flower pots and various sensors. And although, as it 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 in the range of 500 ... 1000 Ohms with dry soil, and 3000 ... 5000 ohms wet
Circuit operation:
Chip IC1A and its associated R1 and C1 form a square-wave generator with a frequency of 2 kHz. Through an adjustable divider R2 / R3, the pulses are fed to the input of the gate IC1B. When the resistance between the electrodes is low (i.e., if there is enough moisture in the flower pot), capacitor C2 shunts the input of IC1B to ground, and a high voltage level is constantly present at the output of IC1B. Gate IC1C inverts the output of IC1B. Thus, the input of IC1D is blocked low, and the LED is accordingly turned off.
When the soil in the pot dries out, the resistance between the electrodes increases, and C2 ceases to interfere with 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 starts to generate short pulses, turning on the LED via transistor Q1. LED flashes indicate the need to water the plant.
The base of transistor Q1 is fed with rare bursts of short negative pulses with a frequency of 2 kHz, cut out from the input pulses. Consequently, the LED flashes 2000 times per second, but the human eye perceives such frequent flashes as a constant glow.
Notes:
The module consists of two parts: contact probe YL-69 and sensor YL-38, wires for connection are included. A small voltage is created between the two electrodes of the YL-69 probe. If the soil is dry, the resistance is high and the current will be less. If the ground is wet, the resistance is less, the current is slightly more. According to the final analog signal, one can judge the degree of humidity. The YL-69 probe is connected to the YL-38 probe via two wires. In addition to the pins for connecting to the probe, the YL-38 sensor has four pins for connecting to the controller.
I wrote a lot of reviews about dacha automation, and since we are talking about a dacha, then automatic watering is one of the priority areas of automation. At the same time, you always want to take into account precipitation so as not to drive pumps in vain and not to flood the beds. Many copies have been broken on the path to trouble-free soil moisture data acquisition. In the review, there is another option that is resistant to external influences.
A pair of sensors arrived in 20 days in individual antistatic bags:
Characteristics on the seller's website:):
Brand:ZHIPU
Type: Vibration sensor
Material: Blend
Output: Switching sensor
Unpacking:
The wire has a length of around 1 meter:
In addition to the sensor itself, the kit includes a control board:
The length of the sensors of the sensor is about 4 cm:
The tips of the sensor, it looks like graphite - get dirty black.
We solder the contacts to the scarf and try to connect the sensor:
The most common soil moisture sensor in Chinese stores is this one:
Many people know that after a short time it is eaten by the external environment. The effect of corrosion can be slightly reduced by applying power immediately before the measurement and turning it off when no measurements are made. But this does not change much, this is what mine looked like after a couple of months of use:
Someone tries to use thick copper wire or stainless steel rods, an alternative designed specifically for aggressive environments is the subject of review.
Let's put the board from the kit aside, and deal with the sensor itself. Resistive type sensor, changes its resistance depending on the humidity of the environment. It is logical that without a humid environment, the resistance of the sensor is huge:
We lower the sensor into a glass of water and see that its resistance will be about 160 kOhm:
If you take it out, everything will return to its original state:
Let's move on to the tests on the ground. In dry soil we see the following:
Let's add some water:
More (about a litre):
Almost completely poured one and a half liters:
Added another liter and waited 5 minutes:
The board has 4 pins:
1 + supply
2 earth
3 digital output
4 analog output
After ringing, it turned out that the analog output and ground are directly connected to the sensor, so if you plan to use this sensor by connecting it to an analog input, the board does not make much sense. If there is no desire to use the controller, then you can use the digital output, the threshold is set by the potentiometer on the board. Seller's recommended wiring diagram when using digital output:
When using a digital input:
Let's put together a small layout:
I used the Arduino Nano here as a power source without downloading the program. Digital output connected to the LED. It's funny that the red and green LEDs on the board are lit at any position of the potentiometer and the humidity of the sensor environment, the only thing when the threshold is triggered, the green shines a little weaker:
Having set the threshold, we get that when the specified humidity is reached at the digital output 0, when the humidity is deficient, the supply voltage is:
Well, since we have a controller in our hands, we will write a program to check the operation of the analog output. Connect the analog output of the sensor to pin A1, and the LED to pin D9 of the Arduino Nano.
const int analogInPin = A1; // sensor const int analogOutPin = 9; // Output to LED int sensorValue = 0; // read value from the sensor int outputValue = 0; // value given to the PWM pin with LED void setup() ( Serial.begin(9600); ) void loop() ( // read the sensor value sensorValue = analogRead(analogInPin); // translate the range of possible sensor values (400-1023 - set experimentally) // to the PWM output range 0-255 outputValue = map(sensorValue, 400, 1023, 0, 255); // turn on the LED for a given brightness analogWrite(analogOutPin, outputValue); // output our numbers Serial.print ("sensor = "); Serial.print(sensorValue); Serial.print("\t output = "); Serial.println(outputValue); // delay delay(2); )
I commented all the code, the brightness of the LED is inversely proportional to the humidity detected by the sensor. If it is necessary to control something, then it is enough to compare the obtained value with an experimentally determined threshold and, for example, turn on the relay. The only thing I recommend is to process several values and use the average to compare with the threshold, so random spikes or drops are possible.
We immerse the sensor and see:
Controller output:
If you take it out, the output of the controller will change:
Video of this test build:
In general, I liked the sensor, it gives the impression of being resistant to the influence of the external environment, whether this is so - time will tell.
This sensor cannot be used as an accurate indicator of humidity (as well as all similar ones), its main application is to determine the threshold and analyze the dynamics.
If it is interesting, I will continue to write about my country crafts.
Thanks to everyone who read this review to the end, I hope this information will be useful to someone. All complete control over soil moisture and goodness!
Connect the Arduino to the FC-28 Soil Moisture Sensor to determine when your soil under your 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 of the soil and gives us the moisture level. The sensor gives us analog and digital data at the output. 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. The two probes allow the current to pass through the soil, which gives a resistance value, which finally 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 more resistance.
The FC-28 sensor can be connected in analog and digital modes. We will connect it first in analog mode and then in digital mode.
Specification
FC-28 Soil Moisture Sensor Specifications:
Pinout
Soil moisture sensor FC-28 has four pins:
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 the value above or below the threshold.
To connect the sensor in analog mode, we need to use the analog output of the sensor. Soil moisture sensor FC-28 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 these values.
Connect the soil moisture sensor FC-28 to the Arduino as follows:
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); Serial.println("%"); delay(1000); )
First of all, we defined two variables, one for the contact of the soil moisture sensor and the other for storing 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 that, 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. Then we will compare the output values from 0-100 because humidity is measured in 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 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); )To connect the FC-28 soil moisture sensor in digital mode, we will connect the sensor's digital output to an Arduino digital pin.
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 output value of the sensor and the threshold value, and then gives us the output value through a 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.
The connections for the soil moisture sensor FC-28 and Arduino in digital mode are as follows:
The code for digital mode is below:
intled_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); ) )
First of all, we initialized 2 variables to connect the LED output and the digital output 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 output of the sensor. If the value is higher than the threshold value, then 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) == 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. Good luck with your projects.