Automatic greenhouse with ventilation and watering. Greenhouse controller on Arduino

Growing crops in greenhouse conditions involves the organization of a certain microclimate indoors. Otherwise, the greenhouse becomes not only of little use, but can also cause irreparable harm to seedlings. Provide plants the necessary conditions you can do it on your own. But, it will be more convenient and efficient to automate the processes that affect the climate inside the greenhouse. How can you automate a greenhouse with ready-made and homemade devices- read the article.

Modern devices for the automation of greenhouses and greenhouses allow autonomous operation of irrigation, heating and ventilation systems. Today, there are several ways to automate the processes on which . Each of them has its own advantages and disadvantages.

Automation in greenhouses differs according to the principle of operation (method of bringing the mechanisms into action) into:

  1. Electrical. Such automation is characterized by ease of installation, the possibility of fine tuning. To disadvantages electrical systems can be attributed to their high cost, compared with other types of automated systems, and dependence on the source of electricity.
  2. hydraulic. Such technologies are reliable and absolutely safe: they are based on the principle of expansion of liquids when overheated. The disadvantages of the designs are the slow response to a decrease in temperature.
  3. bimetallic. Bimetallic devices are based on the ability of various metals to expand. Such systems are ideal for automating the ventilation system. The disadvantage of bimetallic automation is that it is not capable of powering heavy equipment.

The above automatic systems can be installed on any equipment that needs autonomous operation. The choice of automated structures depends on the gardener's budget, the presence of a power grid near the site, and the dimensions of the greenhouse.

More about automation for greenhouses in our material:

Automation for a greenhouse on a microcontroller

Greenhouse automation is possible thanks to accurate sensors that read temperature, humidity and lighting levels inside and outside the greenhouse, timers that transmit information to a special controller. After that, the control system, based on the algorithms built into the program, evaluates the readings from the sensors and makes decisions to turn on or off the greenhouse actuators.

It is the software controller that drives the irrigation system pump, fan and window closer, lighting and heating appliances. Today, there are many controllers whose main task is to regulate the microclimate in the greenhouse. The price of the controller depends on the number of analog inputs and the memory of the device. The most affordable is the Atmega controller on the Arduino platform.

More information about the smart greenhouse based on the Arduino chip can be found at the link:

The automation program for the greenhouse on the microcontroller is focused, first of all, on such processes as:

  1. Setting the desired temperature and humidity.
  2. Turn on, turn off lighting fixtures depending on time of day and year.
  3. Management of the aeration system (opening and closing the windows, starting the fans when the air in the greenhouse is overheated).
  4. Management of the irrigation system depending on the stages of plant development.

Such automation allows you to achieve maximum results when growing even the most whimsical crops, but it differs high cost, therefore, it can be profitable only on large and industrial agricultural facilities.

Greenhouse screening system

In large industrial greenhouses, to normalize the microclimate, greenhouse screening systems are also used. In the domestic economy, such systems show no less high performance.

The curtain system provides shading of the greenhouse, reducing the likelihood of overheating of the greenhouse due to solar radiation in the summer.

There are side and top screens of screening systems. At the same time, there are several types of canvases that perform different functions: full or partial dimming, saving thermal energy, holding artificial light inside the greenhouse.

Often, to control the curtain system, they use centralized control from a single system. automatic regulation microclimate in the greenhouse.

If necessary, the Screen actuates the switch on the automation cabinet. In addition, the system can be included in the program of the general climate controller inside the greenhouse.

Homemade automatic greenhouse

To avoid financial costs, automated systems can be completely or partially made by hand. Of course, in order to create automation on the controller, you will need thermostats, cyclic and daily timers, a ready-made board diagram, communication channels with equipment. It will be much easier to organize automation for each individual process.

Most often, the irrigation system in the greenhouse is separately automated. The organization of the system depends on the dimensions of the panic. So, for small domestic greenhouses, often home-made drip system glaze.

