How to Build a Plant Watering System Using Arduino

by RonFrtek in Circuits > Arduino

1757 Views, 4 Favorites, 0 Comments

How to Build a Plant Watering System Using Arduino

How to Build a Plant Watering System Using Arduino

In this tutorial we will learn how to make a Plant Watering System

Using a moisture sensor, water pump and flash a green LED if everything is ok and OLED Display and Visuino.

Watch the video!

What You Will Need

VisuinoAdvrtisementESPCopterDSTIKEWatch.jpg
pump.jpg
moisture-sensor.jpg
ssd1331.jpg
1-relay-module-for-arduino.jpg
breadboard.jpg
arduino.jpg
jumper-wires.jpg
LED5MM.png

The Circuit

water-pump-plant.jpg

  • Connect OLED Display pin[VCC] to Arduino pin[5V]
  • Connect OLED Display pin[GND] to Arduino pin[GND]
  • Connect OLED Display pin[SDA] to Arduino pin[SDA]
  • Connect OLED Display pin[SCL] to Arduino pin[SCL]
  • Connect Arduino 5V to piezo buzzer module pin VCC
  • Connect Arduino GND to Green LED negative Pin
  • Connect Arduino GND to Red LED negative Pin
  • Connect Arduino Digital Pin 3 to Green LED negative Pin
  • Connect Arduino Digital Pin 2 to Red LED negative Pin
  • Connect Arduino 5V to moisture sensor module pin VCC
  • Connect Arduino GND to moisture sensor module pin GND
  • Connect Arduino analog pin 0 to moisture sensor module pin A0
  • Connect Relay VCC pin(+) to Arduino 5V pin
  • Connect Relay GND pin(-) to Arduino GND pin
  • Connect Relay signal pin(S) to Arduino Digital pin 10
  • Connect power supply 12V (+) to pump red wire(+)
  • Connect power supply 12V (-) to relay pin(com)
  • Connect pump black wire (-) to relay pin(NO)

Start Visuino, and Select the Arduino UNO Board Type

F311FBVK5AHN5HJ.LARGE.jpg
FL8QFGAK5H5EPPK.LARGE.jpg

To start programming the Arduino, you will need to have the Arduino IDE installed from here: https://www.arduino.cc/.

Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program Arduino UNO! The Visuino: https://www.visuino.eu also needs to be installed. Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

In Visuino ADD and Set Components

2020-07-05_19-18-45.jpg
F8XICR9KC937SFN.LARGE.jpg
F8HVEOVKC937SFM.LARGE.jpg
FW9UTS4KC937SFQ.LARGE.jpg
FET14LMKC937SFP.LARGE.jpg
FKZATLNKC937SFO.LARGE.jpg

Add "OLED Display" component

Add 2X "Compare Analog Value" component

Double click on the DisplayOLED1 and in the elements window drag Text Field to the left, then in the properties window set size to 3

Close the elements window

  • Select CompareValue1 and in the properties window set "Compare Type" to ctBiggerOrEqual and Value to 0.7 << this is the sensitivity value, you can change it if you want
  • Select CompareValue2 and in the properties window set "Compare Type" to ctSmaller and Value to 0.7 << this is the sensitivity value, you can change it if you want

In Visuino Connect Components

soil-sensor-pump.png
2020-07-17_11-43-48.jpg
2020-07-17_11-43-32.jpg

  • Connect Arduino analog pin 0 to CompareValue1 pin In, CompareValue2 pin In, DisplayOLED1>Text Field1 Pin In
  • Connect CompareValue1 Pin Out to Arduino digital pin 2
  • Connect CompareValue1 Pin Out to Arduino digital pin 10
  • Connect CompareValue2 Pin Out to Arduino digital pin 3
  • Connect DisplayOLED1 pin I2C Out to Arduino board I2C pin In

Generate, Compile, and Upload the Arduino Code

2020-10-30_13-20-50.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the Arduino UNO module, and the LED should flash (red not enough water,green enough water) and the OLED Display will show the moisture level, if the water level is too low the pump will start adding the water.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it and open it in Visuino: https://www.visuino.eu