I want to measure the soil moisture with a capacitive (=non corrosive) sensor and transport the data via the CC2530 Zigbee module. This is how I did it.
Capacitive soil moisture sensor
This is readily available:
The device gives a DC signal of 0-3 V depending on the moisture content.
First challenge is to make it water tight so it can be used in moist soil .
I followed this idea: https://www.domoticz.com/forum/viewtopic.php?f=51&t=24116
Convert voltage to moisture
Connect the moisture sensor/diode/CC2530 and turn on the power. Make sure HA allows new devices to join. Use the MQTT explorer (http://mqtt-explorer.com/ ) and connect to HA and look for the newly added device. You should see something like:
Calibration is needed. Note the voltage when the sensor is dry (in my case Vdry = 2.463 V), now put the sensor in glas of water and read the voltage again (in my case Vwet= 1.386 V).
Create moisture MQTT sensor in HA
The formula is: ( (Vdry - voltage_l1) / (Vdry-Vwet) ) * 100
That’s really cool. I didn’t realize there was a configurable firmware available for the cc2530. I’ve been wanting a zigbee alternative to esphome and this looks really promising!
yeah indeed, Zigbee is more reliable than wifi. I also have shared on this forum my other Zigbee-PTVO builds ( DS18B20 temperature sensors and roller blinds)
I built the sensor following your first post but i’m facing an issue :
moisture sensor is always reporting the same value even with the sensor into water.
Hi @MomoB, if you have a simple multimeter, you can first measure the voltage from Capacitive Moisture Sensor before and after the diode to see real voltage.
Thanks. I dont have a multimeter but I put the diode in the wrong direction and the output was 0.4V instead of the usual 3.2V. So the diode seems to be OK.
Also, with the cable disconnected from the pin P06, the output is 0.2V.
It’s looked like the Moisture Sensor is faulty ? The 2 i have ordered do have the same behavior.
Fixed : Both sensors i received have a faulty PCB which seems to be a common occurence.
It is caused by the 1 Mega-Ohm resistor in R4 not being connected to GRD.
After some soldering, the sensor is correctly reporting 2.4V dry and 0.9V wet.
Thanks for this tutorial. I flashed the firmware on my CC2530 + CC2591. Now trying without a diode, but I measure already 3,3V on P06, is this correct? Is the diode only for better reading or absolutely necessary?
I have measured the current used by the capacitive soil moisture device: 5 mA This is excluding the CC2530 device:
A bit too much for a battery operated device.