Introduction
The SparkFun Qwiic Soil Moisture Sensor (Capacative) is a simple sensor breakout to measure moisture in soil and similar substances. The breakout measures moisture using a capacitive plate in the board along with the CY8CMBR3102 Capsense® Express™ controller. Because this soil moisture sensor does not have exposed metal leads it's more resistant to corrosion. The board also includes a ruler with both Imperial and Metric units to measure the sensor's depth in soil for more precise moisture data. There's also a blue status LED tied to the CY8CMBR3102 which can be used as a visual indicator for when the sensor measures beyond a user-defined threshold value.
The SparkFun Qwiic Soil Moisture Sensor (Capacative) has code packages available for both the Arduino IDE as well as MicroPython. These code packages cover how to calibrate the sensor for different soil compositions to get reliable and usable soil moisture data from the sensor.
In this Quick Start guide we'll cover how to assemble the sensor into a Qwiic circuit and use the SparkFun CY8CMBR3 Arduino Library to get capacitance data we can use to determine soil moisture.
Required Materials
In order to use this Qwiic breakout board, you'll need the following materials:
- SparkFun RedBoard IoT - ESP32 (or other Arduino development board)
- Qwiic Cable
Resources and Support Documentation
You'll find the board design files (KiCad files & schematic), relevant documentation (datasheets, white papers, etc.) and other helpful links in the Resources. Lastly, the Support section includes a Troubleshooting page that includes any helpful tips specific to this board as well as information on how to receive technical support from SparkFun.
Quickstart Guide
Troubleshooting
Sensor Calibration
The Qwiic Soil Moisture Sensor (Capacitive) operates by detecting changes in capacitance in the soil it's inserted into. This works in measuring soil moisture by measuring the soil's change in relative permittivity (or dielectric constant). Put simply, wet soil has a higher relative permittivity than dry soil and therefore the sensor will report higher capacitance values in wet soil. As soil dries out, it loses permittivity and the measured capacitance drops.
Different soil types and environments can return significantly different capacitance values so it is important to calibrate the Qwiic Soil Moisture Sensor (Capacitive) to get an effective range of capacitance values for the soil it's monitoring. Start by inserting the sensor into a completely dry soil sample to get the minimum values for the soil. Then place the sensor into a completely saturated sample of the same soil to get the max values. With this range defined, you can create thresholds to trigger events like turning on the Soil Moisture Sensor's blue STAT LED when a threshold is exceeded as demonstrated in Example 03 - LED.
General Troubleshooting
Note
Not working as expected and need help?
If you need technical assistance and more information on a product that is not working as you expected, we recommend heading on over to the SparkFun Technical Assistance page for some initial troubleshooting.
If you don't find what you need there, the SparkFun Forums are a great place to find and ask for help. If this is your first visit, you'll need to create a forum account to search product forums and post questions.
Resources
For more information about the SparkFun Qwiic Soil Moisture Sensor (Capacitive) check out the following resources:
