• Do you need help identifying a ūüĆ∂?
    Is your plant suffering from an unknown issue? ūü§ß
    Then ask in Identification and Diagnosis.

greenhouse The Ghost Pepper Store's automated hydroponics greenhouse project

Some of you might have noticed that I haven't been around lately and have been slow to answer non-business related emails or PMs. Some of you also might know that I am a habitual project starter and constant tinkerer. I have been working that last few weeks on my next project, to fully automate/monitor my greenhouse using cheap, open source, hardware and software.
 
Here is a quick outline of my goals for this project.
 
Monitor
  • Temperature and humidity
  • CO2 levels
  • Ambient light intensity
  • PH and TDS levels in 2 separate hydroponic reservoirs
  • Security camera/time lapse filming
  • Reservoir fluid temperature
  • Reservoir fluid level
Automate
  • Supplemental lighting
  • Hydroponics water pumps
  • Hydroponics air pumps
  • Hydroponics UV sterilization
  • pH adjustments
  • Nutrient level adjustments
  • Hydroponic reservoir fluid level adjustment
Features
  • Wireless (2.4GHz) non-802.11 communication between sensor/relay nodes and control node.
  • 802.11n wireless connected control node with traditional TCP/IP stack
  • Control node internet connected web server for remote control by PC or smartphone
  • Control node touch screen display for monitoring/graphing/manual controls
 
I realize that there are already products that do all of these things on the market today. Most of them are geared towards large greenhouse operations with the capital to afford them. At a minimum these systems run in the $5000 range. My goal is to pull it off for 1/10th the price and learn a bunch of useful stuff along the way.
 
I am sure many who read this will wonder, "Why automate all of this?". Well, I say, "why not?" Honestly, it just gives me an excuse to learn and grow and maybe even share. I believe that one day, be it due to space exploration or climate change, people will need to grow much of their food hydroponically in environmentally controlled indoor areas, finding a way to do it cheaply and hassle-free is in everyone's best interest.
 
For a little background, I am a computer network engineer by trade, so I have a big advantage attacking some of these goals. I have no formal training in programming, which is the majority of the work involved in this project. I have a small amount training in electrical engineering, so the wiring and building of circuits will somewhat of a hurdle as well.
 
I will be building this system using the Arduino platform for the sensor/relay nodes and the Raspberry Pi platform for the control node. The Pi will also drive a touch screen display mounted inside the greenhouse that displays real-time data collected from the sensor nodes. This will be a long term project, probably on the scope of 12-18 months, so there will likely be many hardware changes (I have already had to switch Arduino platforms due to limitations).
 
I look forward to what the growers here have to say about this. I also look forward to input from any of you that are programmers, engineers, web developers or just garden-variety geeks.
 
Thanks for stopping by. I will post an update with the current progress shortly.
 
Brian Holmes - Owner
The Ghost Pepper Store
 
 
 
 
Wow wow wow great project. I don't know if you have seen video games recently or play but in black ops 2 they have hydroponics rails and an automated greenhouse that is how I picture your grow being.
 
Nightshade said:
Wow wow wow great project. I don't know if you have seen video games recently or play but in black ops 2 they have hydroponics rails and an automated greenhouse that is how I picture your grow being.
 
Yeah, that's how I would like to operate one day. I did play CoD Black Ops, but skipped Black Ops 2 and changed over to Battlefield 3 so I haven't seen that in-game. I did take a tour of a big greenhouse operation in Pennsylvania a couple of years ago that had a automated watering robot that could sense when a, single 1020 flat (out of thousands) was drying out and it would zoom past overhead and go directly to that flat and water it, very cool stuff, probably costs tens of thousands for that system.
 
So here is what I have done so far with this project.
 
This is currently an Arduino Uno ($9 from eBay) running as a control node. It has two modules, a 2.4Ghz radio ($2 from eBay) and a real time clock ($3 from eBay). At the moment all this does is log information coming from the sensor node directly to its serial port. It sends an ACK back to the sensor node so that the sensor node knows not to re-transmit and it also sends a time stamp which will allow the sensor nodes to stay in sync with one another.
 

