Techatronic
Published

Smart Irrigation System Using Arduino Uno

A smart irrigation system using Arduino Uno. Control the water requirement of the soil according to the moisture levels.

IntermediateFull instructions provided54,687
Smart Irrigation System Using Arduino Uno

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Power Relay, SPDT
Power Relay, SPDT
×1
SparkFun Soil Moisture Sensor (with Screw Terminals)
SparkFun Soil Moisture Sensor (with Screw Terminals)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Code

smart irrigation system code

C#
int m=0;
void setup() {
  // put your setup code here, to run once:
pinMode(A0, INPUT_PULLUP);
pinMode(8,OUTPUT);
Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:

int m= analogRead(A0);
Serial.println(m);
delay(200);
if (m>=980)
{
  digitalWrite(8, LOW);
  
  }

else if(m<=970)
{

  digitalWrite(8, HIGH);
  }
  
else
{
  digitalWrite(8, HIGH);
  }
}

Credits

Techatronic
127 projects • 139 followers
Electronic engineer

Comments