Auto-irrigation of rooms with Arduino. Robimo autowatering roslin for Arduino help Electronic timers with software keruvans

Auto-irrigation of rooms with Arduino. Robimo autowatering roslin for Arduino help Electronic timers with software keruvans


Ard a room... At the thematic stores, they sell such a design at a crazy price. However, it costs as much as the machine independently adjusts the "ports" for the grower.

At the tsіy statty readachevі it is possible to install the power autowatering on the arduino. Microcontroller in this vypadku is represented by the control system of peripheral attachments.

Necessary tools and peripherals for the implementation of the project "Avtopoliv" on the basis of the microcontroller Arduino

Irigator - pristіy, scho control of the soil moisture content. Attached to the transfer of data to the sensor, which is also designed for automatic irrigation on the cob of the robot. For the folding of the programs, you can use the C ++ program.

Table with necessary materials:

component to describe
Microcontroller Arduino Uno The platform is stored in 2 parts: the software is hardware. The code for shutting down the byte devices is programmed on a non-bobbin middleware - Arduino IDE.

To install the program on the microcontroller, you need to add a USB cable. For autonomous robots, buy a 10 V living unit.

There are 12 pins on the platform, the role of these poles in digital introduction and delivery. Coristuvach individually vibrates the function of the skin pin.

USB cable Obligatory in the design of the "automatic watering on Arduino" system for the transferred code.
Sensor board - Troyka Shield For additional payment, you must connect the sensor periphery of the auxiliary cables. At the edges, the contacts are seam 3 Pina - S + V + G.
push terminal block Serve as a fixator for bundle wires. The design is fixed behind the additional buttons on the springs.
Living unit, equipments with usb input

Soil moisture analyzer

Ideal for connecting platforms. The design of the gears has a lichtary, which is to say about the cob of robots.

Pristosuvannya gives signals, if the ground is overwhelmed or lacking in space. Connection before payment is carried out for additional 3 drops.

● MAX gibini for burrowing into the ground - 4 cm;

● MAX power supply - 50 mA;

● Tension for grazing - up to 4 V.

Pump with a pipe for bored into the water The control is available for the assistance of the commutator. Dovzhin cable reach 2 meters.
power key Designed for mixing and dispensing an electric stake. Iakshcho vikoristovuvati attachment when constructing automatic irrigation Arduino, there will be no need for additional adhesions. The connection to the main panel is also connected with 3 wires.
Provid telephone line - "batko-batko" A bit of wires to connect the peripheral annexes.
Providing telephone line - "mother-batko" Carrying out also create annexes to the periphery.
room apartment The system is suitable for the type room roslin.

Scheme of connection and algorithm of robots in the project "Avtopoliv" on the basis of mk Arduino

The lower representations are the algorithm and the diagram of the connection to the project on the arduino platform. Autowatering will be the offensive rank:

  1. Development of a board for a sensor on a microcontroller.
  2. A key analyzer for additional payment, described in food, up to the analogous pin - A0.
  3. The sensor is accepted by the microcontroller:
    1. Contact CS is connected to pin number 9 on the board.
    2. Functional SPI contacts are connected to the display on the same board.
  4. The power key is inserted into pin No. 4.
  5. The switch is brought up to the power switch in roses, denoted by the letters p +, p-.
  6. now switch water pump from the tube behind the auxiliary terminal block in contact with the letters l + і l-. Proceedingly before constructing a human being prompted a diagram.
  7. Built-in touch panel, as an analysis of the logic, in the housekeeper with a letter.
  8. Kinets tube is inserted with water into the soil. Once I have a roselin at once with a housekeeper behind a wagon I don’t change 2 kg, the okremo hose is closed. You can also throw over the sheet for water droplets.
  9. I lower the water pump into a dance, reminiscent of water.
  10. Pidklyuchaaєmo design to electric living.

Below we offer you two alternative schemes for our annex:

The sensor analyzes the soil acidity status. Before inserting an irrigator into the system, it is necessary to protest and display the following:

  1. Record the views on the display. At the same time, the sensor should be jammed into a dry potter. Tse to be recognized, yak min vologosti.
  2. The earth is watered with the growth. Chekaumo, if the water is to revive the soil before the end. Todi is shown on the touch screen to show one rіven. It is necessary to write down the disclaimer of the property. Tse means max vologosti.
  3. I will write down the notepads of the physical constants HUM_MIN and HUM_MAX to these values, as bulo is corrected in the result of calibrations. Prescribed meaning in the program, as it is transferred to the microcontroller.

