Introduction: Online Herb Hydro Grow

Background

Hello boys and girls!

This project comes from the need of quite a lot of fresh herbs. The best way to achieve this by growing herbs in water. However, unlike normal soil grows, the plants can't survive very long if they run out of water.

To ensure that the plants always have water even while I'm away I needed some way to monitor my plants. I can check in on my plants using any browser while I'm away and at home I use "steam Wall paper engine" to have all the stats and stream as my desktop wallpaper. (pretty nerdy yes) :D

From three basil plants (total 15 slots in grow) I harvest about 2 liters of leafs every second week (pesto fiesta!). The dark green leaf is grown in hydro with LED and the smaller leaf is is all natural (sun light and soil).


This tutorial can be followed in many ways depending on what gear and needs you have. I would suggest you read it through completely before buying any parts!

The IoT chapter can also be very useful for those who want to get into that sort of stuff!

I have my custom built 64 W Cob led light in a few of the pics, I can make a tutorial on that later if someone request it but for this tutorial I will assume that you either have extra lights or using sunlight.


If you like this tutorial, I would also very much appreciate if you considered voting for me in the contest! Thanks!!



Main goals

1) Build a quiet and cost efficient hydroponics grow for herbs. Requires:

Work: 20-60 min

Cost: 20 USD

Special tools: 3d printer or your own simple DIY solution

Skill requirement: Basic knowledge of electricity.

2) Build water level sensor and use a raspberry pi with camera to stream data and image online. Requires additional a raspberry pi with camera.

Work: If everything goes perfect 1-2 hours. In reality probably a few hours.
Cost: 20 + 65 USD
Special tools: Raspberry Pi + camera
Skill requirement: Can use and setup a raspberry pi, some python knowledge to understand how the code works and basic knowledge of electricity and GPIOs. If you never have used Python but is a bad ass on Arduino coding you will easily understand the python code (since it's pretty much psudo code).

Step 1: Step 1

Let's begin!

As a base we'll use the new Ikea product "Växer". This is a great bargain so there is no need to reinvent the wheel by building your own. For about 7 dollars you get everything you need, including net pots and lids. If you want to be safe you can also buy the Ikea herbs since those strains are pretty much guaranteed to work with non adjusted tap water (so you don't need to buy a digital Ph-meter). While at Ikea I suggest you also buy their rockwool and nutrient since you're probably not going to find it cheaper somewhere else anyway.

There are two ways you can use the grow system, the intended way and the special way. The intended way is the "Kratky" (see image), if you use it this way (only fill half of the tank) you wont need a pump later. If you are using the Ikea herbs, the idea is that the plants are ready to harvest when the water runs out.

The special way is if you fill it completely and add a pump you get a DWC system, this is what I will do.

Step 2: Oxygenating the Water

Invest 7.4 dollars in a very silent pump, 5-12 v with PWM (for those who wants to use it). Just connect it to any 5-12 dc wall adapter you have laying around. Red cable is +, black -, and white for PWM (optional). Shipping is free but will probable take about 2 weeks.
http://www.dx.com/sv/p/5-5v-12v-submersible-water-...


Nozzle and filter

The water is oxygenated when the surface tension is broken, not by blowing bubbles into it as one might think (at least I did). This means the oxygen enters from the surface and travels downwards in the tank. This is what makes this growbox so suitable for us, having a wide surface area and shallow depth makes it easier to keep a good oxygen level.

We use the pump to move the water into breaking the surface. To increase the effect, we add bubbles to the mix. We do this by using a special nozzle which mixes the air with water (based on the Venturi effect). I designed my own to make as silent as possible and 3d printed it. But if you don't have access to a printer you can either ignore it or look at something like: https://www.youtube.com/watch?v=Mfe9elW5T88

I spent quite some time on mine (8 physical iterations) to make it as silent as possible and I'm quite pleased with it. If the suction hole is too small (no bubbles) , you can use a small drill to widen it. Note that the larger this opening is, the more noise it will make.

The noise in the clip is mainly from a helicopter outside and the scraping sound is from the stabilizing camera lens. The pump itself is barely audible. You want to place the pump along one side and in the middle. If you leave the middle row empty you get much better circulation.

You also need a filter for the pump inlet to prevent roots and other junk to clog the pump. You can 3d print my filter or simply buy a filter/diy.

So if you don't intend to go fully digital, you're now done!

Step 3: Set Up Raspberry Pi and Camera

  1. Download Raspbian image: https://www.raspberrypi.org/downloads/raspbian/
  2. Download etcher: https://etcher.io/
  3. Use etcher to burn the image to USB stick.
  4. Install Raspbian on Raspberry.
  5. When installation is complete, click the Raspberry icon/Preferences and click "Enable camera" and anything else you might need.
  6. I suggest installing VNC viewer on your regular computer so you can work on the Pi remotely.
  7. Connect the camera and open a command prompt and type:
