We will connect them such that their batteries are hooked up in series, providing a maximum of 3.6 volts total for the ESP8266 (which happens to be the maximum it can handle). If we're worried about too much voltage then that can be dealt with easily, and the minimum voltage is 1.7 volts, which makes things easy.
The ADC is 0-1 volts, so we'll use a voltage divider to read the voltage of the three series-coupled batteries.
The ESP8266 has a deep sleep feature where it basically uses no power. It can be programmed to wake up after custom amount of elapsed time. We'll program it to wake up e.g. every ten minutes, measure the voltage, then shut down if there is not enough. If there is enough voltage it will read sensor data, connect over wifi, report data, and go back into deep sleep mode.
We will measure soil humidity using a capacitance measurement which requires two GPIO pins and two analog inputs. Treehearder already has the code for this, it just has to be ported from an Atmel attiny to the ESP8266. The sensor consists of two long pieces of conductive metal wrapped in thin non-conductive insulation (two long pieces of iron in heat-shrink tube should be good) and a couple of simple support components.
Measuring door opening/closing is still up for grabs. I'm not sure how to do this reliable on any type of door/gate in a way that will be reliable and won't break. On top of that it's not clear whether we'd need to check door status more frequently than every few minutes but if we do then we'll need some way to save "the door was opened" such that the ESP8266 will know about it when it wakes up. This could be done with a simple flip-flop/latch circuit.
For directional antennas we can make a laser-cuttable Yagi template (using online template-generators and some inkscape foo), cut and hot-glue copper elements onto the template and fit the assembled yagi into a piece of PVC pipe and seal with hot glue. It probably makes sense to fit the ESP8266 inside of that tube as well and cover it in hot glue to avoid condensation-related failure. Jake suggested that we simply solder the ESP8266 board straight onto the yagi active element.
All of this being said, I'm 100% for mcgyvering the first prototype using whatever is fast and easy!
--
marc/juul