Vishche described the design of autowatering for one ticket. However, among the lovers of the rooms, the booths are furnished by the highlanders with the quits. On one side, the power supply is also foldable: it is necessary to connect the pump decal and analyzer to the soil. Ale іsnu is much cheaper and simpler in the design of autowatering.

At the hose from the pump, open 25 centimeters for an additional sewer. In the otrimanі dіrochki, there are shmatochki hair cut pens in the bag format. Go to the bag:

  • mountaineers with roslins shykuyutsya in a row on pidvіkonnі;
  • the tube is placed on the quart-sized housekeeper so that the water from the skin poured into the okremiy housekeeper;
  • voila: vinakhid watering all the growing lines at once.

Koristuvach self-selected hour for watering, ale only for one card. Frequently there are no quotations for the same size and size. Otzhe, the soil in the mountaineers dries up for the same hour. For many inventions, the method of combination: the number of housekeepers is divided into groups of wagons and sizes.

Applied to the code for Arduino for the "Auto-watering" project

We turn to the program code:

// Zavanazhuєmo library for robotic display and switch to programs #include "QuadDisplay2.h"; // This is a constant that denotes the contact before the water pump is connected // #define VODPOMPA_PIN 4; // Construct a constant, which denotes a contact, to which one was connected // an analyzer of the earth vologue #define HUM_PIN A0; // Min by volume #define HUM_MIN 200; // Max by vologosti #define HUM_MAX 700; // Hour of changing watering #define INTER 60000 * 3; // It’s a big change, in case the value of the amount will be taken. Unsigned int hum = 0; // In the middle of a change, we will take the hourly advance unsigned long Time = 0; // Ogoloshuєmo object in the QuadDisplay class, then the license plate is transferred // to the CS QuadDisplay contact dis (9); // Create a method that will respond to a display robot void setup (void) (// Run the begin () method; // A clean function that will respond to the output of a water pump from // contact pinMode (VODPOMPA_PIN, OUTPUT); // the display lights up the number - 0 dis.displayInt (0);) // The method is created, which is shown for the indicator for the current moment void loop (void) (// The indicator for the current moment for the moment int humNow = analogRead (HUM_PIN); // If the value of the indicator is not in front of the front, then ... if (humNow! = Hum) (// Take the value at once hum = humNow; // View the value on the screen displayInt (humNow);) // Ask me: how to get rid of the tasks about an hour і // the status of the volog in the ground is less than necessary, then ... if ((Time == 0 || millis () - Time> INTER) && hum< HUM_MIN) { // Даем сигнал о начале работы водяной помпы digitalWrite(VODPOMPA_PIN, HIGH); //Объявляем потом, длящийся 2 секунды delay(2000); // Завершаем работу помпы digitalWrite(POMP_PIN, LOW); // Ставим в значение переменной Time текущее время и добавляем 3 минуты Time = millis(); } }

Before that, you can marvel at a couple of videos from our colleagues.


This statistic will describe how a small unit is to be assembled for automatic watering roslin on the basis of Arduino with vologost control. The need for watering itself will be based on the sensor in the soil content. With bazhanna, you can water the sprinkle of roselin all at once.

Materials and tools:
- Arduino Uno
- Roslin as a housekeeper in dry land
- Water pump
- Sensor in the ground with a loop
- Power key (three) with a loop
- Clamp clamp
- Provid "tato-tato" × 1 piece
- Provid "mama-tato" × 1 piece
- Living unit with USB rose
- USB cable

zbirka:
The display is connected to contact 3 triika-Shild. When all wires are connected to this type, it is important to use the GND contact to close the black hole.

At the pump on the ends of the daytime contacts, the terminal block is victorious. If you need to solder the contacts, then solder them correctly to the wires with the "pinned wires".

The axis is so visible to the connections:

