Some months ago I built a simple wireless device to monitor temperature inside our household composting unit. Although the device worked initially well, I noticed two problems as time passed. First, the battery life wasn’t what I supposed it should be based on device data sheet and my measurements. Second, somehow moisture got into device no matter how well I tried to seal it with silicone.
The short battery life was caused by feeding a MCP1702T 3.3V regulator with two AAA lithium batteries. Although 3V is suitable supply voltage for CC430F5137 microcontroller, the regulator wastes a lot of power internally when input power is not high enough (the regulator datasheet tells this, but I didn’t notice it). I suspect that also the moisture and condensing water lead to current leaks, shortening battery life even more.
The moisture problem was probably caused by pressure inside the device going up and down as the temperature changed.
As I couldn’t find an enclosure that would be more waterproof I bought a pretty standard plastic box for electrical installations and placed it into wall of nearby wood shed. The box had more room than the original one so it was also easy to add extra AAA battery to raise input voltage to 4.5V which puts the regulator into it’s designed working area.
Now the original problems were solved. But because the CC430F5137 no longer sits inside the composting unit, I needed an external temperature sensor. Luckily, I spotted a DS18B20 sensor inside the stainless steel housing. These ready-made sensors are available from ebay and various chinese web stores also. Electrical interface to these sensors is quite simple as 1-Wire bus needs only one GPIO pin and pull-up resistor (I decided to use another pin also to be able to power-down the 1-Wire network between measurement cycles).
As I had to dig the cable from microcontroller to compost into ground I decided to add another sensor to measure ground temperature.
I already had a working 1-Wire layer based on Maxim/Dallas public domain kit on LPC arm microcontroller. To make it work with msp430 I had to make GPIO layer more configurable. Only problems were related to 1-Wire timing requirements, my microsecond delay function wasn’t initially accurate enough.
The system has now been running more than a month. So far everything looks good, but it remains to be seen what wet autumn and cold winter will do to it.