Incubator/ temperature and humidity control with fan and heater


New member
Hi, I breed mealworms as a hobby and I would like to optimize their environment. They get moisture sources like banana peels and usually that means it gets too humid and I have had mold and pest problems because of that.

Since there is enough or too much moisture present all the time I need ventilation control to control the humidity to be between 60 to 75%RH and I need the temperature to be 26 to 28Celcius degrees for optimal growth. I am thinking of having a temperature and humidity sensor, teensy 4.1, pwm controlled ip68 fan, heater and of course all necessary power sources etc.

I am not very good with hardware nor software so I would really appreciate any help to choose the sensors and other elements and especially how to code the whole into working state.

I guess this set and code could be used in way wider applications from egg incubation, brewing, baking, drying to home ventilation and heating to prevent mold etc. especially if the code allowed multiple sensors and a relay board or similar way to control multiple appliances of any type. Anyone interested?

I am based in Finland, Europe so EU sources would be the most convenient for the materials or a single source elsewhere for saving in delivery.
There's a standard piece of kit for doing this in industrial/commercial situations, the PID controller, which is a basic programmable feedback control system. Any microcontroller can be programmed to do PID control, but there are a fair few subtleties especially with thermal control as there can be a lot of thermal inertia, temperature differences between different parts of the equipment being controlled, and without active cooling you have the issue of assymetry between heating and cooling.

The simpler alternative to PID control is hysteresis or "bang bang" or "on off" control, such as with a thermostat used as a switch. That's an easier place to start, but may fail to perform well enough - though if it does its a simple solution. PID control is continuous, not just on-off, and for heating typically uses slow duty-cycle PWM.

There are two aspects to any control system, reaching the set point efficiently (quickly, with a minimum of overshoot), and reaction to external disturbances (for an incubator that would opening the door and chilling the air in it). Sometimes you can anticipate disturbances (door open sensor) and use feedforward as well (increase heater power while the door is open).

So I'd suggest first finding a similar project online that someone's built and documented, and maybe do some reading about basic PID control.
Hi there! Your project sounds fascinating! Optimizing the environment for mealworms can indeed be challenging, but with the right setup, it seems achievable. Considering your requirements for humidity and temperature control, using sensors like DHT22 or BME280 for temperature and humidity sensing could be a good start. As for the hardware, opting for a Teensy 4.1 sounds like a powerful choice, and PWM-controlled IP68 fans and heaters should help regulate the environment effectively.

For coding, you might want to explore platforms like Arduino IDE, which offers plenty of resources and community support for integrating sensors and controlling actuators like fans and heaters based on sensor readings. Libraries for DHT22 or BME280 are readily available, simplifying sensor integration.

Your idea of a versatile setup that could be applied to various applications beyond mealworm breeding is intriguing! Indeed, such a system could find utility in a wide range of scenarios from incubation to home ventilation. I'm sure there would be many enthusiasts and experts who would love to collaborate on this project.
2024-02-20 13_44_28-GPTZero _ The Trusted AI Detector for ChatGPT, GPT-4, & More.png