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

Latest Activity

GarageLab posted blog posts
20 hours ago
Colin Goldberg posted a discussion

Can I use my Samsung Tab 4 tablet as a usb host to a beaglebone board black?

Hi,As a newbie to this space, I would like to know what to think about before I try to connect my…See More
Tuesday
Antonio Turner posted a status
Tuesday
GarageLab posted blog posts
Tuesday
Profile IconGeorge Ray Learmond, Steve Barnes and Diego Leite Mendes joined GarageLab (arduino, electronics, robotics, hacking)
Monday
GarageLab posted a blog post
Oct 17
Stu porley is now a member of GarageLab (arduino, electronics, robotics, hacking)
Oct 16
GarageLab posted blog posts
Oct 16
Atari Punk Console posted a status
"I backed Garag Lab Kick Starter Project the Garagino, I can't wait till I get my Garagino! https://www.kickstarter.com/projects/931487098/g"
Oct 15
Profile IconDan bgarage and Joe Cannella joined GarageLab (arduino, electronics, robotics, hacking)
Oct 15
GarageLab posted blog posts
Oct 14
Profile IconSim Wilkins G. Entendez, Charles Hamilton and Colin Goldberg joined GarageLab (arduino, electronics, robotics, hacking)
Oct 13
GarageLab posted a blog post

Flexible 'Tentacle Robots' Could Aid Planetary Exploration

 Researchers are developing new types of robotic systems inspired by elephant trunks, octopus arms…See More
Oct 10
David Rios is now a member of GarageLab (arduino, electronics, robotics, hacking)
Oct 10
GarageLab posted blog posts
Oct 9
Marcelo Rodrigues is now friends with Tharaka Madhusanka and Guruprasad Balaji
Oct 7
GarageLab posted a blog post
Oct 7
GarageLab posted a blog post
Oct 6
Profile IconScorpio Imran, Joaquim Moroni da Silva, Delan and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
Oct 6
GarageLab posted blog posts
Oct 3

© 2014   Created by Marcelo Rodrigues.

Badges  |  Report an Issue  |  Terms of Service