For the additional Arduino IDE, program the Arduino Uno, attach it to the file below. The sensor itself vologosti, very well, to be embedded in the ground. Come down the end of the tube with water into the ground. As the housekeeper is important, the author recommends that you close the pipe so that the roslin is not turned upside down. Dal, the pump is lowered into the water, and the food is connected.

calibruvannya:
When the sensor is shown, it is necessary to carry out an awkward procedure for calibrating. That is why the accuracy of the indication must be deposited without the presence of acidity in the soil.

1. When you slip into a dry housekeeper, the sensor will be shown on the display. The price is low and low.

2. Pouring water and checking that the water doesn’t get into the ground, and the sensor is shown to be drawn at one value. Dani to sign up and to be recognized as the maximum value.

3. The firmware file will change the value of the HUMIDY_MIN constants, the minimum value will be set, and the HUMIDY_MAX will obviously have the maximum value. Arduino Uno flash again.

scale of the project
There are given statty descriptions of the way of watering everything for one ticket. Ale often needs to be watered immediately with a sprinkle of roselin. Obviously, you can connect more pumps and sensors to the Arduino, but it will be more expensive. The author, in general, promotes the solution is cheaper and simpler. At the pipe, the yak is brought to the pomp, the darts are pierced with an awl, there are close to 30 centimeters between them, in the opening there is a cut from the vicoristan bag handle.

The mountaineers in the booth, as a rule, stand in a row, for example, on the pidvikonn. The pipe was laid on the mountaineers, so the skinny openings were told by the housekeeper. Only the axis of the decision about watering will be taken into account by adding one driver at a time. Most of the time, mountaineers of the same size will often go to the pavilions in this way. Dry the soil in them will be approximately the same. When bazhani i great number roslin at your house, you can connect additional pumps, and distribute all the mountaineers in groups of equal size.

To implement the project, we need to establish a library:

  • Library iarduino_4LED (for robots with a four-digit LED indicator).

About those how to install libraries, you can check out the page Wiki - Installing libraries in the Arduino IDE.

Video:

Connection diagram:

In this urotsi, LED indicator of connections to digital connections 2 and 3, buttons to connect to digital connections 11 and 12, power switch to digital connection 10 (with PWM), sensor of ground level to analog input A0.

Robotic algorithm:

  • When filing a living, Pristrіy is inactive (on the blimas indicators, the value of the soil is exactly the same).
    • As soon as one-time press the buttons "A" and "B" on the offense, then the flowing mill in the soil will be saved as borderline (if you need to start watering) and adjust to the working mode. The boundary value of the soil content can be changed to the input value mode.
    • If you push the buttons "A" and "B" for more than 2 seconds, then you will switch to the entered value mode.
  • Work mode set to display on the indicator of the following: flowing water content of the soil, threshold water content of the soil and an hour to pass through the moment of the last watering. (The threshold value of the soil is perceived to be darker and lower than the average). If you are in the working mode and the value of the flowing water content of the soil in the lower value of the threshold water content of the soil, then you will switch to the irrigation mode.
  • Watering mode set the indicator on the number of seconds until the end of irrigation and blimp points, and also give a PWM signal to the power switch, which turns on the pump. The value of the PWM (pump motor speed) is included in the sketch. The triviality of watering is set to the entered value mode. After finishing watering, prist_y to switch to the och_kuvannya mode.
  • Have a regime set the indicator to write STOP and blimas with dots. The Danish transmission mode is used to ensure that the operator is uniformly spread over the ground before the attachment switches to the working mode. An hour of staying in the ochikuvannya mode will be used in sketches. After the end of the hour to the ochikuvannya mode, try to switch to the working mode.
  • In value input mode you can switch to any mode by touching the “A” and “B” buttons for more than 2 seconds. The Danish mode is stored in two points: setting the threshold water content for the soil (if you need more watering) and setting the triviality for the watering itself. The value of the threshold value can be displayed, as it is possible to change the onslaught either by pressing the button "A" (change), or the button "B" (increasing). If you press the buttons "A" and "B" on the offense one time, then the meaning will change to the exactness of the soil. If the threshold is set, it will take more than 2 seconds to push the buttons "A" and "B" zbіlshennya). For this purpose, the triviality of watering is set, it is necessary to press the buttons "A" and "B" for more than 2 seconds, and switch to the working mode.
  • When in the watering mode, press the button, try to pin the watering and go into the cleaning mode.
  • When in ochіkuvannya mode, press a button, set it to work mode.