Untitled by GhostPepperStore.com, on Flickr
 
This is my current sensor node, Arduino Uno. It has three modules, a 2.4Ghz radio, a temp/humidity sensor ($3 from eBay) and a ambient light sensor ($5 from Amazon). This would normally also have another board stacked on top called a "shield" that contains 4 relays for turning on/off 110v electrical outlets. It was removed for prototyping, plus I will be rebuilding all of this on the Arduino Mega very soon.

Untitled by GhostPepperStore.com, on Flickr
 
Here is the future sensor node, Arduino Mega. More memory, more I/Os for more sensors.

Untitled by GhostPepperStore.com, on Flickr
 
And here is the Raspberry Pi in all its naked glory. I just got it so I will get to fire it up for the first time momentarily.

Untitled by GhostPepperStore.com, on Flickr
 
I left the sensor node and the control node running all week and so far the communication protocol I have come up with has been almost bullet proof. Over 3 days the control node didn't miss a single reading (temp, humidity and light level every 5 minutes) which is pretty impressive given that wireless communication, by its nature, is nowhere near 100% reliable. When I logged into the PC being used to log the serial port, it caused the system to crash though, so hopefully I can work through that bug soon.
 
Hopefully more to come very soon!
 
I recently built my GrowBot using a Raspberry Pi and Arduino.  I'm a computer engineer so it was a fun side project using spare parts I had around the house.  I won't go into great detail because it's your topic...but here's a little info on my setup and some lessons learned.
 
-  I store all of my data in a MySQL database and built a web front end that pulls and displays the data.  A database allows me to store large amounts of sensor data and look back at historical data.  Using a web based front end means I can display the data locally on a small touch screen, or I can access the dashboard from any device connected to my network.
 
-  I can communicate with my system via text messages when away from home.  Sending a simple SMS "get status" will shoot a text back to me with current conditions.  I can turn lights on, add water, etc...with SMS commands.
 
-  The temperature and humidity sensors are a PITA.  I see you're using what looks like a DHT-11.  You'll find that they often must be polled many times to get back reliable results, and that polling will eat your CPU cycles.  You'll need to really code the sensors well to keep them from crashing your system.
 
-  Mixing code will get fun.  Some sensors need to be coded in low level C while others work fine in python.  Controlling everything gets fun when mixing multiple languages.
 
-  Fine control of liquids is tricky.  The sensors struggle to read nutrient levels fast enough and control the pumps well enough to have the necessary control.  In my experience, the few seconds it takes to cut the pumps off leads to extra nutrients being added, and attempting to adjust the code to compensate is a crap shoot.  I haven't given up hope but I haven't figured it out. 
 
Good luck and have fun!
 
Awesome, thanks so much for sharing! One thing I really like about the Arduino/Pi community is that people are really helpful and open to sharing code, lessons learned and such.
 
 
 
Ignite said:
 
-  I store all of my data in a MySQL database and built a web front end that pulls and displays the data.  A database allows me to store large amounts of sensor data and look back at historical data.  Using a web based front end means I can display the data locally on a small touch screen, or I can access the dashboard from any device connected to my network.
 
 
I was planning on logging data into SQL. I was actually considering running SQLite on the Pi. I was also planning on running a web front end that I would be able to access from my phone/tablet on the same network. We are on the same page here!
 
 
Ignite said:
-  I can communicate with my system via text messages when away from home.  Sending a simple SMS "get status" will shoot a text back to me with current conditions.  I can turn lights on, add water, etc...with SMS commands.
 
