kamatalaashish
Published © GPL3+

Soil Moisture Sensor

This project helps you with connecting a soil moisture sensor with Arduino Uno.

BeginnerShowcase (no instructions)3,880
Soil Moisture Sensor

Things used in this project

Story

Read more

Code

Untitled file

C/C++
//soil moisture sensor
const int soilpin=A0;
int ledsoil=12;
void setup()
 {
  Serial.begin(9600);
  pinMode(ledsoil,OUTPUT);


}

void loop()
 {
  int moisture=analogRead(soilpin);
  Serial.println(moisture);
  if(moisture>1000)
  {
    digitalWrite(ledsoil,HIGH);
    delay(100);
  }
else
{
  digitalWrite(ledsoil,LOW);
  delay(100);
}
}

Credits

kamatalaashish

kamatalaashish

2 projects • 7 followers

Comments