Organization drip irrigation has the following steps:

  1. Development of an irrigation scheme taking into account individual sizes greenhouses.
  2. Preparation of materials (drip hoses, water tank, filters, taps, connecting fittings, main pipe).
  3. Installation of the tank at a height of 0.1-0.2 cm, installation of filters for water purification.
  4. Wiring of the main water supply and branches of lines.
  5. Installation of overhead cranes on each branch.
  6. Connection of all components of the water supply using connecting fittings.
  7. Dropper installation.
  8. Filling the tank with water.

The semi-automatic irrigation system includes irrigation by solar distillation, in which water, evaporating from the reservoir, condenses on the hood and flows down to the plants through special gutters.

Installation of the machine in the greenhouse: thermovent for ventilation

The easiest way to control the temperature in a polycarbonate greenhouse is to install automatic ventilation vents. Most often, the automatic window is equipped with a thermal actuator, which sets the device into action when the temperature inside the greenhouse changes.

The principle of operation of the thermal fan is based on the ability of oils to expand when heated. In addition, on the thermal drive, you can set the desired temperature for automatic ventilation of the greenhouse. Expert advice will help you choose an automatic window opener:

The automatic mechanism is mounted on windows or transoms that do not have a large windage. The opener is installed inside the greenhouse, in the upper part of the structure to be opened. For its installation, you only need a screwdriver and self-tapping screws. The thermal actuator can also be mounted on the greenhouse doors.

Equipment: greenhouse automation (video)

Greenhouse automation is a modern, convenient way to increase yields in a greenhouse. All processes in automated greenhouses occur without human intervention, which is indisputable advantage for gardeners whose garden plot is away from permanent place residence. Having equipped the greenhouse with automation, you will stop worrying about how not to forget to open the window, turn on the lighting and heating devices in the greenhouse: the “smart” system will do everything for you, creating the most optimal conditions for the growth and fruiting of culture!

Greenhouses are designed to provide optimal microclimate for the growth and development of plants. It can be large industrial buildings and a small place on the windowsill for growing your favorite flower. But even the smallest greenhouse on the windowsill needs care: watering, maintaining the right temperature, lighting level, etc.

Many gladly engaged in such an economy, but there is neither the strength nor the time for this. And only a dream tells: if only there was such a design that would be so smart that it would do everything itself. Such a greenhouse will be in demand by those who do not want to spend a lot of time caring for plants, and may also not have the opportunity to do so in case prolonged absence— business trips, holidays, etc.
We will start creating such a greenhouse, we will call it smart. And help us create smart greenhouse controller arduino. What functions will the smart greenhouse perform?
First, it is necessary to quickly receive all necessary information about the climatic parameters of our greenhouse: air temperature and humidity, soil temperature and moisture content, greenhouse illumination. Those. monitor the climatic parameters of the greenhouse.

What customer problem will the monitoring function solve? First of all, it will eliminate concerns about whether everything is in order with the plants during his absence: is there water in the system, has the electricity turned off, can the ventilation system provide the desired temperature if the room has become too hot, etc.

You can display monitoring data on the display, or use LEDs to notify about critical values ​​of climatic parameters, or receive data via the Internet or on a tablet.
Further, it is necessary to realize the possibility of managing the greenhouse - to carry out watering, heating, ventilation of plants, to regulate the illumination of plants. You can control it using automation, or remotely (via the Internet or via phone (tablet)).

The next stage is the autonomy function of the greenhouse. When the level of soil moisture drops below a certain value, it is necessary to turn on irrigation, when the temperature in the greenhouse drops, it is necessary to turn on heating, the illumination of the greenhouse must be carried out according to a certain cycle.

Figure 1. Schematic representation of a smart greenhouse

In our lessons we will look at practical implementation smart greenhouse project Let's create a smart greenhouse project -
« home flower". And let's start with the implementation of the greenhouse parameters monitoring function. For monitoring, we need to receive the following data about the environment of our flower:

  1. air temperature;
  2. air humidity;
  3. soil moisture;
  4. flower illumination.

To implement the monitoring function, we need the following details:

  1. Arduino Uno;
  2. USB cable;
  3. prototyping board;
  4. Wires "father-father" - 15 pcs;
  5. Photoresistor - 1 pc;
  6. Resistor 10 kOhm - 1 pc;
  7. Temperature sensor TMP36 - 1 pc;
  8. Temperature and humidity module DHT11 – 1 pc.
  9. Soil moisture module - 1 pc.

