Waterproofing a Capacitance Soil Moisture Sensor

12,649

57

16

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.

Supplies


Parts:

  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

Tools:

  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.

1 Person Made This Project!

Recommendations

  • Go Big Challenge

    Go Big Challenge
  • Chocolate Challenge

    Chocolate Challenge
  • Stone Concrete Cement Contest

    Stone Concrete Cement Contest

16 Comments

0
ingsouta
ingsouta

Tip 6 months ago on Step 10

I have used the second glue, it has great capillary capillarity. That same from second side.

DSC_0212.JPG
0
ingsouta
ingsouta

Tip 6 months ago on Step 9

I have used the Al folie for protect again heat of other areas

DSC_0210.JPG
0
kdorff
kdorff

10 months ago

Thanks for the guide! I recently started using some of these from a kit and noticed they would work and then start not working. I realized it was likely the sensors were getting wet. I found your guide in a search. I performed a similar modification (although my sensors have a surface mount connector, so removing the connectors was less of an option) and so far it's working great.

0
joefilter
joefilter

Question 1 year ago on Introduction

Hello do you know of a simple circuit that can turn off power when a moisture sensor gets wet and when the sensor dries out power is restored 12 volt DC? Please advise thank you...

0
vazquezjm
vazquezjm

Answer 11 months ago

You can use Arduino or a similar controller to power on/off the sensor using a relay.

0
jeremyjeremyjeremy
jeremyjeremyjeremy

1 year ago

Thanks, this is exactly what I was looking for. I was wondering though if using lead-based solder would be a safety hazard here if you're using this on food plants. You'd have to be very certain the waterproofing has worked!

0
diy_bloke
diy_bloke

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

0
ivanhoe011
ivanhoe011

Reply 1 year 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)

0
diy_bloke
diy_bloke

Reply 1 year ago

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

0
MaheshV15
MaheshV15

2 years 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.

Capacitive-Analog-Soil-Moisture-Sensor-3-3-5-5V-Corrosion-Resistant-with-Gravity-3-Pin-interface[1].jpgFBB072BK2I40RIY.LARGE[1].jpg
0
micromet
micromet

Reply 1 year ago

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

0
MaheshV15
MaheshV15

Reply 1 year 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.

0
GavinN
GavinN

Reply 1 year ago

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

0
korle
korle

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

Thanks!

0
audreyobscura
audreyobscura

2 years ago

Awesome tips! Thanks for the share!