My hope for this project is to be able to make a capacitive soil moisture measurement. It will also be handy for non-conductive fluid level measurements of a December indoor tree .
It’s alive in its Frankenstein embodiment on a breadboard.
The capacitor excitation signal is derived from a 10 kHz PWM signal followed by a 2nd order RC low-pass filter. While the output isn’t a perfect sinusoid, its close enough to not to overload the TIA.
I was able to get the RPi Pico to round-robin DMA sample 2 inputs into a 100 kSample buffer (50 kSa each) at the full ADC sample-rate of 500 kSa/s.
The TIA has a forward trans-resistance of approximately -100kOhms. That is why in the figure above the current signal (green) is lagging versus leading; the result is inverted.
Here, I had just used a 24 pF ceramic capacitor in place of measurement electrodes.
The system noise floor measuring the TIA output voltage in a 5 Hz DFT bin is approximately 20 uVrms.
Which would put the measurement resolution at approximately 6 fF rms. I think that should be just fine.
Now to put it all together. For the spectral analysis I will use the Goertzel algorithm to estimate 1 DFT bin. I have already tried this python implementation https://gist.github.com/sebpiq/4128537 on the Pico with good results.
Breadboard to Perfboard
I was able to fit the Pico Puffer into a Bud Industries outdoor rated enclosure.
One step closer to measuring soil moisture content.
The Lost Digit
This is still a work in progress. At present, I am not achieving the measurement resolution I was hoping for, the noise is upwards of 500 uVrms sampling either the excitation signal or TIA output. Even more disheartening is the noise does not scale with the digital process gain of longer sample records. There are a number potential aggressors which could be at fault.
I added 2 additional 10 uF 16V MLCC to the 3v3 rail on the RPI Pico to further reduce the output ripple of the DCDC converter from 7 mVrms to 2 mVrms:
The ADC input to the excitation signal is clean as it has a 10 nF output capacitor from the 2nd order RC low-pass filter. The ADC input from the TIA was suffering from charge injection from the SAR ADC's input sample capacitator:
The addition of a 560 pF bypass capacitor on the TIA output provides a low source impedance to the ADC's input during its sample window. Additionally, the 560 pF bypass capacitor doesn't reduce the effective bandwidth or stability of the TIA.
An additional 470 uF electrolytic filter capacitor was added to the ADC reference supply rail:
When I sample either the excitation signal or TIA output with my in ACV with a 200 Hz measurement bandwidth I do not see millivolt excursions in AC amplitude.
If you bump or breathe too closely to the Pico Puffer you will see a measurement variation. But, the output refereed noise of the TIA in a 200 Hz bandwidth is in the low microvolts not millivolts.
The Pico Puffer took a few day trip to the beach before the summer passes.
As a first pass attempt I just used a piece of copper clad FR4 scored to create to parallel electrodes. The dimensions of each electrode are approximately 1.5 cm x 7 cm.
The plastic shield bag is not a good choice for measurement repeatability, the air gap between the bag and electrodes can vary with time causing the effective capacitance to vary.
Fluid Level Sensing
When the electrode are dry they have a baseline capacitance of 7.8 pF. As the fluid (water in this case) submerges some fraction of the electrode the fringing electric field lines between the two electrode see the dielectric constant of the fluid versus air resulting in a higher effective capacitance. When the electrodes are fully submerged in water the effective capacitance increases to 37 pF.
Soil Moisture Sensing
Originally, I had planned to try and calibrate the copper-clad test electrode. Unfortunately, the cling-film insulator I had used sprung a leak and the test was cut short.
The sensitivity using a sheet of cling-film as an insulator was very impressive, until it leaked and overloaded the TIA. But, I did get a nice graph before leak occurred.
Table of when water was added to the container.
|Time [s]||Weight [g]|