Program code:

#include // switch to a library for robots with a four-digit LED indicator iarduino_4LED dispLED (2,3); // a naked object for robots with the functions of the library iarduino_4LED, from the values ​​of the indicator (CLK, DIO) const uint8_t pinSensor = A0; // blatant constant from the values ​​of the analog input number, before any connection to the ground level sensor const uint8_t pinButtonA = 12; // outrageous constant from the values ​​of the number to the input, to which the button A is connected const uint8_t pinButtonB = 11; // outrageous constant from the values ​​of the number to the output, to which the button B is connected const uint8_t pinPump = 10; / * Visnovok with PWM * / // a blatant constant from the values ​​of the number in the output, before any connection the power key uint8_t btnState; // a bold change for the selection of buttons: 0-pressed, 1-pressed A, 2-pressed B, 3-pressed A and B, 4-pressed A, 5-pressed B, 6-pressed A and B uint16_t arrMoisture; // naked array for saving 10 residual values ​​for soil vologosti uint32_t valMoisture; // bold change for the average value of the soil value uint32_t timWatering; // a bold change for an hour to sprinkle the cob of last watering (in milliseconds) uint32_t timSketch; // out of the blue for taking an hour to run from the moment the sketch starts (in milliseconds) const uint8_t timWaiting = 60; // outrageous constant for taking an hour to clean up for watering (in seconds) from 0 to 99 const uint8_t pwmPump = 100; // a blatant constant for the wrap of the pump motor (efficiency) from 0 to 255 uint16_t timDuration = 5; / * For suggestions * / // there is a lot of change for trivial watering (in seconds) from 0 to 99 uint16_t limMoisture = 0; / * For substitutions * / // a clear change for saving the threshold water content for the soil (for turning on the pump) from 0 to 999 uint8_t modState = 0; / * At the start * / // I will make a big change for the sake of becoming an annex: 0-active, 1-clean, 2-active, 3-watering, 4-setting the threshold, 5-setting the hour of watering void setup () (dispLED. begin (); // іnіtsіyєmo LED indicator pinMode (pinButtonA, INPUT); // translatable pinButtonA to pinMode input mode (pinButtonB, INPUT); // translatable pinButtonB to pinMode input (pinPump, OUTPUT); // translatable to pinButtonB input mode (pinPump, OUTPUT); // translatable pinPump to the output mode digitalWrite (pinPump, LOW); // vimikєmo pump timWatering = 0; // skidmo hour for a cob of stop watering) void loop () (// ******* Reading tribute: ****** * btnState = Func_buttons_control (); // reads the set of buttons, but not more than 2 seconds timSketch = millis (); // reads an hour from the moment the sketch starts if (timWatering> timSketch) (timWatering = 0;) // Zero one hour for the ear the rest of the watering, when it has become re-sowing millis () valMoisture = 0; for (int i = 0; i<9; i++){arrMoisture[i]=arrMoisture;} arrMoisture=analogRead(pinSensor); for(int i=0; i<10; i++){valMoisture+=arrMoisture[i];} valMoisture/=10; // вычисляем среднее значение влажности почвы //*******Управление устройством:******* switch(modState){ // Устройство не активно case 0: if(btnState){ // если зафиксировано нажатие или удержание кнопок if(btnState==6){modState=4;} if(btnState==3){modState=2; limMoisture=valMoisture;} } if(timSketch%100==0){ // если начинается десятая доля секунды if(timSketch/1000%2){dispLED.print(valMoisture);}else{dispLED.print(" ");} } break; // Устройство в режиме ожидания (после полива) case 1: if(btnState){ // если зафиксировано нажатие или удержание кнопок if(btnState==6){modState=4;} if(btnState==1){modState=2;} if(btnState==2){modState=2;} if(btnState==3){modState=2;} } if(timSketch%100==0){ // если начинается десятая доля секунды dispLED.print("stop"); dispLED.point((timSketch/100%4)+1,true); } if(timDuration+timWaiting-((timSketch-timWatering)/1000)<=0){// если закончилось время ожидания modState=2; } break; // Устройство активно case 2: if(btnState){ // если зафиксировано нажатие или удержание кнопок if(btnState==6){modState=4; dispLED.light(7);} } if(timSketch%100==0){ // если начинается десятая доля секунды if(timSketch/1000%15<5){dispLED.light(7); dispLED.print(valMoisture);}else if(timSketch/1000%15<10){dispLED.light(1); dispLED.print(limMoisture,LEN4);}else {dispLED.light(7); if(timWatering){dispLED.print(int((timSketch-timWatering)/1000%3600/60),int((timSketch-timWatering)/1000%3600%60),TIME);}else{dispLED.print("----");}} } if(valMoisture<=limMoisture){ // если текущая влажность почвы меньше пороговой timWatering=timSketch; modState=3; dispLED.light(7); analogWrite(pinPump,pwmPump); } break; // Устройство в режиме полива case 3: if(btnState){ // если зафиксировано нажатие или удержание кнопок if(btnState==6){modState=4;}else{modState=1;} analogWrite(pinPump,0); } if(timSketch%100==0){ // если начинается десятая доля секунды dispLED.print(timDuration-((timSketch-timWatering)/1000)); dispLED.point(0,true); dispLED.point((timSketch/100%4)+1,true); } if(timDuration-((timSketch-timWatering)/1000)<=0){// если закончилось время полива modState=1; analogWrite(pinPump,0); } break; // Устройство в режиме установки пороговой влажности почвы case 4: if(btnState){ // если зафиксировано нажатие или удержание кнопок if(btnState==6){modState=5;} if(btnState==1){if(limMoisture>0) (limMoisture--;)) if (btnState == 2) (if (limMoisture<999){limMoisture++;}} if(btnState==3){limMoisture=valMoisture;} if(btnState==4){while(digitalRead(pinButtonA)){if(limMoisture>0) (limMoisture--;) delay (100); dispLED.print (limMoisture);)) if (btnState == 5) (while (digitalRead (pinButtonB)) (if (limMoisture<999){limMoisture++;} delay(100); dispLED.print(limMoisture);}} } if(timSketch%100==0){ // если начинается десятая доля секунды dispLED.print(limMoisture); } break; // Устройство в режиме установки длительность полива case 5: if(btnState){ // если зафиксировано нажатие или удержание кнопок if(btnState==6){modState=2;} if(btnState==1){if(timDuration>0) (timDuration--;)) if (btnState == 2) (if (timDuration<99){timDuration++;}} if(btnState==4){while(digitalRead(pinButtonA)){if(timDuration>0) (timDuration--;) delay (100); dispLED.print (timDuration);)) if (btnState == 5) (while (digitalRead (pinButtonB)) (if (timDuration<99){timDuration++;} delay(100); dispLED.print(timDuration);}} } if(timSketch%100==0){ // если начинается десятая доля секунды dispLED.print(timDuration); dispLED.point(0,true); } break; } } // Функция определения состояния кнопок uint8_t Func_buttons_control(){ uint8_t a=0, b=0; // время удержания кнопок A и B (в десятых долях секунды) while(digitalRead(pinButtonA)||digitalRead(pinButtonB)){ // если нажата кнопка A и/или кнопка B, то создаём цикл, пока они нажаты if(digitalRead(pinButtonA)){if(a<200){a++;}} // если удерживается кнопка A, то увеличиваем время её удержания if(digitalRead(pinButtonB)){if(b<200){b++;}} // если удерживается кнопка B, то увеличиваем время её удержания if(a>20 && b> 20) (dispLED.print ("----");) // if (a> 20 && b == 0 ) (return 4;) // if the A button shrinks for more than 2 seconds, turn 4 if (a == 0 && b> 20) (return 5;) // if the B button shrinks for more than 2 seconds, turn 3 delay (100) ; // cover for 0.1 seconds, to stifle dirt) if (a> 20 && b> 20) (return 6;) // if the buttons were offended for more than 2 seconds, turned 6 if (a> 0 && b> 0) (return 3;) else // if the button was offended in less than 2 seconds, turned 5 if (a> 0 && b == 0) (return 1;) else // if button A was pressed in less than 2 seconds, turned 2 if (a == 0 && b> 0) (return 2;) else // if button B was pressed less than 2 seconds, turned 1 (return 0;) // if one of the buttons was not pressed, turned 0)

