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);
}

Views: 3293

Latest Activity

sujeeth senthilvel is now a member of GarageLab (arduino, electronics, robotics, hacking)
yesterday
Alan commented on Kevin Krumwiede's group Aquaponics
"Joined this group as my main interest in aquaponics much more than electronics !!! However I not…"
Jun 15
Alan joined Kevin Krumwiede's group
Thumbnail

Aquaponics

Ancient agriculture and aquaculture techniques meet modern technology! Learn how to grow fresh…See More
Jun 15
Profile IconKambiz Hadzad and Kasim Rafiq joined GarageLab (arduino, electronics, robotics, hacking)
Jun 15
Marcelo Rodrigues posted a blog post
Jun 14
Michael Williams updated their profile
Jun 13
Joe Mallat is now a member of GarageLab (arduino, electronics, robotics, hacking)
Jun 12
Profile IconCarlos Bejar Marambio, Harsh and Mohammed Mazed Hossain joined GarageLab (arduino, electronics, robotics, hacking)
Jun 10
Marcelo Rodrigues posted a blog post
Jun 9
Marcelo Rodrigues replied to Marc Stevens's discussion easy drive
"Maybe the time between the steps? Do you hear any sound like vibration or noise? If we use a time…"
Jun 8
Profile IconDon Girvin and Michael Williams joined GarageLab (arduino, electronics, robotics, hacking)
Jun 8
Marcelo Rodrigues replied to Peter Davies's discussion Anyone got stock of Garagelabs automation board
";-) Thanks!"
Jun 8
Peter Davies replied to Peter Davies's discussion Anyone got stock of Garagelabs automation board
"Thanks Marcello - placed an order for 10 units today"
Jun 7
Marc Stevens replied to Marc Stevens's discussion easy drive
"I tried every combination of wiring the stepper motor, but it simply don't work. But the motor…"
Jun 7
Marcelo Rodrigues replied to Peter Davies's discussion Anyone got stock of Garagelabs automation board
"Peter, If you still need the ABs, Seeed finally made them available. Thanks!"
Jun 7
Profile Iconnaibin paul, rbk12456 and Dariusz Jasiński joined GarageLab (arduino, electronics, robotics, hacking)
Jun 7
Profile IconM.Hess and ratno wijaya joined GarageLab (arduino, electronics, robotics, hacking)
Jun 3
Mohamed Hammad is now a member of GarageLab (arduino, electronics, robotics, hacking)
Jun 2
Marcelo Rodrigues replied to Marc Stevens's discussion easy drive
"Marc, Check the connections like the following image: If the problem persists, you can check the…"
Jun 2
Marcelo Rodrigues replied to Christine C's discussion The Spam.
"Thank you Jeff. That guy was suspended. Best!"
Jun 2

© 2016   Created by Marcelo Rodrigues.   Powered by

Badges  |  Report an Issue  |  Terms of Service