Capacitive Water Sensor

A capacitive sensor was developed as a feedback method to measure the moisture content of a system. It was based on an AtTiny2313 running on the internal RC oscillator  @ 8 mHz.

The analog comparator of the AVR was set to trigger a timer when the capacitor reached a level of charge. The timer value was filtered with a composite rolling average and used to set the output of a LED bar graph as well as generate an analog level  by PWM. Once the measurement was taken, the input of the analog comparator was held low to discharge the cap, the timer was reset and the process was repeated indefinitely.

The output scaling values were set by measuring the frequency with a digital storage oscilloscope. After removing the scope probe, a 10nF capacitor and a 10M resister were added across the input to compensate for the effect of the probe.

Source: 2313_cap_sens.c

1) Schematic  2) PCB

Leave a Reply

Your email address will not be published. Required fields are marked *