Tuesday, 7 March 2017

How do you measure soil moisture using a capacitive sensor?



There are a number of capacitive moisture sensor designs on the internet, which use the insulated copper pads on a PCB.For example:


http://zerocharactersleft.blogspot.in/2011/11/pcb-as-capacitive-soil-moisture-sensor.html


In case the above link breaks, here is a photo of a PCB I made using the above design:


capacitive moisture sensor


Just wondering how these work, and how they can be used with a microcontroller to calculate moisture content? I have seen methods that use a square wave, an RC network, and an ADC to do this, but I haven't seen a clear explanation of how it works.



Answer



It's called capacitive because the two copper planes in your sensor are the two plates of a capacitor. In a physics textbook these two plates might be drawn facing one another, with empty space in between. Put a material between the plates, and the capacitance, which is a measure of how much charge is on the plates for a given voltage, changes. This material is called the dielectric, and how much the capacitance changes for a given material is called the dielectric constant of the material.


Dry soil has a different dielectric constant than wet soil, which means that a sensor in wet soil is going to have a different capacitance than one in dry soil.


How do we measure this capacitance? One way is to use an RC circuit, and to measure the voltage on the positive terminal of the capacitor. This terminal is going to reach 63.2% of its maximum voltage \$RC\$ seconds after a voltage is applied, where \$R\$ is the resistance and \$C\$ is the capacitance. By turning on the supply voltage at a time \$t_{on}\$, checking the voltage on the positive terminal of the capacitor continuously until it exceeds 63.2% of the supply voltage, and recording the first time where that voltage was exceeded \$t_{c}\$, we can calculate the capacitance (we know the resistor value because we chose it).


That is,



C = \$(t_{on}-t_c)/R\$


This tutorial will show you how to set something like this up on an Arduino. https://www.arduino.cc/en/Tutorial/CapacitanceMeter


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...