This library provides full access to the functions of the CY8CMBR3102 through an I2C connection using the SparkFun Qwiic connectors and cables. This allows for reading the raw capacitance measured by the SparkFun Capacitive Soil Moisture Sensor. Capacitance increases with soil moisture, so this can be used to measure how moist soil is.
This library is intended for use with the following SparkFun Product - available at www.sparkfun.com.
| Product | Description |
|---|---|
| SparkFun Capacitive Soil Moisture Sensor - CY8CMBR3102 (Qwiic) | SparkFun Qwiic Capacitive Soil Moisture Sensor enables users to sense soil moisture via a capacitive plate in the blade and the embedded CY8CMBR3102 capacitive touch sensor. It features a convenient ruler to allow precise soil moisture measurements. Unlike resistive soil moisture sensors, it does not have exposed metal leads which can suffer from rapid corrosion. If you were so inclined, you could even use this sensor as a touch or proximity sensor since touching the measuruing plate leads to a large increase in measured capacitance. |
| Reference | Description |
|---|---|
| Library Documentation | The full documentation and API for this Arduino library |
| SparkFun Capacitive Soil Moisture Sensor - CY8CMBR3102 (Qwiic) | Hardware GitHub Repository |
| Hook Up Guide - Capacitive Soil Moisture Sensor - CY8CMBR3102 (Qwiic) | Hardware Overview and Quick Start for the SparkFun Capacitive Soil Moisture Sensor - CY8CMBR3102 (Qwiic) |
| CY8CMBR3102 Datasheet | Datasheet for the CY8CMBR3102 IC |
| CY8CMBR3102 Technical Reference Manual | Reference manual for the CY8CMBR3102 Capsense® Express™ controller |
| Installing an Arduino Library Guide | Basic information on how to install an Arduino library |
The following examples are provided with the library
| Example | Description |
|---|---|
| Basic Readings | Take basic readings from the sensor (capacitance in pF) and print them to the terminal. |
| Advanced | Adjust parameters and read multiple forms of counts from the sensor included base counts, diff counts, and raw counts. |
| LED | Demonstrates how to toggle the LED and use it as an indicator for when soil moisture goes below a threshold |
| I2C Address Setting | Shows how to set up a threshold and trigger an interrupt when the light reading crosses that threshold. |
| Multiple Sensors | Demonstrates how to setup and use multiple sensors at once. It requires previously setting the I2C address of two sensors with Example 4 |
| Set Range | Shows how to set the sensor's raw count values to an appropriate range. |
This product is open source!
This product is licensed using the MIT Open Source License.
![SparkFun Capacitive Soil Moisture Sensor (CY8CMBR3102) Arduino Library] SparkFun Capacitive Soil Moisture Sensor (CY8CMBR3102) Arduino Library](/sparkfun/SparkFun_CY8CMBR3_Arduino_Library/raw/main/docs/images/Qwiic_Soil_Moisture-ArduinoBanner.png)