Built to order

IoT Terrarium Controller with Day-Night Cycle Simulation

This project builds an ESP32-based controller for a glass terrarium or vivarium that simulates a natural day-night cycle: a real-time clock schedules a smooth sunrise/sunset dimming curve on a full-spectrum LED grow light, while a DHT22 sensor tracks temperature and humidity, a capacitive probe watches substrate moisture, and a small misting pump plus fan hold the enclosure's climate on target. All readings stream to a web dashboard with live gauges, 24-hour temperature/humidity/moisture graphs and a light-phase indicator. The build ships with the controller, firmware, dashboard and the

Chat on WhatsApp — get a quotation

IoT & Embedded ESP32Capacitive soil-moisture probeDHT22 sensorDS3231 RTCHTML · CSS · JS dashboardMQTT · Wi-Fi telemetryLED grow-light · PWM driverMisting pump · relayHybrid
IoT Terrarium Controller with Day-Night Cycle Simulation — project thumbnail preview
More project photos (3)

The problem

A glass terrarium or vivarium is a closed micro-climate: plants, mosses and small humidity-loving species need a stable light rhythm, warm humid air and moist substrate, and all three drift badly in a room. The common student approach — a desk lamp on a wall timer and hand-misting whenever someone remembers — gives abrupt on/off light transitions that no natural dawn or dusk resembles, and humidity that swings between soggy and bone-dry. This project replaces that guesswork with an embedded climate controller: an ESP32 with a real-time clock drives a full-spectrum LED grow light along a configurable sunrise/sunset dimming curve, monitors temperature and humidity with a DHT22, watches substrate moisture with a capacitive probe, and runs a small misting pump and circulation fan to hold setpoints. A web dashboard shows live readings and 24-hour climate graphs so the keeper can see exactly how the enclosure behaved through the night.

SYSTEM FLOW

8 components 8 connections

Live flow
Drag to explore
100%
sensorDS3231 real-time clock

Keeps local time within plus/minus 2 ppm so the controller knows the current light phase.

Follow the working sequence

How it works

  1. The DS3231 real-time clock keeps local time on the controller; firmware computes the current light phase (dawn, day, dusk, night) from the configured photoperiod and fades LED brightness along a smooth curve using PWM.
  2. A DHT22 sensor samples enclosure temperature and relative humidity every few seconds, and a capacitive probe reads substrate moisture level.
  3. Readings are published over Wi-Fi (MQTT/HTTP) to the backend, which stores them as a time series for graphing.
  4. The dashboard shows live gauges for temperature, humidity and moisture, 24-hour graphs of each channel, the current light phase, and upcoming scheduled events.
  5. When humidity falls below the configured floor, the controller runs a misting burst and starts the fan; when substrate moisture drops below threshold, a watering cycle is triggered.
  6. Threshold breaches (overheat, low humidity, sensor offline) raise visual alerts on the dashboard; the light schedule keeps running on-device even if Wi-Fi drops.
  7. All setpoints — photoperiod, dawn/dusk duration, misting length, alert limits — are edited from the dashboard and take effect immediately.

Tech stack:

  • ESP32 (controller + Wi-Fi)
  • DS3231 real-time clock (±2 ppm)
  • DHT22 temperature/humidity sensor
  • Capacitive soil-moisture probe
  • Full-spectrum LED grow-light strip + MOSFET PWM driver
  • 5 V misting pump + relay, small circulation fan
  • MQTT · Wi-Fi telemetry
  • Python/Node.js backend with time-series store
  • HTML · CSS · JS dashboard
Parameter Value
Controller ESP32 with on-board Wi-Fi
Timekeeping DS3231 RTC, ±2 ppm (datasheet)
Temperature DHT22, ±0.5 °C (datasheet)
Humidity DHT22, ±2–5% RH (datasheet)
Moisture Capacitive probe, 0–100% analog scale
Light Full-spectrum LED strip, 0–100% PWM dimming
Photoperiod Configurable, up to 16 h daylight (typical 12 h)
Dawn/dusk ramp 15–120 min, configurable
Misting 5 V pump, 5–30 s bursts, humidity-triggered
Telemetry MQTT/HTTP, approximately 10 s sample interval (typical)
Power 5 V/12 V adapter, approximately 10–15 W peak (design target)
Dashboard Live gauges, 24 h graphs, single-page web app

Project features

  • [Day-night cycle simulation] A DS3231 real-time clock schedules a smooth sunrise/sunset brightness curve on the LED grow light — configurable photoperiod (up to 16 h daylight) with adjustable dawn and dusk ramp durations.
  • [Temperature & humidity monitoring] DHT22 sensor samples air temperature and relative humidity inside the enclosure every few seconds, with threshold alerts for overheating or dry air.
  • [Substrate moisture sensing] A capacitive soil-moisture probe tracks substrate wetness without corroding, and triggers watering/misting cycles at a configurable threshold.
  • [Misting & fan control] A small 5 V misting pump fires humidity-triggered bursts and a circulation fan evens out the enclosure air, both driven automatically or manually from the dashboard.
  • [24-hour climate graphs] The dashboard renders temperature, humidity and moisture curves for the last 24 hours plus the current light phase and the next scheduled event (dawn, dusk, misting).
  • [Live gauges & alerts] Real-time dial readouts for the three climate channels, with visual alerts when any reading leaves its safe band.
  • [Manual override] Dashboard controls let you force the light to any brightness, run a misting burst, or toggle the fan without touching the hardware.
  • [Setpoint configuration] Photoperiod, ramp durations, misting burst length and alert thresholds are adjustable from the dashboard — no reflashing needed.

What is included

  • Assembled terrarium controller (ESP32, RTC, DHT22, moisture probe, relay/MOSFET driver board)
  • Controller firmware with day-night scheduler and misting logic
  • Web dashboard (live gauges, 24-hour graphs, light-phase indicator, setpoint controls)
  • Backend service with time-series storage
  • Full-spectrum LED grow-light strip with PWM driver
  • 5 V misting pump, tubing, nozzle and small circulation fan
  • Wiring diagram, sensor placement and calibration guide
  • Project report PDF (photoperiod theory, system design, methodology)
  • PPT presentation and viva Q&A

Limitations & prerequisites

  • The DHT22 measures ±0.5 °C and ±2–5% RH — good enough for terrarium keeping, not a calibration-lab instrument.
  • The dimming curve follows the configured schedule; it does not compute astronomical sunrise/sunset for your latitude unless you set it manually (location-based calculation is future scope).
  • Misting runs timed bursts triggered by humidity — it is not a dosing pump and does not measure the volume of water delivered.
  • Glass enclosures trap heat: an overpowered LED strip can push temperature above the setpoint, so strip wattage must be matched to enclosure volume (guidance included).
  • This is a general climate controller for plants, mosses and humidity-tolerant vivarium setups — not veterinary life-support, and it does not replace species-specific care guidance.
  • Wi-Fi is needed for the remote dashboard and graphs; the light schedule and misting logic run on-device regardless.

Frequently Asked Questions

How does the day-night cycle simulation work?

A DS3231 real-time clock keeps accurate local time, and the firmware maps the time of day onto a brightness curve: a gradual ramp up at dawn, full brightness through the day phase, a gradual ramp down at dusk, and darkness at night. You set the photoperiod length and the dawn/dusk ramp durations from the dashboard.

What hardware does the controller actually drive?

The full-spectrum LED grow-light strip (PWM-dimmed 0–100%), a small 5 V misting pump through a relay, and a circulation fan. Sensing comes from a DHT22 (temperature/humidity) and a capacitive substrate-moisture probe.

What is it suitable for — plants or animals?

General climate control for tropical terrarium and vivarium setups: houseplants, mosses, and humidity-loving small species where stable light rhythm, humidity and substrate moisture matter. It is not species-specific care equipment.

Does it keep working if the Wi-Fi drops?

Yes. The light schedule, misting logic and fan control all run on the ESP32 itself; only the remote dashboard and the 24-hour graphs need the network.

Won't the LED strip overheat a small glass tank?

It can if oversized — glass traps heat. The build guide sizes the strip wattage to your enclosure volume, and the temperature alert warns you if the enclosure climbs out of band.

Is this project suitable for a final-year project?

Yes — for Electronics, Electrical and IoT programs. It combines embedded scheduling, PWM power control, multi-sensor fusion, wireless telemetry and a full web dashboard in one coherent system. Suitable for B.E./B.Tech final-year projects in Electronics, Electrical and IoT.

Components & software requirements
  • ESP32 (controller + Wi-Fi)
  • DS3231 real-time clock (±2 ppm)
  • DHT22 temperature/humidity sensor
  • Capacitive soil-moisture probe
  • Full-spectrum LED grow-light strip + MOSFET PWM driver
  • 5 V misting pump + relay, small circulation fan
  • MQTT · Wi-Fi telemetry
  • Python/Node.js backend with time-series store
  • HTML · CSS · JS dashboard
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Get a quotation