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

Latest Activity

GarageLab posted a blog post
Thursday
awet kidane commented on GarageLab's blog post Tutorial: Using GPS Shield as an Anti-Theft Device
"how can i simulate gps  in proteus "
Wednesday
GarageLab posted blog posts
Wednesday
Profile Iconawet kidane, Ken Cofer and Burula Oleg joined GarageLab (arduino, electronics, robotics, hacking)
Wednesday
GarageLab posted blog posts
Jan 19
Colin Green updated their profile
Jan 19
Profile Iconjack, soe, Colin Green and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
Jan 19
Mafaz commented on Thulana Vimukthi's blog post GPS GUIDED AUTONOMOUS ROBOT
"Dear sir , I am doing a project on "Design and Development of Human Following Robot" . In…"
Jan 18
Shannon Bradley replied to Shannon Bradley's discussion Nikola Tesla
"http://www.edisontechcenter.org/tesladebunked.html Thank you Jilt, I'm not sure why my…"
Jan 16
GarageLab posted blog posts
Jan 15
jlt1945 replied to Shannon Bradley's discussion Nikola Tesla
Jan 14
Shannon Bradley posted a discussion
Jan 14
Mafaz is now a member of GarageLab (arduino, electronics, robotics, hacking)
Jan 14
Ron Reiserer replied to Raghuvir G's discussion Digital IO – PIR Sensor – Arduino for Beginners
"I'm not sure why the sketch for that project uses an analog read function. Most of those PIR…"
Jan 13
GarageLab posted blog posts
Jan 13
Profile IconDinesh S, Marcin Bilinski, Sauvik Ray and 2 more joined GarageLab (arduino, electronics, robotics, hacking)
Jan 13
Tom Sobieski replied to Lauren Elizabeth's discussion Scammed...?
"I got a note from her, said I was with FBI and she disappeared"
Jan 11
Javier is now a member of GarageLab (arduino, electronics, robotics, hacking)
Jan 9
GarageLab posted a blog post
Jan 9
SAY SOUKAMNEUTH commented on GarageLab's blog post Tutorial: Bluetooth and Arduino
"The Bluetooth's range is very short distance, 1-10 feet. Is it possible to extend and overcome…"
Jan 9

© 2015   Created by Marcelo Rodrigues.

Badges  |  Report an Issue  |  Terms of Service