Chirp! – the plant watering alarm

I’m a programmer/systems architect by education and by the way of winning bread, but somehow I got infected with the electronics bug 3 years ago – had a side job to upgrade the firmware of a LED display, got into microcontrollers, then made myself comfortable in analog.
Dave Jones has been saying in his videos – go on, make a product. So I’ve made one – even probably built “down to a price” at some extent. It is available for sale on Tindie, but read on…
It’s a “plant watering alarm” – you set the dry point, then water the plant and then it starts to chirp when the plant dries out. Chirps are rare at the beginning and more frequent when the water level gets really low. It has a LED hooked up as a light sensor, so it does not make noise at night.
I decided on a capacitive moisture sensing technique as it is superior to the resistive one – the circuit is totally isolated from the soil, thus it avoids problems with corrosion, battery life, electro-chemical effects and is more reliable and repeatable in general.
Chirp! – the plant watering alarm
The first approach I’ve tried was straightforward – charge an unknown capacitance and measure the time it takes to discharge through known resistance. This works really well when building a makeshift capacitance meter for a lab, but wasn’t really suitable for my purposes. The noise was a problem – when capacitance is so low, you have to increase MCU speed and add a rather big resistance to get some decent dynamic range. This high impedance point picks up all kinds of noise that might be impossible to filter out because of aliasing. Another drawback – high speed and filtering in software implies external oscillator – this affects the battery life and BOM cost.
So I went with another capacitive sensing approach where a square wave is fed into a RC filter formed by known resistance and unknown capacitance as a wide track on the board. The filtered waveform is triangle-like. It is a half-wave rectified by a diode and stored into a capacitor that has a bleeder resistor. When the capacitance changes, the peaks of the waveform become lower or higher resulting in changing voltage in the storage capacitor. Go to http://wemakethings.net/2012/09/26/capacitance_measurement/ for a more detailed explanation.
Read More: Chirp! – the plant watering alarm

Leave a Comment

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