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

Arduino Auto Watering System for Indoor Plants

Hello!

I want to share my homemadethat has been serving me for over a year now.
Starting to master Arduino, I thought about what kind of project to implement. I remembered that I have many indoor plants that periodically forget to water, and the issue of watering during vacations and business trips has a place to be.

The system consists of the following components:

The control unit is the heart of the system. Here are the batteries, Arduino, DS3231 time module, display, voltage converters and controls.


Near the plants is a canister of water. There are submersible pumps in the canister that pump water through pipes into the plants.


The distribution of water between plants can be further adjusted using a comb with taps.

All the technical elements of the system can be hidden behind curtains and pots so that they are not very conspicuous


System Overview:


Key system parameters:

1. Battery life of about 5 months
2. The system supports control of 3 pumps. For each pump, you can connect a comb with 2-4 taps and additionally control the flow of water. Total we get the opportunity to connect up to 12 plants
3. The time is taken from a separate independent watch module DS3231. The pump is triggered when the hour specified in the setting (for example, 8:00).
4. The display shows information
5. Watering settings are indicated in the program code, they can be changed by reflashing Arduino

Explanation of the information shown on the display:
The first line is the table header. Each row shows information on the respective pump. The first column - shows the period of work (PR). For example, with a value of "5" - the pump will operate every 5 days. The second column is the hour of operation (PD) - the hour at the beginning of which the pump will turn on. The third column is the run time (BP) - the pump run time in seconds. The fourth column - days left (BEFORE) - shows how many days are left until the next operation. Date and time are also displayed.



The system has no feedback, so the settings need to be selected empirically. It is best to group plants that are close in terms of watering requirements (some tolerate drought well, while others like plentiful watering) and the size of the pots.
The settings are approximately as follows: every 5 days turn on the pump at 8:00 for 30 seconds.
Below, it will be indicated in which part of the code these settings are located.

In the program code, you can disable the 2nd and 3rd pumps. In this case, information will be displayed only on the included pumps.

Autonomy is ensured by:
• Powered by 18650 batteries
• Arduino and goes into a deep sleep (Powerdown) and wakes up by Watсhdog
• Arduino voltage stabilizer bit off left leg
• The display is turned off during operation. To activate the display, you need to hold the sleep button for about 10 seconds.
• All indicator LEDs are removed from the modules

The system consumes about 3 mA, 1 pump consumes about 350 mA in operation.

Main Details:

• Food container for housing
• Chinese clone Arduino nano
• DS3231 Real-Time Module
• 18650 batteries
• Boost module up to 5V (current about 1 A)
• Lowering module up to 3.3V to power the display
• Nokia 5110 display
• TP4056 module for charging (+ protection) the battery
• Battery charge indicator
• Various "frizz": field-effect transistors, resistors, capacitors (electrolytic and ceramic)
• Switches and buttons

Mounting "scheme" of the device:



Explanations according to the scheme:

1. 4 18650 batteries are connected in parallel. The total capacity is about 13000 mA / h.
2. The battery is connected to the charging and protective module TP4056. Charging is via the micro USB connector from telephone charging. Charging is needed with a current of at least 1A. Estimated time to fully charge is 13-14 hours. Indicator LEDs can be flashed out and displayed on the chassis.
3. Next, a boost converter up to 5V is connected through the switch. It will power most of the components of the circuit, including pumps. With a decrease in the battery charge level, the voltage will decrease from 4.2V to 2.7V, which is not enough for the circuit to work. The module will provide a stable voltage. A filter made of electrolytic and ceramic capacitors is placed at the output of the module. The electrolytic capacitor performs a smoothing, stabilizing role. Ceramic capacitor is used to combat high frequency interference. If the module “beeps” the inductor during operation, to eliminate this phenomenon, an additional electrolytic capacitor can be placed at the input of the module. Electrolytic capacitors with a capacity of 1000 microfarads at 6.3V. Ceramic capacitors are suitable from 1-2 microfarads. The circuit used at 10 uF, because I had a lot of extra.
4. To power the display, you need a voltage of 3.3V, so a buck converter with similar filters from capacitors is added.
5. DS3231 clock module, needed for a more accurate timing. The Power LED (1) is soldered off on the DS3231 module. This is done for energy saving purposes. If you use ordinary batteries (not rechargeable), then you need to unsolder the resistor (2). The module is designed for rechargeable batteries, including charging them. If the battery is normal, the charging current will quickly render it unusable.
Arduino Auto Watering System for Indoor Plants

6. The main brain of the system is the Arduino nano platform. For energy saving purposes, you need to unsolder all the LEDs (or at least only Power), as well as bite off the left leg of the voltage regulator.

7. The pump is controlled via field effect transistors. Any that open with 5V voltage and are capable of switching current from 1A will do. At first I used the ready-made ones. I soldered a battery of field-effect transistors + resistors (100 Ohm to protect the Arduino, 10k Ohm to pull the shutter of the transistor to the ground so that the mosfet closes) + also soldered the connectors KF 301-2P for fixing the wires

Later made a more compact battery on AO3400 SMD mosfets

