We are hosting Hackster Cafe: Open Hardware Summit. Watch the stream live on Friday!We are hosting Hackster Cafe: Open Hardware Summit. Stream on Friday!
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,665
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
73 projects • 132 followers
Electronic engineer
Contact

Comments

Please log in or sign up to comment.