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

Latest Activity

Profile IconJoshua, Mark Webber, Ronan Keets and 6 more joined GarageLab (arduino, electronics, robotics, hacking)
12 hours ago
GarageLab posted a blog post

Sound Torch Bluetooth Speaker Spews Flames

Play Through the Fire and Flames (DragonForce) literally through fire and flames with the Sound…See More
Friday
GarageLab posted a blog post
Wednesday
GarageLab posted a blog post
May 18
Profile Iconmechanical engineer. R&D . and Geert hoste joined GarageLab (arduino, electronics, robotics, hacking)
May 18
Henry Chaj is now a member of GarageLab (arduino, electronics, robotics, hacking)
May 15
GarageLab posted a blog post
May 15
AnalysIR posted a blog post

Simple Infrared PWM on Arduino

We are often asked on discussion boards, about conflicts between IRremote or IRLib and other…See More
May 13
Profile Iconnareshkumar p and Ethan "Lone" Wolf joined GarageLab (arduino, electronics, robotics, hacking)
May 13
GarageLab posted a blog post

Printing photorealistic images on 3D objects

Hydrographic Printing is a technique of transferring colored inks on a film to the surface of an…See More
May 13
GarageLab posted a blog post

3D Printing and Ultrasound Help Blind Pregnant Moms Touch Their Unborn Babies

Here’s a pair of wonderful stories that were made possible with the help of 3D printing. As part of…See More
May 12
iqxca is now a member of GarageLab (arduino, electronics, robotics, hacking)
May 12
Profile IconTom Reagh and Alc joined GarageLab (arduino, electronics, robotics, hacking)
May 11
GarageLab posted a blog post
May 8
Arduino Aficionado posted photos
May 8
GarageLab posted blog posts
May 7
sneha kulkarni is now a member of GarageLab (arduino, electronics, robotics, hacking)
May 7
Profile IconBrian Bunting, Vipul Nathani and Jesús Corbacho joined GarageLab (arduino, electronics, robotics, hacking)
May 5
GarageLab posted a blog post
May 4
Profile IconAbdulaziz Husic, Andrew Toyne, aldren dado depra and 2 more joined GarageLab (arduino, electronics, robotics, hacking)
Apr 30

© 2015   Created by Marcelo Rodrigues.

Badges  |  Report an Issue  |  Terms of Service