Soil Moisture Sensor

-Arduino Uno
-Soil Moisture Sensor

//I2C LCD:
#include <Wire.h> // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>
// Set the LCD I2C address
LiquidCrystal_I2C lcd(0x27, 20, 4);
// These constants won’t change. They’re used to give names
// to the pins used:
const int analogInPin = A0; // Analog input pin that the Sensor is attached to
int sensorValue = 0; // value read from the Soil Moisture
void setup() {
void loop() {
  lcd.print(“Soil Moisture:”);// print the results to the LCD Display:
  sensorValue = analogRead(analogInPin);// read the analog in value:
  lcd.setCursor(0, 1);
  // wait 300 milliseconds before the next loop for the
  //analog-to-digital converter to settle after the last reading:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s