today im going to explain how to water your plants ,with a water control system.its super easy .you just need a an arduino,lcd screen and a moisture sensor.dont worry i'll guide you step by step through the processes.so what we are doing in here is
- using a soil moisture sensor measuring the moisture level
- display the moisture level on lcd (0%-100%)
- if the moisture level is less than 60% turn ON red LED ,if its less,turn ON green LED
- if moisture level is below 60%you must water your plant by opening the water valve(by servo motor)the valve must open proportional to the moisture level.
- display the watering state on LCD (OPEN/CLOSE)
super easy! lets go through the steps
Step 1: Finding Components
arduino uno/mega 2560 and USB cable
red led,green led
16 X2 lcd screen
tower Pro micro servo 9g
jumper wires,mini breadboard
Step 2: Interfacing Moisture Sensor
from the moisture sensor , we are getting analog readings from 0-1023 so we do not need digital I/O pins of arduino.but we need analog A0 pin.
vcc------------5V of arduino
GND----------0V of arduino
SIGNAL(A0) ------A0 of arduino
keep in mind that analog readings that we get from 0-1023 are mapped from 0-100 using the command map(0,1023,100,0)
that means if it is dry---5V-----1023 MAP TO 0%
wet---0V------0 MAP TO 100%
Step 3: Interfacing LCD Screen
i hope you know how to interface a lcd with arduino.if you dont know dont worry i'll guide you to interface it.
take the 16 X 2 lcd screen and connect jumper wires and interface to arduino as follows:
VEE TO POTENTIOMETER
RS PIN 12(ANY DIGITAL PIN)
EN PIN 11(ANY DIGITAL PIN)
DB4 PIN 5
DB5 PIN 4
DB6 PIN 3
DB7 PIN 2
Step 4: Interfacing 9g Servo Motor
red(+)------------------------------5V in arduino
brown(-)---------------------------gnd in arduino
yellow(signal pin)----------------ANY PWM PIN
Step 5: LED BULBS
you are halfway down to finish your water control system .
interface the red and green LED's to 8 and 9 respectively.(longer end to arduino ,shorter end to GND...hope you did not forgot this)
Step 6: Final Connection
your final connection would look like this
Step 7: The Code
1. Download and Install the Arduino Desktop IDE
windows - https://www.arduino.cc/en/Guide/Windows
Mac OS X - https://www.arduino.cc/en/Guide/MacOSX
2. Download and paste servo.h and LiquidCrystal.h file to the Arduino libraries folder.
Paste files to the path - C:\Arduino\libraries
3. Download and open flower_plant_project.ino
4. Upload the code to the arduino board via a USB cable
Step 8: Done !
you are done with your project.but dont be in a hurry to water your plants ,use a wet handkerchief and check whether its working properly for wet and dry.i think you can modify this further and i will leave it for you to do.