A capacitive moisture sensor board employing an ESP32-C3 RISC-V microcontroller capable of transmitting measurements via Wi-Fi and Bluetooth 5 (LE). The board is powered by a single cell LiPo battery, which can be charged using the USB-C port.
Components are spaced quite far apart, with the goal of making it easier to solder them by hand.
The sensor circuit consists of the following building blocks:
- The microcontroller generating a square wave, depicted as voltage source
$U_0$ . - A low pass filter made up of resistor
$R_1$ and capacitor$C_1$ . Capacitor$C_1$ stands for sensor wires together with the medium to be measured acting as a dielectric. Its value is to be determined by the circuit. - A peak voltage detector made up of diode
$D_1$ , resistor$R_2$ and capacitor$C_2$ . - The microcontroller measuring voltage
$U_2$ .
Since resistor
where
- Add battery protection circuit.
- Add a switch for turning the device on and off.
- Add a button to put the device into a mode where it acts as an access point or can be connected via Bluetooth.
- Make it possible for the microcontroller to measure battery voltage and to know if it is powered using USB or the battery. Detect USB using an RTC GPIO port to be able to wake the microcontroller when plugged in.
- Replace the battery solder pads with a connector.
- Remove sensing traces from the top so that it matters less how deep the sensor is pushed into the soil. Additionally, moisture variations are more relevant deeper down than on the top.
- Increase the length of the probe.
- Make it possible to power the board without a battery, using USB-C only. This is currently possible by bypassing the battery charge management controller by connecting VDD and +BATT. Otherwise, the power supply voltage of the microcontroller is not stable.
- Expose JTAG pins for development since the USB-to-JTAG interface is turned off during deep sleep.