» Electronics » Arduino »Automatic watering system for indoor plants pumperino

Automatic watering system for indoor plants pumperino


The following tasks were set:
  1. To make a device for automatic regular watering of indoor plants with adjustable duration of watering;
  2. Make cheap;
  3. Use the minimum number of tools;
  4. To make it simple, preferably from ready-made components, so as not to go too much into the delights of electrical engineering;
  5. Fit into the volume of the standard box for the REU, so as not to bother with the design of the case and 3D printing;
  6. Minimally disfigure the box when installing components, as much as possible;
  7. Use the minimum number of buttons to control;
  8. Use a decoupling breadboard to not design pcb;
  9. Design a device with a minimum number of short wires connecting components inside the case;


The following components were used (estimated price excluding delivery in Chinese stores):
  1. Set for irrigation (383.48 rubles) - hoses, connectors, racks;
  2. 12V pump, 800 ml / min (121.56 rubles);
  3. Prototyping board Arduino Nano v3 (126.94 rubles);
  4. 5V step-down power supply module (60.45 rubles);
  5. Green button switch with self-reset (19.48 rubles), 175.96 rubles. / set (10 pcs);
  6. Membrane keyboard for 4 keys (48.36 rubles);
  7. MOSFET IRF520 module (19.48 rubles);
  8. OLED display yellow-blue 0.96 inches 128x64 I2C SSD1306 (132.98 rubles);
  9. Power connector (module) 5.5 mm x 2.1 mm DC-005 (27.54 rubles), 187.38 rubles. / set (10 pcs);
  10. ABS housing with a transparent cover 115 mm x 90 mm x 55 mm (212.23 rubles);
  11. Power supply 12V 1A (179.99 rubles);
  12. 4x6 unwrapping prototype board (83.28 rubles / set (5 pcs.));
  13. Nylon struts (spacer) M2 white (232.37 rubles / set (180 pcs.));
  14. Nylon struts (spacer) and M3 nuts are black (227 rubles / set (180 pcs.));
  15. Two-component epoxy adhesive (56.42 rubles);
  16. 24 AWG wires black and red, 2 x 71.86 rub. / set;
  17. Silicone flexible wires 20 AWG blue and white 5m, 2 x 144.40 rubles;
  18. Wires Dupont female to female 10cm (43.66 rubles);
  19. 10k ohm resistor (5 rubles).


As you can see, the cost of the initial production of such a model without taking into account the cost of tools may exceed 2,700 rubles (excluding delivery). The second device will cost 1300 rubles (excluding delivery). You can also save on a set for irrigation, whose individual components (tees, hoses and racks) are very cheap if you buy them separately and in bulk. 50 pcs of tees cost about 50 rubles, and 20 meters of hose about 500 rubles.This hose is ideal because it fits snugly on the pump leads (5 mm) and, in principle, does not require the use of clamps. Although, for safety, clamps are still better to use (in Russia, clamps with a diameter of less than 8 mm are certainly not for sale).

Instruments:
  1. Soldering iron, flux gel, POS-41 solder, silicone mat, shavings for cleaning tips;
  2. Screwdriver;
  3. 8mm wood drill
  4. Ceramic drill 12mm;
  5. Set of files COBALT 247-835 (flat, 3 and 4 mm);
  6. A set of screwdrivers for microelectronics.


Production progress:
First, a prototype was built on the breadboard using a ready-made button module. Instead of a test pump, a 12 V ceiling lamp was used.

The membrane keyboard and OLED display were tested on the assembled device.
Then the soldering was done on the soldering prototype board:

As a result, the following scheme was implemented:

Manufacturing difficulties
  1. It’s harder to find suitable fasteners than electronic components, and it costs more due to the widespread sale in bulk. In Russia, finding an affordable price is almost impossible;
  2. One box for REA was mutilated. It turned out that there was not enough free space in height, although nothing portended. Packing the elements inside a small case turned out to be a more difficult task than designing the electronic filling of the device;
  3. Drilling square holes is associated with great inconvenience and cost. In this project, I refused them, and a small engraver was purchased for the future;
  4. Also related to the previous feature is the problem of outputting a power connector into the hole on the case (round connectors are sold only in Chinese stores). As a result, a module with a bright blue LED was used, mounted on the board and close to the cover. The hole in the cover for connecting the power supply is made by two different drills. Also, with the help of small files, a rectangular hole was cut in the lid under the miniUSB connector and the case was cut for the output of the keyboard loop;

  5. Very few small buttons for mounting in a round hole on the housing. 5, 7 and 8mm - literally on one model and only in Chinese stores;
  6. From the MOSFET IRF520 module, I had to solder the corner legs, and solder the straight so that it fit inside the body along the length;

Assembled device:




The device works very simply: by pressing the green button, watering is carried out forcefully. If you click on it during watering, it stops. In automatic mode, watering is carried out at an interval multiple of days. The duration of watering (in seconds) and pause (in days) is controlled using the membrane keypad (you need to find stickers “more or less” somewhere).

Interesting features
  • Due to space saving and device simplification, I refused to use the real-time RTC module and limited myself to using the millis () function to regularly turn on the pump by timer;
  • The display turns on by pressing any of the membrane buttons and turns off after 10 seconds if there are no clicks. Made to prevent rapid burnout of the OLED display. The display uses a modified library ozOLED (thanks) since adafruit exercises take up a lot of RAM. Interestingly, for the full use of ozOLED I had to implement a check of the number of characters displayed on the screen, because the missing character must be replaced with a space (for example, to display 9 after 10, you must print 9_, otherwise it will print 90);
  • Moisture sensors are not intentionally used. Ensuring an ideal life for plants was not part of the project. The goal is to ensure the survival of plants in the summer, while the tenants of the apartment are in the country;
  • The power supply from the 230V network is intentionally used, since the autonomy of the device in a city apartment is not required. For the same reason, the power consumption was not optimized (the LEDs did not evaporate, and deeper saving modes are not used than IDLE);
  • The 1x4 membrane keyboard was chosen for one reason: a convenient library was written for it AmperkaKB, which allows you to simply use this keyboard, rather than thinking about triggers, events, sticks and rattles.Yes, I know that in this library the code for three keyboards is at once - there is enough Arduino Nano memory. The order of the contacts of this keyboard does not correspond to the order of the buttons: the first contact is common, the rest of the contacts have the reverse order of numbering on the keyboard;
  • EEPROM is used to store only two values ​​of variables - activity time and timeout (in milliseconds). Resetting these values ​​to default states is realized by clamping the first membrane button for 3 seconds;
  • The cover is only connected to the housing through the detachable connections of the green button and the power of the pump.

I hope that this review will help beginners to navigate in the manufacture of their homemade on Arduino and will not repeat my mistakes.
with code and schema in Fritzing.
7.7
9.7
9

Add a comment

    • smilesmilesxaxaokdontknowyahoonea
      bossscratchfoolyesyes-yesaggressivesecret
      sorrydancedance2dance3pardonhelpdrinks
      stopfriendsgoodgoodgoodwhistleswoontongue
      smokeclappingcraydeclarederisivedon-t_mentiondownload
      heatirefullaugh1mdameetingmoskingnegative
      not_ipopcornpunishreadscarescaressearch
      tauntthank_youthisto_clueumnikacuteagree
      badbeeeblack_eyeblum3blushboastboredom
      censoredpleasantrysecret2threatenvictoryyusun_bespectacled
      shokrespektlolprevedwelcomekrutoyya_za
      ya_dobryihelperne_huliganne_othodifludbanclose
