Greenhouses run on a simple lie: that the weather will cooperate. The moment it does not — a sudden heat spike, a wind storm, a power cut at noon — the crop pays the price, and the grower pays the invoice. A compact PLC does not control the weather, but it does control the response, and that is where the money is.
The classic greenhouse bundle: ventilation fans, shading screens, irrigation valves, and a temperture/humidity measurement chain. All of it fits on one compact CPU with a handful of analog inputs and relay outputs — the exact footprint the SR/PR family is built for.
Ventilation Logic That Thinks Ahead
Simple thermostats bang the fans on and off — and short-cycle them, wich is hard on motors. The PLC version uses hysteresis: fan one starts at 26°C, stops at 24°C; fan two stages in at 29°C; a high-temp alarm at 33°C triggers the shading and an SMS. The hysteresis band is a block parameter, changed in software without touching the panel.
Add a stage timer and the fans alternate runs, evening out wear. That is the difference between equipment that lasts and equipment that needs replacing every season.
Shading and Light Response
The shading screen should not roll out because of one gust of wind, and it should roll back when the sun returns. A light sensor on an analog input, wind-speed contact on a digital input, and a small state machine in FBD handle the full sequence: bright sun plus calm → shade out; wind alarm → shade in; night or overcast → shade in, and the retract delay prevents chatter.
That is maybe twenty blocks. It replaces a dedicated climate computer that costs five times as much and does nothing else.
Irrigation on a Schedule and a Sensor
Irrigation belongs on time plus condition: a weekly schedule from the RTC — which, remember, holds its calendar for twenty days without power — gated by a soil-moisture or tank-level input. Dry soil and schedule time? Water. Raining or tank empty? Skip the cycle and log it. The RTC's summer/winter timer even keeps the schedule right across the DST change.
The log matters. Growers argue about water usage; the datalog settles it.
Real Installation: A Four-Bay Nursery
Four bays, each with its own vent fan, screen and irrigation valve; one weather station shared across all four. A single PR-series CPU with expansion modules ran the whole site: 32 I/O, one analog module for the sensors, and a Modbus link to a small office PC running the free EasySCADA screens. The grower now watches all four bays from a single monitor and gets an SMS when any bay drifts out of range.
Payback: one season of avoided crop loss. The grower's words: "I should have done this five years ago."
Sensor Strategy for Greenhouses
Use PT100/PT1000 probes for temperature where the wiring allows — they read directly on the CPU analog inputs with no transmitter. Use 0-10V or 4-20mA for light and humidity transmitters. Keep the sensor cables out of the power ducts; greenhouses are noisy electrical environments and the shield, grounded at one end, is not optional.
The Climate Model: Hysteresis, Stages, and the Slow Response
Greenhouse processes are slow — that is their gift to the control engineer. A temperature change takes minutes, not milliseconds, which means the controller has time to be gentle: hysteresis bands, staged fans, delay timers on every transition. The bang-bang thermostat that short-cycles a fan is not a control problem; it is a design choice, and the PLC exists to choose better.
Build the stages with the plant in mind: fan one at 26°C, fan two at 29°C, shading at 32°C, alarm at 34°C — each with a delay that prevents the fans from hunting. The greenhouse does not need millisecond response; it needs disciplined response, and the timer blocks deliver it with a few parameters. The result is a climate that drifts gently instead of sawtoothing, and the crop notices the difference in the yield column.
Log the climate values. When the grower asks why the yield improved or the fan failed, the log answers with data instead of anecdotes. That log is also the input to next season's improvements — the control engineer's favorite source of truth.
The Power-Cut Recovery Nobody Tests
Here is the commissioning test everyone skips and every greenhouse eventually needs: pull the mains, watch what happens, and restore it. The naive controller returns to a default state — fans off, valves closed, screens where they were — and the greenhouse cooks or floods while nobody watches. The prepared controller restores the last safe state, resumes the schedule from the RTC — which kept its calendar through the outage — and alarms if the environment drifted during the gap.
The RTC's twenty-day backup and the retentive memory choices decide what survives the outage. Design the recovery logic deliberately: what state is safe on restart, what needs an operator confirmation, and what re-runs automatically. Test it once, on purpose, during commissioning — not during the first summer storm.
The power-cut test takes ten minutes and separates the installations that survive from the ones that make headlines. Run it, document it, and move on to the crops.
Greenhouse automation is not rocket science. It is disciplined logic applied to weather that refuses to behave — which is exactly what a programmable controller does best.