Somewhere in half a year 2 field-effect transistors failed. The reason was that, in braking mode, the collector motor works like a generator. To protect the field effect transistor, you need to use a protective diode. I used 1N4007.


8. The display shows all the information. To wake up the display, you need to hold the button for up to 10 seconds. If you change the minute in hours, the system will go to sleep, and the display will turn off.

Build process:

First tests on a breadboard and writing firmware


Next, connected everything with a hinged installation

Picked up the body and tested with real pumps

I drilled holes in the case, painted everything with a black matte primer and fixed the components to hot-melt adhesive


Additional assembly points:
• A container of water must always be located below the pots, otherwise there is a risk that water will continue to pour after turning off the pumps.
• The distance from the bottom of the container to the end of the tube must not exceed 70cm. It will be more difficult for the pump to raise water to a greater height.
• On a mini pump with Ali, transparent hoses 6x1.5 mm are great
• It is important that the opening of the water intake pump does not rest against the wall of the water tank, otherwise there will be no normal pressure.
• Do not use iron parts (clamps, wire, etc.) to fasten the hose to the pump. Everything rusts very quickly.
• The pump has short wires. Most likely they will have to be increased. To seal the wires, it is best to use hot melt adhesive, and on top heat shrink.

The logic of the program:

• Arduino gets out of sleep
• DS3231 module readings (date and time) are assigned to variables
• When the date changes, the value of the counter of past days changes
• If the period of work (setting) coincides with the number of days passed, the hour is checked
• If the hour (setting) and the hour from the time module coincide, turn on the pump for the time specified in the settings
• Arduino goes to sleep
• If you hold the sleep button, power is supplied to the display and the Arduino wakes up

Watering settings are indicated here in this part of the code:


I apply a sketch and libraries

In general, I am satisfied with the system. She regularly watered my plants on the windowsill for about a year. Now I moved the system to another room, and in my own I put together a new, more convenient and interesting one, but that's another story ...
8.9
8.9
8.8

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
9 comments
Author
I completely agree
Quote: EandV
But in my room I don’t have a faucet, I don’t want to pull the hose through the entire apartment from the toilet.
Yes, and dangerous: you never know what kind of failure in automation will happen, you can fill the apartment below.
Now it’s clear about the indicator, we would just draw a rectangle with an explanation - it would be clear that it’s not an LED that cannot be turned on like that.
Author
Well, here you are generally serious. Definitely a competent choice.
In my case, it is important that just none of the plants die. With this, my homemade product seems to be coping.
Author
I agree with you that for greenhouses you need a slightly different solution. Right / wrong it depends on the specific situation. In my case, in one of the rooms I need to water 9 plants in pots on the windowsill when I'm on a business trip / vacation or just forgot about them. If I make a humidity sensor in each pot, then I will have a web on the windowsill, if I make the sensor only in part of the pots, then the meaning of using feedback is lost. Humidity sensors are good to use for open ground (so as not to water again after rain), or for one large plant in a large pot or beds, which will be watered as a separate system. Valves are definitely better for a garden / orchard / greenhouse. But in my room I don’t have a faucet, I don’t want to pull the hose through the entire apartment from the toilet.
Author
Thank you for your feedback!
This is the first of my autowatering systems.Now I’ve done one more (the main differences: there are buttons for changing the settings without flashing and everything is assembled on a printed circuit board, and not a wall-mounted installation). The plans include a system with a soil moisture sensor, but this solution is also not always suitable.

I took the pump here: https://ru.aliexpress.com/item/32813225037.html?spm=a2g0s.9042311.0.0.274233edOrtSYd
In principle, you can drive in the search for "micro pump", it will give a bunch of options. Any pumps powered by 5V are suitable.

Please explain about the error with the battery level indicator. The picture with the LED is very arbitrary, in fact, it is an indicator with ali (in the program where I drew the circuit I didn’t find the indicator picture), which shows the “sticks” of the charge level (essentially a digital voltmeter)
It looks like this: https://ru.aliexpress.com/item/32850741087.html?spm=a2g0s.9042311.0.0.274233ed90SPcD
It is connected in parallel with the output from TP4056, so that it does not glow all the time, it is turned on through the button.
Also this year, I got confused with drip irrigation. Applied the controller Siemens Logo. Watering management on 3 lines. Each line is controlled either manually (if necessary, or from a weekly timer. (Whoever came across such a controller knows that.) The pump is one on all lines - normal water pump for 300 rub. with aliexpress. Rise of water up to 3 meters. Distribution from the comb through solenoid valves (also with Ali). Automatic maintenance of the water level in the tank. Temperature control and automatic ventilation.
In general, now I go to the greenhouse only for harvest.
Guest Vladimir
And I'm interested in the topic, but I'm in Arduino zero. It is more correct to irrigate not by time, but by soil moisture. Personally, I need such a device for irrigation in greenhouses. I suggest using not with pumps, but with e / valves.
Great use of Arduino for a real purpose!
Further development of the project is possible (control of soil moisture, control of water level in a canister).
There are a couple of small remarks: it would be nice to give a link to the pumps (for electronic components, everything is more or less clear and without links) and you need to fix the connection of the LED "Battery charge indicator" in the figure depicting the circuit.

We advise you to read:

Hand it for the smartphone ...