How to Make a Plant Watering System

by emabeltrandiab in Circuits > Arduino

371 Views, 1 Favorites, 0 Comments

How to Make a Plant Watering System

plant watering.jpg

Keeping plants alive is a difficult task. They all need different amounts of water, over a different range of time. This results in innocent plants losing their lives due to humans' lack of skills. What if there was a system that could give your plants exactly the water they need automatically?

Look no further. For this project, we built an electronic plant watering machine with Arduino. The user can input the moisture level percentage of their plants need (easily found online) using the keyboard included. A screen then displays the current moisture level; if it is below the threshold, the system will automatically water the plant to maintain it at an adequate level. Voila, that simple! Then, the plant watering system will be measured again. repeatedly, after a set period of time, to evaluate whether more water is needed. This plant watering system will help keep your plants happy!

Suitable for all types of plants, and all types of users.

Supplies

af5c371a-85ee-4331-8636-f19097a06b2c.jpg
Captura de pantalla 2025-10-14 175757.png
Captura de pantalla 2025-10-14 175942.png
Captura de pantalla 2025-10-14 183211.png
Captura de pantalla 2025-10-14 180129.png
Captura de pantalla 2025-10-14 180248.png
Captura de pantalla 2025-10-14 180506.png
Captura de pantalla 2025-10-14 181032.png
Captura de pantalla 2025-10-14 181439.png
3b7de831-7aa0-40e3-af75-1ad783c14e33.jpg
ed960e4e-6aa1-4c23-a446-4523f906932a.jpg

ELECTRONIC COMPONENTS (links to store -- if not included, supplies were already available to us or bought at a local hardware store.)

  1. Battery button power cable
  2. AAA Batteries (2 units)
  3. AAA Battery holder case (2 units)
  4. Jumper wire Female-Female 30cm (40 units)
  5. Jumper wire Male-Female 30cm (40 units)
  6. Jumper wire Male-Male 30cm (40 units)
  7. Keypad (3cmx4cmx4cm)
  8. Moisture sensors (4 units)
  9. 3V Water pumps (4 units)
  10. Water tubes (3 meters)
  11. Breadboard (400 points)
  12. Arduino uno
  13. 5V Channel relay
  14. LCD screen (80 mm x 35 mm x 11mm) [viewing area = 64.5 mm x 16mm]
  15. Waterproof cable adhesive tape (15 M, 0.3mm x 15mm)

COMPONENT-HOLDERS

  1. Wood wall (90 cm H x 55 cm W)
  2. Wood plant holder (10cm H x 55 W x 20 cm D)
  3. Plant pots (4 units)
  4. Watering can
  5. Component holder (18 cm H x 22 cm W x 6.5 cm D)
  6. Slider (18cm H x 26.4 cm W)

Researching Components

Before embarking on the whole process, we needed to define which components and parts would be needed to make a fully functioning plant watering system. To help us do this, we defined requirements that our machine needed to fulfill:

  1. The system should be based on Arduino to fulfill the course's requirements.
  2. Due to this, all components should be compatible with the Arduino uno system
  3. Interactive : users should be able to input information about their own plant (soil moisture percentage needed).
  4. Visual : the system should be able to display the soil moisture level wanted, as well as the level at a specific moment.
  5. Automatic: the system should measure soil moisture level and water accordingly, with no human interveniton (exept for defining threshold).
  6. Self-sustainable: the system should not need a computer device to be powered, and it should be able to hold sufficient water to last a whole day.

Taking these requirements into account, we were able to define the component list as seen in the "Supplies" section. All of the components were bought on AliExpress.

How not to destroy your components:

  1. An Arduino uno can safely supply 450 mA to all components connected, to ensure we dont exceed this limit, we have researched how much mA our components draw.
  2. Moisture sensors: 20 mA x 4 = 80 mA
  3. Four channel relay (when all four relays are on): 300mA
  4. LCD screen: 30 mA
  5. 3V submirgible pumps: 150 mA x 4 = 600 mA
  6. Keyboard : negligible

So, total mA = 1010 mA

This clealy exceeds the safe supply of the Arduino. Because of this, we included a battery box with two Alkaline AAA batteries, to power the pumps. The remaining electrical components (4 moisture sensors, four channel relay, LCD) add up to an ampage of 410 mA, which is within the safe limit of the Arduino. For the 4 pumps connected to the battery box with the two Alkaline AAA batteries, we made sure that only 1 pump at a time can be turned on to not exceed the limits of the batteries.

Additionally, the cable connections to the components were secured from water damage by using the water-resistant tape. This was done to prevent possible shortcircuits occurring from moisture in the connections.

Lastly, all the components used for this project had resistors included in itself, which prevents from any damage relating to this.

Defining Wiring Scheme

Captura de pantalla 2025-10-21 185146.png
Captura de pantalla 2025-10-15 100538.png

This table and diagram can act as a guide to correctly wire the components.

Note: the PDF shows the wiring diagram in more precise detail.

