WiFi accessible IoT plant monitoring system for your window sill

Similar projects worth following
This project is a wirelessly accessible system for monitoring the key environmental data related to assist in growing plants on your window sill.

By utilizing sensors and a wireless capable microcontroller to log soil moisture, temperature, humidity and natural sunlight, the AGI-ESP8266 is intended to be used by home owners in remote arctic communities to grow lettuce, kale and spinach on their window sills.

Food security in the Arctic is a major social issue, with most groceries and fresh produce needing to be delivered by air cargo; the fresh produce experiences major fluctuations in ambient temperature during transit.

What that means, is that a lot of fresh produce when it's placed on store shelves will already have begun wilting and the plants shelf life is significantly reduced as a result. This drives up produce costs at the grocery store.

This project aims to solve that by providing people with a means to grow their own.

In the DIY hacker community, the ESP8266 microcontroller is the ideal IoT device for logging data. AGI-ESP8266 is intended to assemble a cheap, robust system for logging temperature/humidity, ambient light and soil moisture data over a long period of time.

What this means for end users is that they can monitor all the necessary information needed to grow plants effectively, and efficiently.

Here is a description of the AGI-ESP8266's project goals:

  1. Phase One:
    The first phase of this project involved programming an esp8266 to utilize MQTT to pass sensor data to a wireless local area network host. This portion is complete and the available code is on the github repository on this page. Following the instructions there will get you a basic system to log temperature, humidity and ambient light via MQTT.
  2. Phase Two:
    The second phase is placing the system onto a constructed window sill planter that end users can build themselves using commonly available building supplies. I'm currently working on the best way to do this.
    Current Design: 1x4 planks cut to window size
    Advantages: Low cost, user customizable to window size.
    Disadvantages: Requires saw, drill, drill bits, wire cutters. Additionally, the 1x4 planks will warp in the sun.
    Next Design: 3D Printed PETG brackets on suspended aluminium aircraft cable.
    Advantages: Low cost, user customizable to window size, only tool needed is wire cutters.
    Disadvantages: 3D Printer required to print planter tray brackets.
    Phase Two revisions:
    - Add Water reservoir for passive soil temperature regulation and plant watering.
    - Add gold-plated soil moisture sensors for long term in situ corrosion resistance testing.

    LED grow lighting not required in current testing environment, but will be required in final area of deployment. Once all Phase Two revisions are complete, LED lighting control will need to be tested. Proposed method involves using a UL listed electronic outlet timer to control LED light bars mounted under planters.

  3. Phase Three:
    The third phase involves programming the esp8266 to be easy to use for end users. Involves programming multiple software clients for configuring the system for use by operators without access to the internet and little technical ability.
    Design goal: AGI-esp8266 reset button returns uC to default AP state. User connects to esp8266 wifi AP, then uses PC/Phone application to program system. End user runs MQTT software on their computer and/or phone to perform the data logging for plant sensors. Alternatively, cloud MQTT access also an option for users with internet access.
  4. Phase Four:
    Deployment to the arctic for testing this winter. Ship multiple AGI-ESP8266 sensors and all the necessary hardware to construct window sill planters for growing lettuce, watercress, kale, spinach and other leafy vegetables.

  • 1 × Adafruit ESP8266 Huzzah Wireless Microcontroller
  • 1 × DHT22 Temperature/Humidity
  • 1 × TSL2561 Sensors / Ambient Light

  • Wemos D1 Mini ESP8266 Microcontrollers have arrived!

    hominidae3 days ago 0 comments

    I ordered a pair of Wemos D1 Mini's from AliExpress.

    I will be using them to integrate and extend the Homie-ESP8266 project for my window sill greenhouse project.

    The gameplan going forward will be to evaluate the Wemos D1 Mini as a potential replacement for the Adafruit Huzzah ESP8266 microcontroller. Basically, I chose this board because it has a microUSB port which makes programming easier.

    Stay tuned for updates on that.

  • Made a quick visit to the hardware store...

    hominidae5 days ago 0 comments

    One of the problems I'm currently facing is how I'm going to go about setting up the watering system and the heat exchanger using commercially available building supplies.

    This means I have access to copper pipe, plumbing supplies and the like.

    I have also ordered about 10 low voltage submersible mini-aquarium pumps. Here's a Link to the Aliexpress page I ordered them from.

    The general idea is that I will be using several voltage relay's or MOSFETS triggered by the ESP8266 microcontroller to supply power to the pumps.

    Now, the problem I have here is how to go about designing the heat exchanger. I can either take thin diameter copper tubing and run it through the existing plastic planter trays or run it in coils around the different soil sizes.

    I'm thinking of doing for the heat exchanger what I'm doing for the moisture sensors. Once the soil moisture sensors arrive, I will be testing them against each other to finding out which design emerges victorious.

    Therefore, I will likely setup two different systems. If anyone has better practical engineering suggestions, I would be happy to hear them.

    The first approach involves setting up a copper tube in a grid horizontally along the proposed aluminum aircraft wire prototype. Essentially, the copper tube will run inside and in between the planting tray and the plastic bottom. This would hopefully provide the most direct passive heating or cooling for the soil from the existing room temperature.

    I cannot understand how important this is, as my initial tests have revealed that the temperatures on my window sill reach upwards of 35 degrees celsius. (This kills the lettuce and presumably it will do the same with other leafy vegetables.)

    The second approach involves circulating water openly into a horizontally hung container and placing the commercially available planter trays inside that. However, this has a downside in that the tray itself would be airgapped from the water which means it's effectiveness as a heat exchanger is dubious.

    So, I'm thinking of setting up two small scale experiments to test this theory for each tray singularly.

  • Components ordered.

    hominidae06/17/2017 at 21:06 0 comments

    I have ordered the following soil moisture sensors for testing:
    -Gravity Soil Moisture sensor
    This sensor's surface is gold plated using an immersion electrolysis process. Compared to conventional soil moisture sensors, it should last longer. I'm expecting this to last longer than the Grove sensor.
    -Gravity Capacitive Soil Moisture Sensor
    This sensor uses capacitive sensing to detect soil mositure. I expect this sensor to work the longest.
    - Grove Soil Moisture Sensor
    This sensor uses a corrosive surface to detect soil moisture using resistive sensing. I expect this sensor will last the least amount of time before corrosion occurs.

    Additionally, I have also ordered several mini submersible water pumps from AliExpress.

  • Plant update

    hominidae06/14/2017 at 20:31 0 comments

    I posted two photos of the current setup. Thanks to the esp8266 sketch I noticed that the plants were getting far too hot so I adjusted by opening the window during the day. This dropped the temperature down by 5 degree's from 30 to around 25-26 degrees.

    Compare this to the red/orange plant tray. The lettuce in that container died as a result of being too hot during the day which likely promoted fungal growth/root rot.

    I've also eliminated the use of the clear plastic tray covers to try to avoid containing heat within the planters.

    If this batch goes well, I should have edible lettuce in approximately six weeks.

    Which brings me to my plans for a few revisions to Phase II:
    - Add a gold-plated capacitive soil moisture probe to the agi-esp8266 prototype (Looking at DFRobot for that)
    - Integrate a water reservoir to both cool the plant soil in the hot sun during the day as well as water the plants.
    - Integrate Homie-ESP8266 with contributions to the project for the various plant sensors OR integrating Arduino OTA updates and a default wireless AP mode for configuring the esp8266 uC.

    In the final setup in the desired arctic window conditions, a reservoir would likely serve the opposite effect of warming the soil by getting the plants up to room temperature and/or passively warming the soil by using bleedoff heat from a nearby heated air vent or a nearby radiator. Keeping the soil warm will likely be more effective than attempting to warm the entire plant from residual air temperature. An actual implemented system down the road will be the ultimate test of that. So, that will likely be a testing parameter for Phase III.

  • Rabbit hole

    hominidae06/07/2017 at 19:46 0 comments

    Howdy folks,

    After a bit of thought it seems that it will take more than just a wirelessly accessible set of sensors to grow plants on window sills in the arctic.

    Basically, the issue as it exists now is the plants I am growing need to be cooled and temperature controlled. The opposite principle applies for a setup in the north. The setup will need a way of heating the plant environment to stay within an acceptable range for promoting plant growth whilst inhibiting fungal and bacterial growth.

    After a bit of thinking last night, a solution involving the use of water for it's excellent thermal transfer properties was obvious. After a quick bit of research, it is the roots of plants that need to be kept warm or cool which makes the task a bit easier.

    First, let's operate on the assumption that most homes in the Canadian North use one of two technologies for heating, forced air heating or thermal fluid heating systems. If a small water reservoir was added near an air duct or heat vent it would serve the purpose nicely.

    Passively heating water to room temperature then pumping it through tubing placed under the planters seems like an ideal solution. The opposite principle would apply anywhere warm, circulating comparatively cool water at room temperature to plants on a hot window sill would prevent plants from bolting too soon and/or dying due to fungal soil growth caused by higher temperatures.

    Since we are already going to the trouble of adding a heat exchanger, we may as well also add a system to automatically water the plants too. Plants also tend to have a wide variety of optimal growth conditions, and incorporating those as presets into the final microcontroller system would be an obvious benefit.

    All of this means the scope of the final system configuration changes a bit, from a simple planter and sensor setup into a slightly larger setup involving tubes, pumps and self-watering system.

  • Lactuca Sativa

    hominidae06/06/2017 at 20:25 0 comments

    H'okay, so I have a bit of a theory on why my lettuce died:

    After looking at the sensor logs, a pattern I noticed is that the average temperature for the seeds was between 23-30 degrees celsius. The ideal temperature for lettuce seedlings is actually 16 to 21 degrees. So there's a bit of an issue there.

    To mitigate that as a possible cause with the next test batch, I will likely leave the window open a bit to encourage slight cooling during the day to acceptable levels.

    On that note, I will likely need to think of solutions for a window sill deployments up north. The window setup will likely need a temperature/humidity controlled environment

  • Progress Report

    hominidae06/06/2017 at 19:49 0 comments

    Soil Moisture Sensor(s):
    - Currently researching available options. Corrosion resistance seems to be pretty important as several soil moisture probes available seem to oxidize too quickly to be usable long term. Suggested course of action involve's performing DIY unit testing with an Arduino microcontroller and various soil mock-ups. Will follow up with a post about this specifically once various soil moisture experiments can be conducted.

    Native Clients for WIndows/Mac OS X/Linux:
    - Currently working on Linux-based approach using Mosquitto and Raspbian. Setup as-is currently dumping MQTT sensor data to multiple text files. Suggested course of action involves developing a web server to aggregate MQTT sensor data, and to integrate MQTT OTA update functionality.
    - Currently thinking out multi-client support at the moment. A home PC connected to a Wireless Local Area Network (also connected to the AGI-ESP8266) would be the perfect local storage point for sensor data and aggregate analysis from multiple plant sensors. Configuration would need to take place with the software as well. I like the approach that the Homie-esp8266 project took and has the esp8266 enter a default AP station state which requires connecting to it via wifi for configuration.

    Android Client:
    - The Paho Android client library is an MQTT library for developing IoT applications on Android. I'm currently getting famiiar with the codebase, but I suspect that if I pursue the Homie route; I will likely add support for it. However, if I do not, the current AGI-ESP8266 software will likely have a large update aimed at integrating similar features as the Homie-esp8266 project. Namely the ability to push microcontroller software updates Over The Air using MQTT and to re-configure wireless settings easily using the Android client itself.

    IOS Client:
    - If this happens at all, it will likely be when everything else is complete. Pending review of Apple-centric development/library

    Cloud MQTT Functionality:
    - Currently looking at integrating AGI-ESP8266 with Amazon's AWS IoT platform. Exploring other service options as well.

    PCB Design:
    - Waiting out on final design requirements for soil moisture sensor and evaluation of other possible candidate sensors. End goal is cheapest per unit cost while maintaining reasonable accuracy. Alternatives to the DHT22 temperature/humidity sensor capable of similar accuracy being researched. The BME280 (Temp/humidity/pressure) and the SI7021 (Temp/humidity) are possible options, alongside specific application sensors such as the DS18B20 (Temperature).

  • Shelves!

    hominidae06/05/2017 at 23:56 0 comments

    Added another shelf, unfortunately I didn't spot this the other day but it seems that the 1x4 boards warped in the heat of the sun.

    This actually presents an issue I hadn't thought of. Namely, if this unit is setup on a window in the north with an environmental control setup; the growing environment will likely have high humidity.

    The 1x4 boards, unless they are treated will almost certainly warp.

    It's a bit of a setback actually. I was hoping to have the bulkiest item shipped being the plastic planting trays with baggies of starter soil sandwiched in the middle. Pictured below is the second shelf added, and the board itself has actually warped significantly.
    It seems to work, but it's pretty crude.

    An avenue I may be looking at implementing is utilizing aircraft cable almost entirely for the structural support.

    This would mean 3D printing brackets to hold the planter trays and a suspended adjustment system for levelling the planters. Such a setup might actually be the best setup, as it minimizes the shipping footprint to basically just aluminum wire and accompanying hardware. Items which could likely fit inside a single, low footprint envelope.

  • Bad news

    hominidae06/04/2017 at 19:30 0 comments

    The seedlings that look so promising have unfortunately died.

    I suspect the cause of their demise was changing the relative humidity of their container by placing a clear plastic cover over the planter. I noticed it was getting quite sunny so I put the cover on hoping it would help retain some moisture.

    Alas, the lettuce died. For reference, the lettuce I am attempting to grow is black seeded simpson.

    We will see what happens with the next set. In addition, I've sown the seeds for the spinach, which is Emilia F1.

    In other good news, I've organized the licensing related stuff and added an Apache 2.0 license header to the source code. This should fulfill the requirements for the Hackaday 2017 Internet of Useful Things contest.

    I have also gotten the agi-esp8266 microcontroller setup again and uploaded a new photo of the prototype unit. Down the road I will be designing a PCB to include everything needed and having additional prototypes printed for deployment to some of my family up north in the community of Cambridge Bay, Nunavut. The reason I chose to use 1x4 for the shelves primarily relates to making the brains of the setup easy to ship. I'm going to revise the construction/erection setup as I go because I'd prefer if the entire configuration required the least amount of tools possible. To that end, I picked up a 3D printer so I can print brackets to replace the Tee Nut and eye bolts. The reason for this is that constructing the shelves then requires a drill. Ideally, I'd like the end user setting such a unit up to only require a hand saw or skillsaw to adjust the shelf to match the width of their window then using a commonly available screwdriver to attach the brackets to an level adjuster connected to the aircraft cable.

    Amongst the environmental considerations involved with growing on a window sill are including enough insulation and artificial LED light to augment natural daylight. It will likely be a bit of work to get that figured out.

    Essentially, the problem with growing plants so near a window in the arctic relate to how cold it is in the winter months. I am anticipating needing multiple layers of clear plastic vapour barrier to be added to a window to retain as much heat as possible. The only way to know what this will look like is getting a unit setup on a window in the north, once at that point additional in situ data would be needed.

    Another idea that I had for retaining both heat and humidity involved using LED lights to raise the temperature of the plants by a few degrees and to maintain humidity, I was also thinking of having on the other side of the window (the interior) a lightweight frame with clear plastic vapour barrier to act as a moisture and heat retaining insert. This would obviously need to be removable so that the end user could service and water their plants. However, how such a setup would work is vague at the moment. I will clearly need to be exploring options for that.

    Most homes in the Canadian north used forced air heating, which tends to rapidly decrease relative humidity.

  • Build environment

    hominidae06/02/2017 at 22:52 0 comments

    Howdy all,

    As per the post from yesterday, I've assembled the first test shelf. However, I need to get the AGI-ESP8266 sensor working to a state where I can push updates to it via Arduino OTA.

    Currently, the AGI-ESP8266 will post updates to an MQTT broker running on one of my Raspberry Pi's via Mosquitto.

    The instructions for setting that up are on the github repository. There are issues with such a setup. Namely, each time the Raspberry Pi is restarted; the client commands need to be run and the output piped into a text file. I have setup a batch file, but it's a less than ideal solution. It works as a proof of concept, as evidenced by the logs in the photo here:

    The multiple values of 0.00 are from the DS18B20 sensor. I was comparing the two against each other when it was working, but I putting integrating it aside for the moment until I sort out the more nitty gritty stuff. The temperate difference when I had the i2c addressing setup properly was pretty insignificant, usually within half a degree difference at it's most extreme.

    Note that these logs are from March when I was running long term testing on battery life with the deep sleep function. The deep sleep function on the Adafruit ESP8266 Huzzah with 4x AA NiMH rechargeable batteries was actually quite good. It ran for approximately a month and a several weeks, towards the end it got a little iffy. However, a month between battery changes seems reasonable for end users.

    Next update will be on setting the system up with the proof of concept demonstrator AGI-ESP8266 with detailed instructions. Following that, I'm going to begin the process of fulfilling the 2017 Hackaday Internet of Useful Things contest requirements. This involves documenting the licensing issues from the various open source libraries I've used, to licensing any code I've written under similar/derivative open source licenses.

