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

Latest Activity

GarageLab posted blog posts
13 hours ago
Raghuvir G posted discussions
19 hours ago
Jagajeet K posted a discussion

Digital IO – LED Blink – Arduino for Beginners

I have a doubt in the below link  …in that I used 220 ohm resistor for LED …Is Resistor have any…See More
19 hours ago
Profile IconRalph Wade, Jagajeet K, Raghuvir G and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
yesterday
GarageLab posted blog posts
Tuesday
Enrico M. posted a status
"Building the Apollo console version I"
Monday
Lena Cook is now a member of GarageLab (arduino, electronics, robotics, hacking)
Monday
Paul Denton updated their profile
Nov 21
GarageLab posted a blog post
Nov 21
Profile IconRichard Coplan and Juan V. Sanchez-Andres joined GarageLab (arduino, electronics, robotics, hacking)
Nov 21
Kshitij Dadhekar commented on GarageLab's blog post Tutorial: How to use the Cellular Shield (SM5100B) with Arduino
"Hello,       Can you tell me what is the resistance of the speaker to be…"
Nov 19
GarageLab posted a blog post
Nov 19
Profile IconKshitij Dadhekar, Marvellous Mark and Enrico M. joined GarageLab (arduino, electronics, robotics, hacking)
Nov 19
david chan commented on GarageLab's blog post Tutorial: Humidity and Temperature Sensor with Arduino
"How do you see the output "
Nov 18
Enrico M. posted a discussion

Power supply circuit

Hi guys,I'm building some sort of wood case to arduino mega with LCD, keypad, LED's ...I also want…See More
Nov 18
GarageLab posted blog posts
Nov 18
Profile Icondavid chan, uday harihar, CVassiliou and 4 more joined GarageLab (arduino, electronics, robotics, hacking)
Nov 18
Jeff Bowen updated their profile
Nov 17
Michael Shaw replied to Jean-Guillaume LALANNE's discussion Smallest Arduino with BLE stack and push button integrated
"Check out Tiny circuits for open source: https://tiny-circuits.com/"
Nov 16
rozzers commented on rozzers's video
Nov 14

© 2014   Created by Marcelo Rodrigues.

Badges  |  Report an Issue  |  Terms of Service