Labs / Electronic modules

Capacitive Dust, Rain and Frost Sensor CDS1081

Author: Li Zisheng · Source: FreakStudio open documentation, v1.1 · License: CC BY 4.0 · Driver code (sensors/cds1081_driver): MIT License

Contents

Introduction

Have you ever encountered such situations: the smart irrigation system misjudges light rain and runs pointlessly, the automatic window closer malfunctions due to dust interference, and the rainfall data on food delivery platforms can only be judged by delivery riders with the naked eye?

For a long time, the "environmental perception" of outdoor smart devices has long been a persistent and intractable problem. Traditional raindrop detection solutions generally have obvious shortcomings:

Capacitive Dust, Rain and Frost Sensor CDS1081
Capacitive Dust, Rain and Frost Sensor CDS1081
Capacitive Dust, Rain and Frost Sensor CDS1081

Launched by Minyuan, the capacitive dust, rain and frost sensor CDS1081 is exactly an "all-round sensing player" designed to address these pain points. It is an intelligent sensor based on capacitive sensing, with a self-developed MCP1081S digital capacitance processing chip as its core — simply put, it perceives the environment through "changes in the dielectric constant of substances": when dust, rain or frost covers the surface, different substances will alter the capacitance value, and the sensor can accurately calculate the thickness of dust, rain and frost through such changes, which is equivalent to equipping the device with a pair of "eyes that can sense thickness".

Its core advantages are as follows:

It can be applied to the following scenarios:

Capacitive Dust, Rain and Frost Sensor CDS1081
Capacitive Dust, Rain and Frost Sensor CDS1081
Capacitive Dust, Rain and Frost Sensor CDS1081

From smart homes and outdoor travel to industrial equipment and cleaning appliances, the capacitive dust, rain and frost sensor CDS1081 uses a tiny capacitive sensor to solve the major challenge of "environment perception" for outdoor devices. It enables smart devices to stop operating by "guessing" and truly understand changes in rain, dust and frost, providing reliable intelligent control solutions for various scenarios.

I. Module Introduction

Capacitive Dust, Rain and Frost Sensor CDS1081

This figure shows the physical appearance of the CDS module, from which the sensing area, board shape and dimensions, and overall structural form can be visually observed.

2. Introduction to Main Chips

2.1 Chip Overview

Minyuan 10-Channel Multi-Mode Broadband Digital Capacitance Processor Chip MCP1081S detects the thickness changes of dust, rain and frost based on the variation of dielectric constant in the presence of such substances, and the thickness of dust, rain and frost is directly proportional to the capacitance value.

2.2 Pin Definition

Capacitive Dust, Rain and Frost Sensor CDS1081

This figure illustrates the pin definitions of the module, which can be used to verify the connection relationships between the power supply and serial port signals.

2.3 Functional Block Diagram

None.

2.4 Performance Parameters

Capacitive Dust, Rain and Frost Sensor CDS1081

This figure presents the main performance parameters of CDS, including information such as power supply, power consumption and basic measurement capabilities.

Capacitive Dust, Rain and Frost Sensor CDS1081

This diagram supplements the specifications and application parameters of the module, facilitating reference during model selection and system design.

2.5 Reference Circuit

None

2.6 Chip Configuration

None.

Capacitive Dust, Rain and Frost Sensor CDS1081

This diagram illustrates the basic parameters and frame format of module communication, which serves as the basis for master-slave communication development.

Capacitive Dust, Rain and Frost Sensor CDS1081

This diagram illustrates communication examples and data organization methods to facilitate understanding of the composition of specific read and write instructions.

2.6 Register Definition

Capacitive Dust, Rain and Frost Sensor CDS1081

This figure lists the register definitions, which can be used to read measurement values or configure relevant threshold parameters.

2.8 PCB Routing Precautions

None.

III. Circuit Engineering

3.1 Circuit Source Engineering

To obtain the source project of the circuit, please refer to the link below:

https://www.mysentech.com/productinfo/3168524.html

3.2 Module Usage Instructions

3.2.1 Module Test Environment Setup and Notes

Before using this module, set up the test environment as required:

Here, during testing, we can simulate dust, condensation and rain scenarios using just ordinary paper sheets and clean water: simply put, we cover the sensing surface with paper sheets of different thicknesses to simulate dust accumulation, add a small amount of clean water to simulate rain, frost and condensation, and observe whether the values change steadily and linearly with the occlusion and the thickness of the water layer.

3.2.2 Usage of Modbus Poll

Modbus Poll is a universal Modbus master debugging tool compatible with all capacitive sensors in this series that support the Modbus-RTU protocol. It enables quick serial communication debugging, real-time data reading and log export between sensors and computers, serving as a universal host computer tool for verifying sensor functions and collecting test data. The software supports Modbus RTU/ASCII/TCP/IP protocols, is compatible with multiple register types and data formats, and its operation process is universal for the entire series of sensors.

Before use, you need to complete the software installation and activation first. You can download the installation package through official channels; the first launch supports a 30-day trial, and you can also enter a registration code for permanent activation. After the hardware connects the sensor to the computer, open the software and click "Connection" - "Connect", then configure the serial port parameters (Port Number, baud rate, data bit/parity bit/stop bit; this series of sensors defaults to the 9600 Baud, 8N1 format, subject to the specification sheet of the corresponding specific model) in the pop-up window, and confirm to establish a communication connection.

Capacitive Dust, Rain and Frost Sensor CDS1081

