We'll then use a 4051 chip to switch between eight different analog inputs. These are dirt cheap (about 13 cents apiece if you buy 100):* Shielded wifi chips* Many more GPIO pins* A single ADC input (cheaper versions have none)With help from Jake and Emborg I think I now have an idea how to go about making the garden nodes do what we want.We'll use the ESP8266-07 version which has a number of useful features over the cheaper versions:* Both ceramic on-board antenna and u.fl connector (not that we really need either)And it's still only $3.34 including shipping:
http://www.ebay.com/itm/ESP8266-Remote-Serial-Port-WIFI-Transceiver-Wireless-Module-Esp-07-Type-AP-STA-/371267815543?pt=LH_DefaultDomain_0&hash=item5671494877
http://www.aliexpress.com/item/CD4051BE-CD4051-4051-Free-shipping-100PCS/32224837104.html
Selecting analog input will take up three GPIO pins, but we have plenty.We'll use three one-dollar solar garden lights:
http://www.dollartree.com/household/outdoor-living/Stainless-Steel-Solar-Powered-Garden-Lights-with-Stakes-10-frac14-/500c540c540p336083/index.proWe 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.