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: 2556

Latest Activity

Dam Srasquasz commented on GarageLab's blog post Tutorial: Using GPS Shield as an Anti-Theft Device
"@up you can buy any shield you want for example: click sending text messase is easy and…"
15 hours ago
Profile IconMarek Florianczyk, Amy Ciesielka and Dam Srasquasz joined GarageLab (arduino, electronics, robotics, hacking)
17 hours ago
David Braithwaite posted a discussion

Robot, motor, relay kits

Hi,I have been playing around with bots for a few years now, I have found these guys that sell a…See More
22 hours ago
David Braithwaite replied to derrrick wiltshire's discussion dc motor (small 5v) reverse direction control circuit
" Hi, Check these guys out for these kits, Rk Online Store Laters "
22 hours ago
Chas Stearns updated their profile
Monday
GarageLab posted a blog post

Real-life Spider-Man webshooter uses a coil gun instead of web fluid

In honor of The Amazing Spider-Man 2 opening tomorrow in Germany (among other places), German laser…See More
Thursday
Shannon Bradley and Marcelo Rodrigues are now friends
Apr 16
Terry Renner is now a member of GarageLab (arduino, electronics, robotics, hacking)
Apr 16
Andy S posted a discussion

Arduino MEGA boolean?

Hi everyone,been banging my head against the wall a few days now.i have a small project, where i…See More
Apr 16
Bobby Marshall posted a video

SELFIE Mirror

Meet the S.E.L.F.I.E., the "The Self Enhancing Live Feed Image Engine". Find out how it works: http://istrategylabs.com/2014/04/take-an-instant-selfie-with-t...
Apr 15
GarageLab posted a blog post
Apr 15
pj jones posted a status
"Designing an Home Automation Project"
Apr 14
Profile Iconpj jones, Robert Kribel and Lars Goldschlager joined GarageLab (arduino, electronics, robotics, hacking)
Apr 14
Fontaine Pierre commented on GarageLab's blog post Tutorial: Using GPS Shield as an Anti-Theft Device
"Hi, Is it possible to make a car tracker with this GPS + GSM shield to send a message if limits…"
Apr 11
GarageLab posted a blog post
Apr 11
Profile Iconeslam mohamed haredy, Wesley Castillo and Lise Pape joined GarageLab (arduino, electronics, robotics, hacking)
Apr 10
Terry Dark left a comment for Beula Isaac
"Hi Beulah, Greetings from down under (Australia) Please tell me about yourself and your interests…"
Apr 9
Terry Dark and Beula Isaac are now friends
Apr 9
GarageLab posted blog posts
Apr 9

© 2014   Created by Marcelo Rodrigues.

Badges  |  Report an Issue  |  Terms of Service