Waterproofing a Capacitance Soil Moisture Sensor




Introduction: Waterproofing a Capacitance Soil Moisture Sensor

About: Professor Colorado State University Department of Soil and Crop Sciences Fort Collins, Colorado, USA

Capacitive soil-moisture sensors are a great way to monitor soil water status in your potted plants, garden, or greenhouse using an Arduino, ESP32, or other microcontroller. They are superior to the resistance probes often used in DIY projects. See the video from Andreas Spiess for a good explanation of how they work. The capacitance sensors only cost about $1 each in bulk, however, they have exposed electronics and are not waterproof. A soil moisture sensor that can't get wet is not very useful. This instructable shows you how to waterproof your sensors using adhesive-lined heat shrink, a small set of supplies, and common tools.



  1. Capacitance soil moisture sensor, example from eBay, or from DFrobot
  2. Signal wire (at least 3 conductors), 22 -24 gauge; we used telephone wire from Lowes; it's solid core 4-conductor so one wire is not used.
  3. Adhesive-lined Polyolefin Heat-shrink tubing in three sizes: 1/4", 1/2" and 3/4" diam. with at least 3:1 shrink. Purchased on eBay for about 1$ per foot (example).
  4. Laquer or nail polish: we used Sally Hansen Hard as Nails from Target


  1. Wire Cutter (flush style)
  2. Wire Stripper
  3. Heat Gun
  4. Soldering iron and solder
  5. Arduino or other microcontroller if you want to test the sensor before and after assembly

Note: The most unusual item in this build is the large diam. heat shrink tubing with adhesive. Heat shrink is readily available from many suppliers. It's also on eBay, so you can buy your heat shrink when you buy your soil moisture sensors. Again, it must be adhesive-lined and have a 3:1 shrink ratio.

Step 1: Get a Capacitance-based Soil Moisture Sensor and Test

On rare occasions, we have found batches of these sensors that are flawed (we got a bad order from Ali Express). I would run a simple test of the sensors with an Arduino before waterproofing. There are many tutorials on the web - here is an example.

Step 2: Remove the Connector

Remove the connector with a flush cutter. After the connector is removed, there will be three unused solder through-holes for attaching the signal wires (they cannot be seen until you remove the connector)

Step 3: Prep Signal Wire and Solder to Sensor

Prep signal wire and solder. Made sure to trim the wires on the back of the board flush with the PCB using your cutter. Clean the solder joint with rubbing alcohol.

Step 4: Apply Lacquer (nail Polish) to Exposed Circuits

Apply Sally Hansen's nail polish or a similar compound to exposed circuits on the front and back where the electronic components and traces are exposed. Do not apply to the whole sensor board, just the top inch or so with exposed electronics. Do this outdoors or in a well-ventilated room - allow 30 min to dry.

Step 5: File the Corners of the PCB Sensor With Sandpaper or a File

File the corners with sandpaper or a file. This prevents the sharp corner from piercing the heat shrink tubing

Step 6: Prep Your Heat-shrink Tubing

Cut three sectons of heat shrink tubing as follows.

1/4" diam. - 1.25 inches long

1/2" diam. - 0.75 inches long

3/4" diam. = 1.5 to 1.75 inches long (I used 1 5/8")

Step 7: Shrink the 1/4" Diameter Tubing First

Apply the 1/4 diameter tubing with the heat gun - as always - BE VERY CAREFUL WITH THE HEAT GUN. Get adult supervision if needed.

Step 8: Add the 1/2" Diameter Heat-shrink Tubing

Add the 1/2 tubing with the heat gun.

Step 9: Apply the 3/4" Diameter Heat-shrink Tubing

Last, apply the 3/4" diameter tubing. Make sure the adhesive is melted and seals all the joints. It's important that you get the tubing in the correct position or you won't get full coverage of the electronics. Using a gloved hand, you can apply pressure to the heat shrink while it's still warm to push the adhesive onto the PCB; this may improve the seal.

Step 10: Apply a Thin Layer of Nail Polish at the Sensor / Tubing Seam

Apply a thin layer of nail polish at the sensor / tubing seam to provide extra waterproofing protection.

Step 11: Complete Probes and Test Again

Test the probes again with your Arduino or other microcontroller. I submerged my sensors in a glass of water for several days while taking readings periodically to verify performance.

Be the First to Share


    • Microcontroller Contest

      Microcontroller Contest
    • Automation Contest

      Automation Contest
    • Make it Glow Contest

      Make it Glow Contest



    5 months ago

    There is another problem with this sensor. They are coated before they are separated from eachother. Hence the sides will not be covered and eventually moisture will creap in from the sides


    Reply 5 weeks ago

    Nail polish to the rescue... or superglue or epoxy, which btw can be used to seal the whole thing (and epoxy being clear you can still see inside, to know if there's corrosion or anything else funky going on, so it's even better IMHO)


    Reply 4 weeks ago

    I can't vouch for all nail polish as i had some that dissolved after a few days. PlastiDip wirks great


    10 months ago on Step 1

    the bad items off of aliexpress are probably the following. zoom in and look at component U2 before buying. if it has a 2-pin component at an angle (see photo), they went cheap and used a resistor instead of a 3-pin transistor (see the copy of your photo here, same location, U2). the latter work. with the former, you can open a dispute with aliexpress but be prepared to give them documentation such as a video of your screen showing values from good and bad sensors.


    Reply 8 months ago

    Good eye, yes that was exactly what was the problem with my bad batch. Thanks


    Reply 8 months ago

    i was lucky; it wasn't a substandard component that looked the same. i compared a good sensor with a lousy sensor and went bit by bit until i found the difference. it's a real shame they did this. similarly, it's a real shame the ESP32, such a great device, has piss-poor ADC. to be of any use, you need an external ADC device but then it's super hard to make it work with the ULP (ultra low power) processor. what a mess.


    Reply 4 months ago

    Just want to mention in closing that it still does work with 3.3V and the r4 resistor needs to be connected ground.


    8 months ago

    Hi! Thanks for that, exactly what I was wondering all along... "How can this ever be used outside?"

    What's the maximum lead length to keep it working? Or what would you suggest to for example measure 5 places all over the garden. Would 5 complete Arduino's with power supply and Wi-Fi be needed for something like that?



    1 year ago

    Awesome tips! Thanks for the share!