I considered the SMS route, but I think I am going to skip it for now. It might end up somewhere way down on the priority list. I am tempted to put the Pi fully on the internet so that I can reach the web interface from anywhere, obviously there are some security concerns with that.
 
 
Ignite said:
-  The temperature and humidity sensors are a PITA.  I see you're using what looks like a DHT-11.  You'll find that they often must be polled many times to get back reliable results, and that polling will eat your CPU cycles.  You'll need to really code the sensors well to keep them from crashing your system.
 
 
Yes, I am using a DHT-11 at the moment. I haven't had any problems with the polling so far. The Arduino library I am using for DHT has a "polling cycle" class that seems to give me a reliable result. I do find that temperature changes are slow to show up 1-5 polls, and the granularity is like 1.2 degrees F which I find annoying. I did have a very accurate thermometer sitting next to it during testing and they were always within a couple of degrees. 
 
 
Ignite said:
-  Mixing code will get fun.  Some sensors need to be coded in low level C while others work fine in python.  Controlling everything gets fun when mixing multiple languages.
 
That scares me a bit! I am trying to keep all the sensor calculations on the Arduinos. The Arduinos will just send the final sensor readings for each cycle to the Pi which will store it and display it. Considering I am not a programmer, I am trying to keep it simple.
 
 
Ignite said:
 
-  Fine control of liquids is tricky.  The sensors struggle to read nutrient levels fast enough and control the pumps well enough to have the necessary control.  In my experience, the few seconds it takes to cut the pumps off leads to extra nutrients being added, and attempting to adjust the code to compensate is a crap shoot.  I haven't given up hope but I haven't figured it out.
 
Yes, this is not even on my short list of things to figure out, yet. I have some thoughts on this that I will go into later, but liquid control is going to be a slow process without accuracy. I think it will be much easier to stay in a given range rather than try to stay at an exact level.
 
With all that being said, I would love to see what you are using for sensors and dosing pumps. I have been researching immersion probes for pH and TDS and haven't decided what I want to purchase yet.
 
Hi Brian.
 
Very nice project. I'm almost doing the same, or trying the same.  :party:
 
Together with a Belgium pepper grower, who's also very interested about home automation techniques, I started an Arduino based project to automatically irrigate my pepper plants by a soil moisture sensor. If you are interested see the simple project on: http://hapihq.com/turn-on-your-dompelpomp/
 
Today I've build this simple system to a more sophisticated one: with Xively data sharing (by an Ethernet module coupled to the Arduino and a WIFI nano router), iArd app functionality (data sharing and remote control) and some new sensors (soil moisture, temperature, relative humidity, pump status, etc.)
 
The Belgium grower is much more experienced in this topic. See this link: http://forum.arduino.cc/index.php?topic=130344.0
He has already build your "proposed system". Have a look at this topic, maybe you'll get some inspiration or open-sourced code. 
In a few months I will take over this system from the Belgium guy, and I'll expand it with the WIFI options and soil moisture functionalities. I'll post some pictures from it, when I've bought this system. 
 
Your opinion about global sharing of hydroponics automation knowledge is really great: have a look at hapihq.com a project from Tyler Reed. He is doing basically the same and has the same opinion. He is started a Kickstarter project about this topic. I've already donated some money, because I also believe in this topic!!
See the link: http://www.kickstarter.com/projects/302950287/hydroponic-automation-platform-initiative-hapi
I've some profound contact with Tyler, so if you need some coding or knowledge feel free to contact me or him directly. 
 
If you have some questions, feel free to ask me (by PM or the forum).
Good luck, geetings,
Pieter
From the Netherlands
 
 
Edit 1: you can also use DS18B20 stain-less steel temperature sensors, they are up to 2 digits (DHT-11 is 0 digit), see for example: http://www.ebay.com/itm/UN3F-1pcs-DS18b20-Waterproof-Temperature-Sensors-Thermistor-Temperature-Control-/350930753839?pt=LH_DefaultDomain_0&hash=item51b51a592f
DHT-22 are also up to 1 digit (I believe)
 
 
Edit 2: for acid applications or nutrient applications you can simple use peristaltic pumps, which can be controlled by Arduino. If you build a software delay in it, you'll be fine. My professional background is horticultural researcher: we use similar systems to control our big greenhouse...
 
Wow Brian this is an awesome project! I will be following it as I may look to do something similar but on a much smaller scale (just a few plants).
 
