And we’re done! The entire rig is sealed off and the control box is mounted!
Here is a link to our final video describing how it works: Video
Here is a link to our final write up: Write Up
And here is a final picture to show it off:
Back on Friday our demo ended up going very well. Our system was able to be manually controlled from our “Remote” website and all necessary information (such as sensor data and user input) was correctly being relayed. Our logging software for past sensor readings was and is correctly tracking historical data which we can then use to give analytic information. Hard part is all done!
Now another really exciting update…….we managed to get dirt! Yes, this might seem uninteresting but the process of actually getting it was a logistical nightmare. Below is our fully filled plot with cabbage, basil, and a tomato plant.
Now all we have to do is seal it off and interface our control box with all components in a weather proof manner since we will be leaving this alone for a few months. In a few days we will post our final blog post with our video and lab report.
Before we go into the night and eventually morning of our final demo day, here is an update on the current state of the rig.
On the left is the solenoid valves which are hooked up to a 12V source and mosfets controlled by the microcontroller. Out the bottom right of the right picture is a bunch of wires that go out to our two sensor hubs and four water sensors. At this point we have much of the hardware implemented and just need to verify it all works.
Our goal through the night will be interfacing the server we created with the Photon to relay information to it (like which plants are where) so it can act on those variables.
We’ve finally moved from our development server to a live server!
The server runs using nginx to serve http requests and static files (i.e. scripts, css, and images) and interfaces with gunicorn to create the dynamic website with flask (as detailed in this blog post). We then used a free dns service (freeDNS) to connect to nginx via our own domain name so no one has to remember any pesky IP addresses! Without further ado, meet our credit card sized web server (on a Raspberry Pi 3 Model B)!
Obviously, this can’t handle hundreds of requests, but this is a microcontrollers class after all, so we figured running a microframework on a microcomputer would also be appropriate instead of a big Amazon Web Services node.
Feel free to visit the live site here
Really quick update. We were able to break down the 80/20 that another group had used for their project and rebuilt it to act as the frame for our greenhouse. We plan on wrapping most of it with clear plastic while certain parts will be acrylic to support the exhaust fan.
To hold all of our electrical components and keep them out of the elements, we created a press-fit box. It will house our four relay switches which control 120V sources to our lights, duct-fan, and irrigation control valves. Under the relays will be all of our microcontroller circuitry. Here are some pictures of the control box.
We are also making progress in the server side of things. We received a raspberry pi from the lab on which we will host our server with all our plant information. In this way, we will be able to create new recipes for additional plants in the future and by extension will only relay the desired growing conditions to our Photon board. This gives us much easier control over future additions to our inventory.
Coming soon in the mail we have our analog muxes to take in and read more analog devices than the Photon allows on board. We also have our four water sensors for irrigation control, a duct fan for cooling, and plastic sheeting to put around our greenhouse. We plan on working with 80/20 T-slotted, aluminum building material provided by a previous class project for a frame around which we will wrap the plastic sheeting.
That’s okay, because if you decide to uproot one of your plants, you can go ahead and delete it from the dashboard now.
You can also see current specs for the plant section and modify the recipe if you want to change things up from their default values!
See the screenshot below:
Finally after some issues finding cutting tools, we were finally able to build the planter box. Pictures are shown below. It is 8 feet by 4 feet and is raised about nine inches off the ground to preserve the growing space underneath for when we have to remove our project.
Some progress was also made on the real time monitoring system and the output from the Photon board. The Photon now outputs real time data every one minute to Dweet.io and our website auto refreshes the readings from our sensors every minute using a jQuery setInterval function. It now looks something like this.
In the future we will have more data points posted, each according to the quadrant of the planter.
Looking forward, we have an order sent out for analog muxes and water sensors. Since the photon board only has so many analog inputs, we will need a way to select which we want to read at a certain time. The water sensors will allow us to monitor our soil moisture.
We are also working to figure out a system to control the watering of the planter. Since automating a PVC valve proved to be pretty difficult due to how tight the valve is, we are playing with some other ideas. It will most likely implement a gravity-fed drip system where we control the flow out of an elevated reservoir.
We’ve made our web based dashboard! It’s powered by a flask backend so we can easily interact with an sqlite3 database and the powerful jinja2 templating engine to show details and statistics about the planter and current conditions. We can update the database remotely and then it will update for the public website as well as manage the plants being grown in the planter!
See some screenshots below:
Since our last post, a lot has happened.
We were able to secure a spot to build our entire rig in between Skirkanich and Levine. We plan on building it and leaving it over the summer for long term tests. It provides a relatively shaded area which means we have more control over the light portion of the living conditions.
Because of some issues with finding cutting tools, the construction of the actual planter has been somewhat delayed but we are confident the base will be completed tomorrow. After we have that built, we will move forward with adding the cover for the greenhouse part.
As far as the electrical implementations go, we have made significant progress.
First off, we are building a website using Bootstrap to show information on our rig. There will be a QR code next to the rig where people can visit our website and stay updated on the progress of the entire system. At this point, it looks something like what is pasted below.
Here is an example of the heat map we plan to use to show the intensities of the light sources and water saturation levels at different points in the grid. The website will be hosted on a Raspberry Pi where we will manage incoming data sent by the Photon board.
A nice feature of the Photon board is native support for web hooks. We can “publish” data from the Photon where it is sent to the Particle’s online service and dispatched out to a web hook event that we choose. For simplicity’s sake, we think we are going to use Dweet.io where it automatically publishes the data we send (via a URL) to a JSON file. With that we can parse it and display it on our website or save the data to our database for future use.
We currently have a temperature, humidity, and light sensor interfaced with our Photon. In the coming days we will order the water sensors which should just about complete the array of sensors for our greenhouse. Because of high cost, we have delayed the purchase of the water sensors as long as possible to be sure we are being as cost effective as possible.
Looking forward, we are working on creating a database for a set of preselected plants for which to have “recipes” for specific living conditions. We are also working on two separate integrations for the website. The first is outputting the real-time sensor data to the dashboard. The second is maintaining historical data in a data base and displaying that in a chronological manner; an example might be a bar graph of water saturation over the week.
Next week, we plan on starting the green house portion of the build and interfacing the various control components for things such as ventilation and irrigation.