Skip to content
mattmartini edited this page Jun 2, 2023 · 9 revisions

Welcome to the Greenhouse wiki!

Control System

In the wiki are some images of the temperature control system in action along with descriptions of the system.

Current System

Need for the PID controller

Tuning the PID

Further Tuning

Background Information

Last year I built a greenhouse for the olive trees because they were too big to bring into the house. It worked well and the olive trees thrived over the winter. This year I will have the olive, peach, and pear trees inside.

However I was not satisfied with the temperature control and decided to improve it this year. To that end I built a system with a raspberry pi and some temperature sensors to control the heater instead of using its on board controls. I used a PID controller (software) to regulate the output of the heater.

The greenhouse is 6'x3' by 6' high. it is attached to the side wall of my garage. I ran a power outlet into it.

Last year I used the onboard thermostat on the heater and just monitored the temperature. It was difficult to control the temperature, and I wound up having the heat too high. Which it turns out is counterproductive if you want fruit. All of these trees need to go dormant (below 45 degrees, above freezing) for a couple of months in order to flower and produce fruit. I'm hoping for a good crop this year.

I have been playing with the controller to optimize it. The heater doesn't have variable output, which is required for PID control. So what I am doing is turning the heater on for a percentage of time during each cycle. For example for a 30 second cycle, if the power is 50%, the heater is on for 15 seconds and off for 15 seconds.

This works well, except that if the outside temperature drops rapidly, the heater comes on at a high percentage, causing the inside temperature to rise quickly and overshoot the goal temperature, then the heater goes off and we get oscillations.

I ordered a new heater because of a scare when the old heater stopped working and the temperature started to plummet. I shook it a little and it started working again. However, I got a better, hopefully more reliable one. The new heater has two power modes Half (750W) and Full (1500W). In order to have a more natural response we use a second relay to control which mode the heat utilizes. For computed power less than 50%, Half power mode for twice the duration and more than 50%, Full power mode for normal duration. So Half power for 100% cycle is the transition to Full power for 50% cycle.

This should use less energy and give smoother heating which should reduce oscillations. What I mean is if the power should be 25% then low heat for 50% of the cycle is less jarring then high heat for 25% cycle.

Greenhouse

IMG_4679 IMG_4675 IMG_4676