Siemens S7-1200 PLC | TIA Portal V19 | S7-PLCSIM
A professional PLC-based water tank automation project implementing Automatic/Manual pump control, safety interlocks, dry-run protection, sensor fault detection, and alarm management using Siemens S7-1200 and TIA Portal V19.
This project simulates a water storage tank used in an industrial production facility. A centrifugal pump transfers water from a reservoir to the storage tank. The control system is designed to operate automatically during normal production while allowing manual operation for maintenance and testing.
The PLC continuously monitors tank level sensors, controls the pump, detects abnormal conditions, and provides clear status indication through operator panel lamps.
- Automatic tank filling based on water level sensors
- Manual pump operation for maintenance
- Emergency stop and motor overload protection
- Dry-run protection using timer supervision
- Sensor fault detection
- Centralized fault handling
- Visual status indication through panel lamps
- Industrial-style structured PLC programming
The system supports two mutually exclusive operating modes:
- Automatic Mode
- Manual Mode
Only one mode can be active at any time. If both modes are selected simultaneously, the system generates a Mode Fault and inhibits pump operation.
When Automatic Mode is active:
- The pump starts automatically when the water level falls below the Low-Level sensor.
- The pump continues running even after the Low-Level sensor is submerged.
- The pump stops only when the High-Level sensor is reached.
This latching behavior prevents excessive pump cycling and extends motor and contactor life.
When Manual Mode is active:
- The operator starts the pump using the Start Pushbutton.
- The operator stops the pump using the Stop Pushbutton.
- Manual operation is intended for maintenance, commissioning, and testing purposes.
Pressing the Emergency Stop:
- Stops the pump immediately.
- Activates the Fault Lamp.
- Prevents pump restart until the emergency condition is cleared.
If the overload relay trips:
- The pump stops immediately.
- The Fault Lamp turns ON.
- The system enters a fault state until the overload condition is cleared.
If the pump runs continuously for 30 seconds and the High-Level sensor is still not activated:
- The pump is stopped.
- A Dry_Run_Fault is latched.
- The Fault Lamp turns ON.
- Manual reset is required before operation can resume.
This protects the pump from running without sufficient water supply.
The following condition is physically impossible:
High_Level = TRUE
Low_Level = FALSE
If this condition occurs:
- A Sensor_Fault is generated.
- Automatic operation is inhibited.
- The Fault Lamp turns ON.
The control panel includes four indicator lamps:
| Lamp | Color | Function |
|---|---|---|
| Run Lamp | 🟢 Green | Pump running |
| Auto Lamp | 🔵 Blue | Automatic mode active |
| Manual Lamp | 🟡 Yellow | Manual mode active |
| Fault Lamp | 🔴 Red | Any active fault |
Controller: Siemens S7-1200 CPU 1212C
- Order No.: 6ES7 212-1AE40-0XB0
- 100 KB work memory
- 24 VDC power supply
- 8 Digital Inputs
- 6 Digital Outputs
- 2 Analog Inputs
- PROFINET communication
- Integrated web server
- OPC UA Server support
- Expandable with signal and communication modules
- TIA Portal V19
- S7-PLCSIM V19
- Programming Language: Ladder Logic (LAD)
| Tag | Address | Description |
|---|---|---|
| Auto_Mode | %I0.0 | Auto selector switch |
| Manual_Mode | %I0.1 | Manual selector switch |
| Start_PB | %I0.2 | Start pushbutton |
| Stop_PB_OK | %I0.3 | Stop pushbutton (NC) |
| Low_Level | %I0.4 | Low-level sensor |
| High_Level | %I0.5 | High-level sensor |
| Emergency_OK | %I0.6 | Emergency Stop (NC) |
| Motor_OL_OK | %I0.7 | Motor overload (NC) |
| Reset_PB | %I1.0 | Fault reset pushbutton |
| Tag | Address | Description |
|---|---|---|
| Pump | %Q0.0 | Pump motor |
| Run_Lamp | %Q0.1 | Green run lamp |
| Auto_Lamp | %Q0.2 | Blue auto lamp |
| Manual_Lamp | %Q0.3 | Yellow manual lamp |
| Fault_Lamp | %Q0.4 | Red fault lamp |
| Tag | Address | Description |
|---|---|---|
| Auto_Run_Request | %M1.2 | Automatic pump request |
| Manual_Run_Request | %M1.3 | Manual pump request |
| Dry_Run_Fault | %M0.1 | Dry-run alarm |
| Sensor_Fault | %M0.2 | Sensor fault alarm |
| Mode_Fault | %M1.1 | Invalid mode selection |
| General_Fault | %M0.3 | Combined fault status |
| System_OK | %M0.6 | Safety conditions satisfied |
| Auto_Active | %M0.7 | Auto mode active |
| Manual_Active | %M1.0 | Manual mode active |
| Timer | Preset | Purpose |
|---|---|---|
| DryRun_Timer | T#30s | Dry-run protection timeout |
(In a production system, the preset should be stored in a parameter Data Block such as DB_Settings.DryRun_Time for HMI adjustment.)
Both level sensors are treated as Normally Open (NO) process sensors.
| Signal | Meaning |
|---|---|
Low_Level = TRUE |
Water has reached the Low-Level sensor |
High_Level = TRUE |
Water has reached the High-Level sensor |
Valid sensor states:
| Tank Condition | Low_Level | High_Level |
|---|---|---|
| Empty | 0 | 0 |
| Between sensors | 1 | 0 |
| Full | 1 | 1 |
The combination Low_Level = 0 and High_Level = 1 is treated as a sensor fault.
| Network | Function |
|---|---|
| Network 1 | Safety Logic (System_OK) |
| Network 2 | Mode Selection & Interlocking |
| Network 3 | Automatic Pump Control |
| Network 4 | Manual Pump Control |
| Network 5 | Pump Output Logic |
| Network 6 | Dry-Run Protection |
| Network 7 | Sensor Fault Detection |
| Network 8 | General Fault Management |
| Network 9 | Status Indicator Lamps |
- WinCC Unified HMI
- Adjustable timer parameters via HMI
- Pump runtime counter
- Start/stop cycle counter
- Alarm acknowledgment and history
- SCADA / OPC UA integration
- Function Block (FB) based modular architecture
Amir Sadeghi
Electrical & Control Engineer
Industrial Automation | PLC Programming | Siemens TIA Portal | Control Systems
GitHub: https://github.com/sadeghi2025