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

Latest Activity

Edward Kendall updated their profile
11 hours ago
Edward Kendall joined Eric Rodrigues's group
Thumbnail

Video Games

From eletronic ping pong to the newest technologiesDiscussion about development of both software…See More
11 hours ago
Profile IconElectric and Adderall, Ishmael Muhammad, Yuval kob and 2 more joined GarageLab (arduino, electronics, robotics, hacking)
Feb 3
Jesse Howards updated their profile
Jan 29
Profile Iconsuneet, Augustin Aziankou and Ayinde Adetunji joined GarageLab (arduino, electronics, robotics, hacking)
Jan 29
Augustin Aziankou updated their profile
Jan 28
Profile IconTom Evans, said, Ghenam houssam and 15 more joined GarageLab (arduino, electronics, robotics, hacking)
Jan 25
Kenny Sims is now a member of GarageLab (arduino, electronics, robotics, hacking)
Jan 11
Paulo Trindade is now a member of GarageLab (arduino, electronics, robotics, hacking)
Jan 7
Profile Iconyashwita suvarna, António Gonçalves, Thurman Gillespy and 6 more joined GarageLab (arduino, electronics, robotics, hacking)
Jan 4
Profile IconMehmet Emin Örs, Andrew Myers, Ruban Venkatesh and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
Dec 28, 2015
stephen smith is now a member of GarageLab (arduino, electronics, robotics, hacking)
Dec 22, 2015
Profile Iconlantoniaina bruce, Manoel Pereira, Ben and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
Dec 21, 2015
GarageLab replied to GarageLab's discussion Serious claims against BeagleBone's manufacturer CircuitCo
"Hello guys, New facts to the CircuitCo case. But until now, the didn't refund us or send the…"
Dec 21, 2015
michae coley left a comment for RITIU TRAIAN
"what project have you done?"
Dec 15, 2015
Profile Iconshalini amarnani, Philipp Schmid, Jesse Howards and 4 more joined GarageLab (arduino, electronics, robotics, hacking)
Dec 14, 2015
Profile IconAbador and Dara joined GarageLab (arduino, electronics, robotics, hacking)
Dec 9, 2015
GarageLab posted a blog post

Sodium Ions Rechargeable Battery Prototype

A joint of French science institutions just publish an article that claim they produced a…See More
Dec 7, 2015
Jay Rocket is now a member of GarageLab (arduino, electronics, robotics, hacking)
Dec 7, 2015
GarageLab posted a blog post

Eye Controlled wheelchair

Patrick Joyce has a disease called Amyotrophic Lateral Sclerosis (ALS), the same disease from…See More
Dec 4, 2015

© 2016   Created by Marcelo Rodrigues.   Powered by

Badges  |  Report an Issue  |  Terms of Service