Soil Moisture Sensor (Raspberry Pi)

About: the Raspberry Pi is Awesome!

Basic tutorial of how to setup a soil moisture sensor with the Raspberry Pi.

Supplies:

Step 1: Parts

RPI 3 - https://amzn.to/2VA9pQY

4 Amp Power Adapter - https://amzn.to/2CTptWu

16GB micro SD - https://amzn.to/2SFMwd3

120 pcs jumper cable: https://ebay.to/2VAb9cY

Soil Moisture Sensors: https://amzn.to/2DfX5hs

Step 2: Setup

VCC -> 5V

GND -> GND

SIG -> GPIO 21

Step 3: Code

1. Copy script to raspberry pi

2. Run script by typing "python soil.py" and hit enter to run

Step 4: Additional Info

Share

    Recommendations

    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest
    • Woodworking Contest

      Woodworking Contest
    • Gardening Contest

      Gardening Contest

    7 Discussions

    0
    None
    Hareesh Kanna

    3 days ago

    Why cant we use Analog pin instead of digital pin. Is Analog read() possible in raspberry pi??

    0
    None
    TiglathIII

    24 days ago

    Hi, Can you explain why it is OK to put the DO pin from a 5V device onto a 3.3V Raspberry Pi?
    Every book I read makes a warning about 5V devices and the Pi. I guess that resistors in the device are making sure that the voltage does not exceed 3.3V but is there a safety resistor we should be using in series with the DO pin perhaps just to be safe?

    0
    None
    MagdalenaJ3

    4 months ago

    Hi, Thanks for sharing this - it is really helpful.

    I am trying to set up a system that is rather monitoring how low is the water level in the soil. So how can I modify the code to actually print the output of the GPIO output? I realize this would need to be standardized, but having the actual numbers would be more helpful for me.

    Also - the code that can be downloaded from here has an error - in both cases the output reads "Water detected".

    0
    None
    Willrocks07

    6 months ago

    Hi are used to see instructor ball on a school project slightly modifying it so would play music and LED would change colour depending on the state of the plant this really helped me with my project thank you I will post a instructable on what I did

    0
    None
    HugoS94

    Question 1 year ago

    Hi, Excellent tutorial. Is it possible to connect multiple sensors to the same Raspberry? If yes, how can I do it? Thanks.

    1 answer
    0
    None
    Willrocks07HugoS94

    Answer 6 months ago

    Yes you can you just have to duplicate the script and change the GPIO numbers

    0
    None
    Ghostrider513

    Question 10 months ago

    Can a flexible probe be made to detect dehydration? This could be a great wearable.