pieterbl said:
Hi Brian.
 
Very nice project. I'm almost doing the same, or trying the same.  :party:
 
Together with a Belgium pepper grower, who's also very interested about home automation techniques, I started an Arduino based project to automatically irrigate my pepper plants by a soil moisture sensor. If you are interested see the simple project on: http://hapihq.com/turn-on-your-dompelpomp/
 
Today I've build this simple system to a more sophisticated one: with Xively data sharing (by an Ethernet module coupled to the Arduino and a WIFI nano router), iArd app functionality (data sharing and remote control) and some new sensors (soil moisture, temperature, relative humidity, pump status, etc.)
 
The Belgium grower is much more experienced in this topic. See this link: http://forum.arduino.cc/index.php?topic=130344.0
He has already build your "proposed system". Have a look at this topic, maybe you'll get some inspiration or open-sourced code. 
In a few months I will take over this system from the Belgium guy, and I'll expand it with the WIFI options and soil moisture functionalities. I'll post some pictures from it, when I've bought this system. 
 
Your opinion about global sharing of hydroponics automation knowledge is really great: have a look at hapihq.com a project from Tyler Reed. He is doing basically the same and has the same opinion. He is started a Kickstarter project about this topic. I've already donated some money, because I also believe in this topic!!
See the link: http://www.kickstarter.com/projects/302950287/hydroponic-automation-platform-initiative-hapi
I've some profound contact with Tyler, so if you need some coding or knowledge feel free to contact me or him directly. 
 
If you have some questions, feel free to ask me (by PM or the forum).
Good luck, geetings,
Pieter
From the Netherlands
 
Hi Pieter, and thanks for the input!
 
I am familiar with your project! I did a lot of searching before deciding to undertake this project so I read all about HAPI, yieldbuddy, and several other projects. I looked at a lot of code before purchasing anything, to make sure it wasn't too far beyond my abilities. In the end, I decided to build my system from the ground up, mostly so that I could learn as I go. It would be easy to use some of these other projects to give me a big jump start, but the one thing I have learned so far is that everyone codes differently and it has much to do with how each coder's brain runs through logic.
 
The other reason I really felt that I needed to build from the ground up was that it looked like everyone was using ethernet or 802.11 wireless for node communication. Being a network guy, I thought the most interesting thing to do would be to build a non-traditional, cheap wireless network. Once I get into the more delicate coding of the sensors I may look a little more at the code for HAPI and others.
 
pieterbl said:
Edit 1: you can also use DS18B20 stain-less steel temperature sensors, they are up to 2 digits (DHT-11 is 0 digit), see for example: http://www.ebay.com/itm/UN3F-1pcs-DS18b20-Waterproof-Temperature-Sensors-Thermistor-Temperature-Control-/350930753839?pt=LH_DefaultDomain_0&hash=item51b51a592f
DHT-22 are also up to 1 digit (I believe)
 
 
Edit 2: for acid applications or nutrient applications you can simple use peristaltic pumps, which can be controlled by Arduino. If you build a software delay in it, you'll be fine. My professional background is horticultural researcher: we use similar systems to control our big greenhouse...
 
 It has been clear to me that the DHT11's are not going to be the final temperature probe. I have a couple of DS18B20s lying around so eventually I will make use of them.
 
I have been looking at 6VDC peristaltic pumps and they are what I have planned on using for pH and TDS dosing.
 
Essentially, this is what my planned logic for fluid level control looks like (in my head anyway)
 
waterSensor;
 Read sensor (water level)
 If water level < "full", then fill (this logic will probably be replaced with a simple float valve system)
 
waterTempSensor;
  Read water temp; //used for temperature compensated pH/TDS calculation
 
tdsSensor;
Read sensor (TDS)
 If TDS < "desired level", then nutrient pump on for 10 seconds (10mL dose of nutrient solution) & end reservoir adjust cycle
    else continue
 
phSensor;
 If pH > "desired level", then acid solution pump on for 10 seconds (10mL dose of acid solution) & end reservoir adjust cycle
    else continue
 
