After building my terrarium (mostly for orchids; if you have questions just on that, don't hesitate to ask) I noticed that there's a lot of control needed to successfully operate it. I bought timer plugs to control the lights and misting system but noticed that the light produces too much heat. So I used an old pc fan to cool the system, which decreased air humidity critically. At that point, I already noticed that I will need some sort of automatic control which is related to real-time measurements.
I started by writing a sketch which logs the temperature and air humidity in the terrarium. Through that, I learned about the general characteristics of the climate in my terrarium and knew which thresholds I need to aim for.
After that, I added control parts to the sketch. These control parts will react to the temperature and humidity by turning relais on which control misting and ventilation. However, keeping the variables within the thresholds while logging the data continuously turned out to be more difficult than expected.
The second sketch uploaded is the sketch I currently run for the controls. The code measures temperature and air humidity both in and directly above the terrarium. If the temperature in the terrarium exceeds the threshold, the fan will turn on and run until the temperature is below a certain value. This second value was necessary because the fan would turn off and immediately on again (because the lights continue to heat up the air). The second control part measures air humidity and turns on the misting system for a few seconds. After that, the misting system will be blocked for 300 seconds. This part was needed because in some cases the air humidity was so low that the misting system turned on right after the previous misting. This behavior is highly unwanted because it could flood the false bottom of the terrarium. The logged data includes flags for the fan state and the misting state, which helps me analyze the effects of the measures.
I found many terrarium control sketches in the project hub already, but none fit my needs. The project presented here stands out because it combines the code for a self-regulating terrarium and continuous logging of data for proper data analysis.
Comments