How to Make a Plant Watering System using the Arduino UNO R4 WiFi board Step by Step

Hello and welcome back. In this project, we will learn how to make a plant watering system using the Arduino UNO R4 WiFi board. This project is perfect for anyone who wants to automatically water their plants and monitor soil and temperature conditions from anywhere in the world. For this project, I used a capacitive soil moisture sensor to measure the soil moisture level and a waterproof NTC temperature sensor to measure the surrounding temperature. We can decide to turn the water pump on or off using this data.
I used the Arduino Cloud for monitoring and controlling this project. The Arduino Cloud allows you to easily create beautiful and clean dashboards to display real-time data such as soil moisture and temperature. Also, you can control it from anywhere in the world using your computer or smartphone. I also added a mini water pump to handle the watering process. For that, please connect a suitable relay module to control the pump. I used a 5V DC 10A relay module.
To make the system more user-friendly, I added an LCD screen to display the current soil moisture and temperature values directly. This helps you quickly check the readings without needing to open the cloud dashboard. Additionally, you can modify the components and program as needed.
Ok, let’s do this project step by step. The required components are given below.
- Arduino UNO R4 WIFI board — Our store / Amazon
- Capacitive soil moisture sensor — Our store / Amazon
- NTC Sensor — Our store / Amazon
- 5v Relay module — Our store / Amazon
- 10k resistor — Our Store / Amazon
- LCD screen x 1 — Our Store / Amazon
- I2C module x 1 — Our Store / Amazon
- Mini Water pump — Our store / Amazon
- Water pipe — Our store / Amazon
- Jumper wires — Our store / Amazon
Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.
Step 1
Firstly, identify these components.











Step 2
Secondly, connect the NTC sensor to the Arduino board. For that, I used a voltage divider circuit. Please refer to the circuit diagram below for the correct wiring.



Step 3
Next, connect the soil moisture sensor and the relay module to the Arduino board.




Step 4
Now, connect the LCD screen to the Arduino board. Once that’s done, connect the Arduino board to your computer.



Step 5
Ok, now let’s set up the Arduino Cloud for this project. For that, please follow the steps below.
- First, go to the Arduino Cloud website and log in to your account. If you don’t have an account, please sign up using your email address.
- Next, click the “Add Device” button and follow the setup process.



- Afterward, if this is your first time, you’ll need to install the Arduino Agent program. You can install it easily by following the instructions. After completing this step, your board will be detected automatically.





- Next, rename your device. After that, your internet connection will be detected automatically, and you’ll need to enter your Wi-Fi password. Once that’s done, your setup will be successful.


- Now, click the “Create Things” button and add three variables using the details given below.
- Name -> Temperature / Variable type -> int
- Name -> Moisture / Variable type -> int
- Name -> Relay / Variable type -> bool
- Next, associate your device.






- Afterward, open the Sketch tab. Copy and paste the program below, and then click the Upload button to send the code to your board.
- Program — Download
/*
Sketch generated by the Arduino IoT Cloud Thing
https://create.arduino.cc/cloud/things/...
Variables:
- int moisture;
- int temperature;
- bool relay;
*/
#include "thingProperties.h"
#include <LiquidCrystal_I2C.h>
#define relayPin 2
#define TEMP_PIN A0
#define MOISTURE_PIN A1
LiquidCrystal_I2C dis(0x27, 16, 2);
// Thermistor constants (for NTC 3950 10k)
const float BETA = 3950; // Beta value
const float T0 = 298.15; // 25°C in Kelvin
const float R0 = 10000; // 10k Ohm at 25°C
const float SERIES_RESISTOR = 10000; // 10k Ohm series resistor
void setup() {
Serial.begin(9600);
delay(1500);
initProperties();
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
// LCD setup
dis.init();
dis.backlight();
// Relay setup
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, HIGH); // HIGH = OFF, assuming active LOW
showLoadingScreen();
}
void loop() {
ArduinoCloud.update();
onTemperatureChange();
onMoistureChange();
}
/*
Temperature is READ_WRITE in the cloud
*/
void onTemperatureChange() {
int analogValue = analogRead(TEMP_PIN);
// Convert analog reading to voltage
float voltage = analogValue * (5.0 / 1023.0);
// Calculate thermistor resistance (assuming thermistor is connected to GND)
float resistance = (5.0 - voltage) * SERIES_RESISTOR / voltage;
// Beta equation
float temperatureK = 1.0 / (1.0 / T0 + (1.0 / BETA) * log(resistance / R0));
temperature = temperatureK - 273.15; // Convert to °C
dis.setCursor(0, 0);
dis.print("Temp: ");
dis.setCursor(6, 0);
dis.print(temperature, 1); // One decimal place
dis.print(" C ");
}
/*
Moisture is READ_WRITE in the cloud
*/
void onMoistureChange() {
int rawValue = analogRead(MOISTURE_PIN);
// Calibrated values (adjust to your sensor)
int minVal = 300; // Wet soil
int maxVal = 800; // Dry soil
rawValue = constrain(rawValue, minVal, maxVal);
moisture = map(rawValue, maxVal, minVal, 0, 100); // 0 = dry, 100 = wet
dis.setCursor(0, 1);
dis.print("Moist: ");
dis.setCursor(7, 1);
dis.print(moisture);
dis.print("% ");
}
/*
Relay is READ_WRITE in the cloud
*/
void onRelayChange() {
if (relay) {
digitalWrite(relayPin, LOW); // ON
} else {
digitalWrite(relayPin, HIGH); // OFF
}
}
void showLoadingScreen() {
dis.clear();
dis.setCursor(0, 0);
dis.print("System Loading");
for (int i = 0; i < 16; i++) {
dis.setCursor(i, 1);
dis.print(".");
delay(150);
}
delay(500);
dis.clear();
}



- Now, click the “Create Dashboards” tab and add two percentage widgets and one button widget. For that, select the variables we created earlier. You can customize them as you like. Also, in this step, you can customize both the desktop and mobile views.







Step 6
Next, connect the water pump to the relay module. I also used a 5V DC external power supply for the motor pump. Then, set up the watering connections for your water pump.





Step 7
Afterward, insert the soil moisture probe, NTC sensor, and water dripper near the plant.



Step 8
Next, connect the power supply to your project. I used two Li-ion batteries for this setup, but you can use a 9V battery for that.


Step 9
Then, download and install the Arduino app and log in to your account. Now, you will see the dashboard we created in the Arduino Cloud. Finally, you can monitor and control your plant watering system directly from the app.

Ok, enjoy this project! The full video guide is below. We hope to see you in the next project. Have a great day!
How to Make a Plant Watering System using the Arduino UNO R4 WiFi board Step by Step