CC Blog • Projects • Research & Design Hub

Build a Miniature Greenhouse for Hydroponic and Potted Plants

Automated Monitoring with a Raspberry Pi 4B

A greenhouse requires constant attention to ensure that the environmental conditions appropriate for the plants within it are met. In this article, Evan and Vidhi, two Cornell University students, describe the miniature greenhouse they designed and built for plants grown hydroponically or in soil. Using multiple sensors and a Raspberry Pi 4B, light, temperature, humidity, and soil moisture are monitored and reported in real time on a TFT touchscreen. Built-in water pumps ensure proper humidity and soil moisture.


  • How does a Raspberry Pi automate greenhouse monitoring?
  • What sensors are used to track plant conditions?
  • How are light and water systems controlled automatically?
  • How does remote monitoring with a web app work?
  • What are the key components of a smart greenhouse system?
  • Raspberry Pi 4B
  • Python
  • Flask
  • Pygame
  • Raspberry Pi | raspberrypi.com
  • Adafruit | adafruit.com
  • Python Software Foundation | python.org

Keeping your plants happy and healthy requires consistent care–monitoring light, humidity, soil moisture, temperature. But what if you had a greenhouse that could take care of itself? Or greets you when you check in?

In this project, we explored how a Raspberry Pi 4B can be used to automate plant monitoring and control. By leveraging the multi-core capabilities of the Raspberry Pi, you can simultaneously view real-time environmental data on your plants, give them light, keep them hydrated, and greet them remotely!

DESIGN APPROACH

This project was initially designed for Cornell University’s ECE 5725: “Design with Embedded Operating Systems,” a course centered around building an open-ended Raspberry Pi project that interfaces with external hardware. The inspiration for this automated greenhouse came from our shared passion for plants, and our complementary backgrounds in electrical engineering and computer science.

Our design process began with selecting a housing, followed by the design and fabrication of the interior mechanical components, and then the integration and testing of electronics and software. Your build order might differ and that’s part of the fun!

We encourage you to play around with what works best for your specific needs and the tools that you have at hand, to make this project truly yours. However, we will try to provide the rationale for all our decisions throughout the design process to help you determine your own design process.

MECHANICAL DESIGN—EXTERIOR HOUSING

One of the first major decisions we made was the choice of the exterior housing. The requirements were for it to be:

1) Cost effective.

2) Large enough to mount all electrical components inside or on top.

3) Self-contained (not needing many additional tools or workshopping to achieve full functionality).

These criteria led us to select a sturdy, transparent, acrylic display case (“shoe box”)with dimensions 14.1” × 10.6” × 8.9” [1] (Figure 1).

Figure 1
Acrylic “shoe box” display housing for the greenhouse [1].
Figure 1
Acrylic “shoe box” display housing for the greenhouse [1].

The decision to use clear acrylic serves a dual purpose. First, the transparent panels of the box allow you to see into the greenhouse, and act as an insulative barrier to maintain the temperature and humidity. Second, the rigidity of the acrylic acts as a sturdy base for mounting the electrical components.

A less expensive, more flexible plastic option would be unable to support these components in place and would require extra machining. An added bonus of the shoebox design is a built-in door and hinge mechanism that are perfect for use as the door to our greenhouse!

As an alternative, if you want a more customized look, you could laser-cut acrylic panels to your own dimensions or 3D-print a frame with integrated mounting holes for sensors and wiring. Both options allow for more tailored layouts, though at a higher cost and fabrication time.

MECHANICAL DESIGN—INTERIOR

Inside the greenhouse, a suite of custom-designed components create a compact and efficient growing environment for plants.

Hydroponic Tower: At the heart of the system is a miniature, 3D-printed hydroponic tower, ideal for supporting small plants without soil. We chose to 3D print our tower (parts shown in Figure 2), because mass-produced, small-scale hydroponic towers were hard to come by for a reasonable price. Additionally, 3D printing meant we could easily adjust dimensions to fit a custom number of plants, and to conform with the dimensions of our housing.

Figure 2
Computer-aided design (CAD) models created in Autodesk Inventor, for the 3D-printed hydroponic tower. Top: the tower body. Bottom left: the rain plate. Bottom right: the tower lid.
Figure 2
Computer-aided design (CAD) models created in Autodesk Inventor, for the 3D-printed hydroponic tower. Top: the tower body. Bottom left: the rain plate. Bottom right: the tower lid.

