SIMPLE SOIL MOISTURE SENSOR – ARDUINO PROJECT

This is a simple arduino project for a soil moisture sensor that will light up a LED at a certain moisture level. It uses Arduino Duemilanove microcontroller board. Two wires placed in the soil pot form a variable resistor, whose resistance varies depending on soil moisture. This variable resistor is connected in a voltage divider configuration, and Arduino collects a voltage proportional to resistance between the 2 wires.


Insert the 2 probes (wires, pcb) in the dry soil and measure the resistance value and then pour water and measure it again.
Use a mid value for the resistor (eg: 50kΩ for 100kΩ in dry soil and 10kΩ in wet).

The other method to find the resistor’s value is to try different values or use a potentiometer. Insert the probes into the soil that has the desired moisture when to light up the LED and signal that the plant needs water.

Adjust the potentiometer and see the point at which it starts to light. Measure the potentiomenter current value and replace it with a fixed resistor.

Arduino soil moisture sensor schematic

Project source code

const int VAL_PROBE = 0; // Analog pin 0
const int MOISTURE_LEVEL = 250; // the value after the LED goes ON

void setup() {
Serial.begin(9600);
}

void LedState(int state) {
digitalWrite(13, state);
}

void loop() {
int moisture = analogRead(VAL_PROBE);

Serial.println(moisture);

if(moisture > MOISTURE_LEVEL) {
LedState(HIGH);
} else {
LedState(LOW);
}
delay(100);
}

Tags: ARDUINO, PROJECT

Views: 2820

Latest Activity

Profile IconDinko, Bukasa Tshilombo, simataempat and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
50 minutes ago
ANGEL RUIZ replied to ANGEL RUIZ's discussion Can this Xyron be used as a CNC router
"Here"
17 hours ago
ANGEL RUIZ posted a discussion

Can this Xyron be used as a CNC router

I don't have the money to afford a CNC router so I was wondering if I can convert this into…See More
17 hours ago
GarageLab posted a blog post

HAVOC: NASA’s proposed cloud city over Venus

The surface of Venus is a notorious hell-hole. If an atmospheric pressure roughly 90 times greater…See More
yesterday
roberto premoli's photo was featured

premobox25-per-web-001

premoboard+cubieboard+hdd2.5''features:-3LAN-5USB-2WIFI-500GB HDD…
Tuesday
Veritus's photo was featured

Battery Pack

Created a closed system of power in a wearable back pack. Back pack had 5 power outlets each at 220…
Tuesday
NELU NASTASOIU's photo was featured
Tuesday
wesley wortman's photo was featured
Tuesday
GarageLab posted blog posts
Tuesday
sunny lai left a comment for sunny lai
"thanks for hearing from you, it is my pleasure"
Tuesday
Enahoro Olori updated their profile
Monday
Profile IconRobert Sitton, Mr Abraham Akim and Magnus Nordin joined GarageLab (arduino, electronics, robotics, hacking)
Monday
GarageLab posted blog posts
Dec 12
Profile Icongiacomo, dan rules and Jay Thornton joined GarageLab (arduino, electronics, robotics, hacking)
Dec 11
GarageLab posted a blog post
Dec 10
GarageLab replied to Lou Liberatore's discussion LiquidCrystal_I2C library in the group Arduino
" Hi Lou Lberatone, I think you Hi Lou Lberatone, I think you probably are using the libraries…"
Dec 10
GarageLab joined Marcelo Rodrigues's group
Thumbnail

Arduino

Group for the Arduino communitySee More
Dec 10
GarageLab posted blog posts
Dec 9
Profile Iconbenjamin black and sunny lai joined GarageLab (arduino, electronics, robotics, hacking)
Dec 9
Profile IconJjdelala and Sathish GP joined GarageLab (arduino, electronics, robotics, hacking)
Dec 8

© 2014   Created by Marcelo Rodrigues.

Badges  |  Report an Issue  |  Terms of Service