View all 15 project logs

  • 1

    See the Github page on the left-hand side for instructions.

    Currently, the process is a little complicated as it involves using the Arduino IDE to program the ESP8266 microcontroller, then setting up a Linux host to run an MQTT broker to receive data. I'm currently exploring ways to make all of this easier to work with for end users.

View all instructions

Enjoy this project?



hominidae wrote 06/05/2017 at 22:14 point

Currently looking at switching over to Homie for the software side.

Homie is a project for esp8266 microcontrollers intended to simplify development of IoT applications by providing an easy to use MQTT convention for multiple sensor types.

The reasoning behind this is the software looks mature and it supports multiple sensors. All I would then need to do is focus on developing an easy to use front end with instructions.

In addition, there are numerous similar projects to AGI-ESP8266. There is the Chirp! IoT sensor which performs soil moisture sensing, temperature/humidity and ambient light detection. Also, the GreenThumb device on Tindie which is also based on the ESP8266.

While these projects look great, I'm looking to construct hundreds of these sensors for deployment so keeping overall cost down is a priority. In the spirit of that, I am adding a document to the codebase to document bill of material and cost concerns.

The end goal is to deploy fifty prototype units with accompanying hardware (sans any bulky COTS materials needed) for as many people to implement by the 4th quarter of this calendar year, (Oct-Dec 2017).

  Are you sure? yes | no

hominidae wrote 06/04/2017 at 23:11 point

Things I will add this week:
- Soil Moisture sensors (Simple, primitive capacitive probes)
- Paho Android Client to both receive MQTT data and display it using a fancy graph
-  Integrate cloud functionality with MQTT

  Are you sure? yes | no

hominidae wrote 10/16/2016 at 04:56 point

Feel free to comment/ask questions here.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates