Moisture Sensor Circuit

This moisture sensor circuit is based on a design by Forrest Mims, and adds a Shunt Ammeter so that the output is 0 to +5 Volts instead of amperes. We are using it for the ITPlants project, so that when soil moisture drops below a minimum, the plant can make a phone call for help. Other call-worthy events will be a thank-you when the plant does get watered, a warning if the plant is watered too often, and a follow-up call if the watering is insufficient. This is going to be one chatty shrub.

58 comments on “Moisture Sensor Circuit
  1. daniel says:

    hi rob,

    i’m wondering if you’ve discovered a circuit for detecting changes in biopotential of the plants, something like this:

    I’ve built this, and there is some confusion about the op AMP section, with the batteries.

    Looking foward to your comments..l


  2. faludi says:

    We haven’t done anything with biopotential. Mostly we’re concerned with monitoring the basic health of the plant, so moisture, light and soil chemistry are our focus.

  3. Tom says:

    How do you calibrate with this circuit reliably?

  4. Amit Radhakrishnan says:

    Dear Sir,

    This is a very interesting concept. Could you please elaborate more on the system or provide links or references for the same.

    Thank you.

  5. sheila says:

    can i ask you a favor to please send me one copy of the whole circuitry for moisture sensor and as well as its source code?what type of microcontroller did you use?what kind of program did you use?
    thanks allot,your response is highly appreciated.this would help me in my thesis..

  6. angad tiwana says:

    can i ask you a favor to please send me one copy of the whole circuitry for moisture sensor and as well as its source code?what type of microcontroller did you use?what kind of program did you use?
    thanks allot,your response is highly appreciated.this would help me in my project..

    i am doing a project on an automated sprinkler system. please do reply.
    i am a 3rd year electronics engineering student from india. i study in BITS Pilani goa campus.
    The campus website is

    • Homer says:

      That’s an interesting soesnr idea; you could also communicate stuff, like battery voltage, if you wanted. My first thought for a soesnr was to mount a reflector on the floor under the car, so you could shoot a light beam at it every so often from the opener’s vantage point and find out if the car is in the way. The downside of course is that the underside of a car is not a clean place and the reflector may get fouled. A surer bet would be an ultrasonic rangefinder, which would also be self-contained above the car.

  7. Michael says:

    I assume the circuit is based on the probe going from an open when it is dry to some amount of resistance when it is moist. If that is the case, why not eliminate the transistor and pot and simply have a resistor divider going into an analog to digital converter pin on the micro?

    What do you use for the electrodes?

  8. faludi says:

    The transistor is intended to amplify the very small amount of current that goes through the soil.

    We have tried many different materials for the moisture probes and the best so far is stainless steel rod.

    • BobBob20 says:

      A unity gain voltage follower op amp would be better for sampling the voltage from the voltage divider circuit.

      Is moisture content the major factor that affects the resistance of the soil or does the soil make up also play a part? Thanks.

  9. Tim B says:

    This looks quite easy. Thanks!
    Trying it out I seem to get that to calibrate I need to trim the variable resistor so that it is just low enough that it does not pull the output to ground. Is that the most sensitive setting? I imagine that the transistor essentially pulls the output value up when more moisture is applied.
    I would also be interested in what rod length and rod spacing you used, whether you have found any particular values to be “better” in any sense.

  10. faludi says:

    Rod length and spacing were not the most significant variables. In general you want the probes long enough to reach the moist soil and not so close together that they are likely to touch accidentally. Keeping them about an inch apart works great. The big variable is the composition of the soil itselfj (especially salts), so ideally you would calibrate for each type of soil.

  11. Howard R says:

    This look interesting.

    It would be nice to have a unit that had probes at several depths. A bit from the microcontroller could be used to turn on a transistor that provided the +5 to the soil (if needed).

    I am thinking about housing the unit in a 4 inch PVC pipe several probes attached to determine moisture at several levels. It would be good if the probes could be attached flat on the outside of the PVC pipe. The PVC could be set into the ground with a post hole digger.

    What do you think ?

    • Ed says:

      I presume the actual sensors would be outside of that pvc pipe?

      Seem syou are looking for a difficult solution for a simple problem. why not just 4 sensors at various depths. you could either bury them horizontally at a specific dpt, or insulate them for a specific length until they reach that depth in a vertical position. No haggling with bits, just 4 analog ports.

  12. Roberto says:

    What sensor are you using?
    Thanks for the info!

  13. gaurav says:

    i am doing a project on sprinkler system can u help me about this project?
    can u tell me moisture sensor circuit that u have design is capable of detecting howw much area?
    ur reply is appreciable.

  14. gaurav says:

    if u have done any kind of such project please reply me on my mail id.
    thanking u.

  15. anuradha says:

    i want to know detail about the moisture sensors used in farms and the design of gateway.

  16. adli mokhtar says:

    i have a question..

    1. do you have a soil moisturizer level detector circuit or schematic diagram?
    2. your circuit output is 0-5V, is there any chance to increase the voltage ouput?

  17. ADLI MOKHTAR says:

    sorry to bother you again..
    1. is that “to microcontroller analog input” can be change to the inverter that convert the voltage from 12Vdc to the 240Vac?
    it is because i need to connect that soil moisturizer level detector circuit to the water pump…

    2. my project is like below:
    solar panel(12Vdc) – charge controller (12Vdc, 10A) – rechargeable battery (12Vdc) – soil moisturizer level detector (as sensor, 12Vdc) – inverter (convert 12Vdc to 240Vac) – water pump (240Vac)

    3. can i connect them (all circuit with the soil moisturizer level detector circuit) in series?

    thanks..really appreciate it…

    • faludi says:

      Adli, you’d still want to use a microcontroller to analyze the data and probably have it activate a relay to switch the pump power.

  18. adli mokhtar says:

    is that so? hmmm… is because i do not learn programming (PIC) yet and my time is running out. so do you have any idea of the other kind of circuit? maybe that don’t use a PLC one? thanks…

  19. daryll says:

    can i ask for the whole circuitry if it’s ok..
    before going to a microcontroller,does it have to pass through a analog-to-digital coonverter??

    • mthandazo says:

      did u finally figure out if there is need for an analog to digital converter before going to microcontroller?????

  20. vaishali says:

    could u please send me the sufficient details for this project..
    mail me..doing TE mini project..

  21. lokraj says:


    can i take BC547 transistor instead of 2n2222a

  22. kiLLua says:

    dear mr/ms admin..

    does this circuit determine the level of moisture of the soil??? or does it only recognize between ‘dry’ and ‘wet’ soil??? pls!!! i need some help!

  23. kiLLua says:

    so what does that ‘analog sensor mean??

    pls explain it to me!!! pls????

  24. Sasuke says:

    are the two probes connected together?? if they are, what would i connect between them???

  25. NoGoodInElectronics says:

    i am actually planning to use this circuit to create a telemetric monitoring device of a garden..

    i am assuming that the soil moisture sensor is a tensiometer, right? i’d also wanna ask, admin, if this circuit has been proven to work properly and accurately???

  26. tapan says:

    which microcontroller hav u used….is it 8051

  27. tapan says:

    please i beg .. send me what kind of program did u use..plz send me the program.i would be greatful to u….
    i am also planning to add a sprinkler to it

  28. Carl says:

    Hello, is this sensor accurate enough for use in precision agriculture? I plan to use this to monitor soil moisture content so that i can control precisely the irrigation of sensitive types of crops. Hoping for you favorable response 😀

  29. Domen says:

    what is the normal output of this circuit for dry soil? I have implemented it and I get 4.2V output from a almost dry soil, is that normal or did I do something wrong ?

  30. nickson funumari says:

    can i ask you a favor to please send me one copy of the whole circuitry for moisture sensor and as well as its source code?what type of microcontroller did you use?what kind of program did you use?
    thanks allot,your response is highly appreciated.this would help me in my reseach easy

  31. Nick8877 says:

    nickson funumari

    try used PIC 16F877A

  32. pallavi.G says:

    please tell me know in detail about sensor function and its working principle…..that how it gets detected the moisture level in different conditions??plz reply me

  33. Rob says:


    Did you ever try an electrically isolated version of this moisture sensor? I am looking to build a unit for water detection in pipes and there is a possibility that other equipment can be shifting the ground levels..

  34. klaine says:

    I really need this moisture sensor for our project. I want know how do you calibrate this kind of sensor? What is the potentiometer used for? Please tell me.. Thank you for helping.

  35. silpa says:

    hai sir, am doing project on electronic gardener using soil moisture sensor.. plz tel me about that project uses and about soil moisture sensor

  36. mthandazo says:

    i wonder where the shunt ammeter is placed in the circuit so that we get voltage instead of current…

  37. Marcel says:

    im doing a college electronics project where im designing and making a moisture sensor for a local kindergarten so that the sprinkler system automatically turns on and off during the holidays to save time and money.
    im hoping to make a sensor that can turn on a solenoid water valve when the moisture level is too low and to turn off the valve when the moisture level reaches a certain level.
    would it be possible for you to send me some basic designs of how i could achieve this?

    If anyone else can help me it would mean a lot!!

    cheers, Marcel

  38. vikas says:

    happy new year,
    i want the actual working of this circuit diagram.
    and also tell me how you selected this components.

  39. swithun says:

    can you please elaborate more on the idea of the system making a phone call

  40. Komal says:

    Hello sir..i m keen to knw the working of this soil moisture sensor as m doing a project on agrigultural monitoring using pic18f4520…plz can u send me a copy of complete working and programs…plz help me sir…

  41. aleza says:

    I have the circuit, can I anyone help with the code on how to read data from it?

  42. MasterYoda says:


  43. Enayet Kabir says:

    can u published me the calculation of sensor output voltage to how moisture present.

    • stan chwing says:

      hi,whatever compiler you will be using,this definately need microcontroller ADC.Read dasheeets for the controller u r using then apply it.To those who r asking code may u pliz indicate which compiler u r using.

  44. Venkatesh Girap says:


    I am trying to design circuit for checking moisture in stored cement bags, please advice.
    PLease try to reply on this.

    Kind Regards

    Venkatesh Girap