Capacitive Soil Moisture Sensor
Designed by qqqlab in SwitzerlandNo shipping info available.
Set destination country to see options
Shipping to starts at
Free shipping is available to !
Ships from
This item does not ship to .
More Info
Sign up to get notified when this product is back in stock!
Capacitor to measure soil moisture. Could also be used to measure water level. Capacity increases as more water is present in the vincinity of the sensor, see photos. Capacity Measurements a…
Read More…Capacitor to measure soil moisture. Could also be used to measure water level.
Capacity increases as more water is present in the vincinity of the sensor, see photos.
air | 6 pF |
moist soil | 46 pF |
half submerged in water | 216 pF |
fully submerged in water | 468 pF |
The relative permittivity of water is approx 80 times the relative permittivity of air. So the numbers actually match very well: fully submerged in water the capacity is 80 times higher than in air. I probably just got lucky here, as the accuracy of the multimeter is not the best, but the capacity clearly goes up as more water is present.
Here some results dipping the sensor into a glass of water. Generated with a SOIL01 sensor connected to an Arduino Pro Mini 8MHz/3.3V
adc=1009 C=50.92pF water=0.15%
adc=1011 C=49.15pF water=-0.14%
adc=1003 C=55.53pF water=0.89%
adc=1011 C=49.15pF water=-0.14%
adc=1007 C=52.55pF water=0.41%
adc=1010 C=50.05pF water=0.01%
adc=1007 C=52.55pF water=0.41%
adc=1007 C=52.55pF water=0.41%
adc=828 C=131.83pF water=13.20%
adc=695 C=192.09pF water=22.92%
adc=562 C=274.12pF water=36.15%
adc=476 C=349.02pF water=48.23%
adc=413 C=422.60pF water=60.10%
adc=360 C=503.78pF water=73.19%
adc=325 C=571.58pF water=84.13%
adc=314 C=595.95pF water=88.06%
adc=311 C=602.90pF water=89.18%
adc=302 C=624.54pF water=92.67%
adc=294 C=644.88pF water=95.95%
adc=293 C=647.50pF water=96.37%
adc=281 C=680.38pF water=101.67%
adc=280 C=683.24pF water=102.14%
adc=279 C=686.13pF water=102.60%
adc=277 C=691.96pF water=103.54%
Both sensors are 10 cm long, SOIL01 is 23mm wide and SOIL02 15mm. The SOIL02 has a slightly higher capacitance, but gives similar results as SOIL01.
To connect, use the two outer connections marked PWM and GRD. Leave the middle ADC pin unconnected.
#define CAP_PIN A0 //connect one sensor pin here, the other sensor pin to ground
#define CAP_FACTOR 218.5 //factor to convert ADC to pF capacity
#define CAP_AIR 50 //capacity in air in pF
#define CAP_WATER 670 //capacity in water in pF
void setup() {
Serial.begin(9600);
Serial.println("");
Serial.println("SOIL_capread");
pinMode(CAP_PIN, OUTPUT);
digitalWrite(CAP_PIN, LOW);
}
//get a raw ADC reading from the sensor
//first do an analogRead from the grounded sensor to discharge
//ADC sampling capacitor (improves accuracy)
//then, send a short pulse via the pullup resistor to the capacitor,
//finally, measure the voltage over the capacitor
//NOTE: replace the code between the two analogReads with the following
//to get better control over the pulse length. But this only works on a
//ATMega328 Arduino with the sensor connected to A0
//DDRC &= ~_BV(0); //input (compiles to "cbi DDRC, 0")
//PORTC |= _BV(0); //pullup on (compiles to "sbi PORTC, 0")
//asm("nop"); //repeat as many times as needed to set pulse length
//PORTC &= ~_BV(0); //pullup off (compiles to "cbi PORTC, 0")
uint16_t read_raw() {
volatile uint16_t v = analogRead(CAP_PIN);
pinMode(CAP_PIN, INPUT_PULLUP);
pinMode(CAP_PIN, INPUT);
v = analogRead(CAP_PIN);
pinMode(CAP_PIN, OUTPUT);
digitalWrite(CAP_PIN, LOW);
return v;
}
void loop() {
uint16_t adc = read_raw();
Serial.print("adc=");
Serial.print(adc);
/*==============================================
* Convert the raw ADC value into the capacitance:
*
* C = - dt / ( R * ln(1 - adc / ADC_MAX)
*
* C: capacity (F)
* dt: pulse duration (s)
* R: pullup resistance (Ohm)
* adc: ADC reading (counts)
* ADC:_MAX maximu ADC reading (counts)
*
* or, simplified:
*
* C = - CAP_FACTOR / ln(1 - adc / ADC_MAX)
===============================================*/
float cap = -(float)CAP_FACTOR / log(1.0-(float)adc/(float)1023);
Serial.print(" C=");
Serial.print(cap);
Serial.print("pF");
float water = 100.0 * (cap - (float)CAP_AIR)/((float)CAP_WATER - (float)CAP_AIR);
Serial.print(" water=");
Serial.print(water);
Serial.print("%");
Serial.println();
delay(500);
}
No country selected, please select your country to see shipping options.
No rates are available for shipping to .
Enter your email address if you'd like to be notified when Soil Moisture Sensor can be shipped to you:
Thanks! We'll let you know when the seller adds shipping rates for your country.
Shipping Rate | Tracked | Ships From | First Item | Additional Items |
---|---|---|---|---|
:
|
No shipping info available.
Set destination country to see options
Shipping to starts at
Free shipping is available to !
Ships from
This item does not ship to .
More Info
Sign up to get notified when this product is back in stock!
By clicking Register, you confirm that you accept our Terms & Conditions
We recognize our top users by making them a Tindarian. Tindarians have access to secret & unreleased features.
We look for the most active & best members of the Tindie community, and invite them to join. There isn't a selection process or form to fill out. The only way to become a Tindarian is by being a nice & active member of the Tindie community!