The Problem

5 years ago I had the problem that the drain of our shower was rusted. Replacing the shower tray was not an option, so I repaired the damage as best I could. Since I wasn't sure if the repair would be effective for a long time, I wanted a sensor that would alert me early if the water leak happened again. Such a sensor has space under the shower tray, but cannot be reached after installation.

Therefore, the task arose to build a sensor for humidity and moisture (you can not buy such a thing), which transmits the readings wirelessly and works for a long time without changing batteries. A main requirement was therefore the extremely low power consumption of the design.

The Solution

Battery: Lithium manganese dioxide cells with a nominal voltage of 3V are very suitable for such applications, as the energy density is high and the self-discharge is low. Unlike lithium thionyl chloride batteries, passivation is not a problem here. The voltage remains relatively constant for a long time until a sharp drop at the end of life. The capacity is usually specified to 2V until discharge. The type CR2 has a capacity of about 850mAh, the type CR123 or CR123A about 1600mAh. The lifetime is specified with 10 years. Longer usage is not specified, but may be possible.

Processor: I used an Arduino Pro Mini 3.3V 8MHz as the processor board, since I wanted to use a lithium battery with the rated voltage of 3V. The ATmega328P on the board can be run down to 1.8V, so it can make good use of the lithium battery's capacity. To reduce the current consumption, the voltage regulator and the LED must be removed on the processor board. The processor is operated in power-down mode 99.9% of the time and then requires a few hundred nA. 

Optional finetuning: The fuses are reprogrammed from 2.7V to 1.8V and the startup time after power-down from 16CK to 1CK, deviating from the delivery state of the processor board BOD. This allows the battery capacity to be further utilized and the startup time is shortened by about 2ms, which also saves some power.

Radio: Since the sensor will be installed in metal and concrete, the choice of radio frequency was 433MHz, since this relatively low frequency has better penetration of concrete than, for example, 2.4GHz. A SYN115 module is a good choice. The radio module is switched on and off directly via a processor pin and therefore requires no power in sleep mode.

Humidity sensor: The HDC1080 is used as the humidity sensor, which is specified with a sleep mode current of 100nA and measures temperature as well as humidity.

Water Leakage: Two processor pins are used to measure wetness, which have a different voltage only briefly for measurement and thus do not require any quiescent current.

Wakeup: To wake up the processor from power-down mode, the RTC PCF8563 is used, which has a quiescent current of about 250nA and wakes up the processor e.g. every 15 minutes via an interrupt.

Measurements and Lifetime Calculation

Quiet Current: A quiescent current of the entire circuit during the sleep phase of 600nA at 3V and room temperature is measured using the Atmel Power Debugger.

Active phase: After the processor is woken up by the RTC, the sleep phase is extended by a random value to minimize interference with other radio transmitters. This is followed by a 145ms long active phase in which the measured values are acquired and transmitted. The average current consumption is 14mA. The entire active phase requires a charge of 6.35mJ.

Calculation of battery life: Using a CR2 cell and measurements in a 15 minute cycle, the lifetime is calculated from this formula (partially without units for clarity):

Life = 850mAh * 60 * 60 / (365 * ((0.0006mA * 60 * 60 * 24) + (6.36mAs * 60 / 15 * 24)) = 12.6 years

If the readings are taken only every 30 minutes, the calculated life of the CR2 battery increases to 23.5 years!

Conclusion

Currently, the sensor has been working trouble-free for 5 years. The receiver...

Read more »