Automated Mini Greenhouse with ESP32 and Sensors for Home Assistant
The ESP32 mini greenhouse is a smart project that lets you monitor and control the indoor environment for growing small plants. It uses an ESP32-C3 Super Mini board, environmental sensors, and actuators, all integrated via ESPHome and connected to Home Assistant.
Main components of the mini greenhouse
The system’s control unit is an ESP32-C3 Super Mini, a compact dev board with a 32-bit CPU, 4 MB flash memory, and 13 usable GPIO pins. It can be powered via USB-C or 5 V pins, making it easy to manage connected components.
To detect environmental parameters, specific sensors are used:
- SHT45 sensor for air temperature and humidity, with high measurement precision.
- BH1750 sensor for brightness, useful for assessing the amount of light available in the greenhouse.
- Capacitive hygrometer to monitor soil moisture without electrical contacts that corrode.
- HC-SR04 ultrasonic sensor to check the water level in the reservoir.
To display data locally, a 0.96″ SSD1306 OLED display is used, connected via I²C, showing temperature, humidity, light readings, and the status of the actuators.
Actuators and control
The project includes three 5 V relays (Songle modules) to drive three devices:
- A fan for internal ventilation.
- A submersible pump for automatic watering.
- An LED UV strip to provide supplemental light to the plants.
The relays are controlled by the ESP32 via 2N2222 transistors, ensuring reliable switching of loads.
Configuration with ESPHome

The board is programmed with ESPHome, which lets you define all sensors, outputs, automation logic, and integration with Home Assistant. The ESPHome configuration file includes declarations for:
- Wi-Fi connection and logging, OTA, and API features.
- SHT45, BH1750, ultrasonic, and capacitive hygrometer sensors.
- Relay actuators connected to the fan, pump, and LED.
ESPHome automatically converts many readings into useful values (such as percentages or relevant units) and makes the data available in Home Assistant.
Once the firmware is loaded via USB or OTA, the mini greenhouse is recognized by Home Assistant without additional configuration. From there, you can view real-time values and set up automations (for example, turning on the pump when the soil is dry, or activating the light when brightness drops below a threshold).
Assembly and additional components
Besides the board and sensors, the project requires a 5 V, 5 A power supply with USB-C connector, ventilation/lighting/pump devices, various terminal blocks, diodes, resistors, and a plastic container that serves as the greenhouse itself.
Conclusion
The result is a compact smart greenhouse fully controllable via Home Assistant. The system offers real-time monitoring of key parameters for plant growth and automatically manages actuators according to configured thresholds.