Fiverr gig
$15 — I will help you with your project and simulate it for you
Hire me
🤖 Arduino Projects

Remote Plant Watering System via Mobile App

The Engineer PostMay 29, 20265 min read
Remote Plant Watering System via Mobile App — Arduino UNO tutorial cover image

Welcome to this beginner-friendly Arduino tutorial on the remote plant watering system via mobile app. By the end of the guide, you'll wire the module to an Arduino UNO, flash a short sketch, and read live values on the Serial Monitor — no prior electronics experience required.

What you'll learn

  • How the module works in plain language
  • The exact parts you need and how to wire them safely
  • The full Arduino IDE sketch with comments
  • Common issues and how to fix them
Remote Plant Watering System via Mobile App — overview
Remote Plant Watering System via Mobile App — wiring diagram

Arduino code

Open the Arduino IDE, paste the sketch below into a new file, install any libraries the sketch #includes (Tools → Manage Libraries), select your board and COM port, then click Upload.

/*************************************************************
  Blynk is a platform with iOS and Android apps to control
  ESP32, Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build mobile and web interfaces for any
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: https://www.blynk.io
    Sketch generator:           https://examples.blynk.cc
    Blynk community:            https://community.blynk.cc
    Follow us:                  https://www.fb.com/blynkapp
                                https://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  This example shows how to use Arduino WiFi shield
  to connect your project to Blynk.

  Please update your shield firmware:
    https://www.arduino.cc/en/Hacking/WiFiShieldFirmwareUpgrading

  Feel free to apply it to any other example. It's simple!
 *************************************************************/

/* Comment this out to disable prints and save space */
//#define BLYNK_PRINT Serial

/* Fill in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID "TMPL395_vACHb"
#define BLYNK_TEMPLATE_NAME "IOT WATERING APP"
#define BLYNK_AUTH_TOKEN "FobMj5rwZ9iHdBIWlOVeu2JosNcl-lDh"

#include <SPI.h>
#include <WiFiS3.h>
#include <BlynkSimpleWifi.h>
#include "Arduino_LED_Matrix.h"
#include <EEPROM.h>

#define moisture_sensor A0
#define relay 7

BlynkTimer timer;
ArduinoLEDMatrix matrix;  //Create an led matrix object

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Semicon Media";
char pass[] = "cracksen1605";

int eeprom_addr = 0;  //eeprom address
int sensorValue = 0;  // variable to store the value coming from the sensor
int prev_pump_status = 0;
int pump_status = 0;
float moist_percent = 0.00;



const uint32_t HAPPY_LED[] = {
    0x3fc48a95,
    0x58019fd9,
    0x5889871
};

const uint32_t NORMAL_LED[] = {
    0x3fc40298,
    0xd98d8019,
    0x5889871
};

const uint32_t SAD_LED[] = {
    0x3fc48a9d,
    0xd8898018,
    0x71889905
};


BLYNK_WRITE(V1){     //read data from Blynk cloud
  pump_status = param.asInt();
  EEPROM.write(eeprom_addr,pump_status);
  prev_pump_status = EEPROM.read(eeprom_addr);
  Serial.println(prev_pump_status);
  Serial.println(pump_status);
}

void sendSensor(){   //send data to Blynk cloud
  Blynk.virtualWrite(V0,moist_percent);
}

void init_renesas_MCU_IO(){
  pinMode(relay, OUTPUT);
  pinMode(moisture_sensor, INPUT);
  analogReadResolution(12); //change to 12-bit resolution
  matrix.begin(); //initialise the led matrix*/
}

void track_soil_moisture(){
  
  // read the value from the sensor:
   sensorValue = analogRead(moisture_sensor);
   moist_percent = 100 - ((float)sensorValue / 4096.0) * 100;
   
  if(moist_percent >= 0 && moist_percent < 33.33){
    Serial.println("DRY");
    matrix.loadFrame(SAD_LED);
  }
  else if(moist_percent >= 33.33 && moist_percent < 66.66){
    Serial.println("MODERATE");
    matrix.loadFrame(NORMAL_LED);
  }
  else if(moist_percent >= 66.66 && moist_percent <= 100){
    Serial.println("WET");
    matrix.loadFrame(HAPPY_LED);
  }
}

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);

  init_renesas_MCU_IO();
 
  timer.setInterval(1000L,sendSensor);

  prev_pump_status = EEPROM.read(eeprom_addr);
  pump_status = prev_pump_status;
}

void loop()
{
  Blynk.run();
  timer.run();
  
  track_soil_moisture();
  if(pump_status == 0){
    Serial.println("Water pump is off");
    digitalWrite(relay, LOW);
  }
  else if(pump_status == 1){
    Serial.println("Water pump is on");
    digitalWrite(relay,HIGH);
  }
  delay(500);
}
Remote Plant Watering System via Mobile App — reference image
Remote Plant Watering System via Mobile App — reference image

How it works

The sketch initialises serial communication and the remote plant watering system via mobile app driver in setup(), then in loop() it samples the sensor at a regular interval and prints the result to the Serial Monitor at 9600 baud. Open the Serial Monitor (Ctrl+Shift+M) after upload to see live readings.

Troubleshooting checklist

  • No readings: verify the baud rate in Serial Monitor matches the sketch (usually 9600).
  • Garbage characters: wrong baud rate or loose GND wire.
  • Library not found: install the exact library referenced in the #include line via Library Manager.
  • Sensor not detected (I²C): run an I²C scanner sketch to confirm the address.

What to build next

Once the basic readout works, try logging values to an SD card, sending them over Wi-Fi with an ESP32, or pushing them to a Blynk IoT dashboard. Pair this module with our simulator round-up to prototype the circuit before soldering.

Frequently Asked Questions

Q.What library do I need for the remote plant watering system via mobile app?

Open Arduino IDE → Tools → Manage Libraries, then search for any library named in the sketch's #include lines and install the latest version.

Q.Why does the Serial Monitor show nothing?

The most common cause is a baud-rate mismatch — set the Serial Monitor to 9600 baud (bottom-right dropdown) so it matches Serial.begin(9600) in the code.

Q.Can I use this with an ESP32 instead of Arduino UNO?

Yes. The remote plant watering system via mobile app works with any 3.3-5 V microcontroller. Just remap the wiring to ESP32 I/O pins and keep the rest of the sketch the same.

TEP

The Engineer Post

Embedded systems engineer and educator. Writes weekly tutorials at EmbedLab to help beginners ship real hardware.

Related projects

Browse all 50+ projects