I have a raspberry pi with a moisture sensor that suffers from corrosion. My setup is similar to the one described in this raspberrypi.stackexchange question about corrosion of a moisture sensor.

A solution to this problem, suggested in this answer, is to coat the PCB in gold finishing.

This is something I would like to try.


However, as I am a complete newby to the field, I do not know what section exactly to "gold finish". Therefore my questions are:

Moisture sensor with two regions highlighted: the connections in green and the rods in orange

  1. Do I need to cover the "connections section" with gold finish? By which I mean the section where the pins are connected to the wires. See the green highlighted area in the above figure.

    I can see that protecting this area might be smart, especially since this sensor is used in a moist environment, but I do not see how gold plating the "connections section" prevents corrosion, which happens on the "rods section".

  2. Do I need to cover the "rods section" with gold finish? By which I mean the two "pointy" parts of the sensor. See the orange highlighted area in the above figure.

    I can see that this might prevent corrosion, but won't this stop the sensor from working by covering its rods?

  • \$\begingroup\$ "I do not see how that would prevent corrosion" The reason to use gold is that gold is very resistant to corrosion. (If I remember my chemistry, it will corrode in a mixture of sulfuric and hydrochloric acid but that is a rather uncommon fluid...) \$\endgroup\$
    – Oldfart
    Aug 18, 2019 at 12:29
  • \$\begingroup\$ "Gold finish" is usually just a box that you can tick when ordering PCBs from a manufacturer. It will apply to the whole board - all exposed copper areas to be exact. \$\endgroup\$
    – Turbo J
    Aug 18, 2019 at 12:39
  • \$\begingroup\$ @Oldfart Actually, nitric acid and hydrochloric acid, it's called aqua regia. :) \$\endgroup\$
    – Long Pham
    Aug 18, 2019 at 12:39
  • \$\begingroup\$ @Oldfart what I meant was more along the lines of "I do not see how gold plating the "connections section" prevents corrosion, which happens on the "rods section". I will adjust this in the question. \$\endgroup\$
    – MuadDev
    Aug 18, 2019 at 12:41
  • 1
    \$\begingroup\$ You should be using AC on the probe to minimise electrolysis. Add your schematic. \$\endgroup\$
    – Transistor
    Aug 18, 2019 at 13:28

2 Answers 2


Many of the “hobbyist” soil probe circuit designs actually pass DC current through the probe, which inevitably results in electrolytic corrosion regardless of the metals used. If you only briefly power such a horrible simple circuit and with a low duty cycle you will get less corrosion per unit time. There also should be no flow to ground when off.

Gold will help with corrosion when not in use (you can bury a lump of gold for 100 years and it will look the same when dug up) but not with electrolytic corrosion, in fact it would just reverse the process by which thick layers of gold are sometimes applied (electroplating). The layer of gold on an ENIG PCB is less than a tenth of a micron in thickness typically so it doesn’t take much to strip it down to the nickel barrier.

  • \$\begingroup\$ Thanks for the useful background info about DC current and the gold plating! However, I feel it does not directly address my questions about what parts need to be plated with gold precisely. Although I do now know that it probably will not be feasible for me to do this myself, thanks for that! \$\endgroup\$
    – MuadDev
    Aug 18, 2019 at 14:54
  • \$\begingroup\$ You design and order the PCB made to your specifications with ENIG (cheap) or hard gold (relatively expensive). Any place you don't put solder mask will be covered with a thin layer of gold. The design shown is appropriate- all the mask is removed from areas in contact with the soil, and the mask is only in place to aid soldering in the "dry" area. But, as stated above, that won't help if your circuit is bad, in fact it could make things worse. \$\endgroup\$ Aug 18, 2019 at 15:07
  • 1
    \$\begingroup\$ Agreed, don't do it, won't help. What could be useful, if you reverse the polarity to put back the layer. Even better, replace the sensor with a capacitive one! They're relatively cheap, and they're completely covered, so no corrosion happens. \$\endgroup\$
    – Nyos
    Aug 19, 2019 at 1:42

Gold can help reduce corrosion, so plating the parts in contact with the soil will help. You don't need to plate the parts that stay out of the dirt, but it won't cause problems if you do.

Gold conducts nearly as well as copper, so the plating in no way interferes with the function of the sensor.

Gold itself doesn't really corrode. That's really the best reason why jewelry is made from it - who wants a bronze ring that turns your finger green from corrosion? Gold just doesn't do that.

The thing is, that gold will "wander" away from the surfaces when placed in a conductive solution. That's part of how electroplating works. Moist dirt is a conductive solution - it has to be, or else the electrodes couldn't detect moisture. The amount of water in the dirt changes the electrical resistance of the dirt, which the electrodes detect.

Over time, the gold from the electrodes will "electroplate" the soil around them. This removes gold from the plated electrodes. At some point, the gold will leave bare patches on the copper and then you get corrosion.

So, gold plating isn't a complete solution but it is better than bare copper.

If you need to plate existing probes, then you could try a small electroplating kit. That one costs around $60. The plating will be thin and not especially even.

Or, you do a simple layout with the required circuitry and have it made from a PCB service. Specify gold plating, and you get a good, even gold plate on all bare surfaces. You just leave holes in the solder mask for your electrodes.

A longer lasting solution is to use capacitive sensing. You might also look into using graphite rods as your spikes, as they don't corrode. Stainless steel might be an alternative, but then you'd need to use AC instead of DC.

  • \$\begingroup\$ @jusaca: You are right. Corrected the conductivity of gold. \$\endgroup\$
    – JRE
    Aug 18, 2019 at 13:42
  • \$\begingroup\$ Thanks for explaining why the gold is useful, where to apply it and how this potentially could be done. But seeing your answer I would probably go with capactive sensing and/or graphite rods. Also the stainless steel option seems interesting, however I do not know anything about using my Pi with AC current. If you could link to a useful guide/demo about this than that would be fantastic! Thanks anyway! \$\endgroup\$
    – MuadDev
    Aug 18, 2019 at 14:57
  • \$\begingroup\$ I wouldn't say 70% as conductive is "nearly as well". It's still a good conductor but it's a far cry from copper. \$\endgroup\$
    – Hearth
    Aug 18, 2019 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.