I have already noticed that it is important to let your reservoir "normalize" between the doses of nutrient solution or pH adjusting solutions, therefore this routine would be run every 15 minutes, which should be long enough for a small reservoir to mix properly. I also understand that not all nutrient solutions are pH buffered and addition of them to the system may cause a small change in pH, so they must be added first and allowed to homogenize before taking another reading for the pH.
 
theghostpepperstore said:
 
Hi Pieter, and thanks for the input!
 
I am familiar with your project! I did a lot of searching before deciding to undertake this project so I read all about HAPI, yieldbuddy, and several other projects. I looked at a lot of code before purchasing anything, to make sure it wasn't too far beyond my abilities. In the end, I decided to build my system from the ground up, mostly so that I could learn as I go. It would be easy to use some of these other projects to give me a big jump start, but the one thing I have learned so far is that everyone codes differently and it has much to do with how each coder's brain runs through logic.
 
The other reason I really felt that I needed to build from the ground up was that it looked like everyone was using ethernet or 802.11 wireless for node communication. Being a network guy, I thought the most interesting thing to do would be to build a non-traditional, cheap wireless network. Once I get into the more delicate coding of the sensors I may look a little more at the code for HAPI and others.
 
 
 It has been clear to me that the DHT11's are not going to be the final temperature probe. I have a couple of DS18B20s lying around so eventually I will make use of them.
 
I have been looking at 6VDC peristaltic pumps and they are what I have planned on using for pH and TDS dosing.
 
Essentially, this is what my planned logic for fluid level control looks like (in my head anyway)
 
waterSensor;
 Read sensor (water level)
 If water level < "full", then fill (this logic will probably be replaced with a simple float valve system)
 
waterTempSensor;
  Read water temp; //used for temperature compensated pH/TDS calculation
 
tdsSensor;
Read sensor (TDS)
 If TDS < "desired level", then nutrient pump on for 10 seconds (10mL dose of nutrient solution) & end reservoir adjust cycle
    else continue
 
phSensor;
 If pH > "desired level", then acid solution pump on for 10 seconds (10mL dose of acid solution) & end reservoir adjust cycle
    else continue
 
I have already noticed that it is important to let your reservoir "normalize" between the doses of nutrient solution or pH adjusting solutions, therefore this routine would be run every 15 minutes, which should be long enough for a small reservoir to mix properly. I also understand that not all nutrient solutions are pH buffered and addition of them to the system may cause a small change in pH, so they must be added first and allowed to homogenize before taking another reading for the pH.
 
Great!!! I wasn't aware of the fact that you've already noticed the HAPI site and "my tutorial (which is very simplified when I'm considering my code and wiring now...)
 
You can use the DS18B20 temperature sensor to measure your water temperature!!! It's a really great sensor for that!
 
When considering your "pseudo-code":
Be aware of the dosing of the acid, probably 10 ml is too high!!! What is your biggest tank volume? I'll need approximately 60 ml acid to decrease the pH in my nutrient solution to a range 5.5 - 6.0. That's for 220 liters of pepper nutrition (initial pH approximately 6.8)...
 
The time needed to "stabilize" the TDS or pH value is approximately in between 2 and 5 minutes, when the solution is stirred (I should recommend that!).
 
Do you already have a pH and TDS (or EC) probe? I haven't found any adequante probes yet...
 
PS. your time estimation of 12 to 18 months is realistic. I've started my project last April (being a noob at Arduino and electronics, with some basic programming knowledge) and 8 months later I'm still trying new things and improvements... It's a nice but time-consuming hobby....
 
Good luck!!!
 
10ml is probably too high for dosing, but it was a simple example. Right now my largest reservoir is 80L, and I use "dry" acid to adjust my pH. I was considering mixing my own acid solution to be used. Dry acid is so much cheaper and easily mixed with distilled water. This way I could make a weaker/stronger solution if necessary.
 
I haven't purchased any pH or TDS probes yet. I have some waterproof "pen" type meters that I use currently, but immersion probes (100% duty) are going to be necessary.
 
I have been looking at probes from Atlas Scientific, they have sensors, sensor circuits, and code available for pH, EC, DO, etc.
 
https://www.atlas-scientific.com/product_pages/sensors/ph-sensor.html
 
They aren't the cheapest solution on the market, but I like the idea of the sensor circuits, less coding is needed that way.
 
theghostpepperstore said:
10ml is probably too high for dosing, but it was a simple example. Right now my largest reservoir is 80L, and I use "dry" acid to adjust my pH. I was considering mixing my own acid solution to be used. Dry acid is so much cheaper and easily mixed with distilled water. This way I could make a weaker/stronger solution if necessary.
 
I haven't purchased any pH or TDS probes yet. I have some waterproof "pen" type meters that I use currently, but immersion probes (100% duty) are going to be necessary.
 
I have been looking at probes from Atlas Scientific, they have sensors, sensor circuits, and code available for pH, EC, DO, etc.
 
https://www.atlas-scientific.com/product_pages/sensors/ph-sensor.html
 
They aren't the cheapest solution on the market, but I like the idea of the sensor circuits, less coding is needed that way.
 
Right! When considering 80 liter, a 1 ml dosing is recommended (I use liquid HNO3- 38% acid)
 
I think Atlas is good enough for our purpose. I'll always search on Ebay for cheap sensors, maybe not as reliable as Atlas, but much cheaper (I'm a hobbyist ;-) ).
 
You search on Ebay for pH bnc connector. Did you already noticed this "ultimate hydroponic Arduino shield": http://www.practicalmaker.com/products/arduino-shields/arduarium-controller-ultimate-assembled
Used to connect up to 2 pH probes and 1 TDS unit....
 
I actually tried to purchase one of the really cheap probes from Hong Kong for around $7 US, but after a few days the company emailed me and said that they needed to refund me the money because they were out of stock... Funny how they still had a listing saying 18 "in stock" but the price had jumped to over $60. I may try again to purchase one of the ultra-cheap probes.
 
I had not seen that particular Arduino shield, but $120 is WAY more than I intend to spend on that portion of the project.
 
I have noticed that you can find cheaper supplies by searching for "aquarium" instead of "hydroponic" when searching the internet. The parts are all interchangeable, for some reason companies charge a premium for "hydroponic" supplies, probably because they assume most "hydroponic" growers make huge profits, if you know what I mean.
 
I actually tried to purchase one of the really cheap probes from Hong Kong for around $7 US, but after a few days the company emailed me and said that they needed to refund me the money because they were out of stock... Funny how they still had a listing saying 18 "in stock" but the price had jumped to over $60. I may try again to purchase one of the ultra-cheap probes.
 
I had not seen that particular Arduino shield, but $120 is WAY more than I intend to spend on that portion of the project.
 
I have noticed that you can find cheaper supplies by searching for "aquarium" instead of "hydroponic" when searching the internet. The parts are all interchangeable, for some reason companies charge a premium for "hydroponic" supplies, probably because they assume most "hydroponic" growers make huge profits, if you know what I mean.


Nice advice to use aquarium instead of hydroponic, yes I'm from Holland remember ;-)

Oke, I've found also some probes of $20, still cheaper than the Atlas.

Probably you can also use a DIY build electrical probe to measure the TDS or EC, coupled with a DS18B20 temperature sensor. Look at this link: http://gardenbot.org/howTo/soilMoisture/
 
This is awesome! I notice that most of you have technical backgrounds.... would this be impossible for somebody with 0 knowledge of writing code?
 
This is awesome! I notice that most of you have technical backgrounds.... would this be impossible for somebody with 0 knowledge of writing code?


Everything is possible wright? It requires probably more (learning) hours, but everyone can build his own project. That's the purpose of Arduino of Raspberry Pi projects!!!
 
I'm not necessarily interested in even making it self watering but if I could check my pH and temp and ppm of my hydro resovoirs from my phone, it would make things a lot more convenient
 
Back
Top