Positions 1-6 are available in the sets of the "Dare" series ("Basic", "" and " Smart House”), the TMP36 temperature sensor is available in the Basic and Learn Arduino kits. Links to positions 8 and 9 will be given at the end of the article.
First, let's get acquainted with the sensors that we will use for the function of monitoring the parameters of our project.
Using a photoresistor (Figure 2), the illumination is measured. The fact is that in the dark the resistance of the photoresistor is very high, but when light hits it, this resistance drops in proportion to the illumination.

Figure 2. Photoresistor

The TMP36 analog temperature sensor (Figure 2) makes it easy to convert the output voltage level into a temperature reading in degrees Celsius. Every 10mV corresponds to 10C, you can write a formula to convert output voltage to temperature.

0C = [ (Vout in mV) - 500] / 10

Offset -500 for operation with temperatures below 0 0C.

Figure 3. TMP36 analog temperature sensor

DHT11 sensor consist of capacitive sensor humidity and thermistor. In addition, the sensor contains a simple ADC for converting analog values ​​of humidity and temperature. We will use the sensor in the module version for Arduino (Figure 4).

Figure 4. DHT11 module

The soil moisture module (Figure 5) is designed to determine the moisture content of the soil in which it is immersed. It lets you know about under or over watering of your household or garden plants. The module consists of two parts: YL-28 contact probe and YL-38 probe, YL-28 probe is connected to YL-38 probe via two wires. A small voltage is generated between the two electrodes of the YL-28 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.

Figure 5 Soil Moisture Module

Now let's collect breadboard scheme shown in Figure 6.

Figure 6. Connection diagram for monitoring parameters for "Home flower".

Let's start writing a sketch. The photoresistor, TMP36 temperature sensor and soil moisture module are common analog sensors. For the TMP36 sensor, we can convert analog values ​​to temperature readings in degrees Celsius. To work with the DHT11 module, we will use the Arduino DHT library (Download). We will measure the data with an interval of 5 seconds and output the values ​​​​for the time being to the Arduino serial port.
Let's create a new sketch in the Arduino IDE, add the code from Listing 1 into it, and upload the sketch to the Arduino board. We remind you that in the Arduino IDE settings you need to select the type of board ( Arduino UNO) and board connection port.

Listing 1.

// DHT library connection #include "DHT.h" // DHT sensor type #define DHTTYPE DHT11 // DHT11 module data input connection pin int pinDHT11=9; // contact for connecting the analog output of the soil moisture module int pinSoilMoisture=A0; // contact for connecting the analog output of the temperature sensor TMP36 int pinTMP36=A1; // contact for connecting the analog output of the photoresistor int pinPhotoresistor=A2; // create an instance of the DHT DHT object dht(pinDHT11, DHTTYPE); void setup() ( // start serial port Serial.begin(9600); dht.begin(); ) void loop() ( // get data from DHT11 float h = dht.readHumidity(); if (isnan(h) ) ( Serial.println("Failed to read from DHT"); ) else ( Serial.print("HumidityDHT11= "); Serial.print(h);Serial.println(" %"); ) // getting the value from analog output of the soil moisture module int val0=analogRead(pinSoilMoisture); Serial.print("SoilMoisture= "); Serial.println(val0); // getting the value from the analog output of the TMP36 temperature sensor int val1=analogRead(pinTMP36); // mV conversion int mV=val1*1000/1024;// conversion to Celsius degrees int t=(mV-500)/10; Serial.print("TempTMP36= "); Serial.print(h);Serial.println( " C"); // get the value from the analog pin of the photoresistor int val2=analogRead(pinPhotoresistor); Serial.print("Light= "); Serial.println(val2); //pause 5 seconds Serial.println(); delay (5000); )

After uploading the sketch to the board, we open the serial port monitor and observe the output of values ​​​​with the readings of our sensors (Figure 7).

Figure 7. Outputting values ​​​​with the readings of our sensors to the Arduino serial port monitor.

And here is our grown flower (Figure 8).

Figure 8. Home flower project

Viewing sensor readings via the serial port is not very convenient, in the next lesson we will consider more

V. Karavkin
Radio designer 2000, No. 5, pp. 16-19

Offered greenhouse automatic control device used in the cold season or in northern latitudes.
Functions that this device can perform:
1. Modes "day", "night" - turning on and off the lighting at a given time. For this, two Chinese-made alarm clocks are used - there is no electronic or mechanical difference, the whole process of work is tied to the electronic sound emitters in them.
2. Control illumination - inclusion additional lighting
3. Humidity control
4.Temperature control

Functionally, the device itself consists of two parts: a time relay and an automation unit. The scheme of the first of them is shown in Figure 1

The device itself is a trigger. As already mentioned above, two Chinese alarm clocks were used as time-setting devices (in the diagram they are conventionally designated B1 and B2). When the first of them fires, one of the stable states is set at the output of the trigger and it will be held until another alarm goes off.
Transistor keys are connected to the outputs of the trigger, when opened, voltage is generated on their collectors high level(about 25 volts). The state of each of the keys is signaled by the glow of the LED.

The automation device consists of several comparators. Each of them has its own purpose: the comparator on the A1 chip is responsible for temperature control, the comparator on the A2 chip controls the illumination, the comparator on the A3 controls the humidity. The principle of their operation is clear and does not need a special description: when a certain threshold value is reached on the sensor, an electromagnetic relay is turned on, which will turn on the corresponding actuator (heater, electric lamp, electric pump, depending on the triggered sensor). It is only worth noting that the humidity sensor (according to the scheme, this is R21) here are two metal rods (preferably made of stainless steel) with a diameter of 3 .... 5 mm, immersed in the soil to the depth of the roots, and the resistance of the resistor R19 should be equal to the resistance of the sensor at optimal humidity. resistor R19, by the way, can be installed trimmer.

Now about what role the "day-night" signals play here.
As conceived by the author, these signals should create a difference between the night and day modes of operation of the greenhouse: in order to additional lighting turned on only in the daytime when there is not enough external lighting (for example, in cloudy weather or with short daylight hours), and the temperature at night was maintained slightly lower than in the daytime. Thus, the natural mode of plant growth is preserved.
To do this, the signals from the "day-night" timer make a slight adjustment to the operation of the comparators: a shift in the comparator operation threshold is introduced into the temperature controller, and the dimmer is generally blocked at night.

The relays used by the author in this device are KUTs-1 from the remote control of domestic TVs (they were also used in the Vega-122-stereo amplifiers in the protection device). Ordinary automotive relays can also be used, but then 100 Ohm quenching resistors should be installed in series with their windings - automotive relays are designed to work with 12 Volt voltage, and in this circuit, approximately 25 Volts are supplied to the relay winding.

If you would like to read the job description in more detail this device, then download the source magazine in our library (link above). It seems that there is no need to remind you that everything on our site is completely free....

As I wrote in the last part, initially setting the greenhouse parameters from buttons with display on the display was not planned, so I provided buttons and switches in the box.

All this could also be implemented programmatically, but since I already did, they retained their functionality:

Soil heating switch (heating off / automatic heating on),
- air heating switch (heating off / automatic heating on),
- three-position window opening switch (automatic off, windows open / automatic window control / automatic off, windows closed),
- button for filling water in the tank,
- irrigation button
- watering mode switch (once a day / twice a day)
- a button for turning on the backlight of the display, installed on top of the drawer. Turns on the backlight for 30s.

It is immediately clear that all this is for cases in which something suddenly goes wrong with the automation.
Now about the settings that can be set from the buttons on the panel. This winter, trying to imitate a greenhouse as much as possible, I worked on writing code for a box lying on the table.

So, the main menu consists of 3 items:
1. Settings menu.
2. Setting the date-time.
3. Test program for limit switches and window opening motors.

With setting the date and time, everything is clear. Test program - to connect windows, drive them with the help of buttons, check how they close, whether it is connected correctly, set up limit switches, etc.

The following options can be set in the settings menu:

1. Watering time.
2. Second watering time (if 2 times a day watering is enabled)
3. Water collection time.
4. Temperature of windows opening.
5. Windows closing temperature.
6. Switching temperature of soil heating.
7. Soil heating shutdown temperature.
8. Temperature of turning on the air heating.
9. Air heating shutdown temperature.

The wife said that since there is no redundancy and protection, if the limit switches do not work, you still need to set a limit for the operation of the pump and window motors. It was a correct and fair remark, so I had to enter the following settings:

10. Window opening motor limit time 1.
11. Window opening motor limit 2.
12. Window closing motor limit 1.
13. Window closing motor limit 2.
14. Pump run time limit.
15. Pump run time to start watering.

Now, to illustrate the operation of the menu, I propose to watch a short video:, / p>

Despite the fact that we still had snow in mid-April, I installed the control unit in the greenhouse and connected the soil heating (warm floor) without automation so far and air heating with a heater with automatic control. After a week that the soil warmed up to 30 degrees, at the time of the inspection the heater was turned off, the air temperature was 22 degrees - the sun is already working as it should.
In addition, on April 15, I turned on auto-ventilation to observe his work. You can also see how auto-ventilation works in the video:

Tried the following settings:

Opening windows 25 degrees;
- closing windows 21 degrees;
- turning on the heater 18 degrees;
- turn off the heater 20 degrees.

The settings were not optimal. That is, the temperature outside is 8 degrees and the wind. Approximately every 20 minutes the temperature in the greenhouse reached 25 degrees, the windows opened, the greenhouse was quickly ventilated, the windows at 21 degrees began to close, while they closed, the temperature dropped even lower, so immediately after closing the windows for 5 minutes. the heater turned on.

Changed settings:

Opening windows 28 degrees;
- closing windows 22 degrees;
- turning on the heater 16 degrees;
- turn off the heater 19 degrees.

Everything settled down, the greenhouse stopped slamming windows. Perhaps it is necessary to install another temperature sensor on the street and somehow correlate the temperature control in the greenhouse, based on its readings.

For two weeks, not only was the automatic temperature maintenance system tested in the greenhouse, but cucumbers were also planted on the 20th of April. Now let's talk about automatic watering. Its design in my greenhouse looks something like this:>

From a large tank, once a day at a certain time (set using the menu), water is poured into a tank located in the greenhouse using a pump. In my case at 10:00 am. The amount of water is determined by the activation of the float sensor. Just in case, through the menu, you can set the maximum operating time of the pump (protection against sensor failure. So, the water has poured:

After that, the water in the tank is heated all day in the greenhouse, which is warm. And in the evening, I have it set at 19-00, the pump turns on for 40 seconds, the water overflows and already by gravity, according to the law of communicating vessels, pours into the garden:

How did I set up automatic watering can also be seen in the video:

In early May, the temperature dropped to -8C for several nights. The heater worked, in the greenhouse the temperature was not lower than +12C, the soil temperature was +20C. Working in this mode revealed a lack of Chinese relays. Despite the fact that 10A 250V is stated in the specifications, and the heater is 1kW, the relay responsible for turning on the air heater began to heat up and "stick." I had to put a more powerful relay in series. At present, automatic watering is on and working. Next week I hope to bring the greenhouse online so that I can see its parameters on my website.
Currently, the sketch for Arduino looks like this: https://ideone.com/GvHs7u Please do not criticize the code - I am a beginner programmer, but the code is working, which has been proven, albeit for a short time, by operation.

circuit diagram and an installation example in

greenhouse thermostat on the microcontroller ATmega8.

One way to heat greenhouses is to use electricity. With good and smart automation, you can ensure a high efficiency of the heating system, as well as ease of maintenance and automation in maintaining the set temperature. The efficiency of the greenhouse can be significantly increased by heating the soil and maintaining the air temperature. When developing this device, a home-made electric boiler of 5 square meters was used. Two heating elements 2 + 3 sq. It is possible to use one heating element at a time, now it is warm outside, so one heating element copes well with the task. Heats a greenhouse 11 by 5 meters, height in the center - 3 m, double film, the greenhouse is deepened into the ground by one meter. The control unit monitors five points and manages three circuits. Two - a warm bed, room temperature. In the device menu, you can set your own temperature and hysteresis for each circuit. Separately for each circuit, day and night temperatures are set.

The thermostat also provides control of the coolant temperature for emergency shutdown boiler in case of overheating, as well as the ability to connect a temperature sensor to monitor additional parameter(e.g. outdoor temperature). The transition time from day to night mode and vice versa is set in the menu and is common to all circuits. The operation of the pump is controlled by the automation unit. If the temperature has reached the set parameters and the boiler has turned off, the pump will still work set time and turn off. The pump is applied one general, on warm beds and on the room. warm beds and air temperature, controlled by solenoid valves, 12 volts. Schematic diagram of the thermostat:

This is what the photo looks like soldered board from the track side:

1.Instruction for the operation of automation

The thermostat microcontroller works with 5 DS18B20 sensors. The sensors are connected to one bus. It may be necessary to reduce R1. MK distinguishes sensors by their serial number. When manufacturing for the first time, you will have to randomly determine which sensor is responsible for what and install them accordingly.

Data is displayed in integer format, tenths are discarded, and trailing zeros are suppressed. Temperature range from -9 to +99 degrees. If the temperature is out of range or if there is a sensor error on the display -- instead of the readings of the corresponding sensor.

At the first connection, upon successful initialization of all 5 sensors, their serial numbers will be written to EEPROM. This will allow you to work correctly in the future if some sensors are dismantled or faulty. In case of replacement of sensors, it is necessary to erase the EEPROM and turn on the device. Erase EEPROM is currently possible only in the programmer. Then I can figure out how to do it through the menu. MK will work without quartz 8 MHz. FUSE must be properly installed. Indicator based on HD44780 processor.

2.Working with a thermostat

1. The “MENU” button cycles through the menu pages.

2.In the setup menu (Installation), the parameter available for setting flashes.

3.Set using the PLUS/MINUS buttons as usual.

4. Clock on DS1307. The time is displayed in the format hh:mm:ss. Display format 24 hours. Access to the clock through the menu. Time settings are available on the page - in turn: seconds (PLUS / MINUS buttons reset the value of seconds), minutes, hours. The time for turning on the day mode - day and night - night is set. For modes, the output format is hh:mm. Clock settings are stored in the DS1307 memory.

5. Transition from one parameter to another using the UP / DOWN buttons. The buttons work on a single press, regardless of the duration.

6. After 10 seconds from the last press, the settings will be stored in memory. The display will go to the main mode.

7. When you press any button, as well as when power is applied, the backlight turns on. The backlight will turn off after 30 seconds from the last button press.

3. Boiler control algorithm

1. When power is applied to the device, the controller polls the sensors, reads information from the real time clock. The controller compares the current time with those set for day and night modes and selects the appropriate settings for the operation of thermostats.

2. Approximately after 5 seconds the device is activated and starts to control the boiler.

3. If the temperature from the Pol-1, Pol-2 or Office sensors becomes lower than the set one, then the pump, heater is switched on and voltage is applied to the corresponding actuator for supplying the coolant to this circuit. When the temperature rises above the set value by the hysteresis value, the heater is turned off, the pump remains in operation for 30 seconds to ensure cooling heating element to a safe temperature. To ensure the flow of water through the boiler circuit, the coolant supply remains open to this circuit for the duration of the pump operation. If the operation of the boiler is necessary for another circuit, then the coolant is switched off to an already unnecessary circuit immediately.

4. Emergency mode

1. If the temperature of the heat carrier exceeds the value set for the Boiler parameter, regardless of the state of the sensors, the pump is turned on, the heater is turned off, and the Office circuit is opened to ensure the flow of water through the boiler.

2. If the sensor of any circuit fails, this circuit is considered disabled, if the heater worked on it, then after 30 seconds, the pump and the circuit will turn off.

3. In the event of a malfunction of the heat carrier temperature sensor when the boiler is running, the device will switch the boiler to the mode as indicated in paragraph 4.1.

What else to read