All good day! The axis has come in summer, everyone is going from the place, from the land, and at home, as the growths are in need of watering. At the end of the day, until all the heat is reached, the weather will be increased by the amount of watering of the roselin. And in order to do this, do not take your love for a change, we propose to use an automatic watering system for it, because of our current situation.

1.Information about prist_y

To root the system and watering, we need:

  • Arduino uno
  • Ground viscosity sensor - arduino module
  • Pump (Water pump) - a water pump so you can buy it yourself in China or build it yourself. For a pump, I will turn on the pump at less than 12 volts for an additional relay.
  • Інші important drіbnitsі - a hose of small diameter, a compartment for water, darts, dzherelo vivlennya.

Immediately, I’ll say I’ll say that we will not connect everything to the right to the water supply. Would you like to find out about the state of the art, for simplicity and slickness, we will vikoristovuvat reservoir (mnist with water). A pump (pump) will pump water from the reservoir, a little effort will be enough; If you want to pump a varto vrahuvati when you pidbor: a hose, the pump is installed before watering the rose line, the type of pump. In the case of a collapsible hose, it is not very wide, vibrating along the diameter of the pump outlet, but the fault is not very wide at the outlet to the line. If the system is prompted, the type of irrigation is required, the optimal drip irrigation is used. Vyhodyach from ts'go prisosovuyut a vilny end of the hose from the pump.