raspistill -o cam.jpg

If a new image appears in your home directory the camera works (yay!)

To install the request library open a terminal and enter:

git clone git://github.com/requests/requests.git
cd requests
pip install

Example

We will use the request library to embed our data in a HTTP address. For example, our (fictional) sensor has measured a value of "50" and we want to send this value over the internet. Using this library we can simply type:

ourData = {'Sensor': '50'}
r = requests.get('http://where-we-want-to-send-data', params=ourData)

Step 4: Making and Connecting the Sensor

The water sensor is a very simple design. It measures the water level at three different heights. The Raspberry Pi doesn't have an ADC (analog to digital converter) like the Arduino so we can't use the most common sensors as they often represent a sensor reading by sending a voltage between 0-3.3 volt.
Example: For a water sensor the output would be 0 at no water and 3.3 v at "full", and everything in between.

Since the Raspberry only can read HIGH and LOW we have three options, either we buy a digital sensor, a separate ADC or DIY a sensor. Guess what we're doing :D

How the sensor works

The sensor is basically just 4 cables and a plastic case. The bottom cable provides a 3.3 voltage to the water and the other 3 acts as inputs. When one cable is in the water it senses the voltage it reports "HIGH" to the Raspberry.

To construct the case, we start by 3d printing the container and it's lid. If you don't have one, finding another solution should be pretty easy.

Just simple insert the cables and peel off a couple of mm of the shielding. Then connect the cables to the raspberry pi as seen in the image.

If your sensor doesn't seem to work, add nutrients to the water! The salts in the solution increase the conductivity of the water.

Step 5: Camera Case

Print a case for the raspberry pi camera and put a couple of drops of glue on it to seal the box.

Step 6: Streaming the Camera

Outline

How do we connect to our camera? The first idea would be to setup a server and simply connect to it. The problem is changing ip addresses. What works today perhaps won't work tomorrow.
Also; the Raspberry pi camera does a very good job correcting the white balance when taking photos compared to video mode. My grow has pink light but in the images it looks like normal white light so it's easier to see the state of the plants.

So what we're going to do is to take advantage of Google drive. We're going to automatically take a photo every x second and upload it to Google drive. To keep the same url to the image we're simply overwriting the image every time.

How-to

Place the two attached files in your pi home folder. The file test.py is our main code and the data.txt file is just used to store our average water consumption. The python script will update this textfile with your consumption automatically after 1 first run.

Follow this guide to set up gdrive for your raspberry pi:

http://olivermarshall.net/how-to-upload-a-file-to-...

or the instructions on git:

https://github.com/prasmussen/gdrive

Take the test image you created earlier (cam.jpg) and upload it to any folder in your google drive (using the website if you want).

Open a terminal and type:

gdrive list

You will find the image in the list. What we want to do is constantly update this image so we need to grab its id (something like 0B1GNVwq1vqyFGEpBSGRDSczdDQ)

Now in test.py, modify the id to suit your own file id. Scroll down until you see the line:

os.system("gdrive update 0B1GNVwq1vqyFGEpBSGRDSczdDQ cam.jpg")     

Replace with:

os.system("gdrive update YOURID cam.jpg")

We should now be able to access our image. Just replace your file id in the url and check if it works:

https://drive.google.com/uc?export=download&id=YOU...

If it everything is correct you should see a pop up box to download the image.

Save this url, we will use it in a couple of minutes in the next step.

Step 7: Sampling and Sending the Data

Outline of the data transfer

As we looked at earlier, we will use the request library to embed our data in a HTTP request.

So the Raspberry will send it to a site called dweet.io. They will only act as our middle man to receive our data. To view our data as fancy graphs and bars we will use another site, freeboard.io. It simply displays what ever dweet.io receives from the raspberry pi.

K great so what do I do?

Now go to http://dweet.io/ and click "Try it now" and copy the custom url that appears (example: http://dweet.io/follow/fast-earthquake).

Now go to https://freeboard.io/ and create a new account. After that you create a new board and in the top right corner you choose your data source. Scroll to "dweet.io" and paste your dweet.io url.

Now you can start adding some "Panes" of your choosing. I use "Gauge" type for displaying water level, and "text" for some. Just click data source and choose your data!

Lastly setup the camera.

Create a new pane of type "Image" and simply set the source as the google url you create in the last step.

Step 8: Final Thoughts

If you've made it so far, good job!

If you want you can easily add more sensors and other features, if you do please let me know as it's always fun to see what other peoples ideas! If you have any questions or problems just pm me!

If you want you can use the save/read method to save other data from your sensors and create nice plots in other software later (humidity, temp, etc). Another suggestion would be to create another folder on gmail where you upload 1 photo every hour and keep so you end up with a nice time lapse of your grow.

Anyways, good luck!

I would also very much appreciate if you considered voting for me in the contest. Thanks!

Invention Challenge 2017

Runner Up in the
Invention Challenge 2017