Automatic watering of plants

26 August 2024 3 minutes Author: IronMind

Creating an automatic irrigation system based on Arduino Nano will allow you to monitor soil moisture and automatically turn on a pump depending on the moisture level.

Required components:

Connection diagram

Relay module

  • VCC → Arduino 5V pin
  • GND → Arduino GND pin
  • IN → Arduino D2 pin
  • Connect the two leftmost contacts to the break of one of the wires that goes to the compressor (see the diagram)

LCD 1602 I2C character display 16×2

  • VCC → Arduino 5V pin
  • GND → Arduino GND pin
  • SDA →  Arduino pin A4
  • SCL → Arduino pin A5

Hydrometer and I2C module

  • Connect the outputs of the hygrometer to the contacts + and – on the I2C module (see diagram)
  • VCC → Arduino 5V pin
  • GND → Arduino GND pin
  • A0 → Arduino pin A0

Accumulators

  • connect the + battery to the VIN pin
  • battery to the GND pin

Note that the input voltage must be in the range of 7 to 12 volts.

Firmware

**If you do not have the Arduino IDE installed, I advise you to watch the video tutorial, which shows how to install and configure it. At this link you will find information on how to install the driver on the Arduino board.**

Download the firmware from this link and upload it to the Arduino according to the instructions above. The library and project scheme can be found here.

Importantly

You need to flash the Arduino before connecting all the components. If batteries or other parts are connected to it during the firmware, you risk burning (literally) your computer and Arduino.

Principle of operation

When the sensor gets into the ground, due to the fact that there is a certain amount of moisture in it, a small current begins to flow between the “pins”. Depending on the level of humidity, the current flows differently (because different resistance is created). By measuring this current, you can find out the approximate level of soil moisture. If the level is less than what we need, then the Arduino gives a command to close the relay, which in turn turns on the pump. After the humidity has increased, the Arduino opens the relay and the water supply stops.

Disclaimer. This article is created for informational purposes only. All advice and instructions are provided for educational purposes and we are not responsible for any possible consequences related to the implementation of this project. Always use safety precautions when working with electronic components.

If you have any problems, you can contact us at [email protected].

Found an error?
If you find an error, take a screenshot and send it to the bot.