Automatic greenhouse
Couldn't load pickup availability
Description
This function block automatically controls ventilation, irrigation, and lighting in greenhouses – based on sensor values, time frames, and manual inputs. The code is written entirely in Structured Control Language (SCL) and is ready for use directly in the Siemens TIA Portal. Ideal for professional systems, smart hobby projects, or training purposes.
Note: All modules are designed exclusively as a learning and optimization basis and are not approved for live operation. System modules, in particular, must be finally tested and commissioned by qualified personnel before productive use.
How it works
Safety comes first: The temperature measurement is immediately checked for plausibility. If it lies outside the range of 0.0 °C to 50.0 °C (in tenths of a degree), an alarm is triggered – and all actuators are automatically shut down.
In automatic mode, the module controls the ventilation based on a setpoint. Alternatively, the ventilation can be switched on or off manually using a button.
A TON timer is used for irrigation: It starts automatically when the soil moisture drops below a defined level – or when a manual pulse is triggered in manual mode. The water supply reliably stops after the preset time.
The lighting is time-dependent: Between “light ON” and “light OFF” times, the light remains switched on – regardless of the operating mode.
Technical details
- Sensor testing with fixed limits
- Ventilation: Target-actual comparison in automatic mode, edge detection in manual mode
- Irrigation: Pulse control via IEC timer (TON)
- Lighting: Time-controlled activation based on system time
- All limit values, time parameters and operating modes are clearly structured and commented in the header area
Possible applications
It can be used in private and commercial greenhouses, vertical farming systems, or educational institutions. The module can be easily integrated into HMI applications or higher-level building management systems—ideal for the practical implementation of automated functions with sensor technology.
compatibility
Compatible with Siemens S7-1200 and S7-1500 controllers. Developed for TIA Portal V13 and higher, recommended for simulation (PLCSIM) and visualization with HMI V16 and higher.
Scope of delivery
You will receive an .scl file with complete declarations of all inputs and outputs, time windows, limits, and timers. The file is commented and easily customizable. The download is available immediately after purchase.
Support
Whether you need specific plant cycles, additional sensors like CO₂ or UV, or integration into existing systems—I'm happy to help. Simply contact me via email or the shop function.