Testing Moisture Sensors


  1. Calibrating moisture sensors (including code): The output of the sensors is a value that lays somewhere between 0 and 1023, which is based on the input voltage. The lower the value the sensor provides, the higher the soil moisture is, and viceversa. As this values seem arbitrary, the sensors need calibrating to provide meaningful outputs. To calibrate, the wettest (soil completley saturated with water) and dryest (soil dried for two weeks) scenarios were tested. The results were 220 and 543 respectivley.

Note: to measure the wettest value, the soil was watered thoroughly and allowed to drain for 24 hours to allow it to reach field capacity, which represents the maximum amount of water that the soil can hold for plant usage. (Source: Irrigation strategies for vegetables | UMN Extension)

The determination of values was done using the Arduino serial monitor and intermediate code. Observing the changing values allowed for a better understanding of the values.

To convert these values into more intuitive numbers, they were converted into percentages using the following intermediate code:

const uint16_t SENSOR_DRY = 543;

const uint16_t SENSOR_WET = 220;

const uint16_t SENSOR_RANGE = SENSOR_DRY - SENSOR_WET;

const uint8_t sensorPins[4] = {A0, A1, A2, A3};

inline uint8_t readMoisturePercent(uint8_t sensorIndex) {

uint16_t raw = analogRead(sensorPins[sensorIndex]);

raw = constrain(raw, SENSOR_WET, SENSOR_DRY);

uint16_t numer = SENSOR_DRY - raw;

return (uint8_t)((numer * 100U) / SENSOR_RANGE);

}


Note: this code was written with the sole intention of calibrating the moisture sensors and testing wether they functioned. It may be expressed differently in the final code.

Testing Water Pumps

To test wether the water pumps worked, in combination with the relay modules and the batteries, several steps were taken.

First, they were tested dry (no water). They were turned on individually for a short time period to ensure they functioned properly. In this case, functionality can be observed via the sound of the relay modules. Then, water was introduced to the test, which allows to observe functionality by water flowing through the tubes. If all this was observed, then the batteries also functioned properly.


The general code used for this section is as follows:

Source: Controlling submersible pump with Arduino – SENSING THE CITY


const int pumpPins[4] = {2, 3, 4, 5};

const int PUMP_ON = LOW;

const int PUMP_OFF = HIGH;

void setup() {

for (int i = 0; i < 4; i++) {

pinMode(pumpPins[i], OUTPUT);

digitalWrite(pumpPins[i], PUMP_OFF);

}

}

void loop() {

for (int i = 0; i < 4; i++) {

digitalWrite(pumpPins[i], PUMP_ON);

delay(2000);

digitalWrite(pumpPins[i], PUMP_OFF);

delay(1000);

}

}


Note: this code was written with the sole intention of calibrating the moisture sensors and testing wether they functioned. It may be different in the final code.

Testing Screen


The screen was tested to ensure, first of all, that it was functioning, meaning that it could correctly connect to the Arduino and display inputs. Both components communicate using the LiquidCrystal_PCF8574.h library via the I²C protocol. To test the successful connection, we attempted to display the test message "Hello world", which eventually worked.

Sources: LiquidCrystal I2C | Arduino Documentation , I2C Liquid Crystal Displays | Arduino Project Hub


#include <Wire.h>

#include <LiquidCrystal_PCF8574.h>

LiquidCrystal_PCF8574 lcd(0x27);

void setup() {

lcd.begin(16, 2);

lcd.setBacklight(255);

lcd.setCursor(0, 0);

lcd.print("Hello world");

lcd.setCursor(0, 1);

lcd.print("LCD Connected!");

}


Note: this code was written with the sole intention of calibrating the moisture sensors and testing wether they functioned. It may be different in the final code.

Testing Keyboard


A 4x4 matrix keyboard consisting of 16 buttons (0 - 9, A-D, * and #) was used to allow user input, making the system interactive. The possible inputs are: selecting which one of the four sensors/pumps you want to configure (1-4), cancel = *, confirm=#, and the threshold level you want for each sensor (0-100).

This keypad is connected to the Arduino, and the identification of each key is done by the Keypad library. It was necessary to ensure a correct and reliable key recognition to appropiatley map each button to its intended value or function.

Note: the keypad is a very sensitive component. Do not use superglue to set it in place, instead, use the built-in sticker surface. If in doubt, always refer to the specifications of the component.


Mapping keys:

// source: How to Interface Keypad with Arduino

#include <Keypad.h>

const byte ROWS = 4, COLS = 4;

char keys[ROWS][COLS] = {

{'1','2','3','A'},

{'4','5','6','B'},

{'7','8','9','C'},

{'*','0','#','D'}

};

byte rowPins[ROWS] = {13, 12, 11, 10};

byte colPins[COLS] = {9, 8, 7, 6};

Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);

void handleKeypad() {

char key = keypad.getKey();

if (!key) return;

Serial.print("Key pressed: "); Serial.println(key);


Defining keys for our context:


if (key >= '1' && key <= '4') {

selectedSensor = key - '1'; // choose sensor S1–S4

enteringValue = true;

inputValue = 0;

lcd.clear();

lcd.print("Set S"); lcd.print(selectedSensor + 1);

} else if (enteringValue) {

if (key >= '0' && key <= '9') inputValue = inputValue * 10 + (key - '0');

else if (key == '#') { thresholds[selectedSensor] = inputValue; enteringValue = false; }

else if (key == '*') enteringValue = false;

}

}