The following is a description of the general operation process:

  1. Serial Port Connection Configuration: After connecting the sensor to the computer via a USB-to-serial port module, launch the Modbus Poll software, click "Connection" - "Connect" on the menu bar, select the COM Port Number corresponding to the sensor in the pop-up window, and configure the serial port parameters matching the sensor (baud rate, data bits, parity check mode, stop bits; this series of sensors defaults to 9600 Baud, 8N1 format), then confirm to establish a communication connection.
  2. Import Sensor Configuration File: The software supports importing. mbp pre-configuration files corresponding to various sensor models. These files come with preset register addresses, data formats, and alias definitions, eliminating the need for manual register configuration. Simply open the. mbp file for the corresponding sensor in the software to automatically load all parameters. Once the connection is established, real-time detection data of the sensor (such as dust/rain/frost thickness values, status flag bits, etc.) will be displayed directly.
  3. Data Logging (Optional): If you need to save test data, you can configure logging rules via the "Setup" - "Excel Log" function. It supports logging data at fixed intervals or with every data update, and allows you to set a maximum number of log entries, facilitating subsequent analysis and verification of sensor data.

The above are the general basic operations of the host computer. For the. mbp preconfiguration files, specific register definitions and special configuration details of different sensor models, please refer to the content in "VII. Related Materials".

3.3 Application Experiment

Here, we use the GraftPort-RP2040 development board for testing, and the capacitive dust, rain and frost sensor CDS uses the UART interface to communicate with the main controller.

Here, we first use the HY2.0-4P connection cable to connect the capacitive dust, rain and frost sensor CDS via the XH2.54-4P to HY2.0-4P interface adapter module to the GraftPort-RP2040 development board's UART0 interface:

Capacitive Dust, Rain and Frost Sensor CDS1081

This diagram illustrates the actual wiring method between the CDS module and GraftPort-RP2040 development board.

The module connections are shown in the following table:

Development Board Pins

Module Pins

Description

Pin 16

MTX

UART data transmission line, corresponding to the transmit pin of the development board

Pin 17

MRX

UART data transmission line, corresponding to the receiving pin of the development board

Here, we need to search for the relevant driver packages on uPyPI: https://upypi.net/zh/

Capacitive Dust, Rain and Frost Sensor CDS1081

This diagram demonstrates the operation entry for finding sensor driver packages on the uPyPI platform.

Enter cds1081_driver to search, and the following will be displayed:

Capacitive Dust, Rain and Frost Sensor CDS1081

This figure shows the search results for cds1081_driver, which are used to confirm the name and version of the driver package.

Click to copy the local installation command:

Capacitive Dust, Rain and Frost Sensor CDS1081

This figure shows the interface for copying the local installation command, which facilitates quick driver deployment.

Import the module driver library code via the mip tool. Below are the usage commands for the mpremote tool:

mpremote mip install https://upypi.net/pkgs/cds1081_driver/1.0.0

After importing the driver code for the capacitive dust, rain and frost sensor CDS-MicroPython, copy the following main.py code into our project:

# Python env   : MicroPython v1.23.0
# -*- coding: utf-8 -*-
# @Time    : 2025/9/8 4:52 PM
# @Author  : hogeiha
# @File    : main.py
# @Description : CDS1081 rain sensor data reading and threshold configuration

# ======================================== Import Modules =========================================

import time
from cds1081 import CDS1081

# ======================================== Global Variables ============================================

# ======================================== Functions ============================================

# ======================================== Custom Classes ============================================

# ======================================== Initialization configuration ===========================================

# Wait for the system to stabilize
time.sleep(3)
# Output initialization complete message
print("FreakStudio: CDS1081 sensor initialized")

# Create CDS1081 sensor object, specifying slave address, UART ID, TX pin and RX pin
sensor = CDS1081(slave_addr=1, uart_id=0, tx_pin=16, rx_pin=17)

# Set capacitance calibration value, scaled up 1000 times, corresponding to 6pF
sensor.set_calibration(6000)
# Set alarm threshold
sensor.set_alarm_threshold(40000)
# Set clear threshold
sensor.set_clear_threshold(20000)

# ========================================  Main Program  ============================================

# Read sensor data in an infinite loop
while True :
    # Print node address
    print("Node address:", sensor.get_node_address())
    # Print rain status
    print("Rain status:", sensor.get_rain_status())
    # Print temperature value
    print("Temperature:", sensor.get_temperature(), "C")
    # Print capacitance value
    print("Capacitance:", sensor.get_capacitance(), "pF")
    # Print Count0 value
    print("Count0 value:", sensor.get_count0())
    # Print calibration ideal value
    print("Calibration ideal value:", sensor.get_calibration_value(), "pF")
    # Print alarm threshold
    print("Alarm threshold:", sensor.get_alarm_threshold())
    # Print clear threshold
    print("Clear threshold:", sensor.get_clear_threshold())

Burn the code, open the terminal, and the output is as follows:

Capacitive Dust, Rain and Frost Sensor CDS1081

This figure shows the serial port output result after the program runs, from which information such as node address, status and temperature can be seen.

Capacitive Dust, Rain and Frost Sensor CDS1081

We can observe that after CDS is sprayed with water multiple times, its state gradient exhibits a significant change:

Capacitive Dust, Rain and Frost Sensor CDS1081

4. Drivers

cds1081_driver.zip 45 KB

None.

VI. Revision History

Document Version

Date of Modification

Modifier

Revised Content

v1.0

2026-04-24

Hou Junhan

Initialize Document

v1.1

2026-05-20

Li Zisheng

Add introduction and the usage of 3.2.2 Modbus Poll

VII. Relevant Materials

CDS1081 Capacitive Dust, Rain and Frost Sensor Product Introduction-Minyuan 202603-2.pdf 765 KB

Modbus+Poll Host Software User Guide-Minyuan 20250102(1).pdf 355 KB

CDS Host Software Modbus+Poll Query Configuration File.mbp 1 KB

Modbus+Poll.rar 1.8 MB