The 3D-printed aspect of the tower allows future users to design or place any of their own custom designs, instead of the tower. Both soil plants and hydroponic plants can thrive in this greenhouse, and we tested both in our final design.

If you don’t have access to a 3D printer, another inexpensive option is to make a miniature hydroponic tower using PVC tubing, or even leftover plastic bottles or buckets, and purchase the remaining parts from independent sellers.

There are a wealth of guides online [2, 3, 4], on how to do this, and it might save you a significant amount if you’re trying to keep this project under a tight budget. One hybrid 3D print/commercial example from an artist on Etsy is shown in Figure 3.

Figure 3
a) 3D-printed hydroponic tower, available on Etsy [5].
Figure 3
a) 3D-printed hydroponic tower, available on Etsy [5].

Humidity Regulation System: Behind the hydroponic tower sits a small humidity regulation system (Figure 3b), the components of which (submersible water pump, and clear vinyl tubing) are provided in an automatic irrigation kit discussed later, in the section of this article on Electrical Design—Pumps.

Figure 3
b) Diagram of the humidity regulation system which, sits behind the hydroponic tower.
Figure 3
b) Diagram of the humidity regulation system which, sits behind the hydroponic tower.

Water from a small reservoir is pumped through tubing to sponges attached to the back of the greenhouse. As the water in these sponges evaporates, that moisture distributes itself evenly inside the greenhouse, raising the overall humidity in the greenhouse and helping to maintain a stable, plant-friendly humidity level tailored to your plants’ needs.

DISPLAY HARDWARE

To enable users to interact with the greenhouse via a graphical user interface (GUI), we selected as the display hardware an Adafruit 2.8” TFT Touchscreen. This compact and responsive display connects directly to the Raspberry Pi 4B’s 40-pin GPIO header. The GUI is discussed later in this article, in the Software Overview section.

Because it’s an Adafruit product, it comes with extensive documentation and software support, which makes setup and troubleshooting straightforward. The screen’s small footprint fits neatly on top of the Pi on top of the greenhouse, eliminating the need for extra wiring or bulky enclosures.

ELECTRICAL DESIGN

The electrical system consists of the control and power circuitry for the Raspberry Pi, lights, and pumps within the greenhouse.

Light: A compact, 5V, USB, UV, full-spectrum grow light is mounted at the top of the greenhouse casing, to simulate the natural sunlight. The light we used in our project [6], like many you might find commercially available online, originally had a dimming controller and USB input attached to it.

Since our objective was to fully automate the lighting process, we modified the light by splicing off the controller and USB end to expose the terminals of the light. This allowed us to connect them directly to a breadboard and send a PWM signal from our Raspberry Pi to control their brightness through our own software.

The modified UV light is shown in Figure 4. Grow lights like these are used in many indoor greenhouse setups, and provide the specific light wavelengths required for photosynthesis, supporting healthy plant growth throughout all developmental stages. When selecting your own lighting for this project, make sure to choose one that reaches almost all wavelengths of light in the visible spectrum—roughly 350nm to 800nm. This will sometimes be labeled as “full spectrum” or “grow lights for plants.”

Figure 4
Modified UV light source. This is a photo of the initial wiring of the light to the Raspberry Pi. Here, the MOSFET acts as a switch between the Raspberry Pi and the light. When the Raspberry Pi sends a high signal to the MOSFET's gate pin, the Drain and Source pins become connected, allowing current to flow from the power source to the light (just for testing we used the 5V provided by the Raspberry Pi's pins, but in the final design we drew power from the external battery pack) which turns the light on. We can then adjust the percentage of time in which the signal sent to the light from the Pi is high (duty cycle) to dim or brighten the light in software.
Figure 4
Modified UV light source. This is a photo of the initial wiring of the light to the Raspberry Pi. Here, the MOSFET acts as a switch between the Raspberry Pi and the light. When the Raspberry Pi sends a high signal to the MOSFET’s gate pin, the Drain and Source pins become connected, allowing current to flow from the power source to the light (just for testing we used the 5V provided by the Raspberry Pi’s pins, but in the final design we drew power from the external battery pack) which turns the light on. We can then adjust the percentage of time in which the signal sent to the light from the Pi is high (duty cycle) to dim or brighten the light in software.

This specific light used in our setup, the LORDEM LED Grow Light [6], was chosen for three reasons:

  • Low power consumption : A small light like this requires relatively little power, meaning that we do not need to use a bulky external power supply, nor are we constrained to a wall outlet. Instead, we can connect it to a much smaller, more portable 5V battery pack, and control the current sent to it via a MOSFET.
  • PWM dimmable: With the simple design of the light (no capacitors or visible control circuitry), we can easily send a PWM signal via the Raspberry Pi’s GPIO pins and MOSFET to vary the intensity of the light.
  • Compact: The small form factor of this light allows it to easily fit inside our greenhouse enclosure, while providing an adequate amount of light for ample coverage of all plants.

Pumps: Two small 5V DC submersible pumps, which are part of a automatic irrigation kits [7] are used within the greenhouse. One is used in the humidity system to send water to the humidity sponges, and the other is placed in the base of the hydroponic tower to act as a circulating device to continually pump nutrient filled water up to the roots of the plants in the tower. The reasons for using this specific pump type were:

  • Inexpensive and readily available: Small pumps like these are popular in hobbyist and DIY electronics projects, making them affordable and well documented!
  • Low Voltage Operation: These pumps can be powered from a small 5V battery pack, but can also be used with a dedicated DC power supply for continuous and long-term operation.
  • Simple Control Interface: The pumps can be switched on and off via a GPIO-controlled transistor or relay.

Sensors: To monitor the internal conditions in our greenhouse, we integrated environmental sensors connected to the Raspberry Pi’s GPIO pins. The sensors were chose were:

  • Humidity and Temperature Sensor: We selected the DHT11 sensor, a common option for hobbyist IoT and automation projects, because it is one of the least expensive combined humidity/temperature sensors available, and for its ease of integration. The DHT11 communicates using a single digital pin, meaning it only requires one GPIO connection and no external analog-to-digital converter (ADC.) Its Python libraries (such as Adafruit_DHT) are well-maintained and easy to use. An alternative to the DHT11 is the more expensive DHT22, which provides a more accurate reading and has a wider temperature measurement range.
  • Soil Moisture Sensor: For tracking soil moisture, we chose a resistive soil moisture sensor. This sensor outputs an analog voltage proportional to the soil’s water content, which we read using an ADC connected to the Pi. In future iterations, this sensor can allow our Python control loop to trigger watering cycles automatically, or alert the user when plants are getting too dry.

In a future design however, we recommend using a capacitive soil moisture sensor. These are much more corrosion resistant and reliable for long-term use, and the price difference is often minimal at $1 to $2 more per sensor. Over the long term, this design choice will be significantly lower, when compared to how often you would need to replace the resistive sensors.

Schematics: After the parts were selected, we drew up a quick schematic for wiring all the individual components together. This initial wiring schematic is shown in Figure 5.

Figure 5
Initial wiring schematic diagram.
Figure 5
Initial wiring schematic diagram.

A Cirkit Designer diagram of the final wiring is shown in Figure 6. Note: For powering the system, we show a 5V battery pack in this schematic, because we had it on hand and used in our design to make the device portable. However, if you’re planning to run this device continuously, and are not concerned with portability, you can swap the battery pack for a DC power supply outputting 5V, to eliminate the need to constantly replace batteries.

Figure 6
Cirkit Designer diagram of the final wiring.
Figure 6
Cirkit Designer diagram of the final wiring.
The SOFTWARE

The display hardware for this project, the Adafruit 2.8” TFT Touchscreen, was discussed earlier in this article.

We began by sketching the layout of our GUI for manual control and monitoring of greenhouse conditions. The objective was to give the greenhouse a friendly personality and an interface that was intuitive and easy to use.

Figure 7
GUI storyboard.
Figure 7
GUI storyboard.

To accomplish this, we structured the GUI design into four high-level pages, shown in Figure 7.

1) A Welcome Splash Page appears on boot-up to welcome and prompt users to update the Raspberry Pi with information on the plants being placed inside the greenhouse.

2) The Home Page displays current greenhouse lighting, temperature, and humidity conditions for a hydroponic setup (soil moisture not applicable), alongside date/time information, and a live feed into the greenhouse to monitor the plants.

3) A Settings Page is used to tailor the greenhouse conditions individually to match the plants inside. We could even add a database to store custom settings profiles for commonly bought plants, to make tailoring the conditions inside the greenhouse even easier.

4) In future iterations, we envision a Reminders Page to pop-up and notify users when specific plants need repotting or watering, based on control loops and sensors in the greenhouse.

The GUI in action is shown in Figure 8. For our GUI implementation, we used Python’s Pygame module.

Figure 8
The graphical user interface (GUI) in action!
Figure 8
The graphical user interface (GUI) in action!

Remote Monitoring: To enable remote monitoring and a live camera feed for our plants, we used the Raspberry Pi Camera Module V2 (Figure 9). This camera plugs directly into our Raspberry Pi 4B’s camera port, and with the help of the picamera2 Python module, getting an initial photo feed from the camera is made easy.

Figure 9
Raspberry Pi Camera V2 module [8].
Figure 9
Raspberry Pi Camera V2 module [8].

Some helpful starter code to take a picture with the Pi Camera V2 to help get you going is given in Listing 1.

import time

from picamera2 import Picamera2, Preview

picam2 = Picamera2()

preview_config = picam2.create_preview_configuration(main={“size”: (800, 600)})
picam2.configure(preview_config)

picam2.start_preview(Preview.QTGL)

picam2.start()
time.sleep(2)

metadata = picam2.capture_file(“test.jpg”)
print(metadata)

picam2.close()

Listing 1
This snippet uses the Picamera2 module to initialize a Picamera object, configures a preview with a resolution of 800×600 pixels, starts the camera preview, captures an image, and saves it as "test.jpg", allowing you to test whether you have properly connected your Raspberry Pi Camera V2.

Web Application Setup: We can set up a web application to allow us to access the GUI without needing to be near the greenhouse. In our design, we spin up a simple web server using the Python Flask framework. Some example code for use with Flask is given in Listing 2.

from flask import Flask

app = Flask(__name__)

@app.route(‘/’)
def hello_world():
    return ‘Hello, World!’

if __name__ == ‘__main__’:
    app.run(debug=True)

Listing 2
This snippet instantiates a simple Flask application, defines a url route that returns "Hello, World!" when accessed, and runs the app in debug mode. You can then preview your hello world web application locally at the url that Flask provides when you run this script. From here you can expand on this base implementation to render your own pages, sensor variables, and images!

This code imports the Flask library, instantiates a URL route, and returns an HTTP response with ‘Hello World!’ From here, we can extend this implementation to render our HTML dashboard, and even pass in live sensor readings from the sensors to keep our dashboard up to date, all from within our Python project.

— ADVERTISMENT—

—Advertise Here—

Through this, we can serve a simple HTML dashboard that displays live readings from our sensors and allows remote control of the lights and pumps. The end result is shown in Figure 10.

Figure 10
View of live Web Dashboard.
Figure 10
View of live Web Dashboard.
CODE AND FILES FOR BUILDING THE GREENHOUSE

Now that the individual hardware and software components for our project and the rationale for them have been finalized, we can move on to integrating all the components together and building our system! A photo of the completed project is shown in Figure 8.

Code for the project is available in our GitHub repository [9]. It includes ready-to-print CAD files for the hydroponic designs shown in Figure 2, which enable you to get started quickly, or use as a basis to design your own!

For electrical components, the parts list for components is available on the Circuit Cellar website and the schematics (Figure 5 and Figure 6) have information on wiring. A higher resolution copy of the final wiring diagram also is available in the GitHub repository.

Additional code can be found in GitHub repositories for the Pi camera [10] and the Pi camera V2 to Flask Stream [11]. Detailed information is available for the Raspberry Pi pinout [12], Adafruit TFT [13], and RPi.GPIO Python Module [14].

At the end of our journey together, we have reasoned about and provided the basis for you to design a fully functioning, miniature greenhouse system that enables users to monitor the temperature, humidity, brightness level, and soil moisture of their hydroponic and potted plants.

Using a Flask web server, we can remotely view these conditions on our local network, and manually control the brightness and humidity conditions for the plant.

We hope you go out and build your greenhouse, and make your garden smarter with the power of the Raspberry Pi! 

Parts List

Part and Cost
Raspberry Pi 4B $35.00
Raspberry Pi Camera V2 $25.00
Adafruit 2.8” PiTFT Capactive Touch Screen $44.95
Acrylic Greenhouse Casing $18.89
5V DC Water Pump $6.99 × 2
Soil Moisture Sensor $1.99
5V UV Grow Light $8.99
Temperature + Humidity Sensor $1.99
Plant Growing Medium Sponges $0.20 × 5
Logic Level Shifter $3.95
MOSFET $0.50

RESOURCES
Adafruit | https://www.adafruit.com
Cirkit Designer | https://app.cirkitdesigner.com
Python | https://www.python.org
Raspberry Pi | https://www.raspberrypi.com

REFERENCES
[1] Acrylic greenhouse “shoe box” housing:
https://www.amazon.com/gp/product/B09Z9Y4M95/ref=ox_sc_act_title_1?smid=A12HDUHU81RHJS&th=1
[2] Building a Vertical Hydroponic Tower—Oklahoma State:
https://extension.okstate.edu/fact-sheets/building-a-vertical-hydroponic-tower.html
[3] $10 Hydroponic Tower Garden Cheap and Easy:
https://www.youtube.com/watch?v=O8-su9qeIDg
[4] Build Your Own affordable Hydroponic Grow Tower: https://www.youtube.com/watch?v=dKYsZJsD9dI
[5] Mini modular hydroponic greenhouse:
https://www.etsy.com/listing/1889318750/diy-modular-hydroponic-tower-kit?gpla=1&gao=1&&utm_source=google&utm_medium=cpc&utm_campaign=shopping_us_-home_and_living-other&utm_custom1=k_Cj0KCQiA5abIBhCaARIsAM3-zFWdIp9JCI3b4rzYvC4AFhF_ZIjvE0VPayarKRKhB1eQLaiU26FOqwQaAuVdEALw_wcB_k&utm_content=go_15222226012_129278854773_560419012988_pla-2314590679570_c__1889318750_12768591&utm_custom2=15222226012&gad_source=1&gad_campaignid=15222226012
[6] Grow light used in this project:
https://www.amazon.com/LORDEM-Ceiling-Spectrum-Dimmable-Brightness/dp/B0D5CRF4TF?th=1
[7] 5V DC pumping system used to provide controlled humidity and water recirculation in the hydroponic tower:
https://www.amazon.com/Diitao-Automatic-Irrigation-Capacitive-Detection/dp/B0B7LMFRKS
[8] Raspberry Pi Camera Module V2:
https://quartzcomponents.com/products/raspberry-pi-camera-module-2
[9] GitHub repository containing code for the entire greenhouse project:
https://github.com/evnleong/ECE5725/tree/main/src
[10] PiCamera2 GitHub Repository:
https://github.com/raspberrypi/picamera2/blob/main/examples/capture_to_buffer.py
[11] Pi Camera v2 to Flask Stream:
https://github.com/EbenKouao/pi-camera-stream-flask/blob/master/camera.py
[12] RPi Pinout:
https://randomnerdtutorials.com/raspberry-pi-pinout-gpios/
[13] Adafruit Forums. “Power to Adafruit PiTFT 2.8” TFT”:
https://forums.adafruit.com/viewtopic.php?p=655083
https://sourceforge.net/p/raspberry-gpio-python/wiki/Home/

Code and Supporting Files

PUBLISHED IN CIRCUIT CELLAR MAGAZINE • JANUARY 2026 #426 – Get a PDF of the issue

Keep up-to-date with our FREE Weekly Newsletter!

Don't miss out on upcoming issues of Circuit Cellar.


Note: We’ve made the Dec 2022 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

Would you like to write for Circuit Cellar? We are always accepting articles/posts from the technical community. Get in touch with us and let's discuss your ideas.

Sponsor this Article
+ posts

Evan Leong (epl44@cornell.edu) is currently in his fourth year of study at Cornell University, studying Computer Science and Mechanical Engineering. In his spare time, he loves dogs, playing tennis, baking, and of course, plants!

Vidhi Srivastava (vs356@cornell.edu) is a 2025 graduate of Cornell University, with a BS in Electrical and Computer Engineering, and a minor in Robotics and Law & Society. She is currently a Test Engineer with Marvell Technology. Her professional interests in engineering include industries such as power and transportation infrastructure, sustainable energy, social justice, medical devices, assistive robots, agriculture, art and film, and aerospace research.

Supporting Companies

Upcoming Events


Copyright © KCK Media Corp.
All Rights Reserved

Copyright © 2026 KCK Media Corp.

Build a Miniature Greenhouse for Hydroponic and Potted Plants

by Evan Leong and Vidhi Srivastava time to read: 13 min