Finilizing the System

a008951b-bf5d-4663-948a-bc2dc53e61cc.jpg

Arguably the hardest part of the project is to wire all systems together. If you have reached this step, it means all the independent systems work on their own. Nevertheless, to make a functioning plant watering system, you need to connect all of the independent systems into one. To do so, it is important to do it step-by-step:

  1. Connect the screen to the keyboard
  2. Test wether they work together
  3. Correct output: screen displays user's usage of keyboard (i.e.: user presses number 1, screen displays number 1)
  4. Connect the screen and keyboard to the moisture sensors
  5. Test wether they work together
  6. Correct output: screen displays the moisture percentage level at the moment, and user is able to change moisture threshold on keypad.
  7. Connect all the systems mentioned above to the water-pumps
  8. Test wether all the systems work properly, together as one.
  9. Correct output: all of the above, and if moisture level drops below chosen threshold, pumps will activate and water the plant.

The exact details on how all the components connect can be seen in the wiring diagram.

The final code can be found in the ARDUINO file attached in this section.

Building Component Holder and Wood Parts

computer picture.png
picture of 3d files.png

First, we had to ideate a system in which all the components would be held correctly, meaning that they would all fit together easily and be protected from the environment. Nevertheless, this device is intended for inside use only.Additionally, we thought that it was important to be able to take any component out of the holder if needed, for example, in case of failures, damage or improvements.

With this idea in mind, we decided to design the products shown in the picture above, including the holder and the slider. Details about measurements can be found in the "Supplies" section.

If you want to replicate the designs, or get a more detailed view, please refer to the attached files:

3d files for the system

It is important to note that in this process, we designed the component holder before having the electronic components. Due to this, we relied solely on the measurements provided by the suppliers. With this experience in mind, we would recommend waiting until you can measure the components yourself, as the ones provided were not accurate. This led to our 3D printed design being tight for the components we used, which risks damaging the components. Our team encourages to make a slight overestimation of the design (this does not apply to the screen opening), to avoid this type of complication and allow for easy changes if needed.

Also, as we had to be able to transport the project, we decided to place it on a "movable" wall, which consists of a wood panel. The measurments of this wall can be found on the "Supplies" section. This part of the project is not necessary if the user is planning to keep it installed in one place; if this is the case, the slider includes opening for screws to be able to attach it to any surface. When attaching it, remember to put it in a strategic place, considering where the plants will be situated, as well as the water reservoir, pumps and tubes.

Fitting Electronics in Component Holder

317b9948-e65e-44ba-b303-cfb9ed464456.jpg

The fitting process was done with extreme care with the aim of reducing the probability of a component breaking due to our handling.

Electronics inside of the component holder: screen, battery holders, battery button, wiring for keyboard, arduino UNO, breadboard, part of wiring of sensors and pumps, wiring for screen, wiring for arduino and breadboard.

As mentioned in Step 8, our component holder was tighter than we were expecting, which created concerns about components breaking once they were fitted into the box. Due to this, we decided to test each system as it was fitted into the holder.

Even though our main reasoning at the moment for testing the components while we were fitting them into the box was because it was tight, we would recommend doing so even if your holder is the right fit. With this practice, it is possible to notice whether everything is working as expected, or if a system needs to be fixed. Once in the component holder, it is still possible to fix emergent issues thanks to the slider system, but it increases the difficulty as it is harder to handle the electronics in this way.

Including Water Reservoir

Captura de pantalla 2025-10-14 193801.png
Captura de pantalla 2025-10-14 194633.png

Given that the plant's watering system will provide water automatically, it needs a water reservoir in which it can hold sufficient water for the user's specific needs. In our case, as we have four plants demanding water from the same reservoir, we decided to use a watering can which can hold several liters of liquid, therefore lasting several days. This product can be seen in the picture above.

Also, it is important to make sure that the pumps that you would like to implement in your system all fit within your water reservoir. As mentioned before, the water pumps used in this project are submergible water pumps, which means that they have to be covered by water to transport water into the tubes and out to the plants. The whole pump should be completley submerged in order to work properly and avoid any possible damage. Therefore, this also implies that testing the pumps dry is not optimal, and can eventually lead to breaking the component.

At this moment of the process you should put in place the water pumps and tubes.

Initially, we were under the impression that the pumps were not submergible, which is why we designed and printed the "plant feeder", which can be seen in the pictures above. This is another example of why it is important to carefully research the components you expect to use and ideally wait to design subsequent products until you have all the materials needed.

Plant Time!

FAXKOY7MGJQ6EOK.jpg

Now, after all the hard work, it is the moment to see your own plant watering system in action! Add the plants that you want to be part of the system (make sure to place the moisture sensors as indicated in previous steps), configure the moisture percentage level per plant, and enjoy.