How to Build a Low Cost Automatic Plant Watering System With Arduino

How to Build a Low Cost Automatic Plant Watering System With Arduino

Introduction

As a gardener and plant enthusiast, keeping my plants consistently watered is one of my top priorities. However, I'm often away from home for extended periods, which makes it difficult to keep up with daily watering schedules. So I decided to create an automatic plant watering system using Arduino, which allows me to water my plants automatically while I'm away!

An Arduino-based automatic plant watering system is an excellent project for beginners looking to build IoT (Internet of Things) devices. In this guide, I'll walk you step-by-step through the components, code, and set up I used to build a low-cost smart plant watering system. Let's get started!

Components Needed

To build this automatic plant watering system, you'll need the following components:

Arduino Uno

The Arduino Uno is the microcontroller that will control the system. It's inexpensive but powerful.

Soil moisture sensor

This sensor goes into the soil and detects if the soil is dry or moist. It provides input to the Arduino to tell it when to water the plants. I'm using the FC-28 soil moisture sensor.

Submersible water pump

This water pump connects to a power source and tubing to pump water from the reservoir to the plants when activated. I'm using a small 5V submersible pump.

Breadboard, jumper wires, resistors

A breadboard helps connect the components and jumper wires carry power and signals. A 220 ohm resistor is needed for the moisture sensor.

5V power supply

The Arduino and pump need a 5V power source. I'm using a USB power bank as the supply.

Plastic tubing and fittings

1/4" plastic tubing runs water from the pump to the plants. Barbed fittings connect the pump and tubing.

Containers

A reservoir stores the water, and a planter houses the soil and plants. Plastic food containers work well.

Circuit Diagram

Here is the circuit diagram to connect all of the components:

The soil moisture sensor uses the analog input A0 pin on the Arduino. The water pump connects to digital pin 3 to be turned on and off.

Arduino Code

The Arduino code checks the soil moisture level from the sensor and turns the water pump on when the soil is dry. Here's a breakdown of how it works:

```cpp
// Set pin numbers
const int sensorPin = A0;
const int pumpPin = 3;

// Variables
int moistureLevel; // Moisture reading
int pumpState; // Pump on or off

void setup() {

// Set pump pin as output
pinMode(pumpPin, OUTPUT);

}

void loop() {

// Read moisture sensor
moistureLevel = analogRead(sensorPin);

// If dry, turn pump on
if(moistureLevel < 350){
digitalWrite(pumpPin, HIGH);
}
else {
digitalWrite(pumpPin, LOW);
}

}
```

This checks the sensor pin A0 and compares the moisture reading to a threshold value of 350 (adjust as needed). If dry, it turns the water pump on pin D3 HIGH. Otherwise, it turns it off LOW.

Assembly and Set Up

With the components acquired and code ready, it's time to assemble it! Follow these steps:

  1. Insert the moisture sensor into the soil in the planter.
  2. Connect the sensor, pump, Arduino, and other components on the breadboard per the circuit diagram.
  3. Upload the Arduino code to the Arduino board.
  4. Run the tubing from the water reservoir to the pump, and from the pump outlet to the planter soil.
  5. Place the water reservoir higher than the pump and planter to allow gravity flow.
  6. Plug in the 5V USB power bank to power on the system.

The sensor will now monitor the moisture in the soil and automatically turn on the pump when it gets dry to water the plants!

Some tips for set up:

Conclusion

Building an automatic plant watering system with Arduino is an easy and fun project for makers of any skill level! With a few inexpensive electronic components and basic Arduino skills, you can construct a system that keeps your plants watered while you're away. Customize it to fit your space and needs. This project is also a great starting point for expanding into more advanced automatated gardening systems. Let me know if you have any other questions!