Introduction
This tutorial explains how to implement an automatic water reserve control system using a CONTROLLINO PLC and OpenPLC. The system monitors the water levels of a cistern (minimum level) and an elevated tank (minimum and maximum levels) to control a pump that transfers water from the cistern to the elevated tank. Additionally, manual pump control is possible using start and stop buttons.
Prerequisites
Before starting, ensure you have the following:
- OpenPLC software installed.
- A CONTROLLINO PLC (any model) or a compatible PLC.
- Sensors for water level detection:
- Minimum level sensor for the cistern.
- Minimum and maximum level sensors for the elevated tank.
- Two buttons for manual control (Start and Stop).
- Basic knowledge of ladder logic programming.
Step-by-Step Guide
Step 1: Install and Set Up OpenPLC
- Download OpenPLC:
- Visit the OpenPLC official website and download the software.
- Follow the installation instructions for your operating system.
- Set Up the OpenPLC Environment:
- Open the OpenPLC editor.
- Configure the device by selecting your CONTROLLINO model in Settings > Device.
- Assign the correct COM port for communication with the PLC.
Step 2: Configure System Inputs and Outputs
Define the following inputs and outputs in your ladder logic program:
Name | Type | Description | Pin |
---|---|---|---|
Pool_Low_Level_Sensor | BOOL | Indicates the minimum water level in the cistern. | %IX0.0 |
Tank_High_Level_Sensor | BOOL | Indicates the maximum water level in the tank. | %IX0.1 |
Tank_Low_Level_Sensor | BOOL | Indicates the minimum water level in the tank. | %IX0.2 |
Automatic_Manual_Switch | BOOL | Switch for selecting automatic or manual mode. | %IX0.3 |
Stop_Button | BOOL | Push button to stop the pump manually. | %IX0.4 |
Start_Button | BOOL | Push button to start the pump manually. | %IX0.5 |
Water_Pump | BOOL | Output controlling the water pump. | %QX0.0 |
Step 3: Program the Ladder Logic
- Automatic Mode:
- The pump (
Water_Pump
) is activated automatically when:- The cistern is above its minimum level (
Pool_Low_Level_Sensor
is active). - The tank is below its minimum level (
Tank_Low_Level_Sensor
is active).
- The cistern is above its minimum level (
- The pump is deactivated when:
- The tank reaches its maximum level (
Tank_High_Level_Sensor
is active). - The cistern falls below its minimum level (
Pool_Low_Level_Sensor
is inactive).
- The tank reaches its maximum level (
- Manual Mode:
- The pump can be directly controlled using the buttons:
- The Start Button (
Start_Button
) activates the pump. - The Stop Button (
Stop_Button
) deactivates the pump.
- The Start Button (
- The switch (
Automatic_Manual_Switch
) must be in manual mode to enable this functionality.
- Switching Between Modes:
- The
Automatic_Manual_Switch
toggles between automatic and manual modes. - In manual mode, sensor readings do not affect the pump operation.
Step 4: Connect the Hardware
- Wiring:
- Connect the level sensors to the respective input pins.
- Connect the Start and Stop buttons to other input pins.
- Connect the water pump to the assigned output pin.
- Pin Mapping:
- Ensure that the variable names in OpenPLC match the physical connections.
Step 5: Test the System
- Load the Program:
- Save your project in the OpenPLC editor.
- Connect your CONTROLLINO PLC to the computer and upload the program.
- Test Automatic Mode:
- Ensure the cistern is above its minimum level.
- Lower the water level in the tank below its minimum.
- Observe how the pump automatically activates and fills the tank until it reaches the maximum level.
- Test Manual Mode:
- Switch to manual mode using the
Automatic_Manual_Switch
. - Press the Start Button to activate the pump and the Stop Button to deactivate it.
Ladder Logic Explanation
Automatic Mode
- Automatic Activation:
- When both
Pool_Low_Level_Sensor
andTank_Low_Level_Sensor
are active, the pump (Water_Pump
) turns on.
- Automatic Deactivation:
- The pump turns off when either:
Tank_High_Level_Sensor
is active (tank full).Pool_Low_Level_Sensor
is inactive (cistern empty).
Manual Mode
- Manual Control:
- Pressing
Start_Button
turns on the pump manually. - Pressing
Stop_Button
turns off the pump manually.
Troubleshooting
- Check Wiring:
- Ensure sensors and buttons are connected to the correct input pins.
- Verify the pump is connected to the correct output pin.
- Verify Variables:
- Check that the variable names in OpenPLC match the physical connections.
- Debugging:
- Use the OpenPLC debugging tools to monitor the state of inputs, outputs, and signals.
Conclusion
Congratulations! You have successfully implemented a water reserve control system with both automatic and manual modes. This system is ideal for efficiently managing water levels in elevated tanks and cisterns. You can further customize the system by adding additional sensors or modifying the logic to suit specific requirements.