Hello everyone, I am your engineer! I have been working in the automation field for over ten years, especially in PLC applications, and I have some insights to share. Today, I want to share a personal project I completed last year – a smart greenhouse control system built with Siemens LOGO!
The origin of this project actually stems from my wife’s love for gardening. She often complains that the plants on our balcony suffer when we are away on business trips, especially during the high temperatures of summer and the low temperatures of winter. As an engineer, hearing such a “demand” immediately sparked an automated solution in my mind. Why not utilize my expertise to design a small smart greenhouse control system?
This article is suitable for engineering enthusiasts with basic PLC knowledge or friends who want to get started in industrial automation. I will try to explain the technical points in simple language, hoping to provide some inspiration and help.
1. Hardware Preparation
Choosing the Core Controller
I chose Siemens LOGO! as the core controller for several reasons:
- Affordable price (much cheaper than other PLCs)
- Compact size (suitable for home projects)
- Simple programming (graphical programming, quick to get started)
- Good expandability (modules can be added as needed)
Tip:If you are a student or hobbyist, consider a second-hand LOGO! I bought an 8th generation LOGO! for less than 400 yuan on a shopping platform, which is completely sufficient.
Complete Hardware List
- Siemens LOGO! 8 (12/24RCE) – Basic control unit
- Temperature sensor PT100 – 2 units (indoor and outdoor temperature monitoring)
- Humidity sensor – Soil and air humidity monitoring
- Relay module – Controls water pump, fan, and other actuators
- Water pump (5V small water pump) – Automatic watering
- Small fan – Cooling and ventilation
- Solenoid valve – Controls water flow
- Heating pad – Winter insulation
- Power adapter (24V DC) – Powers the system
- Breadboard and Dupont wires – For connection and debugging
To be honest, I made a mistake during my first material purchase: I bought incompatible sensors, which caused signal conversion issues. I recommend everyone to carefully check the input requirements of LOGO! before purchasing to ensure the sensor output signals are compatible.
2. System Design Approach
Core Function Planning
My greenhouse control system mainly implements the following functions:
- Temperature Monitoring and Regulation: When the temperature exceeds the set range, the fan or heater is activated.
- Humidity Monitoring and Watering: Automatically waters based on soil humidity.
- Light Duration Control: Controls the supplemental light according to a preset schedule.
- Remote Monitoring: Allows mobile status viewing through LOGO!’s network function.
- Data Logging: Records changes in environmental parameters.
System Architecture Diagram
+------------+ +------------+ +------------+
| Sensor Module | -> | LOGO! PLC | -> | Actuator Module |
+------------+ +------------+ +------------+
| ^ |
v | v
+--------------------------------+----------------+
| Temperature Sensor | Humidity Sensor | Light Sensor | Water Level Sensor |
+--------------------------------+----------------+
|
v
+--------------------------------------------------------+
| Water Pump Control | Fan Control | Heating Pad Control | Supplemental Light Control | Alarm Output |
+--------------------------------------------------------+
Experience Sharing: Initially, I planned too many functions and found that LOGO! did not have enough I/O points. Later, I adopted a “core priority” principle, first implementing the two most important functions: temperature and humidity control, and then considering expansion. I recommend everyone to prioritize core needs to avoid overly complex designs that are difficult to implement.
3. Programming Implementation Details
LOGO! Software Installation and Configuration
First, you need to install the LOGO!Soft Comfort software, which is Siemens’ official programming software. I am using version V8.3, which is compatible with most LOGO! devices.
Tip: After installing the software, there may be communication issues the first time you connect to LOGO!. Please check:
- Whether the USB cable is a data cable and not just a charging cable.
- Whether the driver is correctly installed.
- Whether the communication interface settings in the software are correct.
Core Control Logic Implementation
The core of the greenhouse control system is the “decision-execute” logic, and here are the main functional blocks:
- Temperature Control Function Block:
Temperature Sensor -> Analog Input -> Comparator (High Temp) -> Relay Output (Fan)
Temperature Sensor -> Analog Input -> Comparator (Low Temp) -> Relay Output (Heater)
- Humidity Control Function Block:
Humidity Sensor -> Analog Input -> Comparator (Low Humidity) -> Timer (Delay Start) -> Relay Output (Water Pump)
-> Timer (Delay Stop) -> Relay Output (Water Pump Stop)
Lesson Learned: In the first version of the program, I did not set a delay for the water pump to stop, resulting in overwatering during testing. Later, I added a timer control, limiting each watering to 15 seconds, which improved the situation significantly.
Parameter Tuning Tips
The most critical aspect of greenhouse control is parameter settings. After multiple adjustments, I summarized a few experiences:
- Temperature Thresholds: When setting upper and lower limits, leave some margin, for example, controlling summer temperatures between 25°C-30°C instead of fixed values.
- Humidity Judgement: The values from the soil humidity sensor are not very stable, so it is recommended to use multiple samples to take an average value.
- Actuator Start/Stop: Set a minimum start time to avoid frequent starts and stops of the equipment.
Practical Advice: During the parameter tuning phase, it is best to record data daily and make timely adjustments when anomalies are found. I once set the temperature lower limit too low, resulting in poor plant growth in winter. After analyzing the data, I discovered the reason.
4. Practical Application Cases
Smart Garden on the Home Balcony
My system was initially deployed on a small balcony at home to take care of a few succulents and some herb plants. This small system includes:
- 1 LOGO! main unit
- 2 temperature sensors (indoor/outdoor)
- 1 soil humidity sensor
- 1 small water pump and water tank
- 1 small fan
The system has been running for nearly 9 months, and during our two business trips, all the plants thrived, especially during last summer’s 40°C heat, when the system successfully protected the plants by automatically adjusting.
Expansion to Community Micro-Farm
Last winter, after the homeowners’ committee in my community learned about my project, they invited me to design a similar system for the community rooftop garden. This time, I expanded the scale of the system:
- Upgraded to LOGO! 8 with expansion modules
- Added 4 temperature control zones
- Added remote monitoring functionality
- Designed a simple rainwater collection system to work with automatic irrigation
Implementation Insights: The biggest challenge when expanding from home use to community-level applications was reliability design. I added a power failure memory function and set up alarm notifications to ensure that administrators could be promptly informed of any system anomalies.
5. Common Problems and Solutions
Signal Jitter Issue
Problem Description: The temperature sensor occasionally experiences momentary fluctuations, causing the system to malfunction.
Solution: I added an averaging filter algorithm in the program, taking the average of the last 5 readings as the basis for judgment, effectively eliminating the signal jitter issue.
Actuator Response Delay
Problem Description: Sometimes the system determines that watering is needed, but there is a delay in starting the water pump.
Solution: Upon inspection, I found it was an issue with the relay drive circuit. By adding a pull-up resistor and adjusting the drive circuit, the problem was resolved.
Winter Freeze Protection
Problem Description: During sudden drops in winter temperatures, the water pipes are prone to freezing.
Solution: I added a freeze protection program segment. When the external temperature approaches 0°C, the system automatically drains the water from the pipes and shuts off the watering function until the temperature rises.
6. Upgrade and Improvement Directions
My system still has many areas for improvement, and I would like to share a few planned upgrade points:
- IoT Functionality: Plan to utilize LOGO!’s network capabilities to achieve cloud data storage and mobile app control.
- Solar Power Supply: Add solar panels and a charging controller to achieve energy self-sufficiency.
- Image Monitoring: Integrate a simple camera to remotely view the plant growth status.
- AI-Assisted Decision Making: Establish a simple predictive model based on historical data to optimize control strategies.
Personal Reflection: Automation is not meant to completely replace human intervention but to free our hands, allowing us to better observe and enjoy the process of plant growth. Technology should always be a tool to assist, not an end in itself.
Conclusion: The Romance of Engineers
After completing this project, I deeply realized that the joy of being an engineer comes not only from solving problems but also from applying professional knowledge to life, creating practical and personalized works.
Looking at the lush plants on the balcony, knowing they have an “electronic caretaker” looking after them, I feel both gratified and proud. Perhaps this is the romance of engineers – creating small joys in life with technology.
I hope my sharing can provide some inspiration. If you are also interested in similar projects or have other ideas and suggestions, feel free to leave a message for discussion. Together, we can move forward on the path of automation!