Autonomous Greenhouse Factory




Introduction: Autonomous Greenhouse Factory

About: Im a high school student in video design classes, I like to hang out with my friends, build websites and make movies. life is short so make it fun

(Please keep in mind: This is my first instructable, and my first essay-like thing I ever post online, and my first time coding with arduino)
This is my impulsive side when I let go of its leash. I normally go and do something crazy such as this. I got an idea while browsing through instructables. Why not build a greenhouse? I remembered a movie about an autonomous house, so why not do something like that? 
I looked up instructables on greenhouses and I saw an instructables on automatic plant watering with an Arduino. That's great, I finally have a permanent use for my arduino. After brainstorming a little more I thought of using some kind of tank to hold the water, kind of like the ones they use in our city but smaller (way smaller). This would let me use gravity as my source of energy for water movement and leave no need for a water pump. 

This instructable is custom for anyone, there is no exact dimensions since this is more of a "factory" of arduino workers which interoperate and keep the greenhouse in order.

I'll stop with the background/rambling and start with the steps

I forgot to mention this instructable is for the robots contest, and im 16

Step 1: Step One, Materials, Materials, Materials

For this watering (I will add more things, such as ventilation when i finish) system you will need:

-PVC pipes
    -Depends on your design, you mainly need one tube with an end sealed with holes through the tubes to let water to the sprinkler.
-Sprinklers, such as these, or you can buy small clear plastic tubes and cut little holes to make this project more DIY-er ( )

   -One per Tray to control watering and reporting humidity
   -One 'Main' Arduino that other arduinos report to
   -One Arduino to control how much water is in the water container and to refill it

In total you need about 10 arduinos, or if you are able to simplify the code and make it usable in less Arduinos please do. I know this might get a little expensive but It leaves you with limitless posibilities in expansion.

-Cables (20mts or more) Or get some of that phone wire it works great in these projects.
-4 pressure sensors
-Servos (one per tray)
-Hot glue & hot glue gun
-Nails (2 per tray)
-LEDs (red, green, yellow)
-A valve for each tray to water ( ) this picture is just for reference, you could probably find something.
-Pipe glue (or whatever its really called) It will help you make this stronger
-Wood or an structure to hold the water container

I think this is it, I will probably revise this to include all the other materials, Lets get on the building

Step 2: Setting Up the Pipes

I think that the diagram and pictures say everything, but to clear any doubt you can do this in any way:

It can be just a straight line or any shape you want, the main thing is that it has to be a closed system with no water leaks.

You should add an emergency valve next to the jug just in case something breaks and there's water falling everywhere

Step 3: Cabling

To water the plants  you use the servo with the valve and and to check the soil moisture you use 2 nails (which I got the idea from )

*Circuit diagram here* & diagram of the thing

To check the water container's weight I followed ideas from ( ) this tutorial at sparkfun, they use a keg but here we will just use it for water. (This leaves it open for a tweeting greenhouse too)


Step 4: Watering

Coding, im still cleaning it up but here is a brainstorm for the watering bots.

The code used is for improvising, instead of a servo you can use a small toy DC motor that has a gear and blocks the tube (ill post up pictures tomorrow, its kinda really late right now) and whenever the motor moves water is able to seep in. I will probably improve this idea tomorrow when I get the chance to work with the motor, but I think this shows a point.

//define analog inputs
int moistureSensor = 0;
int tempSensor = 2;

//define valve output
int waterValve = 7;

void setup() {
pinMode (waterValve, OUTPUT);
digitalWrite (waterValve, LOW);
void loop() {
moisture_val = analogRead(moistureSensor);
Serial.print("moisture sensor reads ");
Serial.println( moisture_val );

//turn water on when soil is dry
if (moisture_val < 850)
digitalWrite(waterValve, HIGH);

while (moisture_val < 850)
moisture_val = analogRead(moistureSensor);

digitalWrite(waterPump, LOW);


Step 5: Water Container Code

(im still working, but I wanted to add it already to show something and not miss this step)
Little I know about coding Arduinos, so if anyone wants to pitch in and help, please do

const int cintEmptyForce = 1200;
const int cintFullForce = 1347;

const int cintHandleSensorPin = 19;
const int cintForcePin1 = 0;
const int cintForcePin2 = 1;
const int cintForcePin3 = 2;
const int cintForcePin4 = 3;

void loop()

  boolean boolPlantsWatered = [do the bottom thing]

  //Read force sensors
  int intForce1 = analogRead(cintForcePin1);
  int intForce2 = analogRead(cintForcePin2);
int intForce3 = analogRead(cintForcePin3);
int intForce4 = analogRead(cintForcePin4);

//Add up the forces
int intForceSum = intForce1 + intForce2 + intForce3 + intForce4;

//Calculate the percentage full
int intPercentFull = int(float(100.0 * (intForceSum - cintEmptyForce) / ( cintFullForce - cintEmptyForce )));


Step 6: Future Expansions

-Tweeting greenhouse?
-Refilling the container when water is low?
-Temperature sensors & ventilation?
-Solar panels to power everything

National Robotics Week Robot Contest

Second Prize in the
National Robotics Week Robot Contest

3rd Epilog Challenge

Participated in the
3rd Epilog Challenge

Be the First to Share


    • First Time Author Contest

      First Time Author Contest
    • Eggs Challenge

      Eggs Challenge
    • Fabric Challenge

      Fabric Challenge


    YESSS! I was thinking the same thing. BRAVO to this young man for even thinking about these types of projects. Him, and kids like him, are going to be the future innovators of our earth, and I love the fact that several have posted more details about greenhouse issues, but this was an awesome project for someone doing programming with arduino (which I had no idea about what they were a few weeks ago).


    11 years ago on Step 6

    Pablo, this is a good start. I'm not a techno person, but it looks like you're trying to sprinkle/spray the water - don't. This will promote problems when the plants develop a canopy, such as mildew, sunspotting at the water droplets, and a general waste of water. Wasted water running on the floor or other surfaces promotes 'moss' growth, which harbor insect pests. I'd suggest a drip system. Allow for timers - it's best to water early in the day. Also, include water sensors - multiples due to the fact differing plants' needs are different, and the location within the GH can cause varying degrees of water usage. Also, plants need to be deeply and thoroughly watered to promote healthy root systems, while alternately allowing for the roots not to continually sit in water. In other words, a certain amount of drying should occur.

    Refilling water container - perhaps a system of capturing rainwater from gutters when possible, then just filling from the tap via a water hose. Remember to keep the top of the barrel covered w/screen, to keep out mosquitos. Also, the darker the barrel, the less algae growth will happen. Unfortunately, this can overheat the water - a temp sensor here will be helpful to know when to shade the barrel.

    Solar panel - GREAT idea! Make sure you generate enough juice to power at least a gable fan; the larger the GH, the more circulating fans you'll need too. A good suggestion would be the Harbor Frieght website - you may even have a store locally. There are also a few good greenhouse supply catalogs on-line.

    You will need constant monitoring of temperatures, and if you want to go so far, an alarm system for when the electricity doesn't work, the temps are at +\- extremes, or there is no water available - to generate human intervention.

    All GH's in full sun will need shading at some time - I have no idea how you'd monitor this. Also, in temperate zones, a GH will NOT be in production year round - without heat (a whole 'nother discussion) in the winter, you will have hard killing freezes, and in the summer, the GH will need to be 'solarized' - a method of sanitizing the interior, since it's too hot anyway to house plants.

    Good luck, and keep us posted!


    Reply 11 years ago on Step 6

    you could always just use solenoid valvs instead of buying valves at homedepot and then worrying how to connect servos to the valves mthat are hard to turn i bet ,and plus then you have to worry about making the servo moto operate in clockwise and counterclockwise and for how ong of a duration , with the solenoind it is an electromagnet and the valve is either open, magnet on , or closed,magnet off , i thinkg you can get them at grainger for cheap , and that is another thing servos are much more expensive than solenoinds, servo+ a valve is too expensive , but a hydroponic system is better anyways , either a simple ebb and flow sustem or a drip system or an aeroponic system ,i saw one that uses one solenoid and a demand pump and a 5 gallon pressure tank and mist nozzles in pvc pipes, the solenoid is on a timer and opens up to let water be supplied to the mist nozzles by having the solenoid valve connected to the pressure tank to mist the roots hanging in the pvc pipes ,which drain back to a resovior and supply the demand pump , when the pressure in the tank gets low the demand pump kicks on and replaces the pressure and water in the tank ,and nutrient solution ,the solenoid is timed like 1 min on and 4 off etc..


    Reply 10 years ago on Introduction

    I agree with bsnob here. It looks like this is a theoretical project and you are focusing on the coding aspect, which is great, but in reality your servo operated valves will not work. Even brand new these $3 valves can be sticky, and a servo just won't do, and as time passes and scale will develop on the ball making it even harder to turn. Use solenoids instead. Good luck though, your design is pretty nice.


    10 years ago on Step 6

    As far as refilling the container when it gets low, you could use a float valve attached to a standard water tap, like ( It would be a self contained piece for controlling the water level and would run on water pressure in the lines. When it comes to temperature sensor and ventilation, that would depend on your crops, their heat tolerance, and your location. From there you can decide what type of cooling system you need. The simplest would be a passive ventilation system, where warm inside air rises through roof vents and cool outside air is allowed to enter the sides to replace the warm air. Another method would be to use exhaust fans to draw air through vents on the other side of the greenhouse. You would leave any roof vents closed using this method, because honestly it doesn't matter. You're plants aren't growing there. You might want to look at some university extension publications on greenhouse design and construction, for example from Texas A&M (, Purdue (, or West Virginia( You could even try contacting your local extension agent or the horticulture crops specialist at your state's land grant university.


    10 years ago on Step 6

    Hi, I'm impressed by your drawing in the first place, allthough i can think of many things that will make automatisation easyer. The solenoid valves are indeed a good suggestion... I would make the main line for watering a PE Tube in a circuit, from ther on, cappilary tubes with drippers. The capillary tubes should be as short as possible. You'll have to add a pump of about 6000 liters/hour to get the pressure you need for the drippers. Moisture sensors are indeed good, but you will have to "train" the roots by letting the ground run dry every other watering session.

    Then, i've been thinking a lot of this lately. To make the work you have to add/remove soil in your trays, i would suggest growing on gravel, or other soilless system like rockwool or lava balls. I personally have used gravel, rockwool and lava balls... For the moment rockwool is for me the best, but in spring I'm going to try and grow strawberry's on gravel with drippers.

    I am allso very interested in the arduino part, since i'm no programmer but more a builder/designer...


    11 years ago on Introduction

    I agree, I only had two things on my mind when I was 16 one was football and the other was girls. We had no Computers and only 4 TV channels. So, yeah give him a break. Kids like this make think we may survive a bit longer on this planet! Go for it Pablo! If I had the money I would buy the materials for you!


    11 years ago on Introduction

    Build it first, taking photographs, then publish it, I'd like to see the finished thing.(The site is for projects that have been completed).



    Reply 11 years ago on Introduction

    I think that's a bit restrictive. There are many "design-only" Instructables here, both in the form of slideshows as well as fully described and documented concepts.

    Having said that, yes, this I'ble needs some work. Better drawings, including details of components or subassemblies. Proper designs on the "missing" steps. And so on.


    Reply 11 years ago on Introduction

    They changed the button to "I made it" (briefly) didn't they?
    That is the site-philosophy isn't it?



    11 years ago on Introduction

    Im still working on the instructable but I published it to get some feedback. I need to add more steps and code which are my priority, I will add the source files along with a link to the autodesk website where there is a viewer for the CAD files (free)