2. The sensor of the moisture content of the soil

The sensor of the soil moisture content is displayed as an analog signal from 0 to 1023 or digital (0 or 1). We will be able to use an analog signal for greater control of the minimum volume. The value is 0 tse maximum vologosti, 1,023 maximum dry. We will be victorious, the value of 200 is sufficient vologism, the value of 600 is critical dryness. The thresholds for dryness and dryness, if necessary, can be changed in the arduino sketch. The sensor itself is stored in two parts: a probe (sink into the ground) and a comparator. A sensor from 3.3 to 5 volts can be recorded, you can vikoristovuvati in vbudovanie rose arduino.

Comparator circuit on LM393:

Dani to go on the signal wire a0 and to be switched on by the offensive rank:

3. Practical implementation

Robot logic: once per second (you can make more than three steps) arduino will deduct the value from the sensor. If the value is more than 550, the pump didn’t pump out 15 minutes of arduino, it turns on the relay (until the pump is switched on) for an hour of time_work. Covering 15 chilines with irrigation was shattered for that, b the vologue got wet into the ground and the pump pumped more water and less demand. Minliva time_work will set the hour for the robot pump, and it will take an hour for whatever your pump is to fire up the vykachati, I will need a lot of water from your roselin.
After the watering, 15 quills for the robot pump will be installed, with the whole arduino, I will continue to do the same. And then everything is cyclical. When the water level sensor is broken, the pump will not turn on even if there is little water in the tanks and there was an indication.

Connection diagram:

Vlasne the code itself:

Int minv = 600; // low level int maxv = 220; // re-irrigate int normv = 500; // trochs of the vologue int value = 0; // remove the value int last_value = 0; // stop meaning change int value_sdvig = 50; // I mean a change int ralay = 6; // pin relay int time_work = 10; // pump robot hour per second int analogPin = A0; // sensor pin

// Change timeout
int second = 0; // seconds
int time_off = 0; // chiller for an hour
int pause_time = 15; // hour to fix the watering in khiliny

void setup () (
// put your setup code here, to run once:
Serial.begin (9600);
pinMode (ralay, HIGH); // relay setting
digitalWrite (ralay, HIGH);
}

void poliv ()
{
int time_tmp;
time_tmp = time_work;
digitalWrite (ralay, LOW);
while (time_tmp> 0 && value> normv) (// check for the end of the hour of time_work or normal soil conditions
delay (1000);
value = analogRead (analogPin); // the same value
time_tmp--;
}
digitalWrite (ralay, HIGH);
second = 0; // skid seconds to zero
time_off = pause_time; // I will set it up with irrigation
}

