Capacitive Soil Sensor

Hello there,

I'm trying to implement a capacitive soil humidity sensor. The idea is to discharge the sensor connectet to P0.2 via P0.2, then charge it over a resistor. When turning on the GPIO to charge the sensor, a timer should be startet by PPI. Then, when a threashold voltage is reached (i.e. vdd/2), the counter should be stopped by PPI. I want to do it with low level register manipulation. I tried to follow the capsense example https://devzone.nordicsemi.com/guides/short-range-guides/b/design-examples/posts/capacitive-touch-on-the-nrf52-series  but without success... I feel these capsense libraries are really over complicated. I think all that is necessary is:

- discharge sensor

- configure PPI to start timer on GPIO action and stop it on comparator rise event

- configure compartor

- configure timer

- charge sensor

- read out timer value that was reached on comparator event

Any ideas how to do that?

Thanks, Edi

Related