6 comments
Yes, a protective diode should always be installed with an inductive load, whether it is a relay coil or a motor. As far as I know, the mechanism of damage to the transistor without this diode is this. When the transistor is closed, the self-induction EMF is added to the voltage of the power source, moreover, it is added to the “necessary” polarity and the transistor is flashed with an increased voltage.
Author
I am in applied electrical engineering - zero. At the time, at the university, he only drew circuits in programs like NI Multisim. Now there is little to do with this at work, I mainly write computer applications and paper scientific and technical products. Hence the children's mistakes.
Thanks for the comment, I already googled about inductive load and reverse current protection.
Quote: Eig
I didn’t know about the features with the fieldman
This is not only with a field operator, any transistor (bipolar, field, SIT, IGBT) operating on a serious inductive load (ED, relay, solenoid, etc.) must be protected with a diode.
For the first project on Arduino - it’s not very bad.
A couple more tips:
It is better to use a submersible pump in general in a tank separate from the housing with electronics. Moreover, the water tank must necessarily be below the level of the windowsill (or the place where the pots are). Otherwise, according to the principle of communicating vessels, after turning off the pump, the water will not stop flowing until it runs out.
Author
Thanks for the comment. A very rewarding experience. I planned to do the following already on batteries and with humidity sensors, but I didn’t know about the features with a fieldman - it would be very useful. In principle, this one can be further developed in this way. I don’t really worry about mains power, but, of course, I need to make emergency holes for draining water from the bottom of the case (if something starts to leak in the pump). Or, in general, put the leakage sensor down, and realize the mechanical opening of the circuit, but this is already more difficult.
More than 4 plants have not yet been planned in principle. Initially, it was clear that the pressure of such a pump would not be enough for more.
This is generally my first device on Arduino, and the goal was to check myself if I could do something workable. Now there is a significant reason for revision, and this is wonderful. Thanks.
Greetings!
Great article, everything is very detailed, even with a budget.
As a "designer" of such automatic watering systems that have been working at my place for about a year and a half, I want to share my experience.This site has an article on one of my systems:
https://enm.imdmyself.com/14856-sistema-avtopoliva-dlja-komnatnyh-rastenij-na-arduino.html
And also there is another video on the second system on my channel:
https://www.youtube.com/channel/UCn29s1IXPj7QjKouSYS45aQ/videos?view_as=subscriber

There is one important point about the water of your design: there is not enough protective diode for the field worker (it is not in this module, I have the same modules, I specifically checked it) from the reverse current of the electric motor. I ignorantly ignored the moment and ran into a problem. My system is running on batteries and suddenly, after about 3 months, I notice that they quickly sink, very quickly. I checked the circuit turned out to be a field worker about 50 mA, when in theory it should be closed. I think, to hell with him, apparently the defective transistor was caught. Replaced, another 2 months passed the same symptoms, but on a different transistor. “Coincidence? - I don't think so!" I started reading information on the topic and found out that without a protective diode, the pump kills field workers (because the engine works as a generator in braking mode).

The remaining points are a matter of taste, but still I will express myself if you want to do something else on this topic:
* If you need to water more than 3-4 plants, then you need more than one pump. I have 9 plants on the windowsill, in different pots with different irrigation requirements. It is only possible to adjust flows with a comb with taps for 3-4 plants, for a larger number of plants it is unrealistic, I personally checked it. I have 3 pumps connected to the system, each with its own watering settings
* Millis countdown is very random. I had such a system, poyuzat a month and decided to do others. If the response interval of the day is even less, and if you set for example watering once a week, then the error will be +/- day. The response time is also any. For example, at 4 a.m. you can wake up to the sound of a buzzing pump and gurgling bubbles (although this depends on how much you and your relatives sleep soundly)
* I'm still for the option on batteries. Ever since childhood, my parents taught me to turn off everything that is possible (except the refrigerator) from sockets when you leave. I can’t do anything about it.

In general, I want to say that such systems are suitable not only for periods of departure. Before the introduction of such systems, plants often died for me because they were either forgotten to water or poured on the contrary. After the introduction, everything began to grow, blossom and spike, the lethal cases stopped.

PS:
Another piece of advice on installing switches, buttons, connectors, etc. in plastic cases. If possible, put everything round and use a Chinese stepped drill. I used to be tormented by cutting rectangular holes for switches. Then I bought round, a couple of seconds of drilling with a step drill and the switch is already in place!

We advise you to read:

Hand it for the smartphone ...