Methods I Rejected: Capacitor charging time constant

Methods I Rejected: Capacitor charging time constant

Soil Moisture Sensor Project

Measuring the capacitor charging time constant

Another way I looked at to measure capacitance is to measure the capacitor charging time constant. This is how long it takes you to charge the capacitor up to a certain value. There are LOTS of projects that have used this method (Arduino, another arduino, raspberry pi, and another raspberry pi. They all rely upon the fact that a larger capacitor will take longer to charge than a smaller capacitor.

The number of projects using this method indicate that this is apparently very easy to do. All you need is a microcontroller and a capacitor whose capacitance you want to measure. Which is fine if you are using a capacitor that you have bought. All capacitors leak which means that a small amount of charge will cross the gap while the capacitor is charging. (This might not be the right term, but you are not reading this because you are studying for an exam.)

There is very little leakage in an ideal capacitor. But, soil is not an ideal capacitor. Far from it. Unlike commercial capacitors which are made under controlled conditions, soil has lots of impurities. Depending on where you live, your soil will have varying concentrations of minerals, compost, roots, and worms. Each of these will create a path for charge to jump between the electrodes you have placed in the soil. This means that it will take longer than it should to charge your soil capacitor because it is discharging while you are trying to charge it up.

Perhaps you could make your sensors smaller and try to charge your soil capacitor faster. Eventually you reach the point where your capacitor is charging and discharging so fast that your microcontroller cannot keep up. If you think that “so fast” is fast enough, think again. You need frequencies above several megahertz (mega = million, megahertz = million of times per second). You probably need hardware that can measure nanoseconds if you charge a capacitor millions of times a second.

Using this method to measure soil moisture, you have taken into account that the world’s least ideal capacitor will give you inaccurate results because of the stuff in your soil and adjust your automated watering system accordingly. But, if you move the sensor or fertilise the garden, the soil that your sensor was calibrated to will also change. So you give up and ask someone to water the garden while you’re away.

The final method I reviewed was the low pass filter.

Go back to review of previous sensors, or main page.

Leave a Reply

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