Smart Reptile Environment Box
An ESP32-based enclosure system that dynamically plans temperature, humidity, ventilation, and visible light across a complete day-and-night cycle.
Managing a Living Environment
Reptile enclosures are not static spaces. Temperature, humidity, airflow, and light need to change throughout the day while still remaining inside safe limits.
This project combines real-time sensing, time-based planning, and automatic control to create a more stable and measurable environment.
Temperature Gradient
Two sensors monitor the warm and cool sides separately, helping maintain a real thermal gradient rather than one uniform temperature.
Humidity Regulation
Humidity is measured continuously and adjusted using low-voltage misting and controlled ventilation.
Daylight Planning
Visible light intensity rises and falls gradually through the day instead of switching instantly between full brightness and darkness.
Layered Protection
Sensor faults, over-temperature, high humidity, and excessive runtime automatically trigger a safe shutdown mode.
Live Environmental Dashboard
The values below are simulated in real time to demonstrate how the controller responds to changing environmental targets.
Environmental Control Dashboard
Scheduled Environment
24-Hour Schedule
The BH1750 measures lux. It does not measure UVB and cannot replace a professional UV index meter.
From Sensor Data to Physical Control
The ESP32 receives environmental data from multiple sensors, calculates the current target, and controls four low-voltage output systems.
Central Controller
- Reads sensor values
- Calculates dynamic targets
- Applies hysteresis control
- Runs safety protection
- Hosts the web dashboard
Software Is Never the Only Protection
The heater circuit should also include a fuse, an independent hardware thermostat, protected wiring, and a manual power cut-off.
Enclosure Layout
The enclosure is divided into warm and cool zones. Sensors are placed where the animal actually experiences the environment.
Low-Voltage Wiring Overview
Sensors share the I²C bus. High-current devices are powered separately and controlled through 3.3V-compatible MOSFET modules.
Wire gauge, fuse rating, MOSFET current capacity, terminal quality, and power supply size must be calculated from the real hardware. Do not run high-current loads through a breadboard.
Components and Engineering Tools
The first version uses accessible modules so that the project can be assembled, tested, and explained clearly.
Main Components
Engineering Tools
How the Controller Makes Decisions
The system combines a planned daily schedule with feedback from real sensors. It does not simply turn equipment on at fixed times.
Read Sensors
Warm-side temperature, cool-side temperature, humidity, visible light, and real-time clock data are read continuously.
Calculate Target
The controller interpolates between schedule points to create smooth target values throughout the day.
Control Outputs
Heater and humidifier use hysteresis. The fan responds to schedule, temperature, and humidity. Lighting uses PWM.
Check Safety
Sensor faults, excessive runtime, or dangerous values override normal control and activate a safe state.
void updateControl() {
target = calculateTarget(currentMinute);
readSensors();
// Stop all dangerous loads if sensor data is invalid
if (!sensorDataValid()) {
forceSafeState("Sensor fault");
return;
}
controlHeater(sensor.warmC, target.temperature);
controlHumidifier(sensor.humidity, target.humidity);
controlVentilation();
setLightPercent(target.lightPercent);
}
Test the Box Before Testing the Animal
Electrical Safety
Use fuses on the main supply and high-current branches.
Use terminal blocks instead of breadboards for power loads.
Keep electronics physically separated from water.
Install an independent thermostat in the heater circuit.
Failure Testing
Disconnect each sensor and confirm that heating shuts down.
Simulate power loss and confirm safe recovery.
Block the fan temporarily and monitor temperature rise.
Measure terminal, MOSFET, cable, and heater temperatures.
Animal Welfare
Use husbandry targets for the exact species and life stage.
Maintain a real warm-to-cool gradient and hiding areas.
Keep a separate thermometer and hygrometer for comparison.
Use a professional UV index meter for UVB verification.
A Small System for Measurable Environmental Care.
This prototype combines electronics, environmental sensing, embedded programming, interface design, and safety testing in one complete engineering project.