void loop () (
// put your main code here, to run repeatedly:
value = analogRead (analogPin);
if (value> (last_value + value_sdvig) || value<(last_value-value_sdvig)){// если last_value отклонился на value_sdvig выводим value в uart
Serial.println (value);
last_value = value;
}
if ((value> (minv-value_sdvig)) && time_off<1) poliv();//если значение влажности >critical vology - 50 or no recent irrigations
// time functions shouldn't be too busy with timers
if (second> 59)
{
second = 0;
if (time_off> 0) time_off--;
}
delay (1000); // pause 1 sec
second ++;
}

All for this year, thank you all for the respect! Check your comments.

For that, I had a gift for me, I was aware that it was impossible to automate the irrigation process. To that I vapnenniy, I won’t die through the marriage of Vodi.
I took over the design, as if I watered the letter instead of me. As a result, I have an axis of such a device that can cope with its own connections:

With the help of two regulators, it is possible to set up watering at a time, as well as during the period of watering. To whom Tsikavo - Dal lecture, Yak zrobiti such pristіy. At the heart of the brain, I stuck Arduino (Arduino Mega).
For a folding sprinkler, you need a few components and no more than 30 minutes per hour.

Vikoristovuvani components:

  • Arduino Mega
  • A pump and a silikon tube (if a pump for washing car windows is available - you can buy it from any auto parts or you can buy a small submersible pump on ebay)
  • Living block
  • Two variable resistors for regulation (be-yaki)
  • transistor IRL3705N
  • Two resistors (100 Ohm і 100 kOhm)
  • Diod (be-like)
  • Water tank (in my opinion a plastic box from Ikea)
  • layout

Everything is taken in this scheme:

Above first:

The axis was found in me:

With a spatku protest pump. Podamo for new 5V. Yaksho vin zazizhchav, everything is in order, dal.

Now the pump is connected to the Arduino. For control of the pump from Arduino, there is a small binding on the layout.

I will try to play with a pump from Arduino. Call this code

int pumpPin = 5; void setup () (pinMode (pumpPin, OUTPUT); digitalWrite (pumpPin, LOW);) void loop () (digitalWrite (pumpPin, HIGH); delay (1000); digitalWrite (pumpPin, LOW); delay (1000);)

Yaksho vin periodically dizzychit, that means, I know everything is in order.

Now we have lost two regulators. Pidchepity to our attachment change resistor, and convertible to the receptionist.

Call this code on Arduino

int volumePin = A0; void setup () (pinMode (volumePin, INPUT); Serial.begin (9600);) void loop () (Serial.println (analogRead (volumePin)); delay (100);)

Go to the Serial Monitor and the re-connection, which is the reaction to the turn of the regulator. Guilty of a change approximately from 0 to 1024

Now I have become overwhelmed with zmusiti to earn all at once.

Axis without middle sprinkler code:

// The first regulator controls the hour, when the water will flow (from 4 to 15 seconds) #define MAX_FLOWTIME 15 // seconds #define MIN_FLOWTIME 4 // seconds // Another regulator controls the frequency of watering once a day until once a day#define MAX_PERIOD 7 // days #define MIN_PERIOD 1 // days #define MAX 1015 #define MIN 0 int volumePin = A0; // Pin, before any supply, the regulator, which is responsible for watering with water int periodPin = A1; // Pin, until the regulator is hooked up, which is the same for the period between irrigation int pumpPin = 5; // Pin, before which pump control is assigned int volume; int period; // A procedure that turns on the pump for an hour, tasks in volume void water () (digitalWrite (pumpPin, HIGH); // turn on the pump delay (volume); digitalWrite (pumpPin, LOW); // vimikaєmo pump delay (period); ) Void setup () (pinMode (pumpPin, OUTPUT); digitalWrite (pumpPin, LOW);) void loop () ( // Read the value of the regulators (change resistors) volume = map (analogRead (volumePin), MIN, MAX, MIN_FLOWTIME, MAX_FLOWTIME) * 1000; period = map (analogRead (periodPin), MIN, MAX, MIN_PERIOD, MAX_PERIOD) * 1000 * 60 * 60 * 24; water (); )

The axis is all ready. Nasolodzhuєmosya vіdpochinkom. and you will be the nobility of your growths to clean the water.

pereview

Save in Odnoklassniki save VKontakte