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

Latest Activity

GarageLab posted a blog post

Google Project Wing Drone Delivery Service: An Endless Waltz of Packages

Like Amazon, it appears Google has been mulling the use of drones to deliver goods. The company…See More
1 hour ago
Veritus posted photos
5 hours ago
Profile IconRajeevalochana U R, xavier, Jon Maguire and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
6 hours ago
GarageLab posted a blog post

Homemade guitar looper with Arduino

Here is how to produce pedalboard for electric guitar. The idea is to connect pedals to the…See More
Friday
GarageLab posted a blog post

Next generation thrusters for marine robotics

Rustom Jehangir, Joe Spadola and Josh Villbrandt want to further the field of marine robotics. They…See More
Thursday
Profile IconCeline Buline Forma and Gilmar Barbosa joined GarageLab (arduino, electronics, robotics, hacking)
Wednesday
Gilmar Barbosa replied to GarageLab's discussion Show your lab!
Wednesday
GarageLab posted blog posts
Wednesday
Profile IconMichael Tria, Carl C Sartin and Oswaldo Machado joined GarageLab (arduino, electronics, robotics, hacking)
Aug 26
GarageLab posted a blog post

Pressure Gauge Modded to Measure Internet Usage

The appeal of having a 100 year old gauge on the wall that shows the current Internet usage is hard…See More
Aug 25
GarageLab posted blog posts
Aug 22
Profile IconAngelo Zanellato and Allan Byres joined GarageLab (arduino, electronics, robotics, hacking)
Aug 21
Shannon Bradley commented on GarageLab's blog post Company creates device that recharges smartphones ultrasound
" I have been having good results out too ten to twenty miles. I'm about to fix this…"
Aug 21
GarageLab posted blog posts
Aug 21
Marcelo Rodrigues commented on Marcelo Rodrigues's blog post Arduino generated VGA (color) signal - Complete!
"Jay, Here it is. Enjoy! "
Aug 20
Jay Curtis commented on Marcelo Rodrigues's blog post Arduino generated VGA (color) signal - Complete!
"Hey, great stuff! Found this site through searching for a solution to get VGA to work with LCD and…"
Aug 20
GarageLab posted a blog post

Omote uses light to project virtual makeup and real-time animations on your face

A team of artists and computer graphics designers have created a projection mapping system that you…See More
Aug 19
Jay Curtis is now a member of GarageLab (arduino, electronics, robotics, hacking)
Aug 19
GarageLab posted blog posts
Aug 18
GarageLab posted blog posts
Aug 14

© 2014   Created by Marcelo Rodrigues.

Badges  |  Report an Issue  |  Terms of Service