DIY SOIL MOISTURE SENSOR CHEAP YET ACCURATE !
Intro: DIY SOIL MOISTURE SENSOR CHEAP YET ACCURATE !
I am a plant lover and tech head. Recently I decided to grow some plants on my balcony. I decided to automate the watering system as I may forget to water them I didn't want to take any chance with my beautiful flower plants. so decided to get soil moisture sensor and water the plants accordingly for that matter I'll be using microcontroller I prefer Arduino nano as it is compact you may use another microcontroller.I found a lot of commercial soil moisture sensor which weren't cheap by any means as the idea behind this is pretty simple so in this instructable I take you through the steps of making this soil moisture sensor at cheap and readily available parts a home. I'll also be explaining the science behind the working of the resistive soil moisture sensor that we will be making.
So without any further ado let's get started
STEP 1: Gathering the Parts and Tools
- galvanized nails 2" - 2piece
- A bottle cap 1" wide - 1 piece
- 10k ohm 1/4 watt resistor
- few female jumper wires
- Soldering Iron
- hot glue gun
- solder wire
STEP 2: MAKING THE SENSOR
- After gathering all the required parts and tools lets get started with our making of a sensor.
- grab to nails and punch them through bottle cap 1 inch apart that's necessary the distance between the nails may affect your reading of moisture.
- hot glue them on the place.
- solder two wire to each nail/probe.
- fill the opening of the cap with the hot glue to make it sturdy so we could insert them in the soil.
- connect the 10kohm resistor between A0 and GND pin of nano connect it to probe 1 / nail 1 and connect probe 2 / nail2 to a 5v pin of an Arduino.
OOOH YES, THAT'S ALL ABOUT THE SENSOR PART ISNT IT EASY!
STEP 3: INTERFACING THE SENSOR WITH AN ARDUINO
- upload the code which I have made into your Arduino board
- Open the serial monitor and whoola you will see the sensor reading
- Now you would modify the code, you may take the variable that has the sensor value and can switch on or off any external components such as water pump and or some other thing just by making the pin high which the sensor value variable is below a certain threshold.
IF YOU WANT ME TO MAKE A INSTRUCTABLE ON THE COMPLETE GARDEN AUTOMATION USING A SUBMERSIBLE MOTOR WHICH IS AGAIN DIY AND TEMP SENSOR DTH11 WITH TRACKING THE STATUS WITH ANDROID APP. PLS LET ME KNOW IN COMMENTS, PLS LIKE AND FOLLOW FOR FURTHER INSTRUCTABLES. COMMENT IF YOU HAVE A QUESTION OR PROBLEMS ILL DEFINITELY HELP YOU!
STEP 4: SCIENCE BEHIND THE WORKING OF THE SENSOR
So as you had made the sensor I think its very essential to know the science behind the working of the sensor.
so, the 2 probe that we have created are energized with 5volts and other one grounded so when we will be dipped the sensor into the soil the medium between the 2 probes(soil)will be conductive in the sense the probes receive some electron. but we aren't calculating the current received as calculating is tendious and measuring the resistance between to probes is a lot easier than measuring current and the code is written accordingly to measure the resistance between 2 probes and that will determine the amount of moisture in soil and you may react accordingly be sure to use galvanized nail as it will not corrode easily . The 10kohm resistor between the pins A0 and gnd creates a reference resistance for us to calculate. SO THAT'S IT NOW YOU HAVE CREATED YOUR KNOW MOISTURE DETECTING SENSOR AND NOT JUST THAT YOU KNOW THE SCIENCE THE BEHIND THE ACTUAL WORKING OF THE SENSOR AND THATS A GREAT DEAL SO YOU COULD GIVE YOUR SELF THE TITLE OF TITLE SCIENTIST BUT ITS A LONG WAY TO GO FURTHER LET ME KNOW VIEW ABOUT MY INSTRUCTABLES IN COMMENT DOWN BELOW
34 Comments
zposner 2 months ago
I noticed the wiring diagram has a discrepancy, the picture with nails shows probe 1 connected to GND via a resistor, and the sketch in the bottom right shows probe 1 connected directly to GND
*The larger sketch works, the bottom right does not
SpyCBeef 1 year ago
DigitalWrite D1, HIGH
DigitalRead D2
if D2 = HIGH
DO NOTHING
if D2 = LOW
PUMP
or am I understanding the science wrong?
SpyCBeef 1 year ago
baconburgare 1 year ago
rspierenburg 1 year ago
baconburgare 1 year ago
Maybe it's more realistic to measure each bed as one unit? Perhaps the middle pot in each bed can work as a reference for the rest? Watering is not rocket science as long as you have good drainage.
baconburgare 2 years ago
The formula confused me too, but I just measured the highest value in water and divided it by 100, kinda like this; int percent = (moistVal/factor); My max was between 750-790 so a factor of 7.5 worked fine with my probe. Perhaps not scientific but good enough.
Also using a digital port to active the probe when measuring only. Strongly advice that you do the same to avoid corrosion. Only activate current when needed. Great post, thank you!
RichardPillay 4 years ago
Since you don't need to check how wet the soil is very often you can read the moisture level two or three times a day. For the rest of the time, there is no voltage between the probes, so there is no corrosion building up. This can mean the difference between the probes requiring to be changed every 6 months to lasting 5 years or more.
It's also important to know that the probes should be changed every few years. This is because fertilisers and minerals from the soil will coat the nails over time, and change the resistance between them. You could re-calibrate instead of changing them, but if you do that, it means making the code more complex, to avoid having a number of these spread out throughout the garden, all with different versions of the code.
ParthK2 4 years ago
wcmiller5 2 years ago
rick3 2 years ago
Reidar_Vik 3 years ago
StephenF119 5 years ago
LarryF24 3 years ago
ParthK2 4 years ago
LarryF24 3 years ago
Asmodeo 4 years ago
msheppard 4 years ago
msheppard 4 years ago
My question is - have you (or anyone) seen how quickly this corrosion happens? If it takes several months it might be OK to just design this so the nails are easy to replace.
cian45lewis 4 years ago