Soil Moisture Sensor (Raspberry Pi)

Introduction: 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.

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

Attachments

Step 4: Additional Info

Be the First to Share

    Recommendations

    • Puzzles Speed Challenge

      Puzzles Speed Challenge
    • "Can't Touch This" Family Contest

      "Can't Touch This" Family Contest
    • CNC Contest 2020

      CNC Contest 2020

    7 Discussions

    1
    Hareesh Kanna
    Hareesh Kanna

    1 year ago

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

    0
    TiglathIII
    TiglathIII

    1 year 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
    MagdalenaJ3
    MagdalenaJ3

    1 year 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
    Willrocks07
    Willrocks07

    1 year 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
    HugoS94
    HugoS94

    Question 2 years ago

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

    0
    Willrocks07
    Willrocks07

    Answer 1 year ago

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

    0
    Ghostrider513
    Ghostrider513

    Question 2 years ago

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