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

Latest Activity

GarageLab posted blog posts
7 hours ago
Abraham de Villiers is now a member of GarageLab (arduino, electronics, robotics, hacking)
8 hours ago
GarageLab posted a blog post

3D printed humanoid robot goes open source

If you’ve ever dreamed of manufacturing your own legion of mechanical minions, a group of robotics…See More
yesterday
Marion Hale posted a status
"Status"
yesterday
Marion Hale posted a status
"Status"
Saturday
Marion Hale posted a status
"Status"
Saturday
Profile IconMarion Hale and Pratap Kumar Panigrahi joined GarageLab (arduino, electronics, robotics, hacking)
Friday
GarageLab posted blog posts
Thursday
GarageLab posted blog posts
Jul 23
Profile Icongan bensie, Philip Malmstedt and Rodney Leinberger joined GarageLab (arduino, electronics, robotics, hacking)
Jul 22
GarageLab posted blog posts
Jul 21
Profile Iconjolian ahmed, Abdalla, Raul Patterson and 2 more joined GarageLab (arduino, electronics, robotics, hacking)
Jul 21
GarageLab posted blog posts
Jul 17
GarageLab posted blog posts
Jul 15
Ilyass Renswoude joined Sergio Imperador's group
Thumbnail

Robotics

Let's share ideas about building robots.See More
Jul 14
Profile IconShein Wah, Liu Chin Ho and Suresh Babu joined GarageLab (arduino, electronics, robotics, hacking)
Jul 14
NELU NASTASOIU posted photos
Jul 11
NELU NASTASOIU updated their profile
Jul 11
GarageLab posted blog posts
Jul 11
Profile IconTezel Celebi and Lucas Silva joined GarageLab (arduino, electronics, robotics, hacking)
Jul 11

© 2014   Created by Marcelo Rodrigues.

Badges  |  Report an Issue  |  Terms of Service