NEW: RoboRover Core is live! Educational robot base with USB-C rechargeable battery, sensors, OLED + Wi-Fi — ready for projects. 🤖

Orders via Akis Express or Box Now (before 12 PM) Mon–Fri ship same day. Cyprus Post orders ship next working day. 🚀

Kypruino Mini Smart Greenhouse: Build a Temperature and Humidity Controlled Greenhouse

Kypruino Mini Smart Greenhouse: Build a Temperature and Humidity Controlled Greenhouse

Team Robo |

In this project, we will build a small smart greenhouse using the Kypruino board, an AHT10 temperature and humidity sensor, a small fan, and a micro submersible water pump. The greenhouse monitors the air conditions inside the enclosure, turns on ventilation when it gets too warm or too humid, and activates a small pump when the air becomes too dry.

This guide is written so that beginners can follow along. You do not need advanced electronics experience, but you should be comfortable connecting simple modules to a microcontroller, uploading an Arduino sketch, and assembling a small 3D-printed project.


What the project does

The Mini Smart Greenhouse creates a simple automated environment for small plants. It uses a sensor to monitor the temperature and humidity inside the greenhouse, then controls a fan and water pump based on those readings.

  • Temperature monitoring: reads the air temperature inside the greenhouse
  • Humidity monitoring: reads the relative humidity inside the greenhouse
  • Automatic ventilation: turns on a small fan when the greenhouse becomes too warm or too humid
  • Automatic watering support: turns on a small pump when the air becomes too dry
  • Water tank integration: stores water in the front tank and pumps it through tubing
  • Timing protection: runs the pump only for short periods so it does not stay on continuously

The result is a compact STEM project that introduces environmental sensing, automation, transistor switching, and smart agriculture in a practical way.


Components needed

For this build, you will need:

  • 1 × Kypruino board
  • 1 × AHT10 temperature and humidity sensor
  • 1 × small 5 V DC brushless fan, such as an LD3007MS-style fan
  • 1 × micro submersible 5 V DC water pump
  • Flexible tubing for the pump
  • 2 × P16NF06L logic-level N-channel MOSFETs, or suitable equivalents
  • 2 × 220 Ω resistors
  • 2 × 10 kΩ resistors
  • 1 × small breadboard
  • Jumper wires
  • USB-C cable for programming and power
  • 3D-printed greenhouse body with a water tank and transparent cover

Important: Do not connect the fan or pump directly to a Kypruino digital output pin. The output pins are only used to control the MOSFET gates. The fan and pump receive power through their MOSFET switching circuits.

Render of the Mini Smart Greenhouse design, showing the plant compartments, front water tank, fan opening, and transparent greenhouse cover.

How the system works

AHT10 temperature and humidity sensor

The AHT10 sensor measures the air temperature and humidity inside the greenhouse. These readings allow the Kypruino to decide when the greenhouse needs ventilation or watering support.

The AHT10 uses I2C communication, so it connects to the Kypruino through the SDA and SCL connections.

Ventilation fan

The fan is used to ventilate the greenhouse when the air becomes too warm or too humid. In the code, the fan turns on if the temperature reaches 30°C or if the humidity reaches 80%.

To avoid rapid switching, the fan does not turn off immediately when the readings fall slightly. Instead, it turns off only after the temperature falls to 28°C or below and the humidity falls to 75% or below.

Water pump

The micro submersible pump sits inside the water tank at the front of the greenhouse. When the humidity becomes too low, the Kypruino activates the pump for a short period.

In the current code, the pump runs for 3 seconds, then waits 30 seconds before it can run again. This prevents the pump from staying on continuously.

MOSFET switching circuits

The fan and pump are controlled using two N-channel MOSFETs. A MOSFET acts as an electronic switch, allowing the Kypruino to control a device that requires more current than a digital output pin can safely provide.

Each control pin connects to its MOSFET gate through a 220 Ω resistor. This resistor limits brief current spikes when the MOSFET switches.

A 10 kΩ pull-down resistor is also connected between each gate and GND. This keeps the MOSFET switched off while the Kypruino is starting or whenever the control pin is not actively driven HIGH.


Wiring the project

Connect the components to the Kypruino as shown below.

AHT10 temperature and humidity sensor

AHT10 Pin Connects to Kypruino
VIN VCC
GND GND
SDA SDA
SCL SCL

Fan MOSFET circuit

Connection Connects to
Kypruino D8 MOSFET gate through a 220 Ω resistor
MOSFET gate GND through a 10 kΩ pull-down resistor
MOSFET source GND
MOSFET drain Fan negative wire
Fan positive wire 5 V

Pump MOSFET circuit

Connection Connects to
Kypruino D9 MOSFET gate through a 220 Ω resistor
MOSFET gate GND through a 10 kΩ pull-down resistor
MOSFET source GND
MOSFET drain Pump negative wire
Pump positive wire 5 V

P16NF06L MOSFET pinout

When the flat labelled side of the P16NF06L is facing you and the pins point downward, the pins are arranged as follows:

Pin Function
1 Gate
2 Drain
3 Source

The metal tab of the MOSFET is also electrically connected to the drain.

Important: All parts of the circuit must share a common ground. The Kypruino GND, AHT10 GND, both MOSFET sources, fan supply ground, and pump supply ground must all be connected.

Check that the USB supply and Kypruino 5 V connection can provide enough current for the fan, pump, sensor, and board together. If a separate 5 V supply is used for the fan and pump, connect its GND to the Kypruino GND.

Complete wiring overview showing the AHT10 sensor and the two MOSFET circuits used to control the ventilation fan and water pump.

Installing the Arduino libraries

Before uploading the code, install the required libraries in the Arduino IDE.

  1. Open the Arduino IDE
  2. Go to Sketch → Include Library → Manage Libraries...
  3. Search for and install Adafruit AHTX0
  4. Install Adafruit BusIO if it is not installed automatically
  5. Install Adafruit Unified Sensor if required by your setup

Uploading the code

Connect the Kypruino to your computer using a USB-C cable. Open the Arduino IDE, select the correct board and port, then upload the Mini Smart Greenhouse sketch.

The code uses the following control pins:

#define FAN_PIN 8
#define PUMP_PIN 9

Setting one of these pins HIGH switches on the corresponding MOSFET, allowing current to flow through the fan or pump. Setting the pin LOW switches the MOSFET and connected device off.

The AHT10 does not need a normal digital data pin because it communicates through I2C using SDA and SCL.

The main greenhouse thresholds can be adjusted near the top of the code:

const float MAX_TEMPERATURE_C = 30.0;
const float MAX_HUMIDITY_PERCENT = 80.0;

const float FAN_OFF_TEMPERATURE_C = 28.0;
const float FAN_OFF_HUMIDITY_PERCENT = 75.0;

const float MIN_HUMIDITY_PERCENT = 45.0;
const float PUMP_TARGET_HUMIDITY_PERCENT = 55.0;

You can change these values depending on the plants, the size of the greenhouse, and the behaviour you want to demonstrate.


Understanding the control logic

1. The sensor reads the environment

At regular intervals, the Kypruino reads the temperature and humidity from the AHT10 sensor. These values are stored in the program and used to decide what the greenhouse should do next.

2. The fan responds to heat and humidity

If the greenhouse becomes too hot or too humid, the Kypruino sets D8 HIGH. This activates the fan MOSFET and allows the fan to run.

The fan uses two sets of thresholds: one to turn on and another to turn off. This is called hysteresis. It prevents the fan from switching on and off too quickly when the readings are close to the limit.

3. The pump responds to low humidity

If the air becomes too dry, the Kypruino sets D9 HIGH. This activates the pump MOSFET, allowing the pump to move water from the front tank through the tubing.

The pump does not run continuously. Instead, it runs for a short burst, switches off, waits, and then checks the environmental conditions again.

4. Safety behaviour

If the sensor reading fails, the code stops the pump and turns the fan on. This avoids unnecessary watering and keeps air moving until valid sensor readings are available again.


Why use hysteresis?

Without hysteresis, a fan might turn on at 30°C and immediately turn off when the reading falls to 29.9°C. If the temperature continues moving around the threshold, the fan could rapidly switch on and off.

In this project, the fan turns on at a higher value and turns off only after the readings fall to a safer lower value. This makes the behaviour more stable and realistic.


Why use pump timing?

A small pump can move water quickly, especially in a compact greenhouse. If it remained on continuously, it could overwater the plants or empty the tank too quickly.

The code uses a simple timing system. The pump turns on for a short period, then waits before it is allowed to run again. This introduces an important automation principle: actuators often need limits, timing, and protection logic.


Assembling the greenhouse

Once the circuit is working on your desk, you can install the components inside the greenhouse enclosure.

  1. Mount the AHT10 where it can measure the air inside the greenhouse
  2. Attach the fan behind the ventilation opening
  3. Place the pump inside the front water tank
  4. Route the tubing from the pump towards the plant compartments
  5. Place the Kypruino, breadboard, and MOSFET circuits in the electronics compartment
  6. Keep the wires neat and away from the water tank, tubing, and overflow path
  7. Fit the transparent greenhouse cover once everything has been tested

The greenhouse body is divided into several internal sections so that the plants, water tank, electronics, fan, and tubing can be arranged separately. An overflow channel helps direct excess water away from the electronics area.

Important: Keep the Kypruino, breadboard, MOSFETs, and wiring away from water. Only the pump and suitable tubing should come into contact with water. Check carefully for leaks before leaving the project powered.

Internal layout of the greenhouse, showing the plant compartments, front water tank, ventilation fan, tubing route, and protected electronics area.

What students can learn

This project introduces several important STEM concepts:

  • Temperature and humidity sensing
  • I2C communication
  • Environmental monitoring
  • Automatic ventilation
  • Water pump control
  • Threshold-based decision-making
  • Hysteresis for stable control
  • Timing logic using millis()
  • Using N-channel MOSFETs as electronic switches
  • Gate resistors and pull-down resistors
  • Safe control of higher-current external devices
  • 3D design for electronics, ventilation, and water routing
  • Smart agriculture and greenhouse automation

It also teaches an important engineering idea: automation is not only about turning devices on and off, but about deciding when, why, and for how long they should operate.


Possible extensions

  • Add a soil moisture sensor for more accurate watering decisions
  • Add an OLED screen to display temperature, humidity, fan status, and pump status
  • Add NeoPixel LEDs to show the greenhouse status using colour
  • Add a water-level sensor to detect when the tank is empty
  • Add a grow light controlled by an LDR or real-time schedule
  • Add Wi-Fi logging or notifications
  • Create different plant profiles with different temperature and humidity limits
  • Use a larger greenhouse body with more plant compartments

Final thoughts

The Mini Smart Greenhouse is a compact and practical STEM project that combines sensing, automation, electronics, and 3D design. By using the Kypruino board, an AHT10 sensor, a small fan, a water pump, and two MOSFET switching circuits, the project demonstrates how a simple microcontroller can help monitor and control a plant environment.

The greenhouse is simple enough for beginners to understand, but it introduces real engineering ideas such as hysteresis, timed actuation, transistor switching, pull-down resistors, and environmental control. It is a useful example of how technology can support plant care, sustainability, and smart agriculture.

Final view of the Mini Smart Greenhouse, combining a 3D-printed enclosure, environmental sensing, MOSFET-controlled ventilation, and automatic watering support.

Leave a comment

Please note: comments must be approved before they are published.