Hydroponic Greenhouse Monitoring and Control System





Introduction: Hydroponic Greenhouse Monitoring and Control System

In this instructable, I will show you how to construct a hydroponic greenhouse monitoring and control system. I will show you the components chose, a wiring diagram of how the circuit was constructed, and the Arduino sketch used to program the Seeeduino Mega 2560. I will also post a few videos at the end so you can see the end result


  • DHT11


  • Water Pump
  • Air Pump
  • 2 Fans
  • LED Light Strip
  • 4x20 LCD Screen


  • The air and water pump are attached to an external interrupt function which is controlled by an SPDT switch. This allows the user to change nutrient solution or tinker with the irrigation system without having to shutdown the entire circuit. This is important because when you shutdown the entire circuit, the timing for the light resets.
  • The lights are controlled by simple mathematical functions which allows the user to determine how long they would like the lights to be on and off.
  • The fans are controlled by temperature. I have programmed the Relay to switch the fans ON anytime the sensor reads above 25 Celsius. And to be OFF anytime below 26 Celsius.

I feel that I should mention that this project is still a work in progress. By the end of summer I plan to install a pH, electro conductivity, and DO sensor (as these are essential for properly monitoring of a hydroponic system). So if you like what you see, check back sporadically throughout the summer to check on my progress!

Step 1: Component Selection

The photo displayed for Step 1 shows; Component, Model, Company, Function, and Price.

You can most likely find these components for cheaper prices through Amazon or other sources. I just gathered this information from each components source since I was also gathering specification sheets at the same time.


Just realized I left out 2x breadboards for my parts list. These are rather cheap and can be bought through Amazon, or just about any components retailer. .

Step 2: Wiring the Circuit

In the photos displayed for Step 2, you will find the wiring diagram as well as the physical structure of the circuit. Quite a bit of soldering was done in this step to ensure solid connections to the relay as well as the interrupt switch and lights.

If you are having issues with getting a component to power up, remember that a DMM is your BEST friend in this step. Check voltage across a component in parallel and check current through a component in series. I found that checking the components by DMM was much faster than trying to retrace my wiring to look for the reason something was not working.

NOTE: You will notice I used a MicroSD shield on top of my Seeeduino Mega 2560. This is not needed for this project unless you want to record data(which I have not programmed for...yet).

Step 3: Constructing the Hydroponic Greenhouse

The size of your greenhouse is really up to you. The best thing about this project is that all you need to make it on a larger scale is longer wires! (And a water pump with more than 50 cm of head)

The base frame of the greenhouse was constructed out of wood from LOWE's and I used flexible pvc pipe and chicken wire to create the frames hood. (Photo 1)

A simple plastic sheet was used to cover the hood and create an isolated ecosystem for the plants. Two fans in series were used to move air across the greenhouse. One to pull air in and one to pull air out. This was done to cool the greenhouse as fast as possible and to simulate a breeze. The fans are programmed to be off when the DHT11 measures temp < 25 *C and to turn on when temp > or = to 26 *C. This will be displayed in the sketch portion of the instructable. (Photo 2)

The hydroponics system consists of a 3" O.D pvc pipe with two 2" holes cut out of the top for the mesh pots. They are spaced 3" apart to give each plant enough space for both rooting and growing. A drip system was used to provide the nutrient solution to the plants and a 1/4" hole was cut out of the bottom of the pvc to allow the water to return to the reservoir below. The air and water pumps are both connected to an interrupt switch that controls them from a second void running in parallel to the main void loop. This was done so I could turn off the pumps to change the nutrient solution without affecting the rest of the system.(Photo 3, 4, and 5)

An LED light strip was attached to the inside top of the hood and wired into the relay through the RBG amplifier. The light is on a timer which is controlled by "If" and "else if" statements. In my programming you will find they are programmed to turn on and off every 15 seconds. This is purely for demonstrations purpose and should be changed according to a normal light cycle for optimal growing conditions. Also, for actual growing conditions, I recommend using a real grow light rather than the simple LED strip I used in my class project. (Photo 6)

Step 4: Programming in Arduino

Photo 1: Setting up Libraries and definitions.

  • unsigned long timer_off_lights=15000
    • this is where we determine when to turn the LED lights off. The lights are currently programmed to be turned on for until this time is reached. For actual use I recommend checking out the desired light cycle for the plant you want to grow. Ex: if you wish your lights to be on for 12 hours, change this time from 15000 to 43200000.

No other changes are needed in this section of the program

Photo 2: void setup.

No changes are needed in this section

Photo 3: void loop.

  • else if (time_diff <30000)
    • Since the lights are programmed to be on at the start and shut off 15 seconds into the program. 30000 acts as a limit of measured time. The lights remain off until time reaches 30000 and is then reset back to 0, thus turning the lights back on until 15000 is reached again. 30000 should be changed to 86400000 to represent a 24 hour cycle.
  • if (t<26)
    • this is where the program tells the fans to remain OFF. If your plants require different temperatures, change 26 to fit your needs
  • else if (t>=26)
    • this is where the program tells the fans to remain ON. Change this 26 to the same number you changed the previous statement to.

Photo 4: void StopPumps

this is the secondary void mentioned at the beginning of this instructable. No changes are needed, it simply tells the connected pins what to do when the SPDT switch is flipped from its original position.

Step 5: Videos Showing the Function of the System

Video 1:

Shows the air and water pump being controlled by the switch. You can also see how the LED lights on the relay change as the switch is thrown.

Video 2:

By viewing the Serial Monitor, we can see that the lights turn on once the program is started. As the time_diff crosses the 15000 ms threshold the lights turn off. Also, as time_diff crosses the 30000 ms threshold we can view the time_diff resets back to zero and the lights turn back on.

Video 3:

We can see in this video that the temperature is controlling the fans.

Video 4:

Just a walk around the greenhouse

Sensors Contest 2016

Grand Prize in the
Sensors Contest 2016



    • Water Contest

      Water Contest
    • Clocks Contest

      Clocks Contest
    • Creative Misuse Contest

      Creative Misuse Contest

    15 Discussions

    hi, i would change your reservoir box and your tube from the pump to the pipe to any color but not transparant otherwise you will grow algea and that's bad news for the plants and you can buy a cheap rtc timer to add so you don't have to worry if you want to power off the arduino they only cost a dollar on ebay,


    2 years ago

    Nice job! However, once you are done with the construction you have to set the parameters and the nutrients to create the appropriate environment for a plant. Does anyone know where can I find such information for different plants? For example, what's the best temperature and humidity to grow tomatoes, what nutrients to use and in what concentration, etc...

    2 replies

    contact mph gardener.

    Well, for tomatoes: pH 5.5-6.5 EC 2.0-5.0 PPM 1400-3500. If you haven't done hydro before then be aware that this is NOT what you'd start the plant off in. I generally stick to about a third of the recommended ppm and slowly increase each time you change out the water. Similarly stick to the lower end of the pH, perhaps around 6.0.

    When I grew roma tomatoes, they flourished with barely any water (I used a top drip method), higher temperatures (and a generally lower humidity).

    "Tomatoes are a warm weather plant and do not do well when the air temperature dips below 50 degrees (Fahrenheit). Optimum temperature for tomatoes is 70-85 degrees during the day and 65-70 at night. In greenhouse settings these optimum temperatures can be maintained or tomatoes will do quite well at a constant 75 degrees. Many outdoor growers like to start plants inside several weeks before outside temperatures are optimal to get a jump on the season. This is a good practice, but care must be taken not to set plants outdoors too soon. Plants subjected to cold conditions may never fully recover and be poor producers." - C.J.Kline (http://www.gardenandgreenhouse.net/index.php/past-issues-mainmenu-18/25-2008-garden-greenhouse/june-2008/228-hydroponics-101)

    Source: Literally "tomato hydroponics ppm" and "tomato hydroponics temperature" google searches away.

    voted. great project, thank you for sharing.!!
    i have to suggest upgrading the lights. regular led strip lighting will only help the plant grow during seedling stage. you are going to need some real lights, minimum 1W per LED; https://www.instructables.com/id/LED-lights-1/


    You guys are WAY too smart! Can anyone here comment on how to do a humidity-controlled override switch for a house a/c system. I'm looking to have the a/c kick on if the humidity exceeds 75% in the house.

    Or, where to find info on same? Thanks...

    1 reply

    This is just brilliant! I've got a a similar project and this really helped me out a lot to get through issues i had.

    1 reply

    This comment hit me right in the feels... I'm glad my post could help you out. Makes me want to come up with more projects to publish but, I should probably finish all the additions I'm wanting to add to this one first.

    Thanks for the comment!

    Was just wondering if you plan to put this one outside, coz then the fan might be a bit vulnerable... but I understand it is still a work in progress.
    I think I will sort of build your design on one of my existing beds (it already has the plastic conduit arches) and add my controller.
    I don't measure pH, just temperature, humidity, soil moisture and CO2. Control a pump, a fan and for inside a heater and light.
    I definitely like your greenhouse

    1 reply

    I'd love to make this compatible for outside use. Weather stripping around the base of the hood would definitely be needed and you are absolutely right about the fans. I've thought about cutting a 2 liter bottle "hotdog" and "pancake" style and using the top portions as shields against the rain.. A heater is a great idea for being outside.. Id probably also need to add a water heater to my reservoir as well. And add humidity as an input to control to my fans.

    Thanks for your comment. It has given me a lot to think about!!

    Looks good. I have a greenhouse with controller, but your greenhouse looks better than mine. Mine is more of a 'growbox'.
    I think I will take some inspiration from yours

    Good job! Keep working